Skip to content

Share the checkout-pin check between init and project new - #186

Draft
Deicyde wants to merge 1 commit into
mainfrom
golf/checkout-pin-rule
Draft

Deicyde wants to merge 1 commit into
mainfrom
golf/checkout-pin-rule

Conversation

@Deicyde

@Deicyde Deicyde commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #96. No behaviour change: 2 files, +16/-17, one commit.

  • _checkout_pin (scaffold.py). autoform init (scaffold_project) and autoform project new (_resolve_workflow_pin) each reduced plugin_pin's answer the same way: a safe source and a lowercase full commit, or else the default source and no commit. The rule is now one function next to plugin_pin. It looks plugin_pin up on the scaffold module, so the tests that replace scaffold.plugin_pin still govern both commands, which is what the comment this removes from create.py was there to keep. project/create.py imports _FULL_SHA instead of keeping its own copy, and no longer imports the scaffold module or DEFAULT_AUTOFORM_SOURCE.

Noticed, not changed:

  • No test gives either command a checkout pin in GitHub SCP form or with an uppercase commit, so the tests run the normalization and lowercasing in _checkout_pin only on values they leave unchanged.

Overlaps with open PRs:

Validation at exact head aa06d4ed: ruff check autoform_cli servers tests is clean. tests/test_project_create.py (257), tests/test_scaffold.py (106), tests/test_render.py (77), tests/test_project_inspect.py (272) and tests/test_cli.py (5) pass.

scaffold_project and _resolve_workflow_pin each reduced plugin_pin's
answer to a safe source and a lowercase full commit, or else the
default source and no commit. That rule is now _checkout_pin in
scaffold.py. It still looks plugin_pin up on the scaffold module, so a
test that replaces scaffold.plugin_pin still governs both commands.
project/create.py imports _FULL_SHA instead of keeping its own copy.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant