Skip to content
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

Render per-repo pull request template #356

Merged
merged 5 commits into from Jan 3, 2023

Conversation

AetherUnbound
Copy link
Contributor

Fixes

Fixes #1470 by @AetherUnbound

Description

This PR allows the PULL_REQUEST_TEMPLATE.md file to be rendered with repo-specific additions. I took inspiration from the existing examples in order to set this one up, but @dhruvkb please let me know if there's a better way to do this! I believe there was also a desire to add some additional checks to the frontend repo's template, that could be done in this PR as well.

In order to make things less cluttered, I also moved all the templates into a templates folder at the top level, and changed the logic within the .pre-commit-config.local.yaml.jinja file to iterate over a list.

Testing Instructions

  1. just lint should produce no changes
  2. Running just render templates/PULL_REQUEST_TEMPLATE.catalog.md.jinja .github/PULL_REQUEST_TEMPLATE.md should produce a change to the pull request template with the additional rendered content.

Checklist

  • My pull request has a descriptive title (not a vague title like
    Update index.md).
  • My pull request targets the default branch of the repository (main) or
    a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible
    errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@AetherUnbound AetherUnbound requested a review from a team as a code owner December 31, 2022 00:38
@openverse-bot openverse-bot added this to Needs review in Openverse PRs Dec 31, 2022
@openverse-bot openverse-bot added 🟩 priority: low Low priority and doesn't need to be rushed 🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users labels Dec 31, 2022
Copy link
Member

@dhruvkb dhruvkb 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 to me!

- repo: local
hooks:
{% set renders = ["precommit", "prettier", "github"] %}
{% for render in renders %}
Copy link
Member

Choose a reason for hiding this comment

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

This is an amazing use of Jinja, I love it!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wish we could make even the list itself dynamic so we didn't have to update it, but alas that seems more challenging than it's worth 😅

Copy link
Member

@zackkrida zackkrida left a comment

Choose a reason for hiding this comment

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

LGTM! Nice approach. And will be easily adjustable if we decide we need new blocks beyond the additional_sections and additional_checks blocks created here.

Openverse PRs automation moved this from Needs review to Reviewer approved Jan 3, 2023
@AetherUnbound AetherUnbound merged commit d0f068f into main Jan 3, 2023
Openverse PRs automation moved this from Reviewer approved to Merged! Jan 3, 2023
@AetherUnbound AetherUnbound deleted the feature/separate-pull-request-templates branch January 3, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟩 priority: low Low priority and doesn't need to be rushed
Projects
No open projects
Openverse PRs
  
Merged!
Development

Successfully merging this pull request may close these issues.

Add "DAG documentation updated" checkbox to pull request template
4 participants