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(helm): Add Helm repo polling and caching #829

Merged
merged 5 commits into from
Oct 6, 2020

Conversation

jcavanagh
Copy link
Contributor

@jcavanagh jcavanagh commented Aug 6, 2020

  • Helm polling/caching/triggering
  • Models and etc. for Helm repository information

Relates to issue: spinnaker/spinnaker#4447

Related PRs:
spinnaker/echo#988
spinnaker/deck#8475
spinnaker/clouddriver#4773

@gal-yardeni
Copy link
Contributor

@ethanfrogers reminder to review it whenever you can!

@gal-yardeni
Copy link
Contributor

hi @ezimanyi -- since this PR is pending for a while, do you know anyone else that can help with reviewing it? Thanks!

@ethanfrogers ethanfrogers requested review from german-muzquiz and removed request for ethanfrogers September 14, 2020 19:25
@@ -36,7 +36,8 @@ dependencies {
implementation "com.sun.xml.bind:jaxb-core:2.3.0.1"
implementation "com.sun.xml.bind:jaxb-impl:2.3.2"

implementation "com.vdurmont:semver4j:3.1.0"
implementation "commons-io:commons-io"
implementation 'com.vdurmont:semver4j:3.1.0'
Copy link
Member

Choose a reason for hiding this comment

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

Seen this dependency introduced in multiple places. It should be added to kork/spinnaker-dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, this change doesn't actually use the semver4j library - this change is importing commons-io. However, I think standardizing on a semver library is a good thing.

Created: spinnaker/kork#784

The related echo PR did use that same semver4j library, and I can refactor that as well once there's a kork build for the above.

}

// Custom converter to deal with index file raw string responses
class StringConverter implements Converter {
Copy link
Member

Choose a reason for hiding this comment

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

Putting a class inside of the method seems like a bad move - maybe just make it an inner class of HelmConfig.


@ConditionalOnProperty("helm.enabled")
@ConfigurationProperties(prefix = "helm")
public class HelmProperties {}
Copy link
Member

Choose a reason for hiding this comment

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

Remove - unnecessary.

Optional<HelmAccount> account =
helmAccounts.accounts.stream().filter(it -> it.name.equals(partition)).findFirst();
if (!account.isPresent()) {
throw new IllegalStateException(
Copy link
Member

Choose a reason for hiding this comment

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

Please use the SpinnakerException family.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will change to ConstraintViolationException

- Helm polling/caching/triggering
- Models and etc. for Helm repository information
@jcavanagh
Copy link
Contributor Author

jcavanagh commented Sep 19, 2020

Thanks @robzienert and @german-muzquiz for the detailed feedback! I believe I have addressed everything.

Note that this build will fail until spinnaker/kork#784 is merged and bumped here, as the com.vdurmont:semver4j dependency version was moved out of this repo and into kork.

@jcavanagh
Copy link
Contributor Author

@robzienert Thanks for merging the kork change! Let me know if there's anything else you'd like to see changed in this PR.

@gal-yardeni
Copy link
Contributor

hi @jcavanagh, I tried to update your branch so we can merge it but it failed. Can you please take a look so we can actually merge this? thanks!

@jcavanagh
Copy link
Contributor Author

Weird build error, just going to retry it:
image

@jcavanagh
Copy link
Contributor Author

@gal-yardeni Build is happy again 🎉

@gal-yardeni gal-yardeni added the ready to merge Approved and ready for merge label Oct 6, 2020
@mergify mergify bot merged commit 7026ecb into spinnaker:master Oct 6, 2020
@mergify mergify bot added the auto merged label Oct 6, 2020
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.

5 participants