Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ jobs:
- name: Tidy check
run: |
go mod tidy
git diff --exit-code go.mod go.sum
git diff --exit-code go.mod
test ! -f go.sum || git diff --exit-code go.sum
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

Same issue as in lint.yml: checking file existence will miss the case where a tracked go.sum gets deleted by go mod tidy (since the file won’t exist and the diff check is skipped). Prefer checking whether go.sum is tracked, then diff it (which will report deletions), while skipping entirely when it’s not tracked in the repo.

Suggested change
test ! -f go.sum || git diff --exit-code go.sum
if git ls-files --error-unmatch go.sum >/dev/null 2>&1; then
git diff --exit-code go.sum
fi

Copilot uses AI. Check for mistakes.

- name: Verify
run: go mod verify
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ jobs:
- name: Tidy check
run: |
go mod tidy
git diff --exit-code go.mod go.sum
git diff --exit-code go.mod
test ! -f go.sum || git diff --exit-code go.sum
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The test ! -f go.sum || ... guard will skip the diff check when go mod tidy removes a previously-tracked go.sum (file no longer exists), so CI could pass even though the deletion wasn’t committed. Consider guarding on whether go.sum is tracked (e.g., via git ls-files --error-unmatch go.sum) and then always running git diff --exit-code -- go.sum to catch modifications and deletions, while still supporting repos that don’t track go.sum.

Suggested change
test ! -f go.sum || git diff --exit-code go.sum
if git ls-files --error-unmatch go.sum >/dev/null 2>&1; then
git diff --exit-code -- go.sum
fi

Copilot uses AI. Check for mistakes.
- name: gci
run: gci write -s standard -s default -s blank -s dot -s "prefix(${{ steps.settings.outputs.gci_prefix }})" -s localmodule --skip-vendor --skip-generated $(find . -type f -name '*.go' -not -path "./pkg/api/*" -not -path "./vendor/*" -not -path "./.gocache/*" -not -path "./.git/*")
- name: gofumpt
Expand Down
10 changes: 5 additions & 5 deletions chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
)

const (
jobCompletionWait = 2 * time.Millisecond
twoJobCompletionWait = 3 * time.Millisecond
delayedJobDuration = 10 * time.Millisecond
waitForFirstJob = 5 * time.Millisecond
waitForDelayedJobs = 25 * time.Millisecond
jobCompletionWait = 10 * time.Millisecond
twoJobCompletionWait = 20 * time.Millisecond
delayedJobDuration = 50 * time.Millisecond
waitForFirstJob = 25 * time.Millisecond
waitForDelayedJobs = 150 * time.Millisecond
rapidFireJobRuns = 11
rapidFireCompletionWait = 200 * time.Millisecond
independentJobsWait = 100 * time.Millisecond
Expand Down
7 changes: 4 additions & 3 deletions cron_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ const (
)

// baseTime is a fixed instant used by fake-clock tests. It is midnight UTC on
// a Monday so that day-of-week specs behave predictably.
var baseTime = time.Date(2024, 1, 1, 0, 0, 0, 0, time.UTC) //nolint:gochecknoglobals // test constant
// a Monday in a neutral month so that January/December-specific specs never
// fire unexpectedly.
var baseTime = time.Date(2024, 6, 3, 0, 0, 0, 0, time.UTC) //nolint:gochecknoglobals // test constant

// awaitTimeout is the real-time safety net for tests that advance a fake clock
// and then wait for a goroutine to observe the result.
Expand Down Expand Up @@ -458,7 +459,7 @@ func TestLocalTimezone(t *testing.T) {
wg := &sync.WaitGroup{}
wg.Add(2)

// baseTime is 2024-01-01 00:00:00 UTC. Seconds 1 and 2 will fire.
// Seconds 1 and 2 relative to baseTime will fire.
fc := newFakeClock(baseTime)
cron := New(WithParser(testParserWithSeconds()), WithChain(), WithClock(fc), WithLocation(time.UTC))

Expand Down
Loading