-
Notifications
You must be signed in to change notification settings - Fork 97
feat(manifest): Loaded manifest includes all environment and group names #1897
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
feat(manifest): Loaded manifest includes all environment and group names #1897
Conversation
errs = append(errs, manifestErrors...) | ||
} else if len(environmentDefinitions) == 0 { | ||
} else if len(environments.AllEnvironmentNames) == 0 { |
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.
So this is the only behavior change, right?
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.
With this new data structure, I think this is the most robust way to test for this condition.
f52f757
to
f802337
Compare
…yName` `Environments` is not a great name doesn't add value compared to `map[string]EnvironmentDefinition`, but allows us to define `(e EnvironmentDefinitionsByName) Names()`. In most cases, this method also brings no value, as iterating over the map gives us the names anyway. But it simplifies some tests, as then no actual `EnvironmentDefinition` objects are required. By renaming, we can reuse the name `Environments` in the next commit.
…ectedEnvironments` This makes it clear what is contained here: the subset of environments from the manifest actually selected for use.
…the manifest This type includes the selected `EnvironmentDefinitions` as well as the names of all environments and groups.
f802337
to
9d2ce35
Compare
|
Why this PR?
This PR is an alternative to #1876 and this time adds all environment and environment group names seen during loading directly to the manifest data structure.
This PR is more robust because
manifest.Environments.SelectedEnvironments
is identical to the currentmanifest.Environments
, meaning it avoids the effort of having to explicitly deal withSkip
. However, a lot of effort had to be invested in updating the tests.What has changed?
The
Environments
field ofmanifest.Manifest
is now a struct of typemanifest.Environments
that holds selected environments as well as the names of all environments and environment groups seen during loading. This extra information will be used #1880 to emit a warning if an undefined environment or group is referenced.How does it do it?
The PR does some renaming and then simply adds the new type and updates tests. The actual change to production code is pretty small.
Best reviewed commit by commit.
How is it tested?
Existing tests are updated to include the new data structure, which holds information about the names of all environments and environment groups.
How does it affect users?
No effect on users.