Repository navigation
Move janitor's labeling routes onto HttpApi - #137
Merged
Merged
Conversation
The labeling group (listRepositories, getCatalog, getConfiguration, listActivity, listReconciliations, listAudit, getAiConsent and updateAiConsent) joins JanitorApi, and the cluster serves it from Ingress/Labeling.ts through HttpApiBuilder behind the API middleware. The repository-scoped reads and the consent write fail with RepositoryNotFound; listReconciliations declares no errors. Overview, consent, activity (including the row decode) and configuration infrastructure failures die in the handlers. The raw LabelingRoutes module and its test go, and Routes.ts no longer mounts them.
The workspace loads repositories, the catalog, the configuration and AI consent through api.labeling, and sets consent through updateAiConsent; the activity journal pages through listActivity. Each command maps RepositoryNotFound to "This repository is unavailable." and falls back to its own copy with orElseSucceed. labeling-wire.ts goes. Its importers read the domain schemas instead: RepositoryOverview and ReconciliationRecord from Labeling/Reconciliation, the configuration records from Labeling/Policy/Configuration, and so on. The display helpers move beside their types: labelName, policyName and describeRevision to Configuration, describeOutcome to Program, and describePlan to Reconciliation; describeLocation was a copy of formatNodeLocation. The editor's free-JSON ProgramSource and formatSource move to policy-source/format, and TestSubject and TestCandidates to the test bench.
The fixtures were typed against the deleted labeling-wire copies. Brand their ids and revisions with the domain constructors and build catalog entries with FactDescription.make.
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.
The last group,
labeling, moves ontoHttpApi, and the raw Labeling routes go with it.Cluster
Api/Labeling.tsdefines the group:listRepositories,getCatalog,getConfiguration,listActivity,listReconciliations,listAudit,getAiConsentandupdateAiConsent. The activity query struct stays inline.Ingress/Labeling.tsserves it throughHttpApiBuilder.group, merged inRoutes.ts.RepositoryNotFound.listReconciliationsdeclares nothing, since it has norequireRepositorycheck.LabelingOverviewError,AiConsentError, theActivityReaderfailures (SQL, row decode, configuration) andLabelingConfigurationErrordie in the handlers. No service signatures change.Ingress/LabelingRoutes.tsandtest/Ingress/LabelingRoutes.test.tsare deleted. The authenticated raw-router middleware now wraps only the live routes.Web
FetchRepositories,FetchCatalog,FetchDetail,FetchConsent,SetConsent) and the activity journal'sFetchActivitycallapi.labeling.*.RepositoryNotFoundbecomes "This repository is unavailable." Everything else falls back to each command's own copy throughorElseSucceed.labeling-wire.tsis deleted, and its importers read@janitor/domain. The PR-review components getRepositoryOverviewfrom@janitor/domain/Labeling/Reconciliation.labelName,policyNameanddescribeRevisiongo toLabeling/Policy/Configuration.describeOutcomegoes toLabeling/Policy/Program.describePlangoes toLabeling/Reconciliation.describeLocationwas a copy of the existingformatNodeLocation, so callers use that instead.ProgramSourceandformatSourcemove topolicy-source/format.ts, andTestSubjectandTestCandidatesmove totest-bench.ts.Checks
At
9f3d7a8, in the Nix shell:vp check: 0 errors, 333 warnings.vp test: 132 files, 822 tests pass.9f3d7a8updates the fixtures in 8 web test files (routing,ai-prompt,policy-editor,pull-request-review-transcript,pull-request-reviews,repository-switcher,rule-editorandworkspace). They now build ids and revisions with the domain.make(...)constructors, because they were typed against the old wire copies. No casts, assertions or new tests.Closes EFF-2523