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

Rearrange step schema #182

Merged
merged 2 commits into from Feb 25, 2019
Merged

Conversation

carolynvs
Copy link
Member

This moves a step's schema entirely under the mixin. So description and outputs are now under the mixin.

This makes it easier for the mixin to control the schema of the outputs. For example, helm outputs specify secret keys for where to find and publish secrets as outputs. Another mixin like exec, doesn't have outputs at all, and this lets it express that.

Moving description under, simply makes it cleaner and easier to deal with merging schemas.

I've done a sweep and updated all the docs and testdata to match the new schema.

@ghost ghost assigned carolynvs Feb 22, 2019
@ghost ghost added the review label Feb 22, 2019
@carolynvs
Copy link
Member Author

Heh, this PR is why I opened #180. 😀

Copy link
Member

@vdice vdice left a comment

Choose a reason for hiding this comment

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

LGTM!

children := s.Data[mixinName]
d, ok := children.(map[interface{}]interface{})["description"]
if !ok {
return "", errors.Errorf("mixin (%s) missing description", mixinName)
Copy link
Member

@vdice vdice Feb 22, 2019

Choose a reason for hiding this comment

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

Q: Wondering if step should be included in this and the error message below... mixin step (%s) missing..., etc.?

I'm thinking both for clarification and if/when a given mixin has multiple step entries for an action (well, perhaps the latter is a bad practice/rare... though I could perhaps see it occurring with exec). Then again, not sure how we'd identify which mixin step needed fixing if there were more than one step using the same mixin and missing a description...

Mostly thinking out loud here... feel free to ignore :)

Copy link
Member Author

Choose a reason for hiding this comment

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

For now it's a very shallow/poor yaml validation going on here. Let me spruce up that error message.

Once we have real schema validation being applied (which comes after being able to say what our schema is) then we can let that report back what's wrong. The errors coming out of that will give the line number of which step is incorrect.

@carolynvs carolynvs merged commit 66dad26 into getporter:master Feb 25, 2019
@ghost ghost removed the review label Feb 25, 2019
@carolynvs carolynvs deleted the rearrange-mixin-schema branch February 25, 2019 14:39
@carolynvs carolynvs mentioned this pull request Feb 27, 2019
4 tasks
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.

None yet

3 participants