Move Environment Templates out of store into environmenttemplates and templatepg - #320
Merged
Merged
Conversation
api reads Templates through EnvironmentTemplatesReader and writes them through the EnvironmentTemplates service; Session creation resolves its Template through the Reader. cmd/server wires templatepg. The store Template operations, types and tests are deleted.
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.
Part of #1 (store layering), PR 9: Environment Templates move out of
store.environmenttemplatesdomain package: the Template vocabulary, input and list rules, aServicefor create/update/delete, andStorage/Readerports.Reader.Resolvereturns the decrypted configuration used at Session creation.persistence/postgres/templatepg: the PostgreSQL adapter. It seals the setup and initial files with the credential key, and it records write audits in the same transaction viaauditpg. With no confidential fields, no key is needed.EnvironmentTemplates(service) andEnvironmentTemplatesReader(adapter) Dependencies fields, strict fakes, and the templates error writer.cmd/server: wirestemplatepg.New(units, credentialKey)andenvironmenttemplates.NewService.store:environment_templates.go, the template-onlyenvironment_plugins.go/environment_skills.go, and their tests. Coverage moved toenvironmenttemplates/templatepg.Behaviour change: when the credential key is missing, writing or resolving a Template with encrypted setup or files now returns 503
credential_storage_unavailableinstead of 500. Get and List still work without a key.Checks on the final head (2415c42 + 2):
go build ./...andgo vet ./services/core/...across the whole moduleenvironmenttemplatesandtemplatepgin full;apiandcmd/serverstore:-runonly (the conflicted audit test files and the initial-files test)make openapi(no diff) andscripts/check-names.pyNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.