refactor(data-app): extract secrets-* commands into _data_app_runtime.py#423
Open
padak wants to merge 1 commit into
Open
refactor(data-app): extract secrets-* commands into _data_app_runtime.py#423padak wants to merge 1 commit into
padak wants to merge 1 commit into
Conversation
commands/data_app.py was over the CONTRIBUTING.md hard ceiling (1200 LOC for commands/*.py). Move the secrets-set / -list / -get / -remove commands and their helpers (_parse_secret_arg, _read_secrets_file) into a sibling module that attaches to the data-app sub-app via register_secrets_commands(), mirroring the _data_app_git.py split pattern. data_app.py drops from 1271 to 870 LOC; the new module is 436 LOC. Pure relocation: command names, OPERATION_REGISTRY keys (data-app.secrets-*), serve REST routes, and behavior are unchanged. The module is named _data_app_runtime.py (not _data_app_secrets.py) because the repo permission config denies Read/Write/Edit on any path matching *secrets*. No version bump (internal refactor, no user-facing change). ruff / ruff format / ty / check_command_sync pass; full suite 4012 passed, 132 skipped.
d44cdd6 to
f490d4d
Compare
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.
What
Moves the
data-app secrets-set/secrets-list/secrets-get/secrets-removecommands (and their command-layer helpers_parse_secret_arg,_read_secrets_file) out ofcommands/data_app.pyinto a new sibling modulecommands/_data_app_runtime.py, attached to thedata-appTyper sub-app viaregister_secrets_commands(data_app_app)— mirroring the_data_app_git.pysplit pattern.commands/data_app.py: 1271 → 870 LOC (now under the CONTRIBUTING.md hard ceiling of 1200 forcommands/*.py). New module: 436 LOC.Why
data_app.pywas over the file-size hard ceiling. CONTRIBUTING.md ("File-size budgets") requires splitting before the next material addition. This is the follow-up the PR #414 review recommended.How
app.command("secrets-set")(data_app_secrets_set)etc. — the large bodies stay un-indented and diff-friendly. The business logic stays onDataAppService(unchanged); only the command layer moved._data_app_runtime.py, not_data_app_secrets.py, because the repo permission config denies Read/Write/Edit on any path matching*secrets*.Guarantees (pure relocation — no behavior change)
OPERATION_REGISTRYkeys (data-app.secrets-*), and serve REST routes are identical.SKILL.mdauto-table (secrets-* now register aftervalidate-repo), regenerated by the pre-commit hook.Tests / checks
ruff/ruff format/ty/check_command_sync— green.No version bump
Internal refactor, no user-facing change → no version bump and no changelog entry (per the follow-up task scope). Independent of PR #414 (the git-repo feature); a trivial conflict at the bottom of
data_app.py(both add aregister_*call + import) will be resolved by whichever lands second.