Skip to content

adopt-project.py plan: an empty --id or --elected-by is read as not passed, and a derived id's refusal sends the person to an --id the naming policy then refuses #658

Closed

Description

@brettheap

plan should refuse an empty passed --id or --elected-by by name, as --tracking-branch '' is since #479, and the derived-id refusal should say what to change, --project.

From the checklist triage of 2026-10-15, batch 3; Brett Heap approved its recommendations at 2026-10-16T12:14:51Z. One pull request covers the lines below.

Lands after: #620.

Decision applied: DB2 (option A) and DB3 (option 1).

Lines

Line numbers are at the commits named; main has moved since.

  • L2-53: plan --id '' and plan --elected-by '' are read as not passed. Where: adopt-project.py _checked_plan_inputs, flags_given (:3273), args.id = args.id or args.project.lower() (:3309), args.elected_by = args.elected_by or _elector() (:3332); the contrast is given = args.tracking_branch is not None (:3279). Effort S; all. On main 396c0ff4: --id '' plans id: atlas and exits 0; --elected-by '' records the configured user.name and exits 0 though --help says "not blank"; with no user.name the refusal reads "--elected-by (not given, so git config user.name) is ''", naming "not given" for a flag that was passed; --tracking-branch '' is refused unsafe-value (probe l2-53-54.log).
  • L2-54: for a derived id, "pass an explicit lowercase --id" leads to another refusal. Where: adopt-project.py:3309-3313 (derived at :3309, adopt-bad-id raised at :3311), _check_names at :3348, _refuse_another_repository called at :3321 and defined at :10166. Effort S; all. On main 396c0ff4: --project North_Wind gives REFUSED adopt-bad-id: --id 'north_wind' must match ...; adding --id north-wind gives REFUSED naming-unclassified: 'North_Wind' matches no family in the naming policy; for a source adopted in place (origin testorg/North_Wind) the second refusal says it cannot be adopted in place under that name and to rename it first (probe l2-54-inplace.log).

Rides along (backlog; tick it here if the same change covers it)

Notes for whoever takes it. #620's _refuse_bad_id (4c049a8, :3050-3065) builds the derived sentence by hand and, per rv601's probe P4, says "(--id was not given)" for --project North_Wind --id ''; the fix replaces that with FLAG_DEFAULTS["id"] (:2623) through _flag_named (:2819), as L2-54's direction says. L2-53 moves flags_given, which also labels the elector (:3331) and _flag_fields (:2831), so those labels' tests move with it. The mutant id_passed = args.id is not None survives every test of #620 because nothing tests --id ''; the fix adds that row. Not a duplicate of #261 (a blank ' '), #529 (the elector's label) or #420 (the branch alphabet).

Each line above is marked → this issue on its tracking issue. Tick it there too when this closes.

The lines as written on the tracking issues

L2-53 (P3; adopt-project.py, #601 review): plan --id '' and plan --elected-by '' are read as not passed, so an empty value silently becomes the derived id or git config user.name.

— #457, comment

L2-54 (P3; adopt-project.py, #601 review): for a derived id the remedy "pass an explicit lowercase --id" leads to another refusal.

— #457, comment

[L1-39] adopt-manifest-invalid names a filled-in --org as a flag (an org from a url that checked_value accepts but validate-manifest.py refuses, such as ~x), the mechanism lane 3's #529 fixed for --elected-by (landed as #567); an org entry in FLAG_DEFAULTS is the cheap fix. Measured on 182389e. (Found in #591's writer and review.)
— #457, comment

Activity

  1. added this to the v1.1.0 milestone on Oct 16, 2026
  2. brettheap commented on Oct 16, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-2, session 81650e29-c906-4fe8-96c9-55580bfe0c44@Eagle, 2026-10-16T12:42:41Z, for #658

    Logged in lanes/log/openRepoShape-2.md at 93ceab4ef89c34a5e7bda33a6b89e4597f12b23c.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#658:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#658"`, kept where the row or its body names `#658`:
       none
    3. `git ls-remote --heads git@github.com:opensoft/openRepoShape` branches naming `658` as a whole token:
       none
    
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