-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hook go-licenses into tidy again #21353
Conversation
Running it as part of the build is really unnecessary because we have a valid output file in the repo and assuming go dependencies do not change unless go.mod also changes, tidy really is the best target to run the license generation after. Also, regenerate the file as I missed to do so during the chroma update, and mark all json files in assets as generated.
Test failure is unrelated, see #21355. |
running I run Adding this into tidy will result in making checkout even slower. |
CI will always run |
Actually, I think I need to force CI to run the target because depending on git checkout order, the target might be skipped otherwise as seen in the recent run:
|
Added a |
I just learned that
|
Wouldn't this mean you could make go-licenses part of tidy-check? diff --git a/Makefile b/Makefile
index 3a9025746..f56997e82 100644
--- a/Makefile
+++ b/Makefile
@@ -403,12 +403,9 @@ unit-test-coverage:
@$(GO) test $(GOTESTFLAGS) -timeout=20m -tags='$(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
.PHONY: tidy
-tidy:
- $(eval MIN_GO_VERSION := $(shell grep -Eo '^go\s+[0-9]+\.[0-9.]+' go.mod | cut -d' ' -f2))
- $(GO) mod tidy -compat=$(MIN_GO_VERSION)
- @$(MAKE) --no-print-directory $(GO_LICENSE_FILE)
+tidy: go.mod go.sum $(GO_LICENSE_FILE)
-vendor: go.mod go.sum
+vendor: tidy
$(GO) mod vendor
@touch vendor
@@ -424,6 +421,12 @@ tidy-check: tidy
.PHONY: go-licenses
go-licenses: $(GO_LICENSE_FILE)
+go.sum: go.mod
+ $(eval MIN_GO_VERSION := $(shell grep -Eo '^go\s+[0-9]+\.[0-9.]+' go.mod | cut -d' ' -f2))
+ $(GO) mod tidy -compat=$(MIN_GO_VERSION)
+ @touch go.sum
+
+
$(GO_LICENSE_FILE): go.mod go.sum
-$(GO) run $(GO_LICENSES_PACKAGE) save . --force --save_path=$(GO_LICENSE_TMP_DIR) 2>/dev/null
$(GO) run build/generate-go-licenses.go $(GO_LICENSE_TMP_DIR) $(GO_LICENSE_FILE)
|
I'm still not sure why you want to re-introduce the |
* upstream/main: Add user/organization code search (go-gitea#19977) Stop logging CheckPath returns error: context canceled (go-gitea#21064) Hook go-licenses into tidy again (go-gitea#21353) Fix missing left and right carets in TRANSLATORS (go-gitea#21397) Fix calls to i18n in templates (go-gitea#21394) Update JS dependencies and eslint config (go-gitea#21388) Allow creation of OAuth2 applications for orgs (go-gitea#18084) Fix typos in PullRequestMergeForm.vue header comment (go-gitea#21378) Use weighted algorithm for string matching when finding files in repo (go-gitea#21370) Bump playwright to 1.26.1 (go-gitea#21357) npm package registry support for `bin` (go-gitea#21372) Removed one extra whitespace in footer after "Template" (go-gitea#21364)
Running it as part of the build is really unnecessary because we have a valid output file in the repo and assuming go dependencies do not change unless go.mod also changes, tidy really is the best target to run the license generation after.
Also, regenerate the file as I missed to do so during the chroma update, and mark all json files in assets as generated.