Skip to content

Conversation

@Iam-Karan-Suresh
Copy link

Thank you for contributing to Harbor!

Upgrade the Go directive to 1.25 and add an ignore portal directive to src/go.mod
to exclude the frontend-only src/portal directory from Go package pattern matching.

The portal directory contains Angular/TypeScript code only and no Go source files.
Using the Go 1.25 ignore directive prevents false positives during
go build ./... and go test ./... without changing repository structure or runtime behavior.

Issue being fixed

Fixes #22700

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. release-note/infra
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact (no docs changes required for this change)

@codecov
Copy link

codecov bot commented Jan 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.57%. Comparing base (c8c11b4) to head (cb25bc8).
⚠️ Report is 612 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
unittests 46.57% <ø> (+1.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 178 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@reasonerjt
Copy link
Contributor

This PR assumes that in portal directory there will never be .go files, otherwise we should cover it in go test ./...

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
Copy link
Contributor

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

Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor

@wy65701436 wy65701436 left a 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?

@bupd
Copy link
Contributor

bupd commented Jan 7, 2026

This PR assumes that in portal directory there will never be .go files, otherwise we should cover it in go test ./...

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.

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.

see https://go.dev/ref/mod#go-mod-file-ignore

@reasonerjt
Copy link
Contributor

@bupd
I undertand in theory it traverse less directories but could you reply
#22702 (comment)

Signed-off-by: Iam-karan-suresh <karansuresh.info@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Go 1.25 ignore Directive for src/portal in go.mod

7 participants