Skip to content

GH#17808: add CI nesting threshold proximity guard to pulse complexity scan#17822

Merged
marcusquinn merged 1 commit intomainfrom
bugfix/gh17808-complexity-ci-regression
Apr 8, 2026
Merged

GH#17808: add CI nesting threshold proximity guard to pulse complexity scan#17822
marcusquinn merged 1 commit intomainfrom
bugfix/gh17808-complexity-ci-regression

Conversation

@marcusquinn
Copy link
Copy Markdown
Owner

Summary

Adds a proactive regression guard to the pulse complexity scan that warns before the CI nesting depth threshold is exceeded.

Root cause (GH#17808)

The Complexity Analysis CI check failed 6 times in a short window because new scripts pushed the global nesting depth violation count over the threshold (278→279). Each time, the fix was reactive: bump the threshold after PRs started failing. The systemic fix (threshold bump to 279) was already applied to main in commit d531c1d6e.

What this PR adds

_check_ci_nesting_threshold_proximity() in pulse-wrapper.sh:

  • Counts nesting depth violations using the same awk logic as the CI check (global counter, no function-boundary resets)
  • Reads the threshold from .agents/configs/complexity-thresholds.conf
  • When violations are within 5 of the threshold, creates a warning issue with remediation steps
  • Deduplicates: skips if an open warning issue already exists
  • Called from run_weekly_complexity_scan independently of tree-change detection (runs even when no files changed)

.agents/configs/complexity-thresholds.conf: Documents the proximity guard so maintainers know to bump the threshold with a rationale comment.

Files changed

  • EDIT: .agents/scripts/pulse-wrapper.sh — new _check_ci_nesting_threshold_proximity() function + call site in run_weekly_complexity_scan
  • EDIT: .agents/configs/complexity-thresholds.conf — documents the proximity guard

Runtime testing

  • Risk: Low (new function is best-effort, non-fatal, wrapped in || true)
  • Testing: ShellCheck clean on extracted function; logic verified against CI awk pattern

Runtime Testing

  • Risk: Low
  • Testing: ShellCheck on new function (zero violations), logic review against CI awk pattern

Resolves #17808


aidevops.sh v3.6.170 plugin for Claude Code spent 10m on this as a headless worker.

Adds _check_ci_nesting_threshold_proximity() to run_weekly_complexity_scan
in pulse-wrapper.sh. When the nesting depth violation count is within 5 of
the CI threshold, the pulse creates a warning issue before PRs start failing.

The CI Complexity Analysis check failed 6 times in a short window (GH#17808)
because new scripts pushed the global nesting depth count over the threshold.
The threshold was bumped reactively each time. This guard detects proximity
proactively so maintainers can reduce nesting or bump the threshold before
the next PR fails.

Also documents the proximity guard in complexity-thresholds.conf.

Resolves #17808
@marcusquinn marcusquinn added bug Auto-created from TODO.md tag origin:worker Created by headless/pulse worker session labels Apr 8, 2026
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • no-review

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

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 91278fc4-8302-4b51-99ea-8b39e00ee9d4

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/gh17808-complexity-ci-regression

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.

@marcusquinn
Copy link
Copy Markdown
Owner Author

Completion Summary

  • What: Added _check_ci_nesting_threshold_proximity() to pulse-wrapper.sh — warns when nesting depth violations are within 5 of the CI threshold, preventing reactive threshold bumps
  • Issue: Systemic CI failure: Complexity Analysis (6 events) #17808
  • Files changed: .agents/scripts/pulse-wrapper.sh, .agents/configs/complexity-thresholds.conf
  • Testing: ShellCheck clean on new function; CI reruns triggered for affected open PRs (17800, 17805)
  • Key decisions: Buffer of 5 chosen to give 1-2 PRs worth of headroom; guard runs independently of tree-change detection so it fires even when no files changed

@github-actions github-actions bot added the enhancement Auto-created from TODO.md tag label Apr 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

SonarCloud: 0 bugs, 0 vulnerabilities, 647 code smells

Wed Apr 8 04:38:32 UTC 2026: Code review monitoring started
Wed Apr 8 04:38:32 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 647

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 647
  • VULNERABILITIES: 0

Generated on: Wed Apr 8 04:38:35 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

@marcusquinn marcusquinn merged commit 34c6f42 into main Apr 8, 2026
32 checks passed
@marcusquinn
Copy link
Copy Markdown
Owner Author

Completion Summary

  • What: Added _check_ci_nesting_threshold_proximity() to pulse-wrapper.sh — warns when nesting depth violations are within 5 of the CI threshold, preventing reactive threshold bumps
  • Issue: Systemic CI failure: Complexity Analysis (6 events) #17808
  • Files changed: .agents/scripts/pulse-wrapper.sh, .agents/configs/complexity-thresholds.conf
  • Testing: ShellCheck clean on new function; CI reruns triggered for affected open PRs (17800, 17805)
  • Key decisions: Buffer of 5 chosen to give 1-2 PRs worth of headroom; guard runs independently of tree-change detection so it fires even when no files changed

Merged via PR #17822 to main.
Merged by deterministic merge pass (pulse-wrapper.sh).

aidevops.sh v3.6.171 spent 9m on this as a headless bash routine.

@marcusquinn marcusquinn deleted the bugfix/gh17808-complexity-ci-regression branch April 8, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Auto-created from TODO.md tag enhancement Auto-created from TODO.md tag origin:worker Created by headless/pulse worker session

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Systemic CI failure: Complexity Analysis (6 events)

1 participant