test(cmd): carry the encryption block in the composition fixtures (S04-A required encryption block plan: 11/16)
Summary
Step 12 will make startup refuse a config with no encryption block. No
config in cmd/artifact-registry tests has one today, so every boot test
there would fail on that day. This MR adds the block now, while it is still
optional.
- The five fixtures in
cmd/artifact-registry/testdata/getencryption: local: {}right afterversion: 1. The rest of each file does not change. enforcingBaseConfigYAMLandvalidBaseConfigYAML(the shared YAML bases inwire_iam_test.go) become their block-free base plus the block. So each pair differs only by the block.- The block-free bases from Step 10 do not change. The tests that check a config with no block keep using them.
Tests only, no production code. Until Step 12 lands, nothing fails if a fixture loses its block. Step 12 makes that fail. This is Step 11 of the S04-A required encryption block plan.
Checklist
- Ran it: tests only. Unit and integration suites for
./cmd/artifact-registry/pass.TestLifecycle_DatabaseIntegrationbootsvalid_config.yamlagainst PostgreSQL and logsencryption tier wired. A scratch change, reverted, made the test infrastructure serve an empty root key: the tests on the bases and fixtures then failed on the key, and the tests on the block-free bases stayed green. - Interfaces and data: none. Only test configs change. The block stays optional until Step 12.
- Failure: n/a, no production code.
- Rollout: n/a, tests only.
- Hot path: no.
- Database: no migration or query.
- Security: no new input, route or permission.
- ADRs: none.
./scripts/adr-freshness.shreports one upstream commit not yet synced, to ADR-012 (usage data). It does not touch this change. No ADR decides howcmdtests build their configs. - E2E: none. No user journey changes.
- Simplicity: the block goes right after
version, not at the end of each fixture. !2969 (merged) rewrites the fixtures' last section, so this keeps the two MRs from conflicting there.
Every config a cmd test boots or loads is one of the five fixtures, a config
read from valid_config.yaml at run time, one of the two bases, or a
block-free base. Only two helpers write their own block,
writeEncryptionConfigWithTTL and writeWarnLevelEncryptionConfig, and both
build on blockFreeValidBaseConfigYAML. So no config holds two blocks.
Merge order
- Steps 8, 9 and 10 are merged, so this MR can merge now. Step 12 builds on it and must merge after it.
- !2969 (merged) rewrites the two base constants in
wire_iam_test.go, and already conflicts withmainthere. Whichever merges second keeps both changes: !2969 (merged)'s new text goes into the block-free bases, and the two bases keep theencryptionblock on top. A merge that drops the block fails nothing until Step 12. - !2969 (merged) also edits
valid_config.yamlandslow_drain_config.yaml. Those merge cleanly with this MR. - !2944 (closed) and !3226 (closed) touch files this MR changes, but they merge cleanly in those files.
Spec coverage
Spec: S04-A (Configuration). This step adds no product behavior. It only changes the configs tests read.
| Rule | Tests |
|---|---|
| No block: startup fails, naming it (AC-28, E-1) | Step 12 asserts it. This step gets every cmd boot ready for it |
| The block-free bases carry no block | The Step 10 tests, unchanged |
Every other acceptance criterion, error case and security consideration is outside this step.
Closes https://gitlab.com/gitlab-org/ops/artifact-registry/-/work_items/1487