Skip to content
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

Set a deployment's version with Halyard #201

Merged
merged 1 commit into from
Mar 6, 2017
Merged

Set a deployment's version with Halyard #201

merged 1 commit into from
Mar 6, 2017

Conversation

lwander
Copy link
Member

@lwander lwander commented Mar 6, 2017

This turned into more work than expected because

  1. The package containing logic to lookup versions lived with the deployment code (since that's the only place it was needed). This required moving some of the GCS logic into halyard-core.
  2. There was no way to load beans in the nodes of the YAML because they were constructed by Jackson either from HTTP requests or based on what was supplied in the halconfig. Supplying our ProblemSets with the application context to pass to any validation fixed this. This lets us recommend versions like so:
    versions

Copy link
Contributor

@jtk54 jtk54 left a comment

Choose a reason for hiding this comment

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

LGTM.

@@ -32,9 +34,16 @@
public class ConfigProblemSetBuilder {
private List<ConfigProblemBuilder> builders = new ArrayList<>();

@Getter
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens when you leave off the AccessLevel here?

Copy link
Member Author

Choose a reason for hiding this comment

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

It defaults to public. Everything in the core/config code has public getters & setters, it's only the CLI package where I need to be careful to delineate what to generate.

@@ -12,9 +12,10 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
Copy link
Contributor

Choose a reason for hiding this comment

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

On purpose?

Copy link
Member Author

Choose a reason for hiding this comment

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

Likely Intellij during the automatic refactor.

Copy link
Contributor

@danielpeach danielpeach left a comment

Choose a reason for hiding this comment

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

LGTM

@Parameter(
names = "--version",
required = true,
description = "Must be either a version number \"X.Y.Z\" for a specific release of Spinnaker, \"latest\" for the latest "
Copy link
Contributor

Choose a reason for hiding this comment

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

Drop for the latest at the end of the line here.


protected List<String> versionOptions(ConfigProblemSetBuilder psBuilder) {
VersionsService service = psBuilder.getContext().getBean(VersionsService.class);
return service.getVersions().getVersions().stream().map(Version::getVersion).collect(Collectors.toList());
Copy link
Contributor

Choose a reason for hiding this comment

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

getVersions().getVersions() is a little tough to read. Could the first be loadVersions?

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, but then you'd have two methods, one returning a Versions object via get, and another returning a list of Versions.Version objects via load, which is confusing.

@lwander lwander merged commit 118cfc4 into spinnaker:master Mar 6, 2017
@lwander lwander deleted the select-version branch March 6, 2017 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants