Skip to content

[CHERRY-PICK] fix: Bump repository update_time on tag and artifact changes (#23225)#23292

Merged
wy65701436 merged 1 commit into
goharbor:release-2.15.0from
chlins:cherry-pick-23149
May 28, 2026
Merged

[CHERRY-PICK] fix: Bump repository update_time on tag and artifact changes (#23225)#23292
wy65701436 merged 1 commit into
goharbor:release-2.15.0from
chlins:cherry-pick-23149

Conversation

@chlins

@chlins chlins commented May 28, 2026

Copy link
Copy Markdown
Member

fix: bump repository update_time on tag and artifact changes

Fixes #23149.

The "Last Modified Time" column on the repository list only moved when an image was pushed. Adding or deleting a tag from the UI, or deleting an artifact, left the timestamp stale.

This wires update_time bumps into:

  • Tag create, delete, and retag (both UI and registry push)
  • Artifact create and delete

A new repository.Manager.Touch method does the actual update and invalidates the redis cache. It's skipped on tag-create conflicts so a duplicate push doesn't falsely advance the timestamp.

The change is repo-only on purpose: artifacts are addressed by their immutable digest, so an artifact update_time has no use.

Thank you for contributing to Harbor!

Comprehensive Summary of your change

Issue being fixed

Fixes #(issue)

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • 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 and opened a new docs issue or PR with docs changes if needed in website repository.

…r#23225)

fix: bump repository update_time on tag and artifact changes

Fixes goharbor#23149.

The "Last Modified Time" column on the repository list only moved
when an image was pushed. Adding or deleting a tag from the UI,
or deleting an artifact, left the timestamp stale.

This wires update_time bumps into:

- Tag create, delete, and retag (both UI and registry push)
- Artifact create and delete

A new repository.Manager.Touch method does the actual update and
invalidates the redis cache. It's skipped on tag-create conflicts
so a duplicate push doesn't falsely advance the timestamp.

The change is repo-only on purpose: artifacts are addressed by
their immutable digest, so an artifact update_time has no use.

Signed-off-by: aloui ikram <[email protected]>
Co-authored-by: aloui ikram <[email protected]>
Co-authored-by: Chlins Zhang <[email protected]>
Signed-off-by: chlins <[email protected]>
@chlins
chlins force-pushed the cherry-pick-23149 branch from 84df9c9 to f946b3d Compare May 28, 2026 02:56
@codecov

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.70492% with 38 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-2.15.0@54f69e4). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/pkg/repository/dao/dao.go 0.00% 14 Missing ⚠️
src/pkg/cached/repository/redis/manager.go 0.00% 10 Missing ⚠️
src/controller/tag/controller.go 64.00% 6 Missing and 3 partials ⚠️
src/controller/artifact/controller.go 70.00% 2 Missing and 1 partial ⚠️
src/pkg/repository/manager.go 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##             release-2.15.0   #23292   +/-   ##
=================================================
  Coverage                  ?   65.97%           
=================================================
  Files                     ?     1074           
  Lines                     ?   116740           
  Branches                  ?     2952           
=================================================
  Hits                      ?    77016           
  Misses                    ?    35447           
  Partials                  ?     4277           
Flag Coverage Δ
unittests 65.97% <37.70%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/pkg/repository/manager.go 70.00% <0.00%> (ø)
src/controller/artifact/controller.go 61.52% <70.00%> (ø)
src/controller/tag/controller.go 73.97% <64.00%> (ø)
src/pkg/cached/repository/redis/manager.go 57.81% <0.00%> (ø)
src/pkg/repository/dao/dao.go 50.44% <0.00%> (ø)
🚀 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.

@wy65701436 wy65701436 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@wy65701436
wy65701436 merged commit 8c7276b into goharbor:release-2.15.0 May 28, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants