feat: add project sync workflow scaffolding for GitHub Projects integration#2356
feat: add project sync workflow scaffolding for GitHub Projects integration#2356mohityadav8 wants to merge 11 commits into
Conversation
Signed-off-by: Mohit Yadav <ymohit799057@gmail.com>
5a7c71f to
a6fba3b
Compare
|
Warning Review limit reached
Next review available in: 58 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThis PR implements complete GitHub Actions automation to sync PR metadata into a GitHub Project V2 board. It adds two orchestrated workflows (compute and apply), five helper modules for label/GraphQL/data operations, a main entrypoint, and comprehensive unit tests—all configured via environment variables and designed to be idempotent and race-condition tolerant. ChangesPR Project Field Synchronization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📋 Issue PlannerBuilt with CodeRabbit's Coding Plans for faster development and fewer bugs. View plan used: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 10
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 501e8ddb-432a-45f4-9dfa-65cd426dd46d
📒 Files selected for processing (16)
.github/workflows/sync-project-fields-apply.yml.github/workflows/sync-project-fields-compute.yml.github/workflows/test-project-sync.ymlscripts/project-sync/helpers/constants.jsscripts/project-sync/helpers/graphql.jsscripts/project-sync/helpers/index.jsscripts/project-sync/helpers/labels.jsscripts/project-sync/helpers/linked-issues.jsscripts/project-sync/helpers/mapping.jsscripts/project-sync/index.jsscripts/project-sync/package.jsonscripts/project-sync/tests/test-graphql.jsscripts/project-sync/tests/test-labels.jsscripts/project-sync/tests/test-linked-issues.jsscripts/project-sync/tests/test-mapping.jsscripts/project-sync/tests/test-utils.js
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Mohit Yadav <ymohit799057@gmail.com>
|
Hi @leninmehedy and @nadineloepfe, |
Signed-off-by: Mohit Yadav <ymohit799057@gmail.com>
darshit2308
left a comment
There was a problem hiding this comment.
Great work on this one @mohityadav8 ! The foundational architecture for handling GitHub Projects V2 via the GraphQL API is really solid, and splitting this into a two-phase compute/apply workflow is definitely the right approach for security.
However, I've requested a few blocking changes that need to be addressed before we can merge this in:
Critical Blockers (P1):
- Path Mismatches: Workflows are attempting to require and checkout from
.github/scripts/project-sync/, but the module is located atscripts/project-sync/. - Security Boundary: The privileged
applyworkflow currently trusts the unvalidated JSON artifact generated by the untrusted PR branch code in thecomputephase.
Important Fixes (P2):
- The
applyjob is missing theissues: writepermission required for theensureAllLabels()function. - The concurrency group in the
applyworkflow uses a globally unique run ID, defeating its ability to prevent race conditions on the same PR. - The
testworkflow's trigger paths watch a non-existent directory.
I've left inline comments detailing these along with a minor regex robustness suggestion. Let me know if you want to discuss the best way to tackle the artifact validation security boundary!
|
Hello, this is the OfficeHourBot. This is a reminder that the Hiero Python SDK Office Hours will begin in approximately 2 hours and 28 minutes (14:00 UTC). This session provides an opportunity to ask questions regarding this Pull Request. Details:
Disclaimer: This is an automated reminder. Please verify the schedule here for any changes. From, |
Signed-off-by: Mohit Yadav <ymohit799057@gmail.com>
Signed-off-by: Mohit Yadav <ymohit799057@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 5
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a6bbf3b2-69e0-4473-a388-986fb6752408
📒 Files selected for processing (16)
.github/workflows/sync-project-fields-apply.yml.github/workflows/sync-project-fields-compute.yml.github/workflows/test-project-sync.ymlscripts/project-sync/helpers/constants.jsscripts/project-sync/helpers/graphql.jsscripts/project-sync/helpers/index.jsscripts/project-sync/helpers/labels.jsscripts/project-sync/helpers/linked-issues.jsscripts/project-sync/helpers/mapping.jsscripts/project-sync/index.jsscripts/project-sync/package.jsonscripts/project-sync/tests/test-graphql.jsscripts/project-sync/tests/test-labels.jsscripts/project-sync/tests/test-linked-issues.jsscripts/project-sync/tests/test-mapping.jsscripts/project-sync/tests/test-utils.js
parvninama
left a comment
There was a problem hiding this comment.
@mohityadav8 Thanks for the contribution! I agree with several of the CodeRabbit comments, particularly the ones pointing out the syntax and permission issues. I believe those should be addressed before this is ready to merge
|
Hi @mohityadav8, This pull request has had no commit activity for 10 days. Are you still working on it?
If you're no longer working on this, please comment Reach out on discord or join our office hours if you need assistance. From the Python SDK Team |
Signed-off-by: Mohit Yadav <ymohit799057@gmail.com>
Signed-off-by: Mohit Yadav <ymohit799057@gmail.com>
Signed-off-by: Mohit Yadav <ymohit799057@gmail.com>
Signed-off-by: Mohit Yadav <ymohit799057@gmail.com>
|
@parvninama All blocking and major issues have been addressed:
|
|
Hi @mohityadav8! Thank you so much for your work on this issue. We truly appreciate your contribution!! As of now, the GH UI does not support triple sorting. At the moment, the most we are able to get is two. Therefore we will need to adjust how we go about sorting. Additionally, upon discussion in today's Python meeting, the team has elected to have further conversation regarding the priority and scope of this issue and PR. Therefore, as of now I will be converting this to draft. Once discussion has been finalized, we will reach out and let you know when this can be reviewed again. In the meantime, please feel free to work on other issues. Thank you,
|
exploreriii
left a comment
There was a problem hiding this comment.
@mohityadav8 thank you for having a good go at this PR. You have made many good decisions, I expect you have found it useful as a learning process too. I think as the PR stands, it is not currently conforming to the repo structure and has some security questions so we would be unable to merge.
Additionally, I notice the issue you are solving here is marked as in draft - I assume we have not agreed on what the implementation should be. I would suggest we can discuss details here or in the issue body, or in a community call, to see if we can agree on what the review process should look like to avoid wasted effort
I notice some new labels are being proposed here e.g. priority: urgent, bug, and feature, none of which currently exist, which also need to be ratified against our current labels priority: critical/high/medium/low and also github native priority labels that have recently been added as a feature.
Further, the existing sync-issue-labels automation already copies linked-issue labels onto PRs, which we can already filter in the pull request tab.
Overall, there needs to be a fair bit of revamping in order to get this safe but also to ensure it is useful for the repo. Apologies, we now lock issues when they are proposed to avoid developers attempting them before they are 'approved'. Happy to hear any suggestions, and also if you believe we should archive the issue.
Thank you again
| jobs: | ||
| apply: | ||
| if: github.event.workflow_run.conclusion == 'success' | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
should be custom runner
| script: | | ||
| const fs = require('fs'); | ||
|
|
||
| if (!fs.existsSync('project-sync-payload.json')) { |
There was a problem hiding this comment.
Here you are downloading and requiring the project sync payload, plus attempting to give it high token permissions, from the artifact, are you sure the project sync payload is safe?
|
|
||
| - name: Download Artifact | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| continue-on-error: true |
There was a problem hiding this comment.
if they can submit a project sync payload of arbitrary content and paths, we have a problem
|
|
||
| const { prNumber, prNodeId } = payload; | ||
|
|
||
| if (!prNumber || !prNodeId) { |
There was a problem hiding this comment.
these fields could also in theory be corrupted
| - name: Apply Project Field Values | ||
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | ||
| env: | ||
| PROJECT_NODE_ID: ${{ secrets.PROJECT_NODE_ID }} |
| @@ -0,0 +1,176 @@ | |||
| // SPDX-License-Identifier: Apache-2.0 | |||
There was a problem hiding this comment.
Jest tests under tests/jest/ run by test-scripts.yml
| @@ -0,0 +1,107 @@ | |||
| name: Sync PR Project Fields - Apply | |||
There was a problem hiding this comment.
CI automation in this repo lives in .github/scripts/ not /scripts
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | ||
| with: | ||
| script: | | ||
| const prNumber = context.payload.pull_request.number; |
There was a problem hiding this comment.
not checking these are faithful
| const prNodeId = context.payload.pull_request.node_id; | ||
| console.log(`--- Processing PR #${prNumber} (node: ${prNodeId}) ---`); | ||
|
|
||
| const prAuthor = context.payload.pull_request.user.login; |
There was a problem hiding this comment.
The compute workflow triggers on the PR author's copy of it
Upload-artifact preserves relative paths, so the artifact can contain scripts/project-sync/index.js or etc
|
Hi @mohityadav8, This pull request has had no activity for 10 days. Are you still working on it?
If you're no longer working on this, please comment Reach out on discord or join our office hours if you need assistance. From the Python SDK Team |
Description:
Add initial scaffolding for GitHub Project field synchronization automation.
scripts/project-syncRelated issue(s):
Fixes #2288
Notes for reviewer:
This PR introduces the project structure and workflow scaffolding required for implementing automated GitHub Project field synchronization.
The implementation will follow the existing two-phase workflow pattern used by
sync-issue-labelsand will be expanded in subsequent commits.Checklist