Skip to content

adopt-project.py check and execute: one bad plan value is named in different orders, or by two or three findings, and two pin sentences say more than execute does #901

Closed

Description

@brettheap

Goal: check and execute name the same first problem in a hand-edited plan, and name each bad value once, in words that say what execute does.

Filed by lane openRepoShape-3, from its triage of #457 at the v1.1.1 release commit 5017830. It groups #457's lines L2-6, L2-7, L1-K7, L2-12 and L2-42, one pull request's worth.

State at 5017830.

  • check asks the plan's id and organisation in _manifest_values (adopt-project.py:4894), while execute asks the leg paths first, in _checked_plan_values (:12030).
  • _manifest_values' docstring still says "a bad date does not change which problem either command names first" (:4911-4912). That holds for the organisation and the id only. L2-7 measured that with visibility: secret beside elected_on: someday, both commands name election-date-malformed rather than plan-manifest-invalid; that was not measured again here.
  • A pin whose product holds a tab is now three findings about one value.
  • _read_pins spells a pins: that is not a list with repr (:554).
  • Every pin finding ends "execute writes the pin file from the commit and the digest plan records, and nothing else" (:584-586). That includes the digest_source: finding (:494-498), though execute also writes that field as _digest_source_written reads it (:521).

What happens. Measured on a detached clone at 5017830, with a stub gh (exit 97), GH_TOKEN=bogus, an empty GH_CONFIG_DIR and local remotes.

id: "North Wind" and legs.spec_path: "../spec":

check exit 2
REFUSED plan-bad-id: <plan>: `id:` is 'North Wind' and must match ^[a-z0-9][a-z0-9-]*$
execute exit 2
REFUSED plan-bad-leg-path: legs.spec_path is '../spec', which is not a canonical leg path: ...
legs made: 0

org: "-evil" and the same leg path:

check exit 2
REFUSED unsafe-value: org is '-evil', which is not a value this tool will put on a `git` or `gh` command line
execute exit 2
REFUSED plan-bad-leg-path: legs.spec_path is '../spec', ...
legs made: 0

A pin edited to product: "a\t" and repository: "opensoft/a\t":

check exit 1
FINDING plan-pin-malformed: `pins:` entry 1 ('a\t') records `product: 'a\t'` and `repository: 'opensoft/a\t'`, ... `execute` writes the pin file from the commit and the digest `plan` records, and nothing else: re-run ...
FINDING plan-unwritable-value: a `pins:` item is 'a\t', which `execute` writes into the assembly root's `project.yaml`, and it holds a control character
FINDING plan-manifest-invalid: the manifest this run would write is one the project's own validate-manifest.py refuses: manifest-neutral-product-pins: neutral_product_pins entry 'a\t' is not a neutral product name: it holds a character that is not printable.

Direction.

  • Ask the plan's options in one order in both commands, so both name the same first problem.
  • Reword the docstring: "so a bad date beside a bad organisation or id does not make check and execute name different problems first".
  • Let one rule leave a value that another rule names.
  • Spell pins: with _read_as(rows).
  • End the digest_source: finding with "and how it was read, and nothing else", or give it a sentence of its own.

Size: M.

Lane: openreposhape-3 (openRepoShape-3)

Activity

  1. added this to the v1.2.0 milestone on Oct 18, 2026
  2. added 6 commits that reference this issue on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions