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

Update CI to fix error of "ct lint" command #243

Merged
merged 3 commits into from
Nov 11, 2023
Merged

Conversation

kota2and3kan
Copy link
Collaborator

@kota2and3kan kota2and3kan commented Nov 9, 2023

Description

This PR fixes the following two issues.

Error of ct lint command in the CI

At this time, the helm lint command that is called in the ct lint command fail as follows.

>>> helm lint charts/scalardb-analytics-postgresql --values charts/scalardb-analytics-postgresql/ci/scalardb-analytics-postgresql-ct-values.yaml --timeout 300s
Error: unknown flag: --timeout
Error: failed linting charts: failed processing charts

The root cause is the ct command cannot treat extra args properly. In other words, ct lint command passes the invalid option --timeout to the helm lint command. The --timeout is supported in helm install or helm uninstall etc. But, helm lint does not support --timeout option. So, the helm lint command that called via ct lint with --timeout option (invalid option) failed as above.

This issue is fixed in the following PR on the ct side. The latest (v3.10.1) ct command can treat extra args for helm install and helm lint respectively. In other words, ct lint command does not pass the invalid option --timeout to the helm lint command.

https://github.com/helm/chart-testing/pull/605/files

Also, it seems that the latest action of helm/chart-testing-action@v2 does not support ct v3.10.1 yet. So, to fix this issue, I specified the latest version explicitly in the CI.
(I think we can remove this specifying version in the future after the latest action supports the latest ct (v3.10.1).)

CI don't test all charts when we trigger CI from Web UI

If we run this CI via Web UI (i.e., run with the workflow_dispatch trigger), we assume that the ct command checks all charts.

In the current CI, ct install (testing for actual deployment) works against all charts. However, ct lint (testing for yaml syntax check) does not work against all charts.

So, I added a new if statement to run the ct lint against all charts when we trigger this CI with workflow_dispatch.

Related issues and/or PRs

N/A

Changes made

  • Specify the version of the ct command explicitly.
  • Add a new if statement to run the ct command against all charts when we run this CI with the workflow_dispatch trigger.

Checklist

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

I ran this new CI manually, and it worked properly as follows.
https://github.com/scalar-labs/helm-charts/actions/runs/6807941663/job/18511581758

You can see the result of the ct lint command against all charts in the Run chart-testing (all charts) section as follows.

------------------------------------------------------------------------------------------------------------------------
 ✔︎ envoy => (version: "3.0.0-SNAPSHOT", path: "charts/envoy")
 ✔︎ scalar-manager => (version: "2.0.0-SNAPSHOT", path: "charts/scalar-manager")
 ✔︎ scalardb => (version: "3.0.0-SNAPSHOT", path: "charts/scalardb")
 ✔︎ scalardb-cluster => (version: "2.0.0-SNAPSHOT", path: "charts/scalardb-cluster")
 ✔︎ scalardb-graphql => (version: "2.0.0-SNAPSHOT", path: "charts/scalardb-graphql")
 ✔︎ scalardl => (version: "5.0.0-SNAPSHOT", path: "charts/scalardl")
 ✔︎ scalardl-audit => (version: "3.0.0-SNAPSHOT", path: "charts/scalardl-audit")
 ✔︎ schema-loading => (version: "3.0.0-SNAPSHOT", path: "charts/schema-loading")
------------------------------------------------------------------------------------------------------------------------
All charts linted successfully

Release notes

N/A

@kota2and3kan kota2and3kan self-assigned this Nov 9, 2023
Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@feeblefakie feeblefakie merged commit 683ee4c into main Nov 11, 2023
16 checks passed
@feeblefakie feeblefakie deleted the fix-helm-lint-issue branch November 11, 2023 12:58
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.

2 participants