Skip to content

feat: implement issue #817 — Clean up upsert output before fleet apply: conditional negation tail + migrated-comment dedup - #818

Merged
don-petry merged 2 commits into
mainfrom
dev-lead/issue-817-20260719-2346
Jul 20, 2026
Merged

don-petry merged 2 commits into
mainfrom
dev-lead/issue-817-20260719-2346

Conversation

@don-petry

Copy link
Copy Markdown
Contributor

Closes #817

Implemented by dev-lead agent. Please review.

@don-petry
don-petry requested a review from a team as a code owner July 20, 2026 00:06
Copilot AI review requested due to automatic review settings July 20, 2026 00:06
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@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.

2 similar comments
@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.

@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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the gitignore-baseline upsert logic to reduce noisy output by making the “negation tail” conditional (only re-emitting negations that L2 patterns actually re-hide) and improving migration output by deduplicating migrated baseline comments, with corresponding test updates to treat the raw canonical .gitignore as the steady state again.

Changes:

  • Implement conditional negation tail generation via git check-ignore, emitting only necessary negations (or none) instead of always appending a full tail.
  • Deduplicate migrated baseline comment lines in L2 when they exactly match non-bare-# block comment lines.
  • Update bats tests to reflect the new fixed-point behavior (canonical .gitignore is byte-for-byte stable again).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
test/scripts/sync-gitignore-baseline/dry-run.bats Adjusts the “already current” dry-run fixture to treat raw canonical as the steady state.
test/scripts/lib/gitignore-baseline.bats Expands coverage for conditional tail behavior and migrated-comment dedup rules.
test/scripts/compliance-remediate/gitignore-baseline.bats Updates remediation “already current” fixture to align with canonical fixed-point behavior.
scripts/lib/gitignore-baseline.sh Adds conditional negation tail computation and comment dedup during L2 neutralization.

Comment thread scripts/lib/gitignore-baseline.sh Outdated
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) July 20, 2026 00:12
@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@don-petry, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 16 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0c340a3f-0002-4b89-b9cc-d5b9c47de730

📥 Commits

Reviewing files that changed from the base of the PR and between 65a4f97 and 72af4d7.

📒 Files selected for processing (4)
  • scripts/lib/gitignore-baseline.sh
  • test/scripts/compliance-remediate/gitignore-baseline.bats
  • test/scripts/lib/gitignore-baseline.bats
  • test/scripts/sync-gitignore-baseline/dry-run.bats
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-817-20260719-2346

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.

@don-petry
don-petry disabled auto-merge July 20, 2026 00:13
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 20, 2026
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-bot-comment (applied)

Changes committed and pushed.

@don-petry don-petry added the dev-lead:hands-off Opt an item out of the dev-lead persona automation entirely label Jul 20, 2026
@don-petry
don-petry force-pushed the dev-lead/issue-817-20260719-2346 branch from 269c44a to 72af4d7 Compare July 20, 2026 01:51
@sonarqubecloud

Copy link
Copy Markdown

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: 72af4d70a992a9114482f51501498c1f768c113b
Review mode: triage-approved (single reviewer)

Summary

Implements issue #817 in scripts/lib/gitignore-baseline.sh: (A) the re-allow negation tail is now conditional — composed block+neutralized-L2 is probed with git check-ignore in a throwaway repo and only negations whose paths are actually re-hidden are re-emitted; (B) L2 comment lines byte-identical to a block comment (except bare '#' separators) are deduped during migration. The two #815 fixtures are reverted to the raw-canonical steady state as the issue required, and four new bats tests cover the clean-L2 no-tail fixed point, comment dedup, bare-# survival, and canonical byte-for-byte idempotency. Failure direction is safe: omitting a negation only over-ignores (paths stay hidden), never exposes a secret pattern.

Linked issue analysis

Closes #817. Both parts (conditional negation tail, migrated-comment dedup) are substantively implemented, and the mandated side effect — restoring the dry-run.bats and compliance-remediate fixtures to feed the raw canonical — is handled. Acceptance criteria backed by new/updated bats tests; the Gitignore Baseline Tests and Compliance Audit Tests CI jobs pass.

Findings

  • The single Copilot review thread (BSD/macOS mktemp portability, git check-ignore exit-code handling under set -euo pipefail) is RESOLVED: head commit uses 'mktemp -d -t gitignore-baseline.XXXXXX' and captures the exit code explicitly, treating 1 as the no-ignored happy path.
  • Informational (non-blocking): on a hard check-ignore error (exit >1) the tail is suppressed rather than falling back to the full pre-#817 tail as the function comment implies for the git-unavailable case. The failure direction is still conservative (over-ignoring, never secret exposure), so this is acceptable; consider aligning behavior or comment in a follow-up.
  • Secret scan: run_secret_scanning MCP tool not available in this environment; gitleaks CI check passed (no findings).

CI status

All checks green: Lint, ShellCheck, Agent Security Scan, Secret scan (gitleaks), CodeQL, Compliance Audit Tests, Gitignore Baseline Tests, Dependency audit (npm audit passed, others skipped/no ecosystem), SonarCloud quality gate passed (0 new issues, 0 hotspots), AgentShield, CodeRabbit status success.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry
don-petry merged commit 49ecdfb into main Jul 20, 2026
23 checks passed
@don-petry
don-petry deleted the dev-lead/issue-817-20260719-2346 branch July 20, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-lead:hands-off Opt an item out of the dev-lead persona automation entirely

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean up upsert output before fleet apply: conditional negation tail + migrated-comment dedup

3 participants