Skip to content

fix: $global scanner config correctly inherited by per-repo entries#77

Open
Valyrian-Code wants to merge 1 commit into
RocketChat:developfrom
Valyrian-Code:fix/global-scanner-config
Open

fix: $global scanner config correctly inherited by per-repo entries#77
Valyrian-Code wants to merge 1 commit into
RocketChat:developfrom
Valyrian-Code:fix/global-scanner-config

Conversation

@Valyrian-Code
Copy link
Copy Markdown

Summary

  • Scanner config blocks (semgrep, trufflehog, claude, piAgent) in $global were silently ignored when building per-repo configs. The merge chain was DEFAULT_CONFIG → repoOverrides, skipping the global layer entirely.
  • Added globalConfig as the middle layer for all four scanner blocks, matching the pattern already used for trigger and comment.

Root cause

src/config.ts lines 98-101 spread only default and repo-override, never global:

// before
semgrep: { ...DEFAULT_CONFIG.semgrep, ...(repoOverrides.semgrep ?? {}) },
// after
semgrep: { ...DEFAULT_CONFIG.semgrep, ...(globalConfig.semgrep ?? {}), ...(repoOverrides.semgrep ?? {}) },

Test plan

  • New test: $global.semgrep.extraArgs is inherited when repo has no semgrep block
  • New test: per-repo semgrep overrides the global value
  • Full suite: npm test — 635 tests, 0 failures

semgrep, trufflehog, claude, and piAgent blocks were merged from
DEFAULT_CONFIG + per-repo overrides only — globalConfig was extracted
but never spread into the scanner merges. trigger and comment handled
this correctly; scanner blocks did not.

Adds two tests covering global inheritance and per-repo override
precedence for semgrep.
Copilot AI review requested due to automatic review settings May 22, 2026 01:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

2 participants