Skip to content

Support multi-repo projects in ProjectListWorkflow - #199

Merged
C-Hipple merged 2 commits into
mainfrom
claude/project-list-multi-repo-5my19l
Jul 31, 2026
Merged

Support multi-repo projects in ProjectListWorkflow#199
C-Hipple merged 2 commits into
mainfrom
claude/project-list-multi-repo-5my19l

Conversation

@C-Hipple

Copy link
Copy Markdown
Owner

Summary

Refactor ProjectListWorkflow to support projects spanning multiple repositories. Previously, each workflow was tied to a single repo via Owner/Repo fields. Now workflows accept a Repos list (e.g., ["owner/repo1", "owner/repo2"]), allowing a single workflow to cover an entire multi-repo project while maintaining backward compatibility with the singular Owner/Repo pair.

Changes

  • New RepoRef type in jira/jira.go: Replaces string-based repo identification with a structured Owner/Repo pair. Includes case-insensitive matching via normalized() and a targetSet for efficient lookup of configured repos.

  • Enhanced PR URL parsing: Added parsePRURL() function to extract owner, repo, and PR number from GitHub PR URLs, supporting both github.com and enterprise hosts.

  • Updated GetProjectPRKeys() signature: Now accepts []RepoRef instead of []string, returning map[RepoRef][]int to group PRs by their full repo identity rather than short name alone.

  • Improved processIssues() logic: Uses RepoRef matching to handle projects with repos sharing the same short name under different owners. PRs linked to repos outside the configured list are properly filtered out.

  • New resolveRepoRefs() helper in workflows/project_list.go: Converts configured "owner/repo" entries into RepoRef structs, preserving order, dropping malformed entries, and collapsing duplicates.

  • Updated ProjectListWorkflow.Run(): Walks repos in configured order and fetches PRs for each, ensuring consistent behavior across runs.

  • Documentation updates: Clarified that ProjectListWorkflow now supports multi-repo projects via the Repos list, with fallback to root-level Repos if omitted. Legacy Owner/Repo fields still work for single-repo projects.

Test Plan

  • go test ./... passes — comprehensive unit tests added for:
    • parsePRURL() with standard GitHub URLs, trailing slashes, enterprise hosts, and error cases
    • RepoRef case-insensitive matching via targetSet
    • processIssues() grouping PRs across repos and filtering unconfigured owners
    • resolveRepoRefs() handling whitespace, malformed entries, and duplicates
    • ProjectListWorkflow preserving all repos and declaring no PR requirements
  • go build ./... passes

https://claude.ai/code/session_0155MTHf62Th1ZDQ6ejhb71y

claude added 2 commits July 30, 2026 04:54
ProjectListWorkflow already accepted a Repos list, but the Jira lookup it
depends on only ever saw repo short names: GetProjectPRKeys took []string of
short names and keyed its results the same way. Two repos in a project under
different owners collapsed onto one key, so one repo's PRs were fetched from
the other repo's owner (or dropped).

Give the jira package a RepoRef{Owner, Repo} and key the lookup on it. PR
URLs from Jira are now parsed for both owner and repo, matched
case-insensitively (GitHub names are case-insensitive and Jira reports
whatever casing the PR was linked with), and mapped back to the ref as it was
configured so the result can be handed straight to the GitHub API. Parsing is
bounds-checked instead of indexing a split slice blind.

On the workflow side, extract resolveRepoRefs: it keeps the configured order
so each cycle processes repos identically, skips malformed entries, and
collapses duplicates so a repo listed twice is only fetched once.

The docs still told users to create one workflow per repo and share a
SectionTitle; document the Repos list instead, keeping the singular
Owner/Repo example for single-repo projects.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0155MTHf62Th1ZDQ6ejhb71y
The config RPC handlers needed no change for multi-repo project lists —
GetConfig/UpdateConfig pass Workflows through as []config.RawWorkflow, which
already carries Repos, and normalizeWorkflows trims that list for every
workflow type — but nothing pinned that down.

Add two tests: a multi-repo ProjectListWorkflow submitted through
UpdateConfig keeps both repos through validation, the written TOML and the
reloaded config, and still builds into a workflow carrying both; and the
workflow type registry GetConfig serves advertises Repos for
ProjectListWorkflow, which is what makes the web editor offer the field.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0155MTHf62Th1ZDQ6ejhb71y
@C-Hipple
C-Hipple merged commit 42d4a97 into main Jul 31, 2026
7 checks passed
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