Add Security & compliance group to GitHub webhook.#33850
Conversation
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
WalkthroughReplaced switch-case mappings of projectNumber→projectName in the GitHub webhook controller with a reverse lookup from config. Added a new githubProjectsV2.projects entry for "security-compliance": 97 in config. Variable declarations adjusted to const and default projectName to empty string when no match. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ 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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
website/api/controllers/webhooks/receive-from-github.js (1)
742-789: Update documentation to include security-compliance project.The documentation comment lists the tracked projects but doesn't include the newly added security & compliance team.
Update the comment to reflect the current tracked projects:
* Tracked projects: * - Orchestration * - MDM * - Software + * - Security & compliance *
🧹 Nitpick comments (1)
website/api/controllers/webhooks/receive-from-github.js (1)
1175-1178: Good refactor from hardcoded mapping to config-driven lookup.The reverse lookup pattern eliminates hardcoded project number mappings and makes the config file the single source of truth. The use of
constand the empty string fallback are appropriate.Consider extracting the duplicate lookup logic (also at lines 1397-1400) into a helper function or computing it once at the start of the projects_v2_item handler:
+ // Determine project name by reverse lookup (used for both QA and release tracking) + const projectName = Object.keys(sails.config.custom.githubProjectsV2.projects).find( + key => sails.config.custom.githubProjectsV2.projects[key] === projectNumber + ) || ''; + // Handle "in progress" status changes if (isToInProgress) {Then remove the duplicate lookup at lines 1175-1178 and 1397-1400, replacing both with just
projectName.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
website/api/controllers/webhooks/receive-from-github.js(2 hunks)website/config/custom.js(1 hunks)
🔇 Additional comments (1)
website/config/custom.js (1)
419-420: Unable to verifysecurity-complianceproject number
The GitHub GraphQL query returned an error. Please manually confirm that project number 97 corresponds to the security & compliance team’s project in your organization’s Projects V2 list.
Related issue: Resolves #33848
Summary by CodeRabbit
New Features
Refactor