Skip to content

fix: ci classifier dependency files#14

Merged
oneslash merged 2 commits into
mainfrom
fix/par-80_ci-classifier-dependency-files
Apr 25, 2026
Merged

fix: ci classifier dependency files#14
oneslash merged 2 commits into
mainfrom
fix/par-80_ci-classifier-dependency-files

Conversation

@oneslash
Copy link
Copy Markdown
Collaborator

@oneslash oneslash commented Apr 25, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added --dependency-files-changed flag and LIMIER_CI_DEPENDENCY_FILES_CHANGED environment variable to classify dependency file changes in CI workflows (accepted values: true, false, unknown).
  • Behavior Updates

    • Dependency review status now conditionally depends on the dependency-files-changed signal when metadata is unavailable.
  • Documentation

    • Updated CI workflow guidance and CLI reference for the new dependency-files-changed input parameter.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 25, 2026

Warning

Rate limit exceeded

@oneslash has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 44 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 48 minutes and 44 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: b2ef9de4-eb5e-4387-ad2a-6bddc064af9c

📥 Commits

Reviewing files that changed from the base of the PR and between 5ea2ea9 and 8cca998.

📒 Files selected for processing (2)
  • cmd/ci.go
  • cmd/ci_test.go
📝 Walkthrough

Walkthrough

This PR introduces a new CI signal (--dependency-files-changed) that enables the GitHub CI command to classify whether dependency files have changed, allowing more nuanced handling of dependency-related pull requests. The signal is integrated into the dependency upgrade resolution logic, with input validation and conditional behavior that changes the assessment outcome when dependency metadata is absent. Documentation is updated to explain the new flag and its usage.

Changes

Cohort / File(s) Summary
Dependency Signal Integration
cmd/ci.go, cmd/ci_test.go
Adds new CLI flag/env var for dependency-file-change classification, validates input values (true/false/unknown), and integrates signal into resolveDependencyUpgrade logic. When dependency metadata is missing, the outcome now depends on the signal: false returns not_applicable, while true/unknown returns needs_review. Test suite expanded with helper function and new test cases covering each signal state.
Documentation
docs/guide/ci-and-deploy.md, docs/reference/cli.md
Documents new --dependency-files-changed flag and environment variable, including accepted values and behavior impact on CI outcomes when dependency metadata is unavailable.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A flag hops into view,
Classifying files both old and new,
No metadata? The signal knows—
Which way the dependency review goes! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: ci classifier dependency files' directly relates to the main changes: adding a new dependency-file-change classification input to the CI classifier and integrating it into dependency upgrade resolution logic.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/par-80_ci-classifier-dependency-files

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
cmd/ci_test.go (1)

66-84: Recommended: add a test for the invalid-signal rerun branch.

The new rerun path in cmd/ci.go (lines 298–300) — triggered when --dependency-files-changed receives an unsupported value — is currently uncovered. A small case asserting exit code 2, status == "rerun", and the Unsupported dependency file change signal message would lock in that input-validation contract.

