-
Notifications
You must be signed in to change notification settings - Fork 34
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
**PR Template.** As a PR reviewer, I would like contributors to use a PR template, in order to establish standardization and base expectations. #171
Comments
For reference, here is OpenCraft's PR template: https://handbook.opencraft.com/en/latest/pull_request_process/#what-to-include-in-a-pull-request |
Are there any fields missing from OpenCraft's PR template? Anything that should be removed? |
It covers most of the bases -- including a note about flagging migrations. I think the only thing I might add is a similar note about adding feature flags. But that may be overkill. |
@pdpinch It's easy to see if a PR affects migrations, since it'll have files added under a Re feature flags -- maybe a more general step for ensuring that changes are appropriately documented? OpenCraft have a template we use for code reviews which we use to catch this, though it's hazy as to where exactly the change should be documented -- In the code? In an ADR? A README? A wiki somewhere? The edX user docs? But most changes will require some form of documentation change. In the case of feature flags, the edX Feature Flags wiki may be the most up-to-date source of info we have. |
I agree that the reviewer should be responsible for pointing out any shortcomings with migrations of feature flags. But in practice, the detail work necessary for these changes often gets overlooked. For migrations, we need reverse migrations and possibly a devops review. For feature flags we need the necessary annotations. Can we expect any given combination of contributor and reviewer to remember these details? |
I'm glad you asked! We've been encouraging annotation of new feature flags in accordance with OEP-17, and @regisb and @robrap are doing work to improve things further. All new toggles, Django or Waffle, should be annotated similar to this one. If the template has a sort of "things to check for in review" list, I recommend including feature toggle annotations 😄 (Btw, that feature flag wiki page is quite out-of-date now! I'll add a warning at the top of the page.)
+1 -- in absence of good training and/or docs, details are likely to get overlooked. I think we should be able to expect code reviewers and contributors to remember such points, if and only if we provide them onboarding and reference materials that teach them so. That being said: the more we add to the template, the more likely it'll be ignored. I think we have to choose our battles in regards to what information is so vital that it needs to be by-default pasted into every pull request. I like the OpenCraft template because it's not too long, captures the vital points, and is more of a "fill-me-in" template than a "read-these-bullet-points" template, the latter of which I think will be quickly ignored. Now, although I would avoid filling up the PR template with generic coder/reviewer considerations, I'd still advocate for developing a centralized "How to Review Code" doc somewhere (like a new page in the edX developer docs) and then eventually linking out to that in the PR template. OpenCraft's Code Reviewer Expectations strikes me as a good model for such a page. That way, we could keep the templates lean while having a detailed and de-duped guide for reviewers to refer to as needed. So, I would be in favor of adopting the OC template, with three recommendations:
Finally, for any PR template to be successful, there needs to be a culture of actually caring about the template and using it. We'll want to:
|
Regarding feature flag annotations, the intention is to add linting. Lists can be helpful, but linting (or architectural fitness functions) should be preferred when it is efficient, accurate, and helpful. |
All, 🙇♀️ Thanks for the discussion thus far. I'm overall supportive of moving forward with a generalized adaptation of OC's PR template. Simple beats Complex (link to entry in Arch Manifesto)Since each item takes on valuable real estate and cognitive load for each and every PR (for authors and reviewers), each item bears a cost of investment. I like the notion of keeping the PR template short and simple - with links to other references for more detail (as @kdmccormick recommends). One way to achieve this is to align on the outcome for each item in the template. For example, we can externalize/document the outcome for each item as a comment in the PR Template doc. By "outcome", I mean the goal we are striving for - what exactly we are hoping to prevent or achieve. What do you think? Automated Fitness Functions beat Manual Verifications (link to entry in Arch Manifesto)I'd like to have us create automated fitness functions whenever possible rather than rely on PR template checklists (as @robrap points out above).
Semantic Commit MessagesNote that as part of the rollout of this effort, I'd like to standardize naming of our PR titles and commit messages. I am inspired by:
The outcomes of this change being:
So I'd like to move forward with this change as part of our PR fitness functions: template (manual checklist) and automation (linters/CI). |
@nasthagiri: Yes, I’m hoping we get at least minimal linting from the blended toggles project. |
I opened a PR based on the discussion so far. https://github.com/edx/edx-platform/pull/25949 I'm not sure where to host the meta "outcome" discussion that @nasthagiri describes. I'm putting it here, even though ** Description ** JIRA or github tickets Discussions: Dependencies: Screenshots Merge deadline Testing instructions Author Notes and concerns: Commit Message and PR title |
@pdpinch Thanks for the PR. We can move our convo to the PR for further discussion on specific aspects of the template. (I suggested in the PR to use markdown-comments as the place for documenting the rationale/outcomes.) We can then discuss the necessity of each element there. |
For future reference, capturing this link (shared by @regisb) to a linter that can enforce conventional commits https://github.com/jorisroovers/gitlint |
I'm not sure merging edx/edx-platform#25949 should have closed this: there were other efforts mentioned in the description. But, we do now have a PR template in the edx-platform repo. |
@nedbat I believe we've completed the first 2 tasks listed in the description: creating the template and adding the conventional-commits to it. What's remaining at this point?
Do you want to continue to use this issue for the next phase of this effort? Or call our Jan goal complete and open another issue for these follow-ups in Feb? |
Clearing out old issues in some repos - this feels like it could be done. Thoughts? |
I think this needs some follow-up work:
I'm in favor of making a new issue, linking it here, and then closing this issue. |
Here's a follow-up: https://github.com/edx/open-edx-proposals/issues/267 Closing this issue in favor of the new issue; if you disagree, let me know! |
Next Steps
The text was updated successfully, but these errors were encountered: