Skip to content

fix: enabled open to community review for bot-authored PRs#2313

Open
rayank906 wants to merge 4 commits into
hiero-ledger:mainfrom
rayank906:enable-review
Open

fix: enabled open to community review for bot-authored PRs#2313
rayank906 wants to merge 4 commits into
hiero-ledger:mainfrom
rayank906:enable-review

Conversation

@rayank906
Copy link
Copy Markdown
Contributor

Description:
Enabled "open to community review" for bot-authored PRs.

Changes needCommunityReview logic to allow community review for bot-authored PRs. Updated unit tests syncLabel: bot PR does NOT receive community review label and syncLabel: already correct, no stale → returns false logics to expect the label to be added.

Fixes #2272

@rayank906 rayank906 requested review from a team as code owners May 26, 2026 01:20
@github-actions github-actions Bot added open to community review PR is open for community review and feedback queue:junior-committer PR awaiting initial quality review labels May 26, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 88d8be76-bdcc-47a5-bc23-2a3bd4a5c7c8

📥 Commits

Reviewing files that changed from the base of the PR and between afc783a and 9faa904.

📒 Files selected for processing (2)
  • .github/scripts/review-sync/helpers/labels.js
  • .github/scripts/review-sync/tests/test-labels.js

Walkthrough

The PR removes the author-type check from the label-sync logic so the COMMUNITY_REVIEW label is applied based solely on its presence on the PR (not on whether the author is human). Tests were updated to reflect bot-authored PR behavior and the existing-label early-exit case.

Changes

Community Review Label Policy

Layer / File(s) Summary
Remove author-type gating from needsCommunityReview
.github/scripts/review-sync/helpers/labels.js, .github/scripts/review-sync/tests/test-labels.js
needsCommunityReview changed from isHuman && !currentLabels.includes(COMMUNITY_REVIEW.name) to !currentLabels.includes(COMMUNITY_REVIEW.name). Tests updated: the "already correct, no stale" case includes COMMUNITY_REVIEW, and the bot-PR case now expects COMMUNITY_REVIEW to be added (with changed === true).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: enabling the 'open to community review' label for bot-authored PRs.
Description check ✅ Passed The description clearly relates to the changeset, explaining the modification to the needCommunityReview logic and the corresponding test updates.
Linked Issues check ✅ Passed The changes fully satisfy issue #2272 by removing the isHuman check from the needsCommunityReview condition, allowing bot-authored PRs to receive the 'open to community review' label.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the issue: modifications to label.js logic and corresponding test updates to validate bot PR behavior.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📋 Issue Planner

Built with CodeRabbit's Coding Plans for faster development and fewer bugs.

View plan used: #2272

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3ca74046-96e4-4542-a691-2ace0a8f94ef

📥 Commits

Reviewing files that changed from the base of the PR and between 986eee2 and c475b35.

📒 Files selected for processing (2)
  • .github/scripts/review-sync/helpers/labels.js
  • .github/scripts/review-sync/tests/test-labels.js

Comment thread .github/scripts/review-sync/tests/test-labels.js
@rayank906 rayank906 changed the title enabled open to community review for bot-authored PRs fix: enabled open to community review for bot-authored PRs May 26, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/scripts/review-sync/tests/test-labels.js (1)

165-173: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Consider adding a symmetric test for human PRs with COMMUNITY_REVIEW already present.

The test suite covers bot PRs both with and without the COMMUNITY_REVIEW label (lines 113-118 and 155-162), but only tests human PRs missing the label (line 165-171). Adding a test for a human PR that already has queue:junior-committer and COMMUNITY_REVIEW would improve symmetry and make the test coverage more explicit, even though it exercises the same code path as the bot test at line 113-118.

🧪 Suggested additional test case
   {
     name: 'syncLabel: human PR receives community review label if missing',
     test: async () => {
       const mock = createMockGithub({ roles: {}, reviews: [] });
       const pr = { number: 1, labels: [{ name: 'queue:junior-committer' }], head: { sha: '123' }, user: { type: 'User' } };
       const changed = await syncLabel(mock, 'o', 'r', pr, false);
       return changed === true && mock.calls.labelsAdded.includes(COMMUNITY_REVIEW.name);
     },
   },
+  {
+    name: 'syncLabel: human PR with community review label already present → returns false',
+    test: async () => {
+      const mock = createMockGithub({ roles: {}, reviews: [] });
+      const pr = { number: 1, labels: [{ name: 'queue:junior-committer' }, { name: COMMUNITY_REVIEW.name }], head: { sha: '123' }, user: { type: 'User' } };
+      const changed = await syncLabel(mock, 'o', 'r', pr, false);
+      return changed === false && mock.calls.labelsAdded.length === 0;
+    },
+  },
 ];

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 82cfec31-9e7e-4ad4-8016-7f5668703937

📥 Commits

Reviewing files that changed from the base of the PR and between c475b35 and afc783a.

📒 Files selected for processing (1)
  • .github/scripts/review-sync/tests/test-labels.js

@exploreriii
Copy link
Copy Markdown
Contributor

Hi @rayank906 you need to fix your signing please, following the guide here https://github.com/hiero-ledger/sdk-collaboration-hub/tree/main/guides/issue-progression/for-developers

rayank906 added 2 commits May 26, 2026 10:26
Signed-off-by: Rayan Kamdem <rayankdm@umich.edu>
Signed-off-by: Rayan Kamdem <rayankdm@umich.edu>
@rayank906
Copy link
Copy Markdown
Contributor Author

Hi @exploreriii I have signed off commits and rewrote commit history. I believe it should be good now

@github-actions github-actions Bot added skill: beginner Achievable by a fairly new comer that has already completed a couple of good first issues queue:committers PR awaiting committer technical review and removed queue:junior-committer PR awaiting initial quality review labels May 26, 2026
@exploreriii
Copy link
Copy Markdown
Contributor

Please check the github official docs to upload your key, if you click here
https://github.com/hiero-ledger/hiero-sdk-python/pull/2313/commits
on the unverified icon, you'll see what is going on

@aceppaluni aceppaluni added the status: update branch developer needs to click update branch label May 26, 2026
@rayank906
Copy link
Copy Markdown
Contributor Author

rayank906 commented May 26, 2026

@exploreriii Thank you so much it now says verified. I hadn't added the new GPG key to Github. I have also clicked update branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open to community review PR is open for community review and feedback queue:committers PR awaiting committer technical review skill: beginner Achievable by a fairly new comer that has already completed a couple of good first issues status: update branch developer needs to click update branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable "open to community review" label for bot-authored PRs

3 participants