Skip to content

feat(hub): configure repository build workflows - #319

Merged
weastler merged 4 commits into
build/hub/newfrom
weastler-configurable-hub-build-workflows
Nov 20, 2026
Merged

weastler merged 4 commits into
build/hub/newfrom
weastler-configurable-hub-build-workflows

Conversation

@weastler

Copy link
Copy Markdown
Contributor

Why

Hub currently imports Builds only from replica.yml. Repositories such as Mini-Foundry already publish through a different top-level workflow, so Hub ignores those runs even when they produce compatible artifacts.

What changes

Repositories can select build workflows with builds.workflows in .github/replica.json on their actual default branch. Webhook imports and recovery use the same validated selection from a pinned default-branch commit. Explicit selections replace the legacy workflow; omitted configuration keeps it. Existing prototype branches need no configuration update.

Hub rejects invalid or symbolic-link configuration instead of choosing another publisher. Existing Build ownership, artifact validation, and screenshot matching remain unchanged. The build action accepts the new field alongside Hub and template metadata without including it in packaged templates. The guide includes Mini-Foundry's publish-proto.yml caller example.

Live GitHub delivery and hosted Mini-Foundry publishing have not been verified. This change does not deploy Hub or activate downstream workflows.

weastler and others added 2 commits November 19, 2026 15:31
Read build workflow selection from the repository default branch for webhook imports and recovery, preserving legacy defaults and immutable Builds.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reject symbolic-link configuration sources before GitHub dereferences their contents, and distinguish missing files from provider failures at a pinned revision.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@weastler
weastler requested review from a team and nshki as code owners November 19, 2026 23:47
Copilot AI adaptive review requested due to automatic review settings November 19, 2026 23:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Workflow-selection handling can leave builds permanently unfinished and miss screenshot recovery, while synchronous GitHub lookups risk exceeding the webhook acknowledgement deadline.

5 open issues
What changed in this PR

Enables Hub to import compatible Builds from repository-selected GitHub Actions workflows instead of only replica.yml.

Changes:

  • Validates workflow selections from configuration pinned to the repository’s default-branch commit.
  • Applies selections across webhook intake, import workers, and recovery discovery.
  • Adds build-action compatibility, documentation, and regression coverage.
File Description
hub/​server/​workers/​github-recovery.test.ts Tests selection refresh between recovery polls.
hub/​server/​utils/​read-build-workflow-paths/​index.ts Validates workflow paths and legacy defaults.
hub/​server/​utils/​read-build-workflow-paths/​index.test.ts Covers valid selections and invalid configuration.
hub/​server/​routes/​api/​github/​webhooks/​create-github-webhook-route-dependencies/​index.ts Filters connected repositories’ workflow events by selection.
hub/​server/​routes/​api/​github/​webhooks/​create-github-webhook-route-dependencies/​index.db.test.ts Tests webhook selection and failure handling.
hub/​server/​repositories/​repository-access/​find-connected-github-repository/​index.ts Adds a connected-repository lookup.
hub/​server/​integrations/​github/​create-github-actions-client/​index.ts Reads pinned configuration and discovers selected workflows.
hub/​server/​integrations/​github/​create-github-actions-client/​index.test.ts Covers configuration reads, safety checks, and discovery.
hub/​server/​index.ts Wires configuration reads into webhook handling.
hub/​server/​domains/​github-builds/​prepare-github-workflow-run-build/​index.ts Checks runs against selected workflow paths.
hub/​server/​domains/​github-builds/​import-github-workflow-run/​types.ts Extends the importer’s client contract.
hub/​server/​domains/​github-builds/​import-github-workflow-run/​index.ts Loads workflow selection before preparing imports.
hub/​server/​domains/​github-builds/​import-github-workflow-run/​index.db.test.ts Tests custom callers and shared Build behavior.
hub/​server/​domains/​github-builds/​constants.ts Removes the fixed workflow-path constant.
hub/​docs/​github-actions-builds.md Documents selection, compatibility, and recovery behavior.
actions/​build/​scripts/​validate-templates/​index.test.mjs Tests build configuration acceptance and metadata exclusion.
actions/​build/​scripts/​validate-templates/​index.mjs Validates builds without packaging it as template metadata.
.github/​extensions/​replica-prototype/​discover-hub/​index.test.mjs Confirms Hub discovery tolerates build selection metadata.

Review effort: Max (adaptive)

Comment thread hub/docs/github-actions-builds.md Resolved
weastler and others added 2 commits November 19, 2026 16:54
Keep provider reads out of webhook acknowledgements, stop deselected unfinished Builds, and recover screenshots per contributing run without changing dist ownership. Document compatible action pins.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Check the named foreign-key constraint and retained Build references instead of a PostgreSQL-version-specific SQLSTATE.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@weastler
weastler merged commit 865ac2f into build/hub/new Nov 20, 2026
51 checks passed
@weastler
weastler deleted the weastler-configurable-hub-build-workflows branch November 20, 2026 01:35
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