Skip to content

fix: reject custom header flags for an OCI layout path target - #2299

Merged
TerryHowe merged 1 commit into
oras-project:mainfrom
ogulcanaydogan:fix/oci-layout-path-header-flags
Oct 26, 2026
Merged

TerryHowe merged 1 commit into
oras-project:mainfrom
ogulcanaydogan:fix/oci-layout-path-header-flags

Conversation

@ogulcanaydogan

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Target.Parse rejects custom header flags when the target is selected with --oci-layout, but the same kind of target selected with --oci-layout-path (or --from-oci-layout-path and --to-oci-layout-path) silently ignored them. Both set the target type to oci-layout, so this applies the same check to the path case, with the error message in a shared constant.

TestTarget_Parse_oci_header_flags checks --oci-layout and the three path spellings. The three path cases fail without the change.

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

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?

Target.Parse rejects custom header flags when the target is selected with
--oci-layout, but the same target selected with --oci-layout-path (or the
--from-/--to- variants) silently ignored them. Both set the target type to
oci-layout, so apply the same check to the path case.

Signed-off-by: Ogulcan Aydogan <[email protected]>
@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.90%. Comparing base (bc7b32d) to head (f3d1325).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2299      +/-   ##
==========================================
+ Coverage   61.85%   61.90%   +0.04%     
==========================================
  Files         140      140              
  Lines        6098     6100       +2     
==========================================
+ Hits         3772     3776       +4     
+ Misses       2102     2101       -1     
+ Partials      224      223       -1     

☔ 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

@TerryHowe
TerryHowe merged commit e168dfd into oras-project:main Oct 26, 2026
10 checks passed
TerryHowe pushed a commit to oras-project/oras-www that referenced this pull request Nov 19, 2026
Fixes #701 (part of #697)

Adds a blog post announcing ORAS CLI v1.4.0 at
`blog/2026-11-19-oras-1.4.0/index.mdx`. It follows the format of the
v1.3.0 post and uses the `oras` author like the other release posts.

It covers the topics listed in the issue:

- the move to oras-go v3, with a link to the oras-go v3.0.0 post
- `oras copy` with separate credentials on the same registry
(oras-project/oras#1892) and the GitLab login fix
(oras-project/oras#2260)
- the experimental `ORAS_EXPERIMENTAL_CONTAINERS_CONFIG` mode
- `oras blob fetch`/`delete` requiring digests (oras-project/oras#2304)
and header flags rejected for OCI layout targets
(oras-project/oras#2299)
- OCI image labels (oras-project/oras#2300) and build provenance
attestations

It also links the installation page and the full release notes.

The containers config section doesn't link a how-to guide yet because
#700 is still open. I can add the link once that guide lands.

Tested locally: `npm run check-links` passes, and the post renders
correctly with `npm start` at `/blog/oras-v1.4.0`.

I used Claude to help draft this post, and I checked the content against
the v1.4.0 release notes.

---------

Signed-off-by: Ashwanijha1405 <[email protected]>
TerryHowe pushed a commit to oras-project/oras-www that referenced this pull request Nov 20, 2026
Fixes #699 (part of #697)

## Summary

ORAS CLI
[v1.4.0](https://github.com/oras-project/oras/releases/tag/v1.4.0) was
released on 2026-11-17. This PR adds 1.4 as the latest docs version,
following the post-release checklist in the oras `RELEASING.md`. There
was no 1.4 preview, so the 1.4 docs start as a copy of 1.3.

- add `"1.4"` to the top of `versions.json` and `1.4 1.4.0` to
`versions-map`
- copy `versioned_docs/version-1.3/` and
`versioned_sidebars/version-1.3-sidebars.json` to 1.4
- regenerate `versioned_docs/version-1.4/commands/` with `npm run
refresh-commands` against the v1.4.0 binary. The only difference from
1.3 is that boolean flags now show as `--flag[=true|false]`, which is
what `oras <command> --help` prints in v1.4.0. The blob digest
requirement from oras-project/oras#2304 was already reflected in the 1.3
pages, and oras-project/oras#2299 changes behavior but not the help text
- installation page: pin v1.4.0 everywhere (download snippets, WinGet,
`go install`, the `ghcr.io/oras-project/oras` image, the `doras` alias
and setup-oras). The sample `oras version` output comes from the v1.4.0
release binary and matches the one in the issue
- binary verification guide: change the example to v1.4.0. The `gpg
--verify` signature time and the `gh attestation verify` digest and
workflow refs come from the v1.4.0 release assets. The "Starting with
`v1.3.6`" sentences and the expired-key example keep their versions
because they describe when attestations started and an older release
- Go scripting guide: require `oras.land/[email protected]`
- supply chain guide: say that the `oras discover`
`--format`/`--template` flags are experimental in v1.4, which they still
are
- home page Linux install snippet: `VERSION="1.4.0"`
- fix the "pervious" typo in the copied `quickstart.mdx`. Vale checks
the whole new file, so the typo carried over from 1.3 failed the check

One thing to note: WinGet doesn't list `ORASProject.ORAS` 1.4.0 yet (the
latest manifest is 1.3.6). `winget install oras --version 1.4.0` will
work once the community manifest is published. setup-oras already
supports 1.4.0, and `ghcr.io/oras-project/oras:v1.4.0` exists.

## Validation

- downloaded the v1.4.0 release assets. `gpg --verify` passes on the
checksums file and on `oras_1.4.0_linux_amd64.tar.gz`. `shasum -a 256
--ignore-missing -c` passes. `gh attestation verify` succeeds, also with
`--source-ref refs/tags/v1.4.0`, and fails with `--source-ref
refs/tags/v1.3.6`. `oras version` on darwin/arm64 prints the output
shown on the page
- the Go scripting example builds and runs with `oras.land/[email protected]`
(Go 1.26.11)
- `npm run refresh-commands`: only
`versioned_docs/version-1.4/commands/` changes, and older versions are
untouched
- `npm test` (32 passed), `npm run check-links`, `docusaurus build`. In
the build, `/docs/` serves 1.4 with the v1.4.0 snippets, and
`/docs/1.3/` is still there with the older-version banner

Signed-off-by: NopeCharon <[email protected]>
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.

--oci-layout-path accepts custom header flags that --oci-layout rejects

2 participants