Skip to content

fix(ci): keep a typed PR title instead of the linked issue's - #1764

Merged
atriaybagur merged 2 commits into
developfrom
1763-keep-typed-pr-title
Nov 2, 2026
Merged

atriaybagur merged 2 commits into
developfrom
1763-keep-typed-pr-title

Conversation

@atriaybagur

@atriaybagur atriaybagur commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Closes #1763.

When a PR is opened from a branch named <n>-..., pr_acceptance_criteria.yml sets its title to issue #n's title, replacing whatever the author typed. That is right for the usual gh issue develop branch, but a second PR on the same issue (a stacked suggestions PR, a follow-up) gets mislabelled: #1762 opened as [suggestions] MONAI overlay schema: … and came out titled like its base PR #1389.

Change

  • The step now replaces the title only while it is still the branch-derived default that GitHub and gh build (1105 monai overlay suggestions, compared ignoring case and -/_/space runs). Any other title is kept, and is not re-sent, so an edit made before the job runs is not reverted.
  • One behaviour change for the usual flow: a single-commit PR from a gh issue develop branch defaults to its commit subject, which is now kept instead of becoming the issue's title. A multi-commit PR still gets the issue's title.
  • The ## Fixes → ## Fixes #n body splice is unchanged.
  • New .github/tests/workflows/test_pr_acceptance_criteria.py runs the step's script under node against a fake GitHub client. Cases: a default title is replaced (including GitHub's capitalised "UI"), a typed title is kept, a branch without a number is left alone, and a missing issue changes nothing. CI runs it through test_trust_kit_scripts.yml like the other workflow tests.

Testing

  • All 9 .github/tests files pass locally. Against develop's workflow, test_typed_title_is_kept fails.
  • Each of these one-line mutations of the step fails a test: no case-folding, _ not normalised, the kept title re-sent, always replace, always keep, and the catch rethrowing.
  • ruff@0.14.7 check and format --check are clean.
  • This PR is itself a check: its branch starts with 1763- and it was opened with a typed title, which should survive the workflow run.

Acceptance Criteria

Imported from issue #1763

  • A PR opened with the branch-derived default title still gets the issue's title.
  • A PR opened with a typed title keeps it.
  • The ## Fixes #n splice still happens in both cases.
  • A test under .github/tests/workflows/ runs the step's script against both cases.

The PR title step replaced every new PR's title with issue #n's when the
branch starts with <n>-, so a second PR on one issue (a stacked
suggestions PR, a follow-up) took the issue's title, as #1762 did. Replace
the title only while it is still GitHub's branch-derived default; the
## Fixes splice is unchanged. The new test runs the step under node
against a fake client.

Signed-off-by: Alex Triay Bagur <alexandre.triay_bagur@kcl.ac.uk>
@atriaybagur atriaybagur self-assigned this Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

✅ Acceptance criteria have been automatically imported from the linked issue(s) and added to the PR description.

- Normalise the branch and the title the same way (- _ and whitespace
  runs, case), so gh's one-space-per-dash default is recognised.
- Send a title only when replacing it, so an edit made before the job
  runs is not reverted.
- Test a realistic default (GitHub capitalises UI) and a missing issue;
  end the script block by YAML's indentation rule; fail when node is
  missing instead of skipping.

Signed-off-by: Alex Triay Bagur <alexandre.triay_bagur@kcl.ac.uk>
@atriaybagur
atriaybagur merged commit ccd9002 into develop Nov 2, 2026
36 checks passed
@atriaybagur
atriaybagur deleted the 1763-keep-typed-pr-title branch November 2, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR title step overwrites a typed title with the linked issue's title

1 participant