Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@
<!-- Please replace GH_LINK with the link to the GitHub issue this Pull Request is related to -->
GH_LINK

### Linked E/App PR
<!--
Every Onyx PR must ship with a corresponding Expensify/App PR that pins Onyx to this PR's HEAD via git+https
(e.g. "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#<commit_sha>").
That linked PR runs the full E/App test suite signals that the Onyx
change is safe. After this PR is merged and published to npm, swap the linked E/App PR to the pinned version
(e.g. "react-native-onyx": "3.0.72") and request a final review — it becomes the bump PR.

Paste the full Expensify/App PR URL below (e.g. https://github.com/Expensify/App/pull/12345):
-->


### Automated Tests
<!---
Most changes to Onyx should have accompanying tests. Describe the tests you added or if no tests were added an explanation about why one was not needed.
Expand All @@ -20,6 +32,7 @@ Each set of changes should be tested against the Expensify/App repo on all platf
### Author Checklist

- [ ] I linked the correct issue in the `### Related Issues` section above
- [ ] I linked the corresponding Expensify/App PR in the `### Linked E/App PR` section above, and verified this change against it (E/App CI passed and manual testing completed)
- [ ] I wrote clear testing steps that cover the changes made in this PR
- [ ] I added steps for local testing in the `Tests` section
- [ ] I tested this PR with a [High Traffic account](https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#high-traffic-accounts) against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
Expand Down
8 changes: 8 additions & 0 deletions .github/actions/javascript/validatePRChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29983,6 +29983,7 @@ const fs = __importStar(__nccwpck_require__(7147));
const path = __importStar(__nccwpck_require__(1017));
const UNCHECKED_PATTERN = /- \[ \]/g;
const CHECKED_PATTERN = /- \[x\]/gi;
const E_APP_PR_URL_PATTERN = /^https?:\/\/github\.com\/Expensify\/App\/pull\/\d+\/?$/;
function getAuthorChecklistSection(body) {
const startMarker = '### Author Checklist';
const endMarker = '### Screenshots/Videos';
Expand Down Expand Up @@ -30025,6 +30026,13 @@ function validateChecklist(body) {
if (unchecked > 0) {
errors.push(`${unchecked} checklist item(s) are unchecked. All items must be checked before merging — including items that don't apply (check them and note why if needed).`);
}
const linkedEAppPR = getSectionContent(body, 'Linked E/App PR');
if (!linkedEAppPR) {
errors.push('The "Linked E/App PR" section is empty. Every Onyx PR must link to a corresponding Expensify/App PR that pins this PR via git+https and runs the full E/App test suite.');
}
else if (!E_APP_PR_URL_PATTERN.test(linkedEAppPR)) {
errors.push(`The "Linked E/App PR" section must contain a single Expensify/App PR URL (e.g. https://github.com/Expensify/App/pull/12345), found: "${linkedEAppPR}".`);
}
// Section warnings
if (!getSectionContent(body, 'Automated Tests')) {
warnings.push('The "Automated Tests" section is empty. Please describe the automated tests you added, or explain why automated tests are not needed for this change.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface ValidationResult {

const UNCHECKED_PATTERN = /- \[ \]/g;
const CHECKED_PATTERN = /- \[x\]/gi;
const E_APP_PR_URL_PATTERN = /^https?:\/\/github\.com\/Expensify\/App\/pull\/\d+\/?$/;

function getAuthorChecklistSection(body: string): string {
const startMarker = '### Author Checklist';
Expand Down Expand Up @@ -67,6 +68,15 @@ function validateChecklist(body: string): ValidationResult {
errors.push(`${unchecked} checklist item(s) are unchecked. All items must be checked before merging — including items that don't apply (check them and note why if needed).`);
}

const linkedEAppPR = getSectionContent(body, 'Linked E/App PR');
if (!linkedEAppPR) {
errors.push(
'The "Linked E/App PR" section is empty. Every Onyx PR must link to a corresponding Expensify/App PR that pins this PR via git+https and runs the full E/App test suite.',
);
} else if (!E_APP_PR_URL_PATTERN.test(linkedEAppPR)) {
errors.push(`The "Linked E/App PR" section must contain a single Expensify/App PR URL (e.g. https://github.com/Expensify/App/pull/12345), found: "${linkedEAppPR}".`);
}

// Section warnings
if (!getSectionContent(body, 'Automated Tests')) {
warnings.push('The "Automated Tests" section is empty. Please describe the automated tests you added, or explain why automated tests are not needed for this change.');
Expand Down
Loading