Skip to content

An unknown cron subcommand fails instead of installing the sync job - #338

Merged
yourconscience merged 1 commit into
mainfrom
cron-unknown-subcommand
Nov 28, 2026
Merged

yourconscience merged 1 commit into
mainfrom
cron-unknown-subcommand

Conversation

@yourconscience

@yourconscience yourconscience commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

What and why

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.

@sourcery-ai

sourcery-ai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

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!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

parseCronFlags now rejects positional arguments after flag parsing. The error identifies the first remaining argument as an unknown cron subcommand.

Changes: Cron argument validation

Layer / File(s) Summary
Reject positional cron arguments
internal/app/app.go
parseCronFlags returns an unknown cron subcommand error when positional arguments remain after flag parsing. The error includes the first argument.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Possibly related PRs

  • 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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 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.
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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • 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.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@yourconscience
yourconscience merged commit b60f2fd into main Nov 28, 2026
11 checks passed
@yourconscience yourconscience mentioned this pull request Nov 28, 2026
1 of 2 tasks
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