Skip to content

Conversation

@amrc-benmorrow
Copy link
Contributor

This implements pulling schema definitions from an external Git repo. It does this by adding a branch hooks facility to the Git server, meaning the schema loading logic must be implemented inside that service.

The alternative would be to make this a separate service, tracking the repos using change-notify. Such a service would have to track its own state in the ConfigDB and seems a bit overkill for this use case.

This is pulled in by service-api and we don't want a version conflict.
I want to implement notify/v2 for the git server and that requires
synchronising with the API.
The path-matching syntax has changed. It's no longer possible to match
all the tail of the URL.
These are equivalent to the native git-hooks mechanism but configurable
through the ConfigDB. For now at least hooks must be implemented within
the git server.
This gives a force-rerun strategy: remove and recreate the hook.
Update our config schema.
Immutable comparisons were failing because we were getting plain JS
objects included instead of immutable Records.
Hooks should not need to perform this step themselves.
We need this to set the schema source, but it isn't entirely reliable.
An auto-pull branch can still be pushed to, and in that case the
information will not have come from the remote. But I am assuming that
in such a case an admin has done this for a good reason.
Unlike the load-schemas image we don't chdir to the schemas directory.
This would affect the whole process.
I think previously we were not matching the full name, but a partial
match will cause problems. We are now matching only aganst the schema
path itself.
@amrc-benmorrow amrc-benmorrow self-assigned this Dec 1, 2025
@amrc-benmorrow amrc-benmorrow added enhancement New feature or request git labels Dec 1, 2025
@amrc-benmorrow amrc-benmorrow marked this pull request as ready for review December 1, 2025 15:57
@amrc-benmorrow amrc-benmorrow merged commit c615a66 into main Dec 2, 2025
1 check passed
@amrc-benmorrow amrc-benmorrow deleted the bmz/schema-pull branch December 2, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request git

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants