Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 14, 2026

The fuzzy scheduling scattering algorithm already includes org/repo in the hash seed when available, but this behavior was not tested or documented. This ensures workflows with identical names across different repositories get different execution times, preventing org-wide load spikes.

Changes

Test coverage (pkg/workflow/schedule_preprocessing_test.go):

  • Added TestFuzzyScheduleScatteringWithRepositorySlug - verifies different org/repo combinations produce different schedules
  • Added TestFuzzyScheduleScatteringAcrossOrganization - verifies same workflow name across multiple repos scatter properly
  • Added TestFuzzyScheduleScatteringWarningWithoutRepoSlug - verifies warning is shown when repository slug is not available

Documentation (docs/src/content/docs/reference/schedule-syntax.md):

  • Added "Organization-Wide Scattering" section explaining cross-repository distribution
  • Documented seed format: owner/repo/workflow-path

Code changes (pkg/workflow/schedule_preprocessing.go):

  • Clarified that org/repo inclusion prevents same-named workflows from colliding across repositories
  • Added warning when repository context is not available: "Fuzzy schedule scattering without repository context. Workflows with the same name in different repositories may collide. Ensure you are in a git repository with a configured remote."

How it works

Seed construction already includes repository context:

seed := c.workflowIdentifier
if c.repositorySlug != "" {
    seed = c.repositorySlug + "/" + c.workflowIdentifier
} else {
    // Warn if repository slug is not available
    c.IncrementWarningCount()
    c.addScheduleWarning("Fuzzy schedule scattering without repository context...")
}

Test results confirm distribution:

  • githubnext/repo-1/ci.md22 10 * * *
  • githubnext/repo-2/ci.md51 7 * * *
  • githubnext/repo-3/ci.md12 2 * * *
  • other-org/repo-1/ci.md53 13 * * *
Original prompt

Ensure the the fuzzy scheduling scattering algorithm includes org/repo in the hash computation to scatter accross an entire org as well.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 14, 2026 15:34
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Contributor

@copilot show warning if the organization repo is not known

Copilot AI changed the title [WIP] Update fuzzy scheduling scattering algorithm for org/repo hashing Add test coverage and documentation for org/repo-scoped fuzzy schedule scattering Jan 14, 2026
Copilot AI requested a review from pelikhan January 14, 2026 15:50
…le scattering

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 14, 2026

@copilot show warning if the organization repo is not known

Added warning when repository context is not available during fuzzy schedule scattering. The warning message informs users that workflows with the same name in different repositories may collide without the org/repo context. Commit: 84efbf9

@pelikhan pelikhan marked this pull request as ready for review January 14, 2026 16:02
@pelikhan pelikhan merged commit 4ce516f into main Jan 14, 2026
@pelikhan pelikhan deleted the copilot/update-fuzzy-scheduling-algorithm branch January 14, 2026 16:03
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.

2 participants