Skip to content

chore(skills): add fork-pr-contribution skill - #5777

Merged
krishna2020 merged 5 commits into
developfrom
skill/fork-pr-contribution
Nov 11, 2026
Merged

krishna2020 merged 5 commits into
developfrom
skill/fork-pr-contribution

Conversation

@krishna2020

Copy link
Copy Markdown
Collaborator

What are the changes introduced in this PR?

Adds a fork-pr-contribution skill (.claude/skills/fork-pr-contribution/SKILL.md) so everyone handles open-source contributions the same way:

fork PR ──(squash)──▶ contrib/<pr> ──(PR, full CI, merge commit)──▶ develop
  1. Sanity checks on the contributor PR: lint, format, secret paths and unit tests run on fork PRs since ci: make PR workflows work for pull requests from forks #5772. Lists which checks are expected to be skipped (Docker build, ingestion test, Sonar) or to fail (org-level zizmor scan).
  2. Review the diff before it reaches our repo: in our repo it runs with our secrets. The skill says to stop and escalate on .github/, Dockerfile, npm script, lockfile or test-setup changes, and includes a grep for env, shell and network access.
  3. Squash-merge into contrib/<pr>: the squash commit is authored by the PR author, so the contributor keeps the credit.
  4. Raise contrib/<pr> → develop: reuses the contributor's title and description, with a credit header.
  5. Full CI, then merge with a merge commit: squashing here would make the maintainer the author.

Please explain the objectives of your changes below

Fork PRs can't run the checks that need secrets, and those checks show as skipped, which branch protection treats as passing. Without a shared process, a fork PR can be merged into develop without the full CI ever running. Agreed in standup; first used on #5771 → #5774.

Any changes to existing capabilities/behaviour?

None. Docs and agent skill only, no runtime or CI changes.

🤖 Generated with Claude Code

Team process for landing open-source (fork) PRs: run the fork-safe
checks on the contributor PR, review the diff before it reaches our
repo, squash-merge it into contrib/<pr>, then raise a PR from
contrib/<pr> to develop that runs the full CI and is merged with a
merge commit so the contributor keeps authorship.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@krishna2020
krishna2020 requested review from a team as code owners November 10, 2026 05:49
Copilot AI balanced review requested due to automatic review settings November 10, 2026 05:49
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b87a869e-9c26-47d8-9ac8-ac283f12e9f6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The merge workflow does not pin the reviewed commit, allowing later, unreviewed changes to reach an internal PR that runs with secrets.

3 open issues
What changed in this PR

Adds an agent skill for routing fork contributions through an internal branch so full CI runs before merging into develop, while preserving contributor authorship. No runtime or CI configuration changes are included.

Changes:

  • Documents fork-safe checks and security review before promoting contributor code.
  • Defines the squash-to-contrib/<pr>, full-CI, and merge-commit workflow.
  • Covers contributor credit, follow-up fixes, and branch updates.
File Description
.claude/​skills/​fork-pr-contribution/​SKILL.md Adds the fork contribution workflow, review safeguards, and merge instructions.

Review effort: Balanced

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.45%. Comparing base (6a245da) to head (6af83c0).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5777   +/-   ##
========================================
  Coverage    92.44%   92.45%           
========================================
  Files          741      741           
  Lines        41121    41158   +37     
  Branches      9670     9603   -67     
========================================
+ Hits         38015    38052   +37     
- Misses        2845     2923   +78     
+ Partials       261      183   -78     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…skill

- record the reviewed head commit in step 2 and merge with
  --match-head-commit, so code pushed after review can't reach our repo
- add a follow-up fixes section: fix PRs target the existing
  contrib/<pr> branch instead of creating a new one
- pass -R on gh pr update-branch like every other gh command

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 07:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical security flaws allow mutable PR diffs to bypass review before secret-bearing CI and contributor-controlled titles to execute shell commands on the maintainer’s machine.

2 open issues
3 resolved since last review

Review effort: Balanced

Updated the command to use the PR title dynamically.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 07:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The workflow does not validate the PR’s base branch before review, so later retargeting can promote changes that differ from the reviewed diff.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Reject unexpected base branches before reviewing fork PRs

.claude/​skills/​fork-pr-contribution/​SKILL.md:35

A fork PR targeting a branch other than develop passes this check, so step 2 reviews its diff against that branch before step 3 retargets it to a branch created from develop. If the branches have diverged, the promoted changes can differ from the reviewed diff even when the head commit is pinned. Validate baseRefName before review: require develop for an initial contribution or the existing contribution branch for a follow-up, and stop for other bases.

1 resolved since last review

Review effort: Balanced

krishna2020 and others added 2 commits November 10, 2026 13:32
- step 2 fetches the PR head into a local ref, records its SHA and
  reviews `git diff origin/<base>...<sha>`; gh pr diff reads the live
  head, which the contributor can swap during review
- step 3 and follow-up merges use that same $sha with
  --match-head-commit
- step 1 requires the PR base to be develop (or the existing
  contrib/<pr> for a follow-up) so the reviewed and merged diffs match

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- replace $sha/$base shell variables with <reviewed-sha>/<base>
  placeholders; agents run each block in a fresh shell, so the variable
  would be empty and --match-head-commit "" turns the check off
- fetch base and develop with explicit destinations so origin/<base>
  exists even in single-branch clones

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 08:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human judgment is needed because branch updates can invalidate earlier check results, while fork live-test credential failures may be mistaken for contributor-code failures.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@sonarqubecloud

Copy link
Copy Markdown

@krishna2020
krishna2020 merged commit be82f3b into develop Nov 11, 2026
53 of 54 checks passed
@krishna2020
krishna2020 deleted the skill/fork-pr-contribution branch November 11, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants