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

Add basic form to the upgrade flow #1218

Merged
merged 2 commits into from
Oct 15, 2019
Merged

Add basic form to the upgrade flow #1218

merged 2 commits into from
Oct 15, 2019

Conversation

andresmgot
Copy link
Contributor

Ref: #1182

This PR adds the basic form to the UpgradeForm component. Before this PR, DeploymentForm and UpgradeForm were independent components with a bunch of duplicated code. To avoid that, I have moved the common logic to a new component DeploymentFormBody so both components render that one and define its own particularities. This reduces the duplicated the code considerably.

Since DeploymentFormBody now supports the two different cases (a new deployment and upgrading), it can be considered as a "new" component (that's why this PR is so bulky).

@andresmgot andresmgot requested a review from absoludity October 14, 2019 15:53
Copy link
Contributor

@absoludity absoludity left a comment

Choose a reason for hiding this comment

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

Since DeploymentFormBody now supports the two different cases (a new deployment and upgrading), it can be considered as a "new" component (that's why this PR is so bulky).

It's a great change to DRY up the functionality between upgrade and install, but for the future, I think the bulk could be avoided and I could do a much better job reviewing this (ie. identifying between mechanical changes and actual reviewable changes), if it was 2 simple PRs as follows:

  1. Move of DeploymentForm -> DeploymentFormBody with new parent DeploymentForm - this wouldn't require any mental effort to review as it's mostly a mechanical change,
  2. Updating the UpgradeForm to use the DeploymentFormBody

Thanks!

defaultRequiredRBACRoles={{ update: this.requiredRBACRoles() }}
action="update"
resource={`Application ${releaseName}`}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

So this is why the apprepository rbac role was still required for upgrades? Or it wasn't? It's not clear why this is removed with this 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.

Yes, after your changes, it's no longer required to have RBAC permissions to upgrade an app here. We forgot to remove this then and while I was refactoring I removed that.

@andresmgot
Copy link
Contributor Author

It's a great change to DRY up the functionality between upgrade and install, but for the future, I think the bulk could be avoided and I could do a much better job reviewing this (ie. identifying between mechanical changes and actual reviewable changes), if it was 2 simple PRs as follows:
Move of DeploymentForm -> DeploymentFormBody with new parent DeploymentForm - this wouldn't require any mental effort to review as it's mostly a mechanical change,
Updating the UpgradeForm to use the DeploymentFormBody

Yes, sorry for that, most of this work was figuring out what was needed and identifying what I could get out of the DeploymentForm and what needed to stay there.

@andresmgot andresmgot merged commit d93a11e into master Oct 15, 2019
@andresmgot andresmgot deleted the basicUpgradeForm branch October 23, 2019 09:27
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.

2 participants