test(repos): pin DELETE-idempotency contract for virtual member removal (#95)#108
Open
test(repos): pin DELETE-idempotency contract for virtual member removal (#95)#108
Conversation
…al (#95) Re-issuing DELETE /:key/members/:member_key against a member that was already removed by a prior call must return 404 (not 200/204). The handler resolves member_key via get_by_key before attempting the delete, so the second call surfaces AppError::NotFound -> 404; without a test, a regression that swallows the missing-row error would silently change the API contract. Adds the case to tests/repos/test-virtual-repo-member-remove.sh, immediately after the existing first-DELETE assertion, reusing LOCAL_A (already deleted earlier in the suite). Gated behind a new require_feature flag, virtual_member_strict_contract, which maps to backend version >= 1.2.0. The endpoints themselves exist in 1.1.x but this test class is reserved for the v1.2.0 release-gate so it stays out of the in-flight 1.1.9 runs. The flag also covers the sibling follow-ups in #92, #93, #94 (added in their own PRs). Refs artifact-keeper-test#95.
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
Adds a single test case asserting that re-issuing
DELETE /api/v1/repositories/:key/members/:member_keyagainst a member that was already removed by a prior call returns 404, not 200/204.The handler (
update_virtual_member/remove_virtual_memberinbackend/src/api/handlers/repositories.rs) resolvesmember_keyviaservice.get_by_keybefore attempting the delete, so the second call surfacesAppError::NotFound-> HTTP 404. A regression that swallowed the missing-row error and returned 200/204 would silently change the contract for clients (CLI, web, SDKs) that re-drive deletes on retry.Fixes #95.
Why gated to v1.2.0
The endpoints exist in 1.1.x, but per the in-flight v1.1.9 release process we want this strict-contract test class to only run against the v1.2.0+ release-gate. New
require_featureflag added totests/lib/common.sh:The flag is shared with the sibling follow-ups in #92, #93, #94 (each has its own PR). On 1.1.9 backends the case is recorded as a per-test JUnit
<skipped/>(not a suite-level skip, so #870/#871/#888 silent-success protection is preserved).Files
tests/lib/common.sh-- addsvirtual_member_strict_contract->1.2.0to_feature_min_version.tests/repos/test-virtual-repo-member-remove.sh-- adds the new case immediately after the existing 404-on-unknown-member assertion. ReusesLOCAL_A, which was already removed earlier in the suite.Validation
bash -n tests/lib/common.shandbash -n tests/repos/test-virtual-repo-member-remove.shpass.if require_feature ...; then ... fi, so on a 1.1.9 backend the case skips cleanly while the rest of the suite continues.Test Plan
skipped(notfailed) when run against the current release/1.1.x test target.