abcxyz / abc

Apache License 2.0
12 stars 3 forks source link

Require `--upgrade-channel` when installing a template from SHA #626

Closed drevell closed 2 months ago

drevell commented 2 months ago

Background: the manifest file has a field called upgrade_channel when the template is installed from a remote git repository. This field stores the branch or tag name from which upgrades will be pulled (or the magic string latest).

When the user installs a template from a specific SHA, like abc render github.com/foo/bar@1a2b3c4d5e6f..., the old behavior was to use latest for the upgrade_channel. This meant that future upgrades would be pulled from the latest semver tag at the time the upgrade command was run. This behavior turned out to be undesirable though because it's common for the user to actually want to upgrade from the main branch. The old behavior is confusing for the user because the upgrade command just goes haywire in a way that's hard to understand and debug.

The new behavior is to require the user to specify the --upgrade-channel flag in the case where they're rendering from a SHA. They can specify --upgrade-channel=main or --upgrade-channel=latest to clarify their intent. This avoids creating a latent problem that will surface later when an upgrade is attempted.