Skip to content

fix: validate extra destination tags before pushing - #2237

Merged
TerryHowe merged 6 commits into
oras-project:mainfrom
TanvirTian:fix/validate-extra-tags
Oct 15, 2026
Merged

TerryHowe merged 6 commits into
oras-project:mainfrom
TanvirTian:fix/validate-extra-tags

Conversation

@TanvirTian

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
This PR checks extra tags before pushing. If a tag is empty or invalid, ORAS stops early and avoids making unwanted changes.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2236

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header?

@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.71%. Comparing base (6ca02d0) to head (85c8c2e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2237      +/-   ##
==========================================
+ Coverage   57.62%   59.71%   +2.08%     
==========================================
  Files         139      140       +1     
  Lines        6074     6091      +17     
==========================================
+ Hits         3500     3637     +137     
+ Misses       2355     2233     -122     
- Partials      219      221       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TanvirTian
TanvirTian force-pushed the fix/validate-extra-tags branch from 16a3887 to 16720dc Compare October 14, 2026 14:08

@TerryHowe TerryHowe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Issue #2236: extra tags from oras manifest index update --tag are still pushed before validation (update.go PreRunE needs ValidateExtraTags(opts.tags)).

Comment thread cmd/oras/root/manifest/fetch_test.go Resolved
Comment thread cmd/oras/root/cp_test.go Resolved
Comment thread cmd/oras/internal/option/extra_tags.go Resolved
Comment thread cmd/oras/root/manifest/fetch_test.go Resolved
@TanvirTian
TanvirTian force-pushed the fix/validate-extra-tags branch from 16720dc to eeb8d5e Compare October 14, 2026 20:05
@TanvirTian
TanvirTian force-pushed the fix/validate-extra-tags branch from c3ecf39 to 9c94f61 Compare October 14, 2026 20:18
@TanvirTian
TanvirTian force-pushed the fix/validate-extra-tags branch from afed136 to 85c8c2e Compare October 14, 2026 21:01

@TerryHowe TerryHowe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@TerryHowe
TerryHowe merged commit ba3a3dc into oras-project:main Oct 15, 2026
10 checks passed
@Rohilalala Rohilalala mentioned this pull request Oct 15, 2026
4 tasks done
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.

Validate extra destination tags before performing push operations

2 participants