-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[v2 refactoring proposal] Decouple the runner creation from v1 schema #6068
[v2 refactoring proposal] Decouple the runner creation from v1 schema #6068
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6068 +/- ##
==========================================
- Coverage 69.92% 69.29% -0.63%
==========================================
Files 481 482 +1
Lines 18342 18526 +184
==========================================
+ Hits 12825 12838 +13
- Misses 4562 4734 +172
+ Partials 955 954 -1
Continue to review full report at Codecov.
|
6dc89d8
to
7b04197
Compare
@nkubala gentle ping. |
23e38b1
to
cbf7630
Compare
rebased and merge conflict resolved. |
66481d7
to
c5846e3
Compare
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.
I see a few TODO
leftover in this PR, but I'm not sure they match up with the follow up work detailed in the description. if those aren't going to be addressed in this PR, can we leave a short note in the PR description for what needs to be done later?
I'm also feeling a bit strange about moving the type checking from the method signature into a simple typecast in the method - this seems brittle to me. as an example:
func targetArtifacts(opts config.SkaffoldOptions, configs []util.VersionedConfig) []*latestV1.Artifact {
var targetArtifacts []*latestV1.Artifact
for _, cfg := range configs {
for _, artifact := range cfg.(*latestV1.SkaffoldConfig).Build.Artifacts {
it might be better to abstract this away into Get
methods defined on the Pipeline
, similar to what we do in the RunContext
. or maybe this is just an intermediate step and this will disappear in the future 🤷
cmd/skaffold/app/cmd/runner.go
Outdated
|
||
if err := validation.Process(configs); err != nil { | ||
// TODO: yuwen Check v1 or v2. |
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.
should this be addressed in this PR?
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.
Maybe not, providing a v2 validation is not a small change and may deserve another PR.
The TODOs are to save some code reading effort for future work, like marks. It's not necessary though. Removed. The detail is in this doc. Per offline discussion, I'll leave it to you to determine how the refactoring should work and I'm only going to focus on the branch v2.
The interface is my refactoring proposal, and this PR shows the implementation details how that could be done. |
…erface util.VersionedConfig.
88136d1
to
f5c01ec
Compare
There is one small linter error but I think this is pretty much ready to merge after that |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
Related: #5673
Fixes #5797
Description
In runner creation, the schema is no longer bundled with v1 schema (latestV1.skaffoldConfig) but used the interface util.VersionedConfig.
All v1 commands are manually tested to make sure this PR does not break existing commands.
Follow-up Work (remove if N/A)
Distinguish v1 and v2 schema based on the in-use apiVersion in skaffold.yaml.