Repository navigation
Conversation
Greptile SummaryFormats common cron step patterns ( Confidence Score: 5/5Safe to merge — all findings are P2 style/coverage suggestions with no correctness or data-integrity risk. All remaining findings are P2: a missing test for the minute-interval branch, and the common No files require special attention. Prompt To Fix All With AIThis is a comment left during a code review.
Path: ui/src/ui/presenter.test.ts
Line: 19-27
Comment:
**Missing test coverage for minute intervals**
The PR adds logic to format `*/N * * * *` as "Every N minutes", but the test file has no case exercising that branch. The test description even says "hourly cron intervals", matching the omission. A case like `expect(formatCronSchedule(cronSchedule("*/5 * * * *"))).toBe("Every 5 minutes")` would cover the `hour === "*"` path in `formatCommonCronExpression`.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: ui/src/ui/presenter.ts
Line: 80-84
Comment:
**`0 * * * *` falls through to raw cron display**
The hourly-step branch only matches `0 */N * * *` (the step form). The plain `0 * * * *`, which is the most idiomatic "every hour" expression cron generators emit, falls through to `Cron 0 * * * *`. This may be intentional scope, but worth considering alongside `*/1` which is rarely used in practice. A simple string equality check could cover it:
```ts
if (minute === "0") {
if (hour === "*") {
return `Every ${formatCronIntervalUnit(1, "hour")}`;
}
const hourStep = parsePositiveCronStep(hour);
if (hourStep !== null) {
return `Every ${formatCronIntervalUnit(hourStep, "hour")}`;
}
}
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(ui): format common cron intervals" | Re-trigger Greptile |
| describe("formatCronSchedule", () => { | ||
| it("formats common hourly cron intervals as human-readable intervals", () => { | ||
| expect(formatCronSchedule(cronSchedule("0 */6 * * *"))).toBe("Every 6 hours"); | ||
| expect(formatCronSchedule(cronSchedule("0 */1 * * *", "UTC"))).toBe("Every 1 hour (UTC)"); | ||
| }); | ||
|
|
||
| it("keeps unsupported cron expressions on the raw cron fallback", () => { | ||
| expect(formatCronSchedule(cronSchedule("15 3 * * 1"))).toBe("Cron 15 3 * * 1"); | ||
| }); |
There was a problem hiding this comment.
Missing test coverage for minute intervals
The PR adds logic to format */N * * * * as "Every N minutes", but the test file has no case exercising that branch. The test description even says "hourly cron intervals", matching the omission. A case like expect(formatCronSchedule(cronSchedule("*/5 * * * *"))).toBe("Every 5 minutes") would cover the hour === "*" path in formatCommonCronExpression.
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/ui/presenter.test.ts
Line: 19-27
Comment:
**Missing test coverage for minute intervals**
The PR adds logic to format `*/N * * * *` as "Every N minutes", but the test file has no case exercising that branch. The test description even says "hourly cron intervals", matching the omission. A case like `expect(formatCronSchedule(cronSchedule("*/5 * * * *"))).toBe("Every 5 minutes")` would cover the `hour === "*"` path in `formatCommonCronExpression`.
How can I resolve this? If you propose a fix, please make it concise.| if (minute === "0") { | ||
| const hourStep = parsePositiveCronStep(hour); | ||
| if (hourStep !== null) { | ||
| return `Every ${formatCronIntervalUnit(hourStep, "hour")}`; | ||
| } |
There was a problem hiding this comment.
0 * * * * falls through to raw cron display
The hourly-step branch only matches 0 */N * * * (the step form). The plain 0 * * * *, which is the most idiomatic "every hour" expression cron generators emit, falls through to Cron 0 * * * *. This may be intentional scope, but worth considering alongside */1 which is rarely used in practice. A simple string equality check could cover it:
if (minute === "0") {
if (hour === "*") {
return `Every ${formatCronIntervalUnit(1, "hour")}`;
}
const hourStep = parsePositiveCronStep(hour);
if (hourStep !== null) {
return `Every ${formatCronIntervalUnit(hourStep, "hour")}`;
}
}Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/ui/presenter.ts
Line: 80-84
Comment:
**`0 * * * *` falls through to raw cron display**
The hourly-step branch only matches `0 */N * * *` (the step form). The plain `0 * * * *`, which is the most idiomatic "every hour" expression cron generators emit, falls through to `Cron 0 * * * *`. This may be intentional scope, but worth considering alongside `*/1` which is rarely used in practice. A simple string equality check could cover it:
```ts
if (minute === "0") {
if (hour === "*") {
return `Every ${formatCronIntervalUnit(1, "hour")}`;
}
const hourStep = parsePositiveCronStep(hour);
if (hourStep !== null) {
return `Every ${formatCronIntervalUnit(hourStep, "hour")}`;
}
}
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d16967553c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function parsePositiveCronStep(field: string): number | null { | ||
| const match = field.match(/^\*\/([1-9]\d*)$/); | ||
| if (!match) { | ||
| return null; | ||
| } | ||
| const step = Number(match[1]); | ||
| return Number.isSafeInteger(step) ? step : null; |
There was a problem hiding this comment.
Validate cron step ranges before humanizing schedule
parsePositiveCronStep treats any positive integer as a valid step, so cron strings like */70 * * * * or 0 */25 * * * get rendered as “Every 70 minutes” / “Every 25 hours” instead of staying on the raw Cron ... fallback. In environments where malformed cron expressions can still exist in stored jobs, this makes an invalid schedule look valid and obscures why the job is failing; the formatter should only humanize steps that are within the allowed field ranges for minutes/hours.
Useful? React with 👍 / 👎.
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep this PR open, but it is not merge-ready: the small Control UI formatter is useful polish, yet it can make invalid cron expressions look valid and the external PR still has only unit-test validation rather than real UI proof. Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. Do we have a high-confidence way to reproduce the issue? Yes for the PR-introduced formatter bug by source inspection: the added parser accepts out-of-range positive steps that Croner rejects. I did not run the Control UI because this read-only review cannot provide the contributor's required real behavior proof. Is this the best way to solve the issue? No as-is. The presenter is an acceptable narrow layer for display polish, but it must share Croner's valid field bounds or use a safe parser so only exact supported patterns are humanized. Security review: Security review cleared: The diff only changes Control UI formatting code and a colocated unit test; no dependency, workflow, secret, permission, install, publishing, or code-execution surface is changed. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 3630d502eb9b. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
Heads up: this PR needs to be updated against current |
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Testing