ci: make public-hygiene-lint green - #6
Open
MattJackson wants to merge 3 commits into
Open
Conversation
The public-hygiene gate flags text in customer-readable files that describes how the software was BUILT rather than what it DOES. Every hit in this repo is rewritten to state the behaviour or the invariant; no allow markers are added, so the gate keeps its teeth.
busbar resolves `env:` secret references during `--validate` now and exits
non-zero when one cannot resolve, so the file-drop fixture -- which names
`providers.mock.api_key: { env: MOCK_KEY }` and never exported MOCK_KEY --
described a gateway that could not start:
busbar --validate must succeed with the file-dropped postgres plugin: stdout=
stderr=[error] providers.mock.api_key: secret env:MOCK_KEY cannot resolve:
environment variable 'MOCK_KEY' is unset
CI had not surfaced this one yet: the admin-API test failed first for a
different reason and aborted the run before this binary was reached.
The variable names are derived FROM the config files busbar is about to read,
rather than listed at each call site, so the next person to add a secret
reference to one of these fixtures does not also have to remember to export it --
forgetting produces a failure that never names the variable. Reading the files
back (not the strings the test built them from) is what keeps the two from
drifting apart. `tests/common/mod.rs` holds the scan; `tests/config_secrets.rs`
covers it directly.
Red-before-green against a real `busbar` built from the core branch CI tests
against, and a real postgres: before, `load_and_exercise_postgres_plugin_via_file_drop`
FAILED with the error quoted above; after, every test in the crate passes.
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.
public-hygiene-lint was RED on
mainin this repo. Every hit is fixed by rewriting the text tostate the BEHAVIOUR rather than our internal process. No allow markers were added anywhere in
this change: a blanket allow would turn the gate into decoration.
Hits found on
main, and the decision for each.github/scripts/next-version.sh+.github/workflows/release-selftest.yml[internal-issue-id]cited an internal guard id. REWRITTEN: id dropped.
store-postgres/src/lib.rs[audit-finding-id] carried a bare audit id(L2)on a doc comment.REWRITTEN: removed. The sentence describes the function completely without it.
store-postgres/src/tests.rsx5 [tdd-narration] narrated how each fix was developed ("revertingthe fix makes this test fail, confirmed by re-running"). REWRITTEN to state the invariant and why
the assertion is non-vacuous, which is the durable fact; the development sequence is not.
store-postgres/src/tests.rsx2 [mutation-testing, internal-issue-id] named the QA harness andits campaign round. REWRITTEN to describe what the tests below pin, and to state the
unreachable-branch conclusion directly rather than as a coverage-pass scoping decision.
store-postgres-plugin/tests/{e2e,admin_api_e2e}.rs[mutation-testing] named the QA harness as abuild-shape example. REWRITTEN:
release-check.sh's phase is the concrete case and it is kept.Red before green
Same invocation CI uses. Output is ASCII-folded for this description; the runs are verbatim
otherwise.
Before (on
main)After (this branch)