Conversation
15f7741 to
de2bc1e
Compare
|
Hi @scottrigby 👋 Could you please review this PR when you have some time? You mentioned recently #535 (comment) about using Chart Releaser as well, not sure if you'd like suggesting it as part of this or as a separate PR. Thanks, much appreciated! |
scottrigby
left a comment
There was a problem hiding this comment.
Thanks for the PR. This is something I planned to get to very soon. In general, have you seen https://github.com/helm/charts-repo-actions-demo?
.github/workflows/helm.yml
Outdated
| - '!chart/README.md' | ||
| - '!chart/.helmignore' |
There was a problem hiding this comment.
Changes to any file within the chart – including the README etc – should trigger linting. The main reason is chart version packages must be immutable, and linting checks version bumping among other things.
There was a problem hiding this comment.
Ah. I have seen varying opinions on whether or not a readme change justified a version bump. Yall are the boss and i have no opinion on it haha. I will fix.
.ct.yaml
Outdated
| @@ -0,0 +1,4 @@ | |||
| helm-extra-args: --timeout 600s | |||
| charts: chart | |||
There was a problem hiding this comment.
I would recommend changing this:
| charts: chart | |
| chart-dirs: chart | |
| - charts |
Mainly because the charts option "disables changed charts detection and version increment checking". Whereas chart-dirs retains those checks, which are very useful.
I would change the current chart dir to be a charts dir, and inside add another directory for the chart. Like:
.
└── charts
└── hub
This may seem redundant but it makes path-based checking easier. This is what I was planning to do when I opened a PR for this.
Alternatively, without changing the file tree you could set chart-dirs: "." (see helm/chart-testing#71), but you would then need to exclude all the files in the git repo root if you don't want to trigger Action runs for every change.
There was a problem hiding this comment.
If you have a moment to test yourself, maybe you will be able to come to another verdict than i was able to! I have found the chart-dirs option to be extremely inconsistent and buggy when specifying anything other than charts. I attempted to use chart-dirs and point to the current directory, which failed catastrophically. I was not going to move the chart directory without the express approval of yall. Now that it is suggessted I can take care of that.
All of that said, if you know some secret about the chart-dirs function that all of my guys are oblivious to.. please drop some knowledge on me!
There was a problem hiding this comment.
I haven't seen an issue for that in the chart-testing repo, but would appreciate one if you can remember problems you've seen. As an example, I can say that this does work for the stable and incubator chart repos – this is the ct config file where those dirs are defined: https://github.com/helm/charts/blob/master/test/ct.yaml#L3-L5
| @@ -0,0 +1,41 @@ | |||
| name: Helm CI | |||
There was a problem hiding this comment.
I'd rename this file from helm.yml to something more specific, like chart-testing.yaml, since as @tegioz said we also want to add another workflow for chart-releaser (I'll do that in a separate PR).
.github/workflows/helm.yml
Outdated
| @@ -0,0 +1,41 @@ | |||
| name: Helm CI | |||
| on: | |||
| push: | |||
There was a problem hiding this comment.
Don't we instead only want to run this check when pushing to a PR fork/branch? If so, the pull_request config below should suffice. That is the most common workflow I've seen.
There was a problem hiding this comment.
Ive seen unfortunate merges where master does not reflect the pr branch after merge. It was added as a "does no harm but can potentially help". Ill remove it :)
.github/workflows/helm.yml
Outdated
| - '!chart/.helmignore' | ||
| pull_request: | ||
| paths: | ||
| - 'chart/**' |
There was a problem hiding this comment.
This is interesting. Chart-testing already does an internal check for changed charts, but might be nice in that it would limit unneeded Action runs that just say "no chart changed detected". Would you be interested in making a PR to add this to the helm actions demo here? 😄
There was a problem hiding this comment.
That is exactly the purpose. As github is undoubtedly going to enforce minutes on actions sooner rather than later, this is just a safe default
There was a problem hiding this comment.
Love it. And if you feel motivated I'd support a PR to add this to the lint-test workflow in the Helm Actions demo repo 😉
| changed: ${{ steps.lint.outputs.changed }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v2 |
There was a problem hiding this comment.
For the changed check, it's important to get git history, like this:
| uses: actions/checkout@v2 | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 |
See https://github.com/helm/charts-repo-actions-demo/blob/master/.github/workflows/lint-test.yaml#L11-L12 for reference.
There was a problem hiding this comment.
I have done it a significantly more verbose way in the past. Good catch - I am going to have to go clean up a few workflows because of this
There was a problem hiding this comment.
Same here 😄 You can see we updated it recently helm/charts-repo-actions-demo#25 Props to @davidkarlsen for initially pointing out the cleaner syntax in checkout action v2.
.github/workflows/helm.yml
Outdated
| uses: helm/[email protected] | ||
| with: | ||
| command: install | ||
| config: .ct.yaml No newline at end of file |
There was a problem hiding this comment.
I am a huge proponent of pre-commit. Would you be opposed to me adding a minimal pre-commit config to the repo as well? (this would ensure the aforementioned is a non-issue, and could ensure things like sign offs are done)
There was a problem hiding this comment.
I think this is up to @mattfarina, @tegioz and @cynthia-sg as maintainers of this project. I don't have an opinion.
Though this can also be caught in CI, and maybe it should? I haven't checked if the GitHub Superlinter Action does newline at EOF checks, but may be worth looking into.
There was a problem hiding this comment.
I think it's better if all this kind of checks are centralized in CI.
.github/workflows/helm.yml
Outdated
| outputs: | ||
| changed: ${{ steps.lint.outputs.changed }} |
There was a problem hiding this comment.
Are you adding this because you have separated test into its own job? Just a note that this isn't necessary if you keep these combined into a single lint-test job. Combined may also be a little faster as well, and less repeated step definitions.
There was a problem hiding this comment.
I initially had this in the same workflow as the ci.yml file. Fixing :)
cdcced9 to
85e0287
Compare
|
@dirtycajunrice Looks like DCO is failing because you accepted my commit suggestion. This is a common problem on DCO-required repos. I made this browser plugin to help if you're interested: https://github.com/scottrigby/dco-gh-ui You could also just paste your signoff line into the UI, but this helps automate that, make sure it's properly formatted etc. |
charts/hub/ci/ct-values.yaml
Outdated
| @@ -0,0 +1 @@ | |||
| fullnameOverride: hub No newline at end of file | |||
There was a problem hiding this comment.
Ah but also, I just said hub as an example, I see the chart name is artifact-hub. I personally think we should keep the chart directory name the same as the chart name for clarity to end users.
At risk of bikeshedding here, this brings up a question to me: should the chart name be artifact-hub or artifacthub to be consistent with the github org name? This is probably a question for @mattfarina, @tegioz and @cynthia-sg as they maintain this project.
There was a problem hiding this comment.
We can rename it to artifacthub, sounds good to me 👍
There was a problem hiding this comment.
to condense replies: All above issues are resolved (i believe). I also fixed the secret to match the newer template of host for postgresql. I changed the name of the chart to artifacthub as decided, and fixed the commit issue. I leave the Resolve conversation buttons to the creators so i dont step on any toes. Lemme know if you see anything else!.
Signed-off-by: Nicholas St. Germain <[email protected]>
Signed-off-by: Nicholas St. Germain <[email protected]>
Signed-off-by: Nicholas St. Germain <[email protected]>
Signed-off-by: Nicholas St. Germain <[email protected]>
Signed-off-by: Nicholas St. Germain <[email protected]>
Co-authored-by: Scott Rigby <[email protected]> Signed-off-by: Nicholas St. Germain <[email protected]>
Signed-off-by: Nicholas St. Germain <[email protected]>
…and bump Chart.yaml Signed-off-by: Nicholas St. Germain <[email protected]>
…and bump Chart.yaml Signed-off-by: Nicholas St. Germain <[email protected]>
60c9069 to
0898cc4
Compare
Signed-off-by: Nicholas St. Germain <[email protected]>
Signed-off-by: Nicholas St. Germain <[email protected]>
cmd/hub/Dockerfile
Outdated
| USER hub | ||
| WORKDIR /home/hub | ||
| COPY --from=backend-builder /hub ./ | ||
| COPY --from=backend-builder /charts/artifacthub ./ |
There was a problem hiding this comment.
Could you please leave this one as /hub? This is one of the cmd names, not the chart, and that path is where the resulting binary is located. Otherwise the binary won't be copied when building the images. Thanks!
There was a problem hiding this comment.
@tegioz That was a mass sed casualty. Fixing now.
Signed-off-by: Nicholas St. Germain <[email protected]>
|
Regarding the chart renaming, there are some more things we may need to update (and I was wondering if we really should change it now as part of this PR):
Maybe we can just step back and leave the chart renaming for a different PR if we really want to go ahead with it and think about all the implications carefully. I should have thought about all of this yesterday before agreeing to the name change, my bad. |
|
Other than that everything looks great! So if we go back to naming the chart Thanks for your work @dirtycajunrice 👍 |
…itespace / end-of-files lint on the repo Signed-off-by: Nicholas St. Germain <[email protected]>
Signed-off-by: Nicholas St. Germain <[email protected]>
|
Actually that is correct. What we would want to do before we name change is make a release where we mark the old name |
|
Could you please revert the mass new line change commit? It has broken some tests in the frontend as some snapshots don't match anymore. Thanks! |
|
@tegioz oop went to sleep after and didnt wait for the tests. Yeah ill revert and exclude the ui |
…iling-whitespace / end-of-files lint on the repo" This reverts commit 09086f6 Signed-off-by: Nicholas St. Germain <[email protected]>
Signed-off-by: Nicholas St. Germain <[email protected]>
Signed-off-by: Nicholas St. Germain <[email protected]>
fixes #535
Separated workflow to allow filtering trigger by file changes without needing multiple step workarounds