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

refactor: Add upgrade utility to handle all pipelines in a SkaffoldConfig #2582

Merged

Conversation

corneliusweig
Copy link
Contributor

@corneliusweig corneliusweig commented Jul 31, 2019

Before, the main pipeline and the profile pipelines had to be upgraded
manually, which was easy to forget.

In contrast to what is outlined in #2469, I didn't introduce a new interface. This is mainly because I want to avoid double json-cloning of the same objects. Instead, I opted for reflection which has the main drawback that it requires the exact same go-naming for Pipeline and Profiles[*].Pipeline. Given that this naming scheme is rather stable now, I think this is affordable.

Fixes #2469

@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #2582 into master will increase coverage by <.01%.
The diff coverage is 64.51%.

Impacted Files Coverage Δ
pkg/skaffold/schema/util/upgrade_pipelines.go 63.15% <63.15%> (ø)
pkg/skaffold/schema/v1beta8/upgrade.go 66.66% <66.66%> (+3.03%) ⬆️
pkg/skaffold/schema/v1beta9/upgrade.go 93.44% <66.66%> (+7.72%) ⬆️

@corneliusweig corneliusweig changed the title refactor: Add utility to upgrade all pipelines in a SkaffoldConfig refactor: Add upgrade utility handle all pipelines in a SkaffoldConfig Jul 31, 2019
@corneliusweig corneliusweig changed the title refactor: Add upgrade utility handle all pipelines in a SkaffoldConfig refactor: Add upgrade utility to handle all pipelines in a SkaffoldConfig Aug 1, 2019
Copy link
Contributor

@nkubala nkubala left a comment

Choose a reason for hiding this comment

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

makes sense to me, can you add some tests?

Before, the main pipeline and the profile pipelineshad to be upgraded
manually, which was easy to forget.

Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
@corneliusweig corneliusweig force-pushed the w/refactor-upgrade-machinery branch from de4012a to aee1696 Compare August 16, 2019 23:11
@corneliusweig
Copy link
Contributor Author

@nkubala Thanks for reviewing. My thinking was that this code is tested implicitly by the existing config upgrade tests, but it's better to make this explicit :). Do you think what I added is enough for that?

@nkubala nkubala added the kokoro:run runs the kokoro jobs on a PR label Aug 19, 2019
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Aug 19, 2019
Copy link
Contributor

@nkubala nkubala left a comment

Choose a reason for hiding this comment

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

thanks for doing this!

@nkubala nkubala merged commit 56264fe into GoogleContainerTools:master Aug 20, 2019
@corneliusweig corneliusweig deleted the w/refactor-upgrade-machinery branch August 20, 2019 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Schema upgrade mechanism fails to upgrade profiles by default
4 participants