You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An unknown cron subcommand fails instead of installing the sync job - #338
tackroom cron with a word it does not know, such as a mistyped tackroom cron puase ID, fell through to bare tackroom cron, which installs the periodic sync job. It printed + install launchd tackroom-pull and exited 0.
Bare cron takes flags only, so a leftover word is now an error: unknown cron subcommand "puase", exit 1, nothing installed.
How I checked it
In a temporary home with a launchctl stub that logs its calls:
Released 3.1.0, cron puase some-job: installs dev.tackroom.tackroom-pull.plist, exit 0.
This branch, cron puase some-job and cron --interval 30m bogus: the error, exit 1, no plist, no launchctl call.
This branch, cron --interval 30m still installs the job, cron --remove removes it, cron collect still works.
go test ./... and go vet ./... pass
I can explain this change without an AI tool
Summary by Sourcery
Bug Fixes:
Reject unknown positional arguments to cron instead of treating them as bare cron and installing the sync job.
Summary by CodeRabbit
Bug Fixes
The cron command now reports an “unknown cron subcommand” error when given a positional argument, instead of continuing with parsed options.
Reject leftover cron arguments so unknown subcommands cannot fall through to installing the sync job.
internal/app/app.go L646-649
Tips and commands
Interacting with Sourcery
Trigger a new review: Comment @sourcery-ai review on the pull request.
Continue discussions: Reply directly to Sourcery's review comments.
Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with @sourcery-ai issue to create an issue from it.
Generate a pull request title: Write @sourcery-ai anywhere in the pull
request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
Generate a pull request summary: Write @sourcery-ai summary anywhere in
the pull request body to generate a PR summary at any time exactly where you
want it. You can also comment @sourcery-ai summary on the pull request to
(re-)generate the summary at any time.
Generate reviewer's guide: Comment @sourcery-ai guide on the pull
request to (re-)generate the reviewer's guide at any time.
Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
pull request to resolve all Sourcery comments. Useful if you've already
addressed all the comments and don't want to see them anymore.
Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
request to dismiss all existing Sourcery reviews. Especially useful if you
want to start fresh with a new review - don't forget to comment @sourcery-ai review to trigger a new review!
yourconscience/tackroom#226: Changes the behavior of the bare tackroom cron command, which is also the dispatch path affected by this argument validation.
Suggested reviewers:sourcery-ai
Merge Risk: Minimal · up to 9d86f
Mistyped cron subcommands such as "puase" now fail with an error instead of installing the periodic sync job. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main behavior change: an unknown cron subcommand now fails instead of installing the sync job. It matches the raw summary, which describes parseCronFlags rejecting positional argum…
Description check
The description follows the template. It has a clear 'What and why' section explaining that a mistyped word such as 'puase' fell through to bare cron and installed the sync job, and that the change ma…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main behavior change: an unknown cron subcommand now fails instead of installing the sync job. It matches the raw summary, which describes parseCronFlags rejecting positional arguments with an unknown cron subcommand error rather than proceeding with bare cron.
Full details: Description check
Explanation
The description follows the template. It has a clear 'What and why' section explaining that a mistyped word such as 'puase' fell through to bare cron and installed the sync job, and that the change makes leftover words an error. The 'How I checked it' section lists the commands run and the observed results, and it includes the go test and go vet checkbox. The 'Fixes #' line is absent, but the template marks it as deletable when no issue exists. The 'I can explain this change without an AI tool' checkbox is unchecked, which is an author attestation and does not block completeness. The Sourcery summary block is extra but harmless.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 0443052d-d5b8-48f1-9374-6a7fd65982a1
Commits
Reviewing files that changed from the base of the PR and between a89b4e2 and 9d86ff5.
Files selected for processing: 1
internal/app/app.go
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
tackroom cronwith a word it does not know, such as a mistypedtackroom cron puase ID, fell through to baretackroom cron, which installs the periodic sync job. It printed+ install launchd tackroom-pulland exited 0.Bare
crontakes flags only, so a leftover word is now an error:unknown cron subcommand "puase", exit 1, nothing installed.How I checked it
In a temporary home with a
launchctlstub that logs its calls:Released 3.1.0,
cron puase some-job: installsdev.tackroom.tackroom-pull.plist, exit 0.This branch,
cron puase some-jobandcron --interval 30m bogus: the error, exit 1, no plist, nolaunchctlcall.This branch,
cron --interval 30mstill installs the job,cron --removeremoves it,cron collectstill works.go test ./...andgo vet ./...passI can explain this change without an AI tool
Summary by Sourcery
Bug Fixes:
croninstead of treating them as barecronand installing the sync job.Summary by CodeRabbit