Skip to content

fix(compliance-audit): handle boolean false in settings checks#133

Merged
don-petry merged 1 commit intomainfrom
fix/compliance-audit-jq-boolean-false
Apr 15, 2026
Merged

fix(compliance-audit): handle boolean false in settings checks#133
don-petry merged 1 commit intomainfrom
fix/compliance-audit-jq-boolean-false

Conversation

@don-petry
Copy link
Copy Markdown
Contributor

Summary

The jq alternative operator (//) treats boolean false as falsy, so jq -r '.$key // "null"' returns "null" when the setting value is false. This causes any boolean-false check (e.g. has_wiki: false) to always fire as a finding, even when the repository setting is correctly set.

Before:

actual=$(echo "$settings" | jq -r ".$key // \"null\"")

After:

actual=$(echo "$settings" | jq -r ".$key | if . == null then \"null\" else tostring end")

This uses an explicit null guard and tostring conversion, so boolean false"false" and boolean true"true", while null still maps to "null".

Impact

  • has_wiki: false no longer generates a false-positive finding for repos that already have wiki disabled
  • All other boolean settings checks are also fixed (any future expected: false checks will work correctly)

Test plan

  • Run the compliance audit after merging — bmad-bgreat-suite should no longer report has_wiki as a finding since its wiki is already disabled

Closes petry-projects/bmad-bgreat-suite#89

Generated with Claude Code

The jq alternative operator (//) treats boolean false as falsy, causing
settings like has_wiki: false to be reported as null instead of false.

This means the has_wiki check (and any other boolean-false check) always
fires even when the repository setting is correctly set to false.

Fix: use '| tostring' with an explicit null guard instead of //.

Closes petry-projects/bmad-bgreat-suite#89
Copilot AI review requested due to automatic review settings April 14, 2026 15:10
@don-petry
Copy link
Copy Markdown
Contributor Author

@don-petry please review and merge — this fixes the false-positive compliance finding for has_wiki in bmad-bgreat-suite (and any other repo where a boolean-false setting is correctly applied).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 14, 2026

Warning

Rate limit exceeded

@don-petry has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 26 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 3 minutes and 26 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 49e35d33-a16d-4199-b17f-3c76d8d9e382

📥 Commits

Reviewing files that changed from the base of the PR and between d01423d and 8189f46.

📒 Files selected for processing (1)
  • scripts/compliance-audit.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/compliance-audit-jq-boolean-false

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.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

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.

Pull request overview

Fixes false-positive findings in the compliance audit’s repository settings checks by ensuring jq distinguishes between null and boolean false when extracting settings values.

Changes:

  • Replace jq’s // "null" fallback with an explicit null guard plus tostring, so false is preserved as "false" instead of being treated like missing data.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@don-petry don-petry merged commit 9b7bd7b into main Apr 15, 2026
23 checks passed
@don-petry don-petry deleted the fix/compliance-audit-jq-boolean-false branch April 15, 2026 23:15
Claude AI added a commit that referenced this pull request Apr 15, 2026
- Merge PR #133 from main (same jq boolean fix)
- Apply printf instead of echo for JSON piping (safer)
- Use jq --arg for key interpolation (prevents injection)

Agent-Logs-Url: https://github.com/petry-projects/.github/sessions/bc09d7ce-9add-488c-a416-223d826cc900

Co-authored-by: don-petry <36422719+don-petry@users.noreply.github.com>
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.

Compliance: has_wiki

2 participants