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

Check repo state instead of props when upgrading #1469

Merged
merged 2 commits into from Jan 20, 2020
Merged

Conversation

andresmgot
Copy link
Contributor

Description of the change

After #1455 I introduced a regression. When upgrading, if the repository can be auto-resolved, the properties of AppUpgrade are not being updated and the condition I introduced was always true, causing an infinity loop.

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.

Approving, but keen to understand why the test you added for the code you've deleted doesn't fail now?

@@ -93,7 +94,7 @@ class AppUpgrade extends React.Component<IAppUpgradeProps, IAppUpgradeState> {
repo &&
repo.metadata &&
repo.metadata.name &&
(prevProps.app !== app || prevProps.repo !== repo)
(prevProps.app !== app || prevRepo !== repo)
Copy link
Contributor

Choose a reason for hiding this comment

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

I had expected the test you added with 7b96684 to fail with this change, as it was added to verify that if the props.repo changes it fetches the data? Why is it not failing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In that test, state.repo is empty at the beginning. Then component gets updated with props.repo. componentDidUpdate is executed and the state is updated. Since prevRepo was empty and repo now contains the repo info, getDeployedChartVersion is executed.

@andresmgot andresmgot merged commit f4869fa into master Jan 20, 2020
@andresmgot andresmgot deleted the fixUpgrade branch January 22, 2020 10:42
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.

None yet

2 participants