Repository navigation
feat(discovery): onboard documentation sites from the doc-target property - #6
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Adds SitePath, DiscoveryFailed, Token, DocTarget, GitHubApi, GitHubProjectSource and the per-build factory seam, and binds ProjectSourceFactoryInterface in ConfigProvider so site:build can read the doc-target repository property and find onboarded projects. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Rename the discovery failure so it ends in Exception and move it into the root level Exception namespace, matching the fleet guard rule that any exception class be named *Exception and live in an Exception namespace segment. Behaviour is unchanged: the private constructor, the readonly reasonCode property and the three named constructors are identical, and every reference in source, tests and the plan source tree follows the rename. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
tyrsson
force-pushed
the
tyrsson-discovery-of-projects
branch
from
November 13, 2026 06:31
cade1df to
1e34cf6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Implements the discovery half of the aggregate site: an organisation is listed, each repository's
doc-targetcustom property is read, and the repositories that carry one become the projects the build renders. Onboarding a new documentation site is now one property write and nothing else.One commit,
702ea13d, on top of1.0.xat75a57e5e.Why this shape
doc-targetis the same custom property the CI workflow already targets, so there is one source of truth for "this repository publishes documentation" rather than a manifest that would drift. A repository without the property is not rendered; it simply never becomes a project.The HTTP boundary is deliberately split in two.
GitHubApiowns the request, the token and the status codes and decides nothing about meaning ("What an answer means is decided by the caller; this type only refuses it").GitHubProjectSourceowns the meaning, including the one asymmetry that matters: a404on the properties endpoint reads as "no property", not as a failure.ProjectSourceInterfacesits besideSource\SourceFactoryInterfaceand takes the same shape,create(SiteConfig). Both exist for the same reason: the organisation, the token variable and the cache directory are not known untilsite.jsonhas been read. The dependency runs discovery to source, not the other way round:SourceInterfaceconsumesDiscovery\Project, never the reverse.Verification
Run locally in the worktree at
702ea13d, tree clean and in sync with origin.core.autocrlfisfalse, soformat --checkis meaningful.mago lint --ignore-baselinemago format --checkmago analyzemago guard408 tests, 829 assertions, zero failures. No baseline entry was added and no
[[issues]]suppression was introduced for any new file.tasks.mdcheckboxes are left unticked and.specifyis untouched.Local Infection on this commit: MSI 97% and covered code MSI 97% against the 95 floor, 843 mutations. Two escaped mutants sit in the new code and both are structural no-ops:
DocTargetline 45 (a removedreturn nullfalls through to$property['value'] ?? null, which returns the same null) andGitHubApiline 85 (array_valuesover a JSON array, which always decodes to a list, kept because it enforces thelist<array<string, mixed>>type thatarray_merge(...$pages)relies on). Neither warrants a test that exists only to kill a mutant.Decisions the plan did not settle
https://api.github.com, rather than asite.jsonkey.site-config.schema.jsonhas no such key and adding one is a schema change, so it is left for a plan revision if a GitHub Enterprise target is ever wanted.BuildCommandand mapped to exit 2 with a diagnostic on stderr and no report written.SiteBuildkeeps@throws DiscoveryFailed, so the failure cannot be swallowed by a caller that does not handle it.SiteBuildFactorytakes aProjectSourceFactoryInterface, not aProjectSourceInterface, because a factory only ever receives aSiteConfigat build time.duplicate-slugfinding rather than being detected twice.GitHubApiandDocTargetare split to stay inside mago's class complexity, kan-defect and method-count thresholds. No threshold was raised.Spec
specs/001-aggregate-renderer/tasks.mdphase 5, US3, T064 to T070. Checkpoint: a new project appears in the next build after one property change and nothing else.Closes nothing; this is one phase of
001-aggregate-renderer.Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com