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

feat: add 'skaffold inspect jobManifestPath' and 'skaffold transform-schema jobManifestPath' commands #8575

Merged
merged 1 commit into from
Mar 27, 2023

Conversation

aaron-prindle
Copy link
Contributor

fixes #8573

@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Merging #8575 (16b84ff) into main (290280e) will decrease coverage by 6.27%.
The diff coverage is 54.74%.

@@            Coverage Diff             @@
##             main    #8575      +/-   ##
==========================================
- Coverage   70.48%   64.21%   -6.27%     
==========================================
  Files         515      613      +98     
  Lines       23150    30689    +7539     
==========================================
+ Hits        16317    19707    +3390     
- Misses       5776     9505    +3729     
- Partials     1057     1477     +420     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/completion.go 13.04% <0.00%> (-1.25%) ⬇️
cmd/skaffold/app/cmd/config/list.go 65.21% <ø> (ø)
cmd/skaffold/app/cmd/config/set.go 88.72% <ø> (ø)
cmd/skaffold/app/cmd/config/util.go 54.28% <ø> (ø)
cmd/skaffold/app/cmd/credits.go 100.00% <ø> (ø)
cmd/skaffold/app/cmd/credits/export.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/deploy.go 40.90% <0.00%> (-12.94%) ⬇️
cmd/skaffold/app/cmd/generate_pipeline.go 60.00% <ø> (ø)
cmd/skaffold/app/cmd/inspect_modules.go 65.00% <ø> (ø)
cmd/skaffold/app/cmd/inspect_profiles.go 66.66% <ø> (ø)
... and 39 more

... and 391 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@aaron-prindle aaron-prindle marked this pull request as ready for review March 24, 2023 16:59
@aaron-prindle aaron-prindle added kokoro:force-run forces a kokoro re-run on a PR and removed !! do-not-merge !! kokoro:force-run forces a kokoro re-run on a PR labels Mar 24, 2023
@aaron-prindle aaron-prindle force-pushed the fix-8573-v2 branch 4 times, most recently from 13078b2 to 218dcf3 Compare March 27, 2023 17:51
@ericzzzzzzz ericzzzzzzz added the kokoro:force-run forces a kokoro re-run on a PR label Mar 27, 2023
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Mar 27, 2023
// Open our jsonFile
jsonFile, err := os.Open(inputFile)
if err != nil {
fmt.Println(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we return the err here? Or log it with log.Entry(context.TODO()).Error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, good catch. This now properly handles errors and has a test case related to this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also logs the error as well to stdout for users to know what happened

byteValue, _ := ioutil.ReadAll(jsonFile)

var result jobManifestPathList
json.Unmarshal(byteValue, &result)
Copy link
Contributor

Choose a reason for hiding this comment

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

This operation can return an error, if the inputFile is not a json file. I noticed that we fail silently, and the generated output is the same skaffold.yaml without the modifications. Should we also log the error from the unmarshal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, good catch. This now properly handles errors and has a test case related to this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also logs the error as well to stdout for users to know what happened

@aaron-prindle aaron-prindle merged commit 8460b1c into GoogleContainerTools:main Mar 27, 2023
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.

Add abillity to modify skaffold verify jobManifestPath
4 participants