-
Notifications
You must be signed in to change notification settings - Fork 141
Remove timestamp from CI branch names, implement 1:1 PR relationship #493
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
base: pranaygp/external-collaborator-ci
Are you sure you want to change the base?
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: pranaygp <[email protected]>
Co-authored-by: pranaygp <[email protected]>
Co-authored-by: pranaygp <[email protected]>
Co-authored-by: pranaygp <[email protected]>
|
@copilot resolve merge conflicts |
Co-authored-by: pranaygp <[email protected]>
Merge conflicts resolved in commit 0889038. The base PR #325 was updated to extract inline GitHub Action scripts into separate files. I've:
All functionality is preserved with the same 1:1 PR relationship behavior. |
| if (existingPR.title.startsWith('[CI Test]')) { | ||
| // Use the existing PR and add the labels | ||
| ciPR = existingPR; | ||
| isNewPR = true; // Treat as new to ensure labels are added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| isNewPR = true; // Treat as new to ensure labels are added | |
| isNewPR = false; // This is an existing PR being reused, not a new one |
When reusing an existing CI test PR without the 'ci-test' label but with the correct title, the isNewPR flag is incorrectly set to true, causing the comment to say "CI test created" instead of "CI test updated".
View Details
Analysis
Incorrect isNewPR flag causes misleading message for reused CI test PRs
What fails: When reusing an existing CI test PR that lacks the 'ci-test' label but has a title starting with '[CI Test]', the isNewPR flag is incorrectly set to true at line 54 of .github/scripts/create-ci-pr.js. This causes the user comment at line 75 to say "✅ CI test created" instead of "✅ CI test updated", which is misleading since the PR is being reused, not newly created.
How to reproduce:
- Trigger
/run-cion an external PR that creates a new CI test PR (branch:ci-test/{prNumber}) - The initial comment will correctly say "✅ CI test created"
- Manually remove the 'ci-test' label from the CI test PR
- Trigger
/run-ciagain on the same external PR - The code will find the existing CI test PR without the label (line 31), verify it has the correct title (line 50), and reuse it (line 52)
- The isNewPR flag is set to true (line 54), causing the comment to incorrectly say "✅ CI test created" again
Expected: The message should say "✅ CI test updated" because the code path represents reusing an existing PR (line 52: ciPR = existingPR), not creating a new one. The labels are added automatically via the label-adding logic (lines 60-70), so setting isNewPR = true is unnecessary and incorrect.
Fix: Changed line 54 from isNewPR = true to isNewPR = false, with an updated comment clarifying that this code path represents an existing PR being reused. The label-adding logic continues to work correctly in all scenarios.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.