-
Notifications
You must be signed in to change notification settings - Fork 5.1k
chore(go): ignore frontend portal directory using Go 1.25 #22702
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
base: main
Are you sure you want to change the base?
chore(go): ignore frontend portal directory using Go 1.25 #22702
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22702 +/- ##
==========================================
+ Coverage 45.36% 46.57% +1.20%
==========================================
Files 244 252 +8
Lines 13333 14273 +940
Branches 2719 2931 +212
==========================================
+ Hits 6049 6647 +598
- Misses 6983 7268 +285
- Partials 301 358 +57
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
This PR assumes that in But given there's no .go files, are there any real performance gain with this statement? Please kindly provide evidence, otherwise, I don't think this change is needed. |
| module github.com/goharbor/harbor/src | ||
|
|
||
| go 1.24.6 | ||
| go 1.25 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we would like to bump the go version of harbor, this change is not enough.
Please refer to #22238
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Iam-Karan-Suresh please update pr with necessary changes required
Thanks
| google.golang.org/api => google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff | ||
| ) | ||
|
|
||
| ignore portal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have any concrete comparison between enabling and not enabling it? I’d like to understand how much benefit we can gain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes,
The Go 1.25 ignore directive excludes portal/ from Go tool traversal (go list, go build, go test, etc.).
src/portal Directory Stats
| Metric | Value |
|---|---|
| Total size | 757 MB |
| Total files | 54,186 |
| Go files | 0 |
Performance Impact
| Command | With ignore |
Without ignore |
Improvement |
|---|---|---|---|
go list ./... |
0.43s | 0.80s | 46% faster |
I would suggest we can go with this change - since this gives measurable performance gain with no downside. and is officially introduced in go1.25
Thanks
wy65701436
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please ensure if we would like to upgrade the go version to v1.25 with this PR?
yes this would obviously increase the performance of go tool uses ./... since there would be much less directories to traverse and since harbor is a monorepo and contains portal - which is not a go module we should exclude it. |
|
@bupd |
Signed-off-by: Iam-karan-suresh <karansuresh.info@gmail.com>
cb25bc8 to
aa42522
Compare
Thank you for contributing to Harbor!
Upgrade the Go directive to 1.25 and add an
ignore portaldirective tosrc/go.modto exclude the frontend-only
src/portaldirectory from Go package pattern matching.The
portaldirectory contains Angular/TypeScript code only and no Go source files.Using the Go 1.25
ignoredirective prevents false positives duringgo build ./...andgo test ./...without changing repository structure or runtime behavior.Issue being fixed
Fixes #22700
Please indicate you've done the following:
release-note/infra