Skip to content

fix(scan): use created time from annotations in accessory art#23113

Merged
chlins merged 1 commit intogoharbor:mainfrom
chlins:fix/sbom-created
Apr 20, 2026
Merged

fix(scan): use created time from annotations in accessory art#23113
chlins merged 1 commit intogoharbor:mainfrom
chlins:fix/sbom-created

Conversation

@chlins
Copy link
Copy Markdown
Member

@chlins chlins commented Apr 14, 2026

Thank you for contributing to Harbor!

Comprehensive Summary of your change

This pull request introduces an improvement to the handling of artifact creation times in the GenAccessoryArt function within the package scan. The function now parses a created timestamp from the provided annotations and uses it to set the artifact's creation time, allowing for more accurate metadata.

Enhancement to artifact creation metadata:

  • src/pkg/scan/util.go: Updated the GenAccessoryArt function to parse the created value from accAnnotations and set it as the artifact's creation time, improving accuracy of artifact metadata.
  • src/pkg/scan/util.go: Added import of the time package to support parsing RFC3339 timestamps.

Issue being fixed

Fixes #23112

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.

@chlins chlins requested a review from a team as a code owner April 14, 2026 07:48
@chlins chlins enabled auto-merge (squash) April 14, 2026 07:49
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.01%. Comparing base (62564cc) to head (7d25c8c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/pkg/scan/util.go 33.33% 3 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #23113   +/-   ##
=======================================
  Coverage   66.01%   66.01%           
=======================================
  Files        1074     1074           
  Lines      116697   116702    +5     
  Branches     2941     2941           
=======================================
+ Hits        77032    77045   +13     
+ Misses      35392    35383    -9     
- Partials     4273     4274    +1     
Flag Coverage Δ
unittests 66.01% <33.33%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
src/pkg/scan/util.go 60.00% <33.33%> (-4.00%) ⬇️

... and 5 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.

Copy link
Copy Markdown
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.

lgtm

Signed-off-by: chlins <chlins.zhang@gmail.com>
@chlins chlins force-pushed the fix/sbom-created branch from 20ea496 to 7d25c8c Compare April 20, 2026 02:30
@chlins chlins merged commit 781bafa into goharbor:main Apr 20, 2026
11 of 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.

SBOM creation time is invalid in API response

5 participants