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

Release charts update cmd #464

Merged
merged 14 commits into from
Aug 12, 2024

Conversation

nicholasSUSE
Copy link
Contributor

@nicholasSUSE nicholasSUSE commented Aug 2, 2024

Issue:

#446

Solution:

After implementing: rancher/charts-build-scripts#145

This is the integration between:

  • charts-build-scripts command release
  • ecm-distro-tools command release update charts

Result example:

  • target chart pulled from dev branch to the current branch
  • changes staged and committed.

Extra

Implemented auto-completion for the 3 arguments on the command:

release update charts <branch> <chart> <version>
  • <branch> has 2 options: 2.8 and 2.9
  • <chart> will auto-complete all available charts in the repo.
  • <version> will check the state.json file generated from the list command, look in real-time for available release versions, and auto-complete that.

This extra is very very useful!

@nicholasSUSE nicholasSUSE force-pushed the release-charts-update-cmd branch from b2a785f to ea03c74 Compare August 5, 2024 22:51
@nicholasSUSE nicholasSUSE marked this pull request as ready for review August 5, 2024 22:52
cmd/release/cmd/update.go Outdated Show resolved Hide resolved
release/charts/charts.go Outdated Show resolved Hide resolved
@nicholasSUSE nicholasSUSE requested a review from tashima42 August 7, 2024 16:07
release/charts/arguments.go Outdated Show resolved Hide resolved
release/charts/arguments.go Outdated Show resolved Hide resolved
release/charts/arguments.go Outdated Show resolved Hide resolved
release/charts/arguments.go Outdated Show resolved Hide resolved
release/charts/arguments.go Outdated Show resolved Hide resolved
release/charts/charts.go Outdated Show resolved Hide resolved
@nicholasSUSE nicholasSUSE force-pushed the release-charts-update-cmd branch from e253f9a to 4d16e09 Compare August 7, 2024 19:57
@nicholasSUSE nicholasSUSE force-pushed the release-charts-update-cmd branch from d227123 to 24523a8 Compare August 7, 2024 20:02

var branch, chart, version string
var found bool
var err error
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be a problem when an error is checked and the action is not to return which leaves this value potentially untouched on a subsequent check causing issues. Let's not define a catch-all error value here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented

@@ -0,0 +1,132 @@
package charts
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the context for the name arguments? If it's related to the command(s) being ran, that's an implementation leak and should be renamed to represent the business logic and now how the logic is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented a fix from what I could at understand at:
"changing naming strategy from arguments.go -> chart_management.go"
Commit.


// BranchArgs will return the list of available branch version lines
func BranchArgs() []string {
return []string{"2.9", "2.8"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be part of configuration to avoid code changes when things change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implementing

@@ -3,7 +3,10 @@ package cmd
import (
"context"
"errors"
"fmt"
"log"
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove this in favor of regular CLI outut. We don't have anything consuming these logs and they're created at the time of execution so their timestamp values don't give us any extra value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented

@nicholasSUSE nicholasSUSE mentioned this pull request Aug 9, 2024
@nicholasSUSE nicholasSUSE requested a review from briandowns August 9, 2024 23:50
@nicholasSUSE nicholasSUSE merged commit 5f7ffe5 into rancher:master Aug 12, 2024
2 checks passed
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.

4 participants