Title: Declare required sections in each pull request template and check them · Issue #102 · learningequality/.github · GitHub
Open Graph Title: Declare required sections in each pull request template and check them · Issue #102 · learningequality/.github
X Title: Declare required sections in each pull request template and check them · Issue #102 · learningequality/.github
Description: ❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues. Overview Contributors open pull requests that do not follow the pull request template. Revi...
Open Graph Description: ❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues. Overview Contributors open pull requests that do no...
X Description: ❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues. Overview Contributors open pull requests that do no...
Opengraph URL: https://github.com/learningequality/.github/issues/102
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Declare required sections in each pull request template and check them","articleBody":"\u003c!---HEADER START-->\n\n\u003cimg height=\"20px\" src=\"https://i.imgur.com/c7hUeb5.jpeg\">\n\n❌ **This issue is not open for contribution. Visit \u003ca href=\"https://learningequality.org/contributing-to-our-open-code-base/\" target=\"_blank\">Contributing guidelines\u003c/a>** to learn about the contributing process and how to find suitable issues.\n\n\u003cimg height=\"20px\" src=\"https://i.imgur.com/c7hUeb5.jpeg\">\n\n\u003c!---HEADER END-->\n\n## Overview\n\nContributors open pull requests that do not follow the pull request template. Reviewers then ask\nfor the missing information by hand.\n\nMake the template reachable in every consumer repo, declare the required sections inside each\ntemplate, and fail the run when a body does not carry them.\n\n**Complexity:** Medium\n**Target branch:** main\n\n### Context\n\nA sample of recent pull requests from non-members showed three separate failures: no template\nsections at all, a missing `## AI usage`, and `…` placeholders left in place. A body can carry\nevery heading and still leave a required section empty, so the template is not one check.\n\n`kolibri-design-system`, `morango` and `test-actions` hold their own template in `.github/`.\n`kolibri`, `studio`, `le-utils`, `kolibri-app` and `kolibri-installer-android` hold none, so they\nfall back to the org default in this repo at `.github/PULL_REQUEST_TEMPLATE.md`.\n\nGitHub applies an org default in the web form. A pull request opened with `gh pr create`, the REST\nAPI, or a coding agent reads the working copy instead, and the org file is not in the working copy.\nA contributor in a `kolibri` checkout therefore has no template to follow.\n\nNone of the three repo-specific templates carries an `## AI usage` section, and none mentions AI at\nall. `kolibri-design-system`'s was last changed in September 2024, before the policy existed. So\ncontributors there are never asked for the disclosure, and a check that reads their template could\nnot ask either.\n\n`kolibri-design-system` also opens its template with \"Please remove any unused sections\", so its\nheadings cannot all be required. That is why the required set is declared in the template rather\nthan derived from every heading.\n\n`kolibri-design-system` already enforces one section in `.github/workflows/changelog.yml`. It reads\nthe body, fails the job when the section is absent or still the placeholder text, and exempts\n`dependabot[bot]`. It is the model for the check here.\n\n### The Change\n\n**Declare the required sections in each template.** A section is required when its heading carries a\n`\u003c!-- REQUIRED -->` marker. The check reads the marker from the template file, not from the body, so\na contributor deleting the comment blocks as the template instructs cannot change the required set.\nA template that marks nothing requires every level-two heading, so a new repo is strict rather than\nsilently unchecked.\n\n**Mark the templates.** `.github/PULL_REQUEST_TEMPLATE.md` marks Summary, References, Reviewer\nguidance and AI usage. `kolibri-design-system`, `morango` and `test-actions` each take a small pull\nrequest that adds `## AI usage` and their own markers, leaving their optional sections unmarked.\nThose merge before the check turns on, or every pull request in those repos fails for a section\ntheir template never showed.\n\n**Put the template in the checkout.** Extend `scripts/sync-automation-template.js` so it carries\n`PULL_REQUEST_TEMPLATE.md` to consumers alongside `automation-template.yml`. Skip any repo that\nholds its own template. This prevents the failure rather than reporting it, because the file then\nsits where every tool looks for it.\n\n**Add a `pull-request-template` automation.** Add an entry to `automation-registry.yml` with a leaf\nthat reads `github.event.pull_request.body`. The leaf resolves the template the same way GitHub\ndoes, repo copy first and org default second, then takes the marked sections from it. The generator\nplaces the job in `automation-group-pull-request-target.yml`. There is no skip list: every repo is\nchecked against its own template.\n\nThe check reports three things:\n\n1. A required section heading is absent.\n2. A required section holds no text.\n3. A required section still holds the `…` placeholder.\n\n**Fail the run.** The job exits non-zero, as `changelog.yml` does.\n\nThe job log is the only channel, so it must name every missing section rather than fail on the\nfirst one.\n\n### Notes for the implementer\n\nOrder matters. The three template pull requests merge first, then the check turns on.\n\nTrigger on `pull_request_target` types `opened`, `edited` and `reopened`, so a corrected body clears\nthe check. The template `on:` block currently carries `labeled`, `opened` and `review_requested`, so\n`edited` and `reopened` are new. Every consumer needs the widened template, which the sync workflow\nproposes on its next run.\n\nStrip HTML comments from the body before judging a section empty.\n\nExempt bot authors, as `changelog.yml` does.\n\n### Out of Scope\n\n- Rewording the existing sections. This work adds `## AI usage` and the markers, nothing else.\n- Posting a comment on the pull request. The failed check is the only report.\n- Making the check required in branch protection. That is a repo setting, and it follows once the\n check runs clean.\n- Changing the `kolibri-design-system` changelog check.\n\n### Acceptance Criteria\n\n- [ ] The sync workflow proposes `PULL_REQUEST_TEMPLATE.md` to consumers without their own copy, and\n skips `kolibri-design-system`, `morango` and `test-actions`.\n- [ ] `automation-registry.yml` holds a `pull-request-template` entry, and the generated files are\n up to date.\n- [ ] Every template marks its required sections, and each of the three repo-specific templates\n carries `## AI usage`.\n- [ ] A marked section that is absent, empty, or still holds `…` fails the run.\n- [ ] An unmarked section that is absent passes.\n- [ ] A template that marks nothing requires every level-two heading.\n- [ ] The log of a failed run names every missing section, not only the first.\n- [ ] A body that follows the template passes.\n- [ ] Editing a bad body to a good one turns the check green.\n- [ ] Bot authors pass.\n- [ ] The check reads the repo template in a repo that holds one, and the org default elsewhere.\n\n### Testing\n\nTest in `test-actions`. See\n[testing the automations](https://github.com/learningequality/.github/blob/main/docs/testing-automations.md).\nThe contributor cases need an account outside the organization.\n\n1. Open a pull request with an empty body. Expect a failed check that names every missing section.\n2. Edit the body to follow the template. Expect the check to pass.\n3. Open a pull request that fills every marked section but omits an unmarked one. Expect a pass.\n4. Open a pull request that leaves `…` under a marked section. Expect a failure.\n5. Dispatch the sync workflow with `only: test-actions` and `dry_run`. Expect no template row,\n because `test-actions` holds its own copy.\n\n### References\n\n- #97 added the sync workflow.\n- #98 made `test-actions` the place to test.\n- #101 grouped automation jobs by trigger event.\n\n## AI usage\n\nI used Claude Code to sample recent contributor pull requests, to check which repos hold their own\ntemplate, to confirm that none of those three asks for AI usage, and to read the\n`kolibri-design-system` changelog check. I decided the approach and the marker convention.\n","author":{"url":"https://github.com/akolson","@type":"Person","name":"akolson"},"datePublished":"2026-09-28T10:46:34Z","url":"https://github.com/learningequality/.github/issues/102"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:030c24c4-6a53-9c50-ccc4-f58e361bc216 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E31A:22BD05:17D2911:1FFA0CC:6AFFEE9D |
| html-safe-nonce | 99a3c77fb65af4b5b2a8b2f273c01ff4decc90bbfc06d8a2adece4d916d525d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzFBOjIyQkQwNToxN0QyOTExOjFGRkEwQ0M6NkFGRkVFOUQiLCJ2aXNpdG9yX2lkIjoiMzU1OTQ3Njk5NzU4MTE3MjM4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ab269657ea53d984594d44bcc1a90c4954f1d7e8027a2e2d949983878666c46c |
| hovercard-subject-tag | issue:5613287711 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/learningequality/.github/102/issue_layout |
| twitter:image | https://opengraph.githubassets.com/69ded8ca82621da9e7c393635811a859469450cf1c5256182337f88e0287fa95/learningequality/.github/issues/102 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/69ded8ca82621da9e7c393635811a859469450cf1c5256182337f88e0287fa95/learningequality/.github/issues/102 |
| og:image:alt | ❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues. Overview Contributors open pull requests that do no... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | akolson |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| go-import | github.com/learningequality/.github git https://github.com/learningequality/.github.git |
| octolytics-dimension-user_id | 3926525 |
| octolytics-dimension-user_login | learningequality |
| octolytics-dimension-repository_id | 647407699 |
| octolytics-dimension-repository_nwo | learningequality/.github |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 647407699 |
| octolytics-dimension-repository_network_root_nwo | learningequality/.github |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width