Skip to content

fix: validate format before special handling - #2205

Merged
TerryHowe merged 2 commits into
oras-project:mainfrom
TanvirTian:fix/format-validation
Oct 9, 2026
Merged

TerryHowe merged 2 commits into
oras-project:mainfrom
TanvirTian:fix/format-validation

Conversation

@TanvirTian

@TanvirTian TanvirTian commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
This PR fixes inconsistent --format validation by validating the format against the command's supported formats before applying format-specific handling.

This prevents:

oras discover --format text from returning the wrong error.
oras repo tags --format table from showing a deprecation warning for an unsupported format.

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 #2204

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 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.14%. Comparing base (87495d5) to head (361ca58).
⚠️ Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2205      +/-   ##
==========================================
+ Coverage   87.81%   88.14%   +0.32%     
==========================================
  Files         139      139              
  Lines        5689     6015     +326     
==========================================
+ Hits         4996     5302     +306     
- Misses        413      425      +12     
- Partials      280      288       +8     

☔ 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.

@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

@TanvirTian

Copy link
Copy Markdown
Contributor Author

can you merge it if its good to go?

@TerryHowe
TerryHowe merged commit e58fee3 into oras-project:main Oct 9, 2026
10 checks passed
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.

fix: validate format before special handling

2 participants