Fix OpenApi vetting (#23974)
* fix openApi vetting
The underlying mattermost-govet tool effectively hasn't been called for some time, as we weren't checking out and building the spec files to pass. Now that hte API is in the monorepo, build it locally and check against it.
Unfortunately, our API documentation isn't up-to-date, and this PR isn't fixing that. For now, add a discrete `make vet-api` and workflow that won't block the build until the API documentation is back in sync and can be merged into the existing `make vet` directive.
* mattermost-govet: use upstream@new
* fix missing /api/v4 prefix for commands autocomplete suggestion
* document /api/v4/ldap/users/{user_id}/group_sync_memberships
* document /api/v4/groups/{group_id}/restore
* fix /files/{file_id}/public actually at root
* document /api/v4/users/invalid_emails
* fix SetThreadUnreadByPostId
* Revert "fix SetThreadUnreadByPostId"
This reverts commit b16bcc80442b4391c3e7472ce47b9da65809697b.
* Revert "Revert "fix SetThreadUnreadByPostId""
This reverts commit 8bda05dc8aa8c57b20e2fd525431b43e21474859.
* workaround undocumented API endpoints
* remove unnecessary whiteline
* ignore go tool output
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
930309e01e
Коммит
0577a5aaa2
@@ -768,19 +768,21 @@ endif
|
||||
|
||||
vet: ## Run mattermost go vet specific checks
|
||||
$(GO) install github.com/mattermost/mattermost-govet/v2@new
|
||||
@VET_CMD="-license -structuredLogging -inconsistentReceiverName -inconsistentReceiverName.ignore=session_serial_gen.go,team_member_serial_gen.go,user_serial_gen.go -emptyStrCmp -tFatal -configtelemetry -errorAssertions"; \
|
||||
if ! [ -z "${MM_VET_OPENSPEC_PATH}" ] && [ -f "${MM_VET_OPENSPEC_PATH}" ]; then \
|
||||
VET_CMD="$$VET_CMD -openApiSync -openApiSync.spec=$$MM_VET_OPENSPEC_PATH"; \
|
||||
else \
|
||||
echo "MM_VET_OPENSPEC_PATH not set or spec yaml path in it is incorrect. Skipping API check"; \
|
||||
fi; \
|
||||
$(GO) vet -vettool=$(GOBIN)/mattermost-govet $$VET_CMD ./...
|
||||
$(GO) vet -vettool=$(GOBIN)/mattermost-govet -license -structuredLogging -inconsistentReceiverName -inconsistentReceiverName.ignore=session_serial_gen.go,team_member_serial_gen.go,user_serial_gen.go -emptyStrCmp -tFatal -configtelemetry -errorAssertions ./...
|
||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||
ifneq ($(MM_NO_ENTERPRISE_LINT),true)
|
||||
$(GO) vet -vettool=$(GOBIN)/mattermost-govet -enterpriseLicense -structuredLogging -tFatal $(BUILD_ENTERPRISE_DIR)/...
|
||||
endif
|
||||
endif
|
||||
|
||||
vet-api: export GO := $(GO)
|
||||
vet-api: export GOBIN := $(GOBIN)
|
||||
vet-api: export ROOT := $(ROOT)
|
||||
vet-api: ## Run mattermost go vet to verify api4 documentation, currently not passing
|
||||
$(GO) install github.com/mattermost/mattermost-govet/v2@new
|
||||
make -C ../api build
|
||||
./scripts/vet-api-check.sh
|
||||
|
||||
gen-serialized: export LICENSE_HEADER:=$(LICENSE_HEADER)
|
||||
gen-serialized: ## Generates serialization methods for hot structs
|
||||
# This tool only works at a file level, not at a package level.
|
||||
|
||||
Ссылка в новой задаче
Block a user