-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstraction layer for [setup.backends]
#421
Conversation
d5aebf8
to
2ea7d32
Compare
Where you have [setup] information, could you say:
Because the |
dd222e4
to
a0777e3
Compare
@triblondon updated output. A couple of things to note:
|
👍 |
@triblondon this is ready for review now. |
pkg/commands/compute/init_test.go
Outdated
@@ -21,6 +22,10 @@ func TestInit(t *testing.T) { | |||
t.Skip("Set TEST_COMPUTE_INIT to run this test") | |||
} | |||
|
|||
// TODO: Change back to "main" before merging PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@triblondon in order for the tests to show as passing I needed to use a PR branch for each of the starter kits we pull in.
So basically once this PR is approved, and all the starter kit PRs are approved (see: links below), then I'll need to coordinate merging both this PR and cut a new CLI release as quickly as possible after the fact.
- use latest
manifest_version
interface compute-starter-kit-rust-default#49 - use latest
manifest_version
interface compute-starter-kit-assemblyscript-default#21 - use latest
manifest_version
interface compute-starter-kit-javascript-default#7 - use latest
manifest_version
interface compute-starter-kit-rust-beacon-termination#16 - use latest
manifest_version
interface compute-starter-kit-rust-static-content#13
NOTE: with the exception of the rust starter kit they're all one line changes, so if you could also take a moment to approve those (when you have a chance).
@kailan adding you to the reviews in case Andrew is busy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with the UX here.
pkg/errors/errors.go
Outdated
// longer compatible with the current CLI version. | ||
var ErrIncompatibleManifestVersion = RemediationError{ | ||
Inner: fmt.Errorf("the fastly.toml contains an incompatible manifest_version number"), | ||
Remediation: "Update the `manifest_version` in the fastly.toml and refer to https://developer.fastly.com/reference/fastly-toml/#setup-information", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Integralist I need to update this message so it points to the next CLI changelog that this code will be released under.
This is actually a complex change because we need to do a bunch of work that is done by the custom Version type when calling toml.Unmarshal(). The reason we have to duplicate that work is because we can find ourselves in a position where toml.Unmarshal will error if given a toml file with a structure not supported by the CLI code, and so in order to provide a good remediation to the user we need to first identify the manifest_version separate from a full unmarshal of the data.
b07b52f
to
1d38b46
Compare
* update the [setup] structure to reflect latest interface Latest interface: fastly/Developer-Portal#852 * update `manifest_version` to what will become the latest * Switched from 'prompt' to 'description' as per the CLI implementation i.e. fastly/cli#421 (comment)
NOTE: The below screenshots aren't the final product. For example they will include language in the displayed user messages that will likely have been updated as part of a code review.
Scenario: existing service
If you set a Service ID into the
fastly.toml
file, we will not validate the service for missing backends, nor will we prompt the user to create any backends...Scenario: new service
If no Service ID, then we'll prompt the user to create a service, including any backend resources required.
In the case of
[setup]
the user will be prompted for backends to be created that align with that configuration...If there is no
[setup]
configuration, then the user will be prompted for at least one backend (more can be added)...Lastly, if the user doesn't enter any information, then an originless backend will be created...