Repository navigation
2026-11-21 bundle: TR-112b schema apply, TR-112c non-root images, TR-116 repo names - #1126
Merged
Merged
Conversation
…SCHEMA_MODE `resource-explorer schema apply` runs the registry schema setup once, counts the statements, writes a one-row schema_version marker (hash of the schema-defining code) and prints "schema ready · N statements · elapsed". A second run finds the marker, sends no DDL and prints the same line. It uses the same database URL as web, so ?options=-csearch_path is kept. RE_SCHEMA_MODE=auto (default) is unchanged. external never runs DDL: it checks the marker and raises SchemaNotReady with the instruction to run schema apply. The entrypoint gains a schema-apply role. A Postgres advisory lock serialises concurrent applies. ProjectRegistry's constructor signature is unchanged (a test pins it). Tests run against a throwaway Postgres (RE_SCHEMA_TEST_PG_URL); they skip without it, so none can reach a shared registry. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ith GID 0 Written paths (data dir, HOME, model cache) are group 0 with g=u and HOME is set explicitly, so the same image runs as trellis (1000:1000, what compose uses, unchanged) and as a random UID with GID 0 (OpenShift restricted-v2). docker/proof-nonroot.sh runs both images both ways: health, a write to every written path, ports at or above 1024, and for RE schema-apply twice then web in RE_SCHEMA_MODE=external. Stacked on the TR-112b branch. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…pe and upgrade notes The version hash followed only self. attributes and registry.py assignments, so a change to open_data STATEMENTS or ADD_REPO_SLUG_COLUMN, survey_report.ANNOTATION_TYPES_REGISTRY or org_importer._url_to_slug left it unchanged. It now follows imports (module level and inside methods) and the module-level definitions they reach, in a new schema_fingerprint module. Tests: each of those moves the hash; docstrings and comments do not. Docs and SchemaNotReady say external mode covers the registry only (four stores still run their own DDL; TR-115) and that rolling upgrades rely on additive migrations. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…, from its URL The SCL was named from the registry's display name, which depends on how the repository was registered: the onboarding wizard stores the bare repo name, the discovery and org-import paths store GitHub's full_name. One helper now derives owner/repo from the URL (https, ssh, ssh://, trailing slash, .git) and the publisher's create uses it, falling back to the registered name only when the URL has no owner and repo. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
open_for_schema_apply builds the instance with cls.__new__ and _construct (schema_mode="apply"); __init__ keeps its signature and calls _construct. The mode no longer lives on ProjectRegistry, so a MagicMock'd ProjectRegistry class (the scheduler and scouting tests) cannot leak into a real constructor, and two threads cannot see each other's mode. Tests: a patched ProjectRegistry class, two threads with their own modes, and the constructor signature pin. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ne off github.com A query or fragment no longer stays in the name, and a non-github.com host (a GitLab subgroup path, say) gives None so the publisher falls back to the registered name instead of publishing a wrong owner/repo. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
The environment value is validated against auto and external only, so "apply" is reachable only through open_for_schema_apply's parameter. A web start with RE_SCHEMA_MODE=apply used to run neither the setup nor the marker check. Test: the environment value apply raises a ValueError naming auto and external, and open_for_schema_apply still works. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
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.
2026-11-21 bundle: TR-112b schema apply, TR-112c non-root images, TR-116 repository names
Two branches, merged with merge commits onto
main(b3d9c69). The bundle's tree (3a2b2727) is byte-identical to the tree gate b481 tested.TR-112b:
resource-explorer schema applyandRE_SCHEMA_MODEresource-explorer schema applybuilds the registry schema once, then printsschema ready · <n> statements · <elapsed>. A second run sends no DDL.schema_versionmarker holds a fingerprint of the schema-defining code. That code includes what_init_schemaimports, such asopen_data.schema, the annotation types and the slug helper. A change to any of it moves the fingerprint.RE_SCHEMA_MODE=externalnever runs DDL. It refuses withSchemaNotReadywhen the marker is missing or out of date.autois unchanged.open_for_schema_apply, never held as class state.applyis accepted only from that command, never from the environment.TR-112c: RE and EA images run as an arbitrary UID with GID 0
g=u, and HOME is set.trellis(1000:1000).1000680000:0:TR-116: a repository's SourceControlLibrary name is
owner/reporepo; discovery and org import storedowner/repo.repo_display_name(url), derivesowner/repofrom the URL and drops.git,?queryand#fragment.git@host:owner/repo,ssh://and token URLs.Nonefor a host other than github.com, and the publisher then falls back to the registered name.Verification
Signed-off-by.Merge with a merge commit (not squash). Deploying RE 8813 is a separate step.
🤖 Generated with Claude Code