♻️ Suggested addition
func TestRunGitHubCIRerunsOnInvalidDependencyFilesChangedSignal(t *testing.T) {
	t.Parallel()

	outputDir := filepath.Join(t.TempDir(), "limier")
	err := runGitHubCI(t.Context(), githubCIOptions{
		outputDir:              outputDir,
		failOn:                 "block,rerun",
		dependencyFilesChanged: "bogus",
		getenv:                 emptyCIEnv,
	})
	requireExitCode(t, err, 2)

	status := readCIStatus(t, filepath.Join(outputDir, "status.json"))
	if status.Status != "rerun" {
		t.Fatalf("status.Status = %q, want rerun", status.Status)
	}
	if !strings.Contains(status.Message, "Unsupported dependency file change signal") {
		t.Fatalf("status.Message = %q, want unsupported signal message", status.Message)
	}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/ci_test.go` around lines 66 - 84, Add a new unit test that exercises the
invalid `--dependency-files-changed` branch by calling runGitHubCI with a
githubCIOptions that sets dependencyFilesChanged to "bogus" (and failOn
including "rerun"), assert the returned error exit code is 2, then read the
produced status.json and assert status.Status == "rerun" and that status.Message
contains "Unsupported dependency file change signal"; name the test e.g.
TestRunGitHubCIRerunsOnInvalidDependencyFilesChangedSignal and follow the same
pattern as TestRunGitHubCIRequiresReviewWithoutDependencyFileSignal (use
t.Parallel(), a temp outputDir, emptyCIEnv, requireExitCode, and readCIStatus).
docs/reference/cli.md (1)

71-73: Optional: document the accepted aliases or drop them from the parser.

resolveDependencyFilesChangeSignal (cmd/ci.go lines 359–368) also accepts 1/0/yes/no (case-insensitive) as aliases for true/false, but the reference here only lists true, false, unknown. Either mention the aliases or tighten the parser to only accept the three documented values, so users don't get inconsistent surface area between the CLI and the docs.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/reference/cli.md` around lines 71 - 73, The docs and parser disagree:
resolveDependencyFilesChangeSignal (cmd/ci.go) accepts case-insensitive aliases
"1"/"0"/"yes"/"no" in addition to "true"/"false"/"unknown" and
LIMIER_CI_DEPENDENCY_FILES_CHANGED can be set to those aliases; update the CLI
reference to list these accepted aliases (1, 0, yes, no) alongside
true/false/unknown and mention the env var LIMIER_CI_DEPENDENCY_FILES_CHANGED,
or alternatively tighten resolveDependencyFilesChangeSignal to reject any values
other than "true"/"false"/"unknown" so the docs and parser match—pick one and
make corresponding changes in cmd/ci.go or docs/reference/cli.md.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@cmd/ci_test.go`:
- Around line 66-84: Add a new unit test that exercises the invalid
`--dependency-files-changed` branch by calling runGitHubCI with a
githubCIOptions that sets dependencyFilesChanged to "bogus" (and failOn
including "rerun"), assert the returned error exit code is 2, then read the
produced status.json and assert status.Status == "rerun" and that status.Message
contains "Unsupported dependency file change signal"; name the test e.g.
TestRunGitHubCIRerunsOnInvalidDependencyFilesChangedSignal and follow the same
pattern as TestRunGitHubCIRequiresReviewWithoutDependencyFileSignal (use
t.Parallel(), a temp outputDir, emptyCIEnv, requireExitCode, and readCIStatus).

In `@docs/reference/cli.md`:
- Around line 71-73: The docs and parser disagree:
resolveDependencyFilesChangeSignal (cmd/ci.go) accepts case-insensitive aliases
"1"/"0"/"yes"/"no" in addition to "true"/"false"/"unknown" and
LIMIER_CI_DEPENDENCY_FILES_CHANGED can be set to those aliases; update the CLI
reference to list these accepted aliases (1, 0, yes, no) alongside
true/false/unknown and mention the env var LIMIER_CI_DEPENDENCY_FILES_CHANGED,
or alternatively tighten resolveDependencyFilesChangeSignal to reject any values
other than "true"/"false"/"unknown" so the docs and parser match—pick one and
make corresponding changes in cmd/ci.go or docs/reference/cli.md.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b08d3889-533f-434c-a79c-54caed5b5cf2

📥 Commits

Reviewing files that changed from the base of the PR and between 1fe5e9d and 5ea2ea9.

📒 Files selected for processing (4)
  • cmd/ci.go
  • cmd/ci_test.go
  • docs/guide/ci-and-deploy.md
  • docs/reference/cli.md

@oneslash oneslash merged commit 435efae into main Apr 25, 2026
5 checks passed
@oneslash oneslash deleted the fix/par-80_ci-classifier-dependency-files branch April 25, 2026 14:35
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.

1 participant