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

Before branching day: step 4 #3212

Conversation

danilo-gemoli
Copy link
Contributor

This is a tool that tries to automate the fourth step of phase "Before branching day" .
Check Centralized Release Branching and Config Management V3

/cc @jmguzik @droslean

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 20, 2022
return nil
}

func setMapIfNil[T any](x *map[string]T, y map[string]T) {
Copy link
Member

Choose a reason for hiding this comment

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

This is not a go idiomatic approach. I am not sure what you are trying to achieve here, but there should be an easier way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have factored this code out:

// m is a map of type map[string]T, where T is any
if m == nil {
  m = make(map[string]T)
}

that would be have otherwise replicated at least three times.
Happy to change it if you know a more idiomatic approach.

Copy link
Member

Choose a reason for hiding this comment

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

In the place you are defining the map you should create it instead. Then there will be no need to do this check. Also, you can just do the if nil then make it as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've defined them right after releaseConfig := ReleaseConfig{}, thanks!

return nil
}

func (b *ReleaseControllerConfigBumper) Marshall(releaseConfig *ReleaseConfig,
Copy link
Member

Choose a reason for hiding this comment

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

nit: the name of this method is not correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah you're right, even if marshalling is allowed as well, check here. Changing that would mean to modify files that are not strictly related with the purpose of this PR, I'm planning to open another one.

@danilo-gemoli danilo-gemoli force-pushed the feature/before-branch-day-tool-4 branch from 31ee67c to 9b7b0a1 Compare January 4, 2023 09:54
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 4, 2023

@danilo-gemoli: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 4, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 4, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danilo-gemoli, droslean

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [danilo-gemoli,droslean]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit ef7eda4 into openshift:master Jan 4, 2023
@danilo-gemoli danilo-gemoli deleted the feature/before-branch-day-tool-4 branch January 16, 2023 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants