Repository navigation
fix(ci): keep a typed PR title instead of the linked issue's - #1764
Merged
Merged
Conversation
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>
|
✅ 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1763.
When a PR is opened from a branch named
<n>-...,pr_acceptance_criteria.ymlsets its title to issue #n's title, replacing whatever the author typed. That is right for the usualgh issue developbranch, 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
ghbuild (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.gh issue developbranch 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.## Fixes→## Fixes #nbody splice is unchanged..github/tests/workflows/test_pr_acceptance_criteria.pyruns 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 throughtest_trust_kit_scripts.ymllike the other workflow tests.Testing
.github/testsfiles pass locally. Against develop's workflow,test_typed_title_is_keptfails._not normalised, the kept title re-sent, always replace, always keep, and thecatchrethrowing.ruff@0.14.7 checkandformat --checkare clean.1763-and it was opened with a typed title, which should survive the workflow run.Acceptance Criteria
Imported from issue #1763
## Fixes #nsplice still happens in both cases..github/tests/workflows/runs the step's script against both cases.