Skip to content

gh project issue set-fields silently drops --risk-tier, --start-date and --target-date #2714

Description

@codeforester

Goal

basectl gh project issue set-fields --risk-tier, --start-date and --target-date should set their issue fields. Today the parser stores them under keys the command doesn't recognize, so all three are dropped silently: the command writes nothing for them and reports success. Readiness requires a Risk tier before Ready, so basectl currently can't set a field that every Ready issue needs.

Background

The mismatch (main da93ba7b):

  • Parser: cli/python/base_github_projects/project_parser.py stores issue-field options as state.field_values[option[2:]], at L209 (spaced --risk-tier Medium) and L224 (inline --risk-tier=Medium). That gives risk-tier, start-date and target-date, with hyphens.
  • Command: project_issue_fields_command.py L13–21 (ISSUE_FIELD_NAMES, DATE_FIELD_KEYS) expects risk_tier, start_date and target_date, with underscores, and drops any other key. So does the REST path, rest_issue_set_fields_command (engine.py L208, keys at L215–221).
  • Other options: --status, --priority, --area, --initiative, --size and --effort have no hyphen, so they work.

Reproduction, through the parser and the value normalization, with Base's config:

argv: project issue set-fields 2711 --project base --owner basefoundry --repo basefoundry/base
      --config .github/base-project.yml --no-defaults --risk-tier Medium --target-date 2026-12-31 --area CLI
issue_field_values_for_args: {'risk-tier': 'Medium', 'target-date': '2026-12-31', 'area': 'CLI'}

None of the three hyphenated keys is in ISSUE_FIELD_NAMES, so only Area is written. The same happens with --target-date=2026-12-31, and without --config.

Side effects:

  • The guard never fires. "Risk tier and date options require project.field_source to be set" (project_issue_fields_command.py L103–104, engine.py L222–225) checks the underscore keys, so it never fires for these options.
  • An explicit start date is ignored. With --start-date-today-if-empty, which basectl gh issue start passes, the command checks for "start_date" not in values. An explicit --start-date is therefore dropped, and today's date is written in its place.
  • The documentation promises otherwise:
    • gh.sh L426 and L443–445;
    • docs/command-reference.md L251;
    • docs/stability-baseline/current.json L708 and L726.

Why tests miss it. The command test (tests/test_project_issue_fields_command.py L485) builds ProjectArguments with underscore keys directly, so it never goes through the parser. gh.bats covers only --start-date-today-if-empty. No parser test covers the three options.

