Skip to content

Host target environment TOMLs in git instead of registry#3508

Merged
itowlson merged 1 commit into
spinframework:mainfrom
itowlson:target-envs-defs-in-git
May 13, 2026
Merged

Host target environment TOMLs in git instead of registry#3508
itowlson merged 1 commit into
spinframework:mainfrom
itowlson:target-envs-defs-in-git

Conversation

@itowlson
Copy link
Copy Markdown
Collaborator

This is the underlying code for #3504.

The corresponding Git repo is https://github.com/spinframework/spin-environments.

bikeshed go brrr

@itowlson
Copy link
Copy Markdown
Collaborator Author

I know this needs work on error messages and stuff but I want to agree the approach and iron out any other concerns before I invest too much time in those!

@itowlson itowlson force-pushed the target-envs-defs-in-git branch from f8d4d9f to 5d8d66e Compare May 13, 2026 02:40
Comment on lines 740 to +747
pub enum TargetEnvironmentRef {
/// Environment definition doc reference e.g. `spin-up:3.2`, `my-host`. This is looked up
/// in the default environment catalogue (registry).
DefaultRegistry(String),
/// An environment definition doc in an OCI registry other than the default
Registry {
/// Registry or prefix hosting the environment document e.g. `ghcr.io/my/environments`.
registry: String,
/// Environment definition document name e.g. `my-spin-env:1.2`. For hosted environments
/// where you always want `latest`, omit the version tag e.g. `my-host`.
id: String,
/// in the default environment catalogue (the `spin-environments` repo, `env` directory).
Catalogue(String),
/// An environment definition doc HTTP URL
Http {
/// The environment document URL e.g. `https://github.com/me/environments/blob/main/target-envs/spin-up.3.6.toml`.
url: String,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, explicit registry refs will break. I can either put them back or we can roll this into a 4.0.1 and pretend it's part of the 4.0 family of breaking changes.

Default registry refs will NOT break because all existing default registry envs will be in the repo, and I translate syntax for compatibility.

Copy link
Copy Markdown
Collaborator

@fibonacci1729 fibonacci1729 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Signed-off-by: itowlson <ivan.towlson@fermyon.com>
@itowlson itowlson force-pushed the target-envs-defs-in-git branch from 5d8d66e to b794927 Compare May 13, 2026 22:38
@itowlson itowlson enabled auto-merge May 13, 2026 22:39
@itowlson itowlson merged commit fa7b22a into spinframework:main May 13, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants