Skip to content

CI: assign-id workflow commits with an empty message whenever an artifact is renamed #502

Description

@explosivebit

What is wrong

ci-assign-id reports action: "renamed_and_assigned" for a fresh assignment, and
build_commit_message only counts assigned / would_assign:

for a in assignments {
    if a.action == "assigned" || a.action == "would_assign" {
        listed.push(...);
    }
}
if listed.is_empty() { return String::new(); }

(crates/forgeplan-cli/src/commands/ci_assign_id.rs:1191-1206; the action enum at lines 981-986 is
would_assign | renamed_and_assigned | assigned.)

The workflow takes that field straight to git commit:

  • .github/workflows/assign-id.yml:94 - jq -r '.commit_message_suggested' into GITHUB_OUTPUT
  • .github/workflows/assign-id.yml:133 - git commit -m "$COMMIT_MSG", with no
    [[ -n "$COMMIT_MSG" ]] guard

So on any PR that introduces a new artifact - the common case, since Phase 2.2 renames
<kind>-<slug>.md to <KIND>-<NNN>-<slug>.md - the commit step aborts with
Aborting commit due to empty commit message., the step fails, and the "Comment on PR" failure
handler fires. The renamed files are committed by git add -A but never pushed.

Evidence

Reproduced on 0.37.0 in a throwaway git workspace:

$ forgeplan ci-assign-id --head HEAD --base HEAD --json
  "assignments": [ { "slug": "prd-widget-auth", "action": "renamed_and_assigned",
                     "assigned_number": 1, "path": ".../PRD-001-widget-auth.md" } ],
  "commit_message_suggested": ""

$ git commit -m ""
Aborting commit due to empty commit message.

Source: build_commit_message gate at ci_assign_id.rs:1191-1206; workflow lines 86, 94, 133.

Fix options

  1. include renamed_and_assigned in the gating condition (it is a real assignment), or
  2. guard the commit step: skip the commit when the message is empty, or
  3. fall back to a default message in the workflow.

Option 1 is the honest one - the message is about an assignment, and a rename is one.

Revisit trigger

Act if a PR that adds an artifact is merged with the ID assignment left to CI - the run will fail
before the ids land.

Activity

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions