8000 add PR template for new SPECs by drammock · Pull Request #393 · scientific-python/specs · GitHub
[go: up one dir, main page]

Skip to content

add PR template for new SPECs #393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

drammock
Copy link
Member
@drammock drammock commented May 22, 2025

@jarrodmillman proposed this idea at the Summit and I volunteered to implement. However, I'm actually not sure it's a good idea to merge this, because:

  1. The template's current location and filename Locating the template at .github/pull_request_template.md should mean that it shows up on every new PR; however, this repo gets PRs other than new SPEC proposals (e.g., to update draft SPECs, add project endorsements, etc), and the new-SPEC-specific PR template won't be relevant for those.
  2. Although GH allows a repo to have multiple PR templates, they aren't selectable through the UI like issue templates are; they require manually adding URL query parameters like ?template=propose_a_new_spec.md. (They also require storing the templates in .github/PULL_REQUEST_TEMPLATE/, and if one does so, new PRs opened through the UI will not use any template at all.)

It might be possible to hack a solution by making a default template at .github/pull_request_template.md that includes relative links to the various templates using URL query parameters (example here), but that feels a bit brittle / over-engineered. LMK if there's appetite for that approach though, and I can give it a shot. EDIT: I've now implemented this approach, see below.

Other note: while Issue templates can be defined in YAML files and include built-in validation, PR templates cannot. Validation would have to use a GH Action (example here).

@bsipocz
Copy link
Member
bsipocz commented May 22, 2025

Ohh, it's too bad that unlike issues, we cannot template different types of PRs.

Maybe then just a link to a docs page and template? Or a bot comment with the checklist on any PRs that adds a new spec file/directory? (Though that will be just as after the fact as us commenting)

@drammock
Copy link
Member Author
drammock commented Jun 9, 2025

OK, so I tried "the fancy way" and it seems to work:

Screenshot 2025-06-09 at 14-53-48 Comparing main bar · drammock_specs

To get the proof-of-concept I had to merge this PR's changes into main of my fork (PR templates are only used for pulls against a repo's default branch), and then make a PR into my fork's main branch. Clicking the "preview" tab does make the link active, and clicking the link does populate the description with the template text (and does preserve the base and compare branches). I have every reason to assume it will work for cross-fork pulls too, once these changes were merged in here. So I think now it's up to the community / @scientific-python/spec-steering-committee as to whether this is a net positive change, or too baroque to be worthwhile.

EDIT: here's the URL if you want to fiddle with the UX: https://github.com/drammock/specs/compare/main...drammock:specs:bar?expand=1

@@ -0,0 +1,3 @@
If you are opening this PR to propose a new SPEC, please go to the `Preview` tab,
then [click here for the new SPEC templatee](?expand=1&template=new_spec.md).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If folks do like it, we should fix this typo before merging:

Suggested change
then [click here for the new SPEC templatee](?expand=1&template=new_spec.md).
then [click here for the new SPEC template](?expand=1&template=new_spec.md).

Copy link
Contributor
@lucascolley A7D0 lucascolley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@pllim
Copy link
Contributor
pllim commented Jun 10, 2025

FWIW having a template is nice. Thanks!

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.

4 participants
0