Repository navigation
Release v0.8.8: fix S3 initremote false-fallback - #398
Merged
Merged
Conversation
* Fix S3 initremote false-fallback to enableremote (#396) Tighten the configureS3Remote fallback so it only fires on git-annex's actual duplicate-remote wording ("There is already a special remote named X"), not on any S3 stderr containing the substring "already exists". Substring matching previously matched bucket-level errors like BucketAlreadyOwnedByYou and triggered a doomed enableremote for a remote that was never registered, masking the real S3 error as "git-annex: there is no available git remote named nemar-s3". Also rewrite annexRemoteExists to probe with `git annex info <name> --json` directly instead of fuzzy-matching repository descriptions in the full info dump. * Address PR review findings (#397) - Tighten annexRemoteExists to require info.remote === name; rejects the 'here' alias, bare UUIDs, and annexed-file path collisions that git annex info accepts as valid lookups. - Extract initOrEnableSpecialRemote so the duplicate-detect-and-fallback flow is generic and end-to-end testable with type=directory remotes (no S3 credentials needed). - Surface raw stderr or exit code when initremote fails and filterAnnexInfoMessages strips everything, so users no longer see a bare 'Failed to configure S3 remote' with no context. - Add tests for the here/UUID/file-collision false positives, the new end-to-end fallback path, and a multi-line stderr regex fixture. - Assert init exit codes inside newAnnexRepo so missing git-annex fails the suite cleanly instead of producing confusing assertions.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Patch release. Fixes the OpenNeuro onboarding workflow at
nemarDatasets/.github/workflows/onboard-openneuro.yml(recent failure: https://github.com/nemarDatasets/.github/actions/runs/25174599561/job/73803153849).configureS3Remoteso the enableremote fallback fires only on git-annex's exact "There is already a special remote named X" message instead of any stderr containing the substring"already exists". The loose match was triggered by S3 bucket-conflict messages (BucketAlreadyOwnedByYou,BucketAlreadyExists) and cascaded into a doomed enableremote, surfacing asgit-annex: there is no available git remote named nemar-s3.annexRemoteExiststo probe withgit annex info <name> --jsonand requireinfo.remote === name. Rejects theherealias, bare UUIDs, and annexed-file path collisions thatgit annex infoaccepts.initOrEnableSpecialRemoteso the duplicate-detect-and-fallback flow is testable end-to-end withtype=directoryremotes.filterAnnexInfoMessagesstrips everything, so users no longer see a bare"Failed to configure S3 remote".Closes #396.
Test plan
bun test test/git-annex-remote.test.ts— 14 tests, all pass (real git-annex, no mocks)gh workflow run onboard-openneuro.yml -R nemarDatasets/.github -f openneuro_ids=ds003825after cleanup of partial on003825 state, expect S3 setup to succeed or surface the real S3 error