History: the bug came in with S2 (#2709, aebb26ff, 2026-11-25). Claude reviewed that PR and missed it.

Workaround in use: a REST POST repos/basefoundry/base/issues/N/issue-field-values with the Risk tier field ID (50466154). Claude set Risk tier on #2711 and #2712 this way on 2026-11-26.

Plan

Approach: the parser maps each option to the command's key explicitly, through one table built from ISSUE_FIELD_OPTIONS: --risk-tier → risk_tier, --start-date → start_date, --target-date → target_date, and the others unchanged. Both the spaced and the inline paths use the table. The command then rejects any command-line key it doesn't recognize, instead of dropping it, so a future mismatch fails loudly.

Rejected alternative: switching the command to hyphenated keys. Underscore keys are the contract elsewhere: issue_defaults in .github/base-project.yml accepts risk_tier, start_date and target_date (ALLOWED_DEFAULT_KEYS, project_config.py L22–25).

Slices: S1, one PR.

Expected behavior

  1. The options work: --risk-tier, --start-date and --target-date, spaced or inline, reach the command as risk_tier, start_date and target_date and write their issue fields.
  2. The guard applies: without a configured project.field_source, these options fail with the existing "require project.field_source" error, on both the GraphQL and REST paths.
  3. An explicit start date wins: --start-date D with --start-date-today-if-empty writes D, not today's date.
  4. Unknown keys fail: a command-line field value (args.field_values) whose key the command doesn't recognize is a usage error, not silently dropped. Config defaults the command doesn't write, such as assignee, are still ignored, as today.
  5. No other change: --status, --priority, --area, --initiative, --size and --effort behave as today.

Acceptance Criteria

  1. Every Expected behavior item passes its validation in the map below.
  2. After merge, basectl gh project issue set-fields 2711 --project base --owner basefoundry --repo basefoundry/base --config .github/base-project.yml --no-defaults --risk-tier High --dry-run prints Would set issue field Risk tier to High. (Keep gh project doctor and configure from recreating Project Priority and Size in issue-field repositories #2711's Risk tier is Medium, and the dry run lists only changed values.)

Acceptance-to-validation map

Expected behavior Validation
1 The options work A parser test for every entry in ISSUE_FIELD_OPTIONS, in both syntaxes, asserts that the key is one the command recognizes. An end-to-end test runs from argv through requested_values and asserts the Risk tier, Start date and Target date writes.
2 The guard applies Tests from argv, with no field_source, for each option on the GraphQL and REST paths.
3 Explicit start date A test with --start-date 2026-12-01 --start-date-today-if-empty asserts 2026-12-01.
4 Unknown keys fail A test passing an unrecognized command-line key asserts a usage error. A test with an assignee config default asserts it is still ignored.
5 No other change The existing parser and command tests pass.

Validation

  • pytest cli/python/base_github_projects/tests
  • bats cli/bash/commands/basectl/tests/gh.bats
  • The dry run in Acceptance Criteria 2.
  • The repository's hosted checks.

Affected Areas

  • CLI (Python): project_parser.py, project_issue_fields_command.py, engine.py, and tests.
  • Docs: CHANGELOG.md. The reference docs already describe the intended behavior.

Scope

One PR (S1). It doesn't depend on #2704's remaining S3 steps.

Non-Goals

  • New options or fields.
  • Changing how Project fields are chosen (#2713).
  • The stability baseline, which already lists the options.

Risks and mitigations

Proposed Risk tier: Medium. This changes CLI option behavior that agents and maintainers rely on, and it can be undone.

Risk Mitigation
Rejecting unknown keys breaks a caller that passes one today. The check covers only command-line values, and the parser accepts only ISSUE_FIELD_OPTIONS. Config defaults keep today's behavior. Map row 4 pins both.
An explicit --start-date now overrides the today-if-empty default. That is what the option documents. Map row 3.

Impact and Evidence

# Category Disposition
1 Product intent No impact.
2 Architecture and contracts The parser maps options to keys explicitly. The command rejects unknown keys.
3 User guidance No impact. The guides already describe the intended behavior.
4 CLI/API and reference The documented options start working. No option changes.
5 Operations and safety basectl can set Risk tier again, so the REST workaround is no longer needed.
6 Validation and testing Adds the missing parser-level coverage. See the map.
7 Examples and downstream use No impact. No other repository uses field_source yet.
8 Governance and contributor process Agents can set Risk tier, which readiness requires before Ready, with basectl.
9 Decision records None.
10 Release notes A CHANGELOG entry: set-fields --risk-tier, --start-date and --target-date now set their fields. Breaking / action required: no.

Open Questions

None block Ready.

Project Fields

  • Status: Triage
  • Priority: High
  • Effort: Small
  • Risk tier: Medium (proposed)
  • Area: CLI
  • Initiative: Contract Hardening
  • Milestone: v1.11.0
  • Category: bug
  • Issue Type: Bug

Agent Assignment

Assignee: codeforester. Claude Code (Opus 5.5) wrote this issue at Ramesh's request, from #2704 S3 step 6. Codex reviews the issue, and Ramesh approves it. Codex implements S1, and Claude reviews the PR.

Assisted-by: Claude-Code:claude-opus-5-5

Activity

  1. added this to the v1.11.0 milestone on Nov 26, 2026
  2. self-assigned this
    on Nov 26, 2026
  3. added theissue type on Nov 26, 2026
  4. added
    bug
    on Nov 26, 2026
  5. updated Priority Medium and Effort Small on Nov 26, 2026
  6. moved this from Backlog to Triage in baseon Nov 26, 2026
  7. moved this from Triage to Backlog in baseon Nov 26, 2026
  8. updated Risk tier Medium and Priority High on Nov 26, 2026
  9. moved this from Backlog to Triage in baseon Nov 26, 2026
  10. codeforester commented on Nov 26, 2026

    @codeforester
    CollaboratorAuthor

    Issue review round 1

    Reviewed #2714 as Issue Type Bug, Status Triage, against DESIGN v1.6 at main da93ba7b420fc042a57286c6ef3cc5bff4f5899f and IMPLEMENTATION-PLAN v4.6.

    1. Root cause verified on both transports. For spaced and inline input at the Python parser layer, risk-tier, start-date and target-date survive value normalization with hyphens. Running those parsed arguments through the real command functions with mocked operations, alongside --area CLI, returns success on both GraphQL and REST while writing only Area. The underscore-based source guard misses the same keys. I also reproduced an explicit 2026-12-01 start date being replaced by today's date when today-if-empty is requested.

    2. The fix and acceptance contract are appropriately bounded. One option-to-key table shared by both parser syntaxes restores the command/config key contract. Rejecting unknown keys only in args.field_values preserves ignored config defaults such as assignee. The validation map covers parser-to-command behavior, both transport guards, explicit-date precedence, unknown-key rejection and the existing options. The planned argv regression tests exercise the boundary bypassed by today's direct-ProjectArguments fixtures.

    3. The live acceptance check is read-only and has a distinct expected change. Risk tier's live field ID is 50466154, and Keep gh project doctor and configure from recreating Project Priority and Size in issue-field repositories #2711's current value is Medium, so the proposed High dry run can demonstrate the fix without changing the issue. The command reference already promises these options; a CHANGELOG correction without a new option or stability-baseline change is consistent. The 57 focused command, field-source, REST and configure baseline tests passed.

    No actionable findings. No live Project or issue-field writes were performed.

    Verdict: Ready. No findings.

    Status remains Triage.

    2026-11-27. Independent reviewer: Codex (GPT-6), independent reviewer session 01a217d5-ad11-7760-a944-5afef3747203; author: Claude Code (Opus 5.5 / claude-opus-5-5; author session not supplied). Exact reviewer runtime model ID and token usage are not exposed.

  11. moved this from Triage to Ready in baseon Nov 26, 2026
  12. moved this from Ready to In Review in baseon Nov 27, 2026
  13. codeforester commented on Nov 27, 2026

    @codeforester
    CollaboratorAuthor

    In Review: PR #2717 is non-draft and approved in review round 1. The built-in 'Pull request linked to issue' workflow set In Review when the closing link was added on 2026-11-27. In Progress wasn't recorded at start, because the issue was started with --no-project.

  14. added a commit that references this issue on Nov 27, 2026
  15. moved this from In Review to Done in baseon Nov 28, 2026
  16. added a commit that references this issue on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

Fields

Priority

Medium

Effort

Small

Start date

None yet

Target date

None yet

Risk tier

Medium

Projects

  • Status
    Done

Relationships

None yet

Development

No branches or pull requests

Issue actions