Skip to content

feat: implement issue #1361 — SonarCloud: code security review (pythonsecurity) - #1383

Open
don-petry wants to merge 39 commits into
mainfrom
dev-lead/issue-1361-20261027-2120
Open

don-petry wants to merge 39 commits into
mainfrom
dev-lead/issue-1361-20261027-2120

Conversation

@don-petry

@don-petry don-petry commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

SonarCloud: code security review (pythonsecurity)

From the issue: 2 open SonarCloud finding(s) in combsmith/.github, worst severity MAJOR. Generated by the org SonarCloud Audit.

Risk

Low — 3 file(s) changed; no CI- or runtime-critical paths touched.

Test plan

No test files were added or updated. Verification: bash scripts/dev-lead-lint.sh (shellcheck --severity=warning) ran pre-commit; the existing CI (bats + lint) guards the change.

Rollback

Revert this PR. No non-revertible side effects (no tags, migrations, or external state).

Monitoring

This PR's CI checks (Lint + bats) are the success/regression signal.

Closes #1361

View guided diff Turn on auto-fix

@don-petry don-petry added the auto-rebase:ready Opts a non-draft PR into auto-rebase without an approval (auto-rebase ready_label) label Oct 27, 2026
@don-petry
don-petry requested a review from a team as a code owner October 27, 2026 21:24
@coderabbitai

This comment has been minimized.

@chatgpt-codex-connector

This comment has been minimized.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #1383
No changes were committed, but the PR still can't be marked done: required check SonarCloud is still pending. The retry cron will re-attempt automatically. Next attempt after: 2026-10-27T21:55:49Z

@don-petry

Copy link
Copy Markdown
Contributor Author

Note

@don-petry I reviewed this PR and no code changes were needed, but I can't mark it done yet: required check SonarCloud is still pending. I'll re-check automatically.
Next attempt after: 2026-10-27T21:55:49Z

@don-petry
don-petry enabled auto-merge (squash) October 27, 2026 21:25
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-27T22:26:37Z.

@donpetry-bot

donpetry-bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

No description provided.

@don-petry
don-petry disabled auto-merge October 28, 2026 00:12
@don-petry

This comment has been minimized.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 0
- Rate-limit notice ("Review limit reached"): No actionable findings — purely operational notice that the free OSS review quota was exhausted. [issue comment: disposition=informational]
Files changed: None
Skipped (informational): 1
```
The CodeRabbit comment contained only a rate-limit block with no findings-bearing sections (no Security Architecture Review, Actionable comments, Nitpicks, or Outside diff range sections). Since it is purely an operational notice with no specific code issues to fix, I posted an `informational` disposition on the original PR comment to clear the maintainer-comment gate. No code changes were needed.

@don-petry
don-petry enabled auto-merge (squash) October 28, 2026 00:13
@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@don-petry
don-petry disabled auto-merge October 28, 2026 01:28
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@donpetry-bot

donpetry-bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

No description provided.

@don-petry
don-petry disabled auto-merge October 28, 2026 05:26
@don-petry

This comment has been minimized.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
**Finding:** Code Review completed with no findings
- Status: ✅ Completed on commit `7447f9c`
- Result: `has_any_findings: false`, `has_unresolved_findings: false`
- **Action:** Dispositioned as `informational` — no code changes needed
**PR State:**
- ✅ All CI checks passing (no Tier 1 blockers)
- ✅ No review threads with changes requested
- ✅ Codex review found no issues
**Comment disposition:** Posted `informational` marker to clear the maintainer-comment gate (comment reply: https://github.com/combsmith/.github/pull/1383#issuecomment-6461430281)
**Files changed:** None — clean code review report requires no fixes.

@don-petry
don-petry enabled auto-merge (squash) October 28, 2026 05:27
@donpetry-bot

donpetry-bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Superseded by automated re-review at 25363734e3258252e0f93cc014fe1fd7b8b98bc7 — click to expand prior review.

Review — fix requested (cycle 1/3)

The automated review identified the following issues. Please address each one:

Findings to fix

Automated review — NEEDS HUMAN REVIEW

Risk: MEDIUM
Reviewed commit: 7447f9c097e327288854ce3f23be538b75ee067c
Review mode: triage-approved (single reviewer)

Summary

The fix for SonarCloud S8707 in validate-signals.py is sound and well tested. However, the PR also commits a stray binary .coverage file (a 53 KB pytest-cov SQLite database) to the repository root. That artifact must be removed before merge, so this needs a code change and cannot be auto-approved.

Linked issue analysis

Closes #1361 (SonarCloud: two pythonsecurity:S8707 path-traversal findings in .github/scripts/feature-ideation/validate-signals.py).

  • Real fix, no NOSONAR: met. _confine_path now rebuilds the confined path from os.scandir entries under the trusted root (_rebuild_from_root) instead of returning the argv-derived string, which breaks the taint flow Sonar traced through the commonpath guard.
  • No behavior change: met. The old .exists() checks are replaced by FileNotFoundError handling that keeps the same not found / schema not found messages and exit code 2. New tests cover both. A non-directory intermediate component (NotADirectoryError) is caught by the new except OSError branch and also exits 2.
  • Findings resolved to zero: SonarCloud's PR quality gate passed with 0 new issues. Whether the two existing findings close will only show in the main-branch analysis after merge.

Findings

  1. [Blocking, maintainability/hygiene] Stray build artifact committed: .coverage (new binary file, 53,248 bytes). This is the pytest-cov / coverage.py SQLite data file left over from the local test run. It records absolute runner paths (/home/runner/work/.github/.github/...). It is not ignored by the repo's .gitignore (no coverage entry) and is unrelated to the fix. If committed, it will go stale and churn on every future local run. Fix: git rm --cached .coverage. Consider also adding .coverage (and .coverage.*) to .gitignore so the dev-lead agent cannot commit it again. The PR description ("3 file(s) changed") does not mention this file, and the triage tier missed it.

  2. [Non-blocking, nit] _rebuild_from_root matches case-insensitively via os.path.normcase. On Linux (where this runs) normcase is the identity, so this changes nothing. On a case-insensitive filesystem holding two entries that differ only by case, the first scandir hit wins. This is harmless here, so no action is needed.

  3. [Non-blocking, observation] Extra cost. Each confined path now does one scandir per path component. That is negligible for this CLI's two arguments.

Secret scan: the run_secret_scanning MCP tool was unavailable in this run. The gitleaks CI check passed, and the diff contains no credentials.

CI status

All checks are green: Lint, ShellCheck, the "Lint, schema, and bats" job, CodeQL (actions + python), SonarCloud (quality gate passed, 0 new issues), gitleaks, AgentShield, Agent Security Scan, and dependency-audit. Several checks were SKIPPED as not applicable, and CodeRabbit was NEUTRAL because it was rate-limited. There are no human reviews or unresolved review threads. mergeStateStatus is BLOCKED only because a required review is pending.


Reviewed automatically by the PR-review agent (single-reviewer mode: opus 5.5 [opus 4.8, opus 4.7]). Reply if you need a human review.

Additional tasks

  1. Resolve all unresolved review thread comments from other reviewers
  2. Ensure all CI checks pass after your changes
  3. Rebase on the target branch if behind
  4. Do NOT modify files unrelated to the findings above

The review cascade will automatically re-review after new commits are pushed.

@don-petry

Copy link
Copy Markdown
Contributor Author

No description provided.

@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-28T12:48:24Z.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

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

Labels

auto-rebase:ready Opts a non-draft PR into auto-rebase without an approval (auto-rebase ready_label) needs-human-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SonarCloud: code security review (pythonsecurity)

2 participants