Repository navigation
fix(id): one archive-tag rule for writer and reader (#11790) - #11798
Conversation
The FileOps writer reserved any non-empty stem with an all-digit suffix, while the reader required a parseable u64 suffix and accepted an empty stem. So '.archive.5' was an archive to the reader only, and overflowing digit suffixes were reserved by the writer but primary to the reader. Both sides now use archive_tag_timestamp in id-sync: non-empty stem, unsigned decimal suffix that fits in u64. Tests cover both shapes.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 44 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Local: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ed88abe27
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fn is_archive_tag_name(name: &str) -> bool { | ||
| let Some((file_name, suffix)) = name.rsplit_once(".archive.") else { | ||
| return false; | ||
| }; | ||
| !file_name.is_empty() && !suffix.is_empty() && suffix.bytes().all(|b| b.is_ascii_digit()) | ||
| archive_tag_timestamp(name).is_some() |
There was a problem hiding this comment.
Align archive deletion before admitting overflowing suffixes
With this change, users can create an ordinary file named report.archive.18446744073709551616, but deleting report also deletes that independent file and its metadata. FileOps::delete still collects every tag with the matching prefix and an all-digit suffix (fileops.rs:711–715), regardless of whether the suffix fits in u64 or the tag has archive ownership metadata. Update the deletion scan and ownership predicate to use the shared archive rule before relaxing the writer's reservation.
Useful? React with 👍 / 👎.
|
agent-note:v1 Parked 20 min: CI checks have not registered on this PR. Resume will check PR state fresh and merge only if green. |
Closes nothing automatically; refs #11790.
Problem
The FileOps writer (
id-syncis_archive_tag_name) reserved any non-empty stem with an all-digit suffix. The reader (id-webclassify_tag) required a u64-parseable suffix and accepted an empty stem. Result:.archive.5was an archive to the reader but not the writer, and overflowing digit suffixes were reserved by the writer but primary to the reader.Change
id-sync: newarchive_tag_timestamp(name) -> Option<u64>(non-empty stem, unsigned decimal suffix that fits u64). The writer's predicate now delegates to it.id-web:classify_taguses the same function for the archive branch.id-sync; reader cases for.archive.5, u64 overflow and u64::MAX inid-web.Behaviour note
A name with an overflowing all-digit suffix is no longer reserved by the writer; it is an ordinary file, matching the reader. No producer mints such a suffix.
Verification
rustfmt --checkclean on both files.cargo test -p id-sync --lib archive_tag_timestamp: running at PR open; CI is the merge gate.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.