Skip to content

test(repos): pin DELETE-idempotency contract for virtual member removal (#95)#108

Open
brandonrc wants to merge 1 commit intomainfrom
test/95-virtual-member-delete-idempotency
Open

test(repos): pin DELETE-idempotency contract for virtual member removal (#95)#108
brandonrc wants to merge 1 commit intomainfrom
test/95-virtual-member-delete-idempotency

Conversation

@brandonrc
Copy link
Copy Markdown
Contributor

Summary

Adds a single test case asserting that re-issuing DELETE /api/v1/repositories/:key/members/:member_key against a member that was already removed by a prior call returns 404, not 200/204.

The handler (update_virtual_member / remove_virtual_member in backend/src/api/handlers/repositories.rs) resolves member_key via service.get_by_key before attempting the delete, so the second call surfaces AppError::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_feature flag added to tests/lib/common.sh:

"virtual_member_strict_contract") echo "1.2.0" ;;

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 -- adds virtual_member_strict_contract -> 1.2.0 to _feature_min_version.
  • tests/repos/test-virtual-repo-member-remove.sh -- adds the new case immediately after the existing 404-on-unknown-member assertion. Reuses LOCAL_A, which was already removed earlier in the suite.

Validation

  • bash -n tests/lib/common.sh and bash -n tests/repos/test-virtual-repo-member-remove.sh pass.
  • The new case is wrapped in 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

  • Do not merge until v1.1.9 has shipped.
  • Once merged, confirm the new case runs (not skipped) against a v1.2.0+ test deployment.
  • Confirm the case is recorded as skipped (not failed) when run against the current release/1.1.x test target.

…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.
@brandonrc brandonrc added test-coverage Hardening Core hardening Hardening Core: stability and process work labels Apr 30, 2026
@brandonrc brandonrc added this to the v1.2.0 milestone Apr 30, 2026
@brandonrc brandonrc moved this from Todo to In Progress in Hardening Core Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hardening Hardening Core: stability and process work test-coverage Hardening Core

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

test(repos): add DELETE-idempotency test (delete same virtual member twice)

1 participant