Repository navigation
Report a Malformed Registry Entry Rather Than Raise in Validate - #3941
Conversation
secret_scope_errors passed a dotted cataloged entry to secret_plan even when its requiredSecrets or publish was malformed. The plan reads both fields bare, so validate raised instead of listing the defect the per-entry checks had already reported. Such an entry is now skipped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The per-entry loop iterated a registry entry's publish bare, so a null or a number raised before any error printed. It is now reported as its own error. The secret-scope skip reuses is_str_list. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The dotted-entry subtests now also run a nested requiredSecrets element and a null publish, so each skip guard is exercised. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟡 Changes recommended
An active moderate issue remains because unhashable publish targets can trigger a TypeError instead of being reported as malformed, requiring validation before planning and a regression test.
1 open issue
What changed in this PR
This pull request hardens registry validation so malformed requiredSecrets and publish declarations are reported instead of causing validation tracebacks, with regression coverage for these cases.
Changes:
- Skip malformed secret declarations before building secret plans.
- Report non-array
publishdeclarations explicitly. - Add direct and end-to-end tests for malformed registry entries.
A remaining moderate issue allows an unhashable publish.target value to raise TypeError; the test documentation also needs a present-tense wording correction.
| File | Summary |
|---|---|
spec/validate.py |
Adds guards for malformed secret and publish declarations. One moderate issue remains for unhashable publish targets (3 votes). |
tests/test_spec_validate.py |
Adds regression coverage for malformed registry fields. One documentation nit requests present-tense wording (1 vote). |
This pull request requires changes.
Review effort: Lite
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3941 +/- ##
===========================================
- Coverage 78.68% 78.67% -0.02%
===========================================
Files 37 37
Lines 12611 12621 +10
===========================================
+ Hits 9923 9929 +6
- Misses 2688 2692 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…rets Directory (#3937) ## Summary Promotes #3934 and #3941 to `main`. - **`configure.sh apply` provisions a repository's secrets from the host's `~/.secrets/` (#3934).** Each secret a cataloged repository owes is read from `~/.secrets/`. It is set in every store its mechanism names, with the value passed on stdin only. - `spec/secrets.json` `secretScopes` gives each name a strict `fleet` or `repository` scope, which picks the one file it is read from. A file at the wrong scope aborts the run before any write. - `check` asserts the names per store. Missing and refused files are listed and make the run exit non-zero. - An excluded entry, a slug its registry url does not name, and a repository whose ground branch does not exist yet are each handled without a wrong-target write. - Name resolution moved into the stdlib-only `spec/secret_names.py`, shared with `spec/audit.py`. `spec/resolve_secrets.py scaffold` pre-creates every expected file as an empty mode `600` placeholder. - CODESTYLE.md "Script and Utility File Names" defines a repository name field for secret file names. - The hub declares the `host-secrets` type. - **`spec/validate.py` reports a malformed registry entry rather than raising (#3941).** A dotted cataloged entry with a malformed `requiredSecrets` or `publish` is skipped before its secrets are planned. A non-list `publish` is now its own error. CodeRabbit raised it on this promotion. ## Verification - #3934 merged after sixteen recorded local passes, the last one clean, plus CodeRabbit and green CI including Windows. - Live rollout from `develop`: `apply` ran on all 22 cataloged repositories and set 148 secret values. A fresh `check` sweep found every owed secret in both stores. `spec/audit.py` reports no missing or forbidden secret anywhere, and the unclaimed ones left are tracked by #3936 and #3902. Closes #3932 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Summary
spec/validate.pyno longer raises on a malformed registry entry before it can report it. CodeRabbit raised this on the #3937 promotion.secret_scope_errorspasses a cataloged entry whose name cannot form a repository name field tosecret_names.secret_plan. When that entry'srequiredSecretsorpublishwas malformed, the plan raisedTypeErrororAttributeError. The validator then printed a traceback rather than the defect the per-entry checks had already listed. Such an entry is now skipped, and the skip reusesis_str_list.mainiteratedpublishbare, so a null or a number there raised before any error printed. It is now reported aspublish must be an array of publish entries.Verification
requiredSecrets, and a null and a non-objectpublish. Amain-driven test covers a null and a numericpublish, and it fails without the guard.spec/validate.pyare clean.🤖 Generated with Claude Code