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

Build improvements #623

Merged
merged 14 commits into from Apr 19, 2019
Merged

Build improvements #623

merged 14 commits into from Apr 19, 2019

Conversation

astefanutti
Copy link
Member

No description provided.


func RegisterStep(steps ...Step) {
for _, step := range steps {
StepsByID[step.ID()] = step
Copy link
Contributor

Choose a reason for hiding this comment

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

now that the id has a real meaning wondering if we need to add some tests/check to avoid overriding a step by mistake

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I thought about it but got somehow a bit lazy 🙈. I guess we can fail-fast and panic because step overriding should not happen.

Copy link
Contributor

Choose a reason for hiding this comment

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

yep but a test would help too :) just to avoid to find the problem at runtime

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've added panicking and unit testing, and updated the builder integration tests to cover all the packages.


var Steps = steps{
Publisher: builder.NewStep(
"publisher/s2i",
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we should find a better naming convention for steps IDs like s2i/publisher to reduce the risk of overriding steps f

Copy link
Contributor

Choose a reason for hiding this comment

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

@astefanutti wondering if you have time to fix this too before merging

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, better doing it while we are at it.

Copy link
Member Author

Choose a reason for hiding this comment

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

The step IDs are now generated from the structs and automatically set on each step with reflection.

@astefanutti astefanutti merged commit c52a052 into apache:master Apr 19, 2019
@astefanutti astefanutti deleted the pr-30 branch April 19, 2019 07:18
@nicolaferraro
Copy link
Member

Great work! 👍

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