Skip to content

feat: add FileStore annotation constants#352

Open
wangxiaoxuan273 wants to merge 1 commit intooras-project:mainfrom
wangxiaoxuan273:feat/filestore-annotations
Open

feat: add FileStore annotation constants#352
wangxiaoxuan273 wants to merge 1 commit intooras-project:mainfrom
wangxiaoxuan273:feat/filestore-annotations

Conversation

@wangxiaoxuan273
Copy link
Copy Markdown
Contributor

@wangxiaoxuan273 wangxiaoxuan273 commented Feb 27, 2026

What this PR does / why we need it

Adds FileStore-specific annotation key constants for digest and unpack indicators used by the File Store implementation.

  • FileStoreAnnotations.AnnotationDigest — key for the digest of uncompressed content
  • FileStoreAnnotations.AnnotationUnpack — key for indication of unpacking

Includes a test file that validates all constant values.

Which issue(s) this PR resolves / fixes

Part of the File Store implementation split (issue 2 of 10).
Related: #328, #37

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

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.76%. Comparing base (5953fb1) to head (8d0c283).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #352   +/-   ##
=======================================
  Coverage   91.76%   91.76%           
=======================================
  Files          64       64           
  Lines        2755     2755           
  Branches      364      364           
=======================================
  Hits         2528     2528           
  Misses        138      138           
  Partials       89       89           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces FileStore-specific annotation key constants as part of the File Store implementation. It adds two annotation constants that match the oras-go v2 implementation, maintaining compatibility with the upstream Go library.

Changes:

  • Adds FileStoreAnnotations class with two annotation key constants for digest and unpack indicators
  • Includes comprehensive unit tests validating the constant values

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/OrasProject.Oras/Content/File/Annotations.cs Defines FileStore annotation key constants for digest tracking and unpack indication
tests/OrasProject.Oras.Tests/Content/File/AnnotationsTest.cs Unit tests validating the annotation constant values

Adds FileStore-specific annotation key constants for digest and unpack indicators.

Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@akashsinghal
Copy link
Copy Markdown
Collaborator

Caution

This review was generated by Copilot using Claude Opus 4.6, mimicking the review style of shizhMSFT. This is not the real shizhMSFT.

Review of PR #352

Verified constants match oras-go (content/file/file.go:52-55) exactly. Two observations:

1. Legacy io.deis.oras prefix (Annotations.cs:25-26, 32-33)

These annotations use the io.deis.oras.content prefix, which is a legacy namespace from when ORAS was part of the Deis project (now deprecated). oras-go carries these for backward compatibility. Since this is the first time the .NET library introduces these constants, it's worth adding a brief XML doc note explaining the provenance — e.g., "This key uses the legacy io.deis.oras prefix for compatibility with oras-go." This prevents a future contributor from "helpfully" renaming the prefix and breaking cross-runtime interop.

2. public visibility for internal-only consumers (Annotations.cs:19)

FileStoreAnnotations is public, but the consuming FileStore class (in oras-go and in the planned .NET implementation per #328) is the only expected user. If the FileStore itself is internal (or not yet implemented), shipping these as public commits to a public API surface that hasn't been exercised yet. Should this be internal until the FileStore is ready for public use? "Public method should return public type" — but the corollary is: don't make types public until you have a public consumer.

Otherwise SGTM — simple, correct, well-tested constants.

@akashsinghal
Copy link
Copy Markdown
Collaborator

@wangxiaoxuan273 can you follow up on the previous AI comment and address them if you feel they are relevant?

/// digest of the uncompressed content.
/// </summary>
public const string AnnotationDigest =
"io.deis.oras.content.digest";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

very minor nit: in PR 351 these sort of declarations are on a single line but these are on 2 lines. Is there a standard line length?

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.

4 participants