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

GitHub Action workflow to validate changes to Helm chart #1882

Merged

Conversation

KevinMellott91
Copy link
Contributor

Problem

When changes are made to the Marquez Helm chart, they need to be manually verified by installing and testing the chart into a local instance of Kubernetes (ex: Minikube). This process is both time consuming and prone to error.

Solution

An automated GitHub Actions workflow has been created that performs the following checks whenever a pull request is opened that affects the Helm chart.

  • Lint the chart to verify it is valid to the Helm specification
  • Create a kind Kubernetes cluster and use it to deploy the Helm chart
  • Execute the Helm chart tests, which verify the deployment completed successfully and the pods/services are available

All of these checks can executed locally as well, using the act utility. Additional instructions have been added to the contribution guide.

Checklist

  • You've signed-off your work
  • Your changes are accompanied by tests (if relevant)
  • Your change contains a small diff and is self-contained
  • You've updated any relevant documentation (if relevant)
  • You've updated the CHANGELOG.md with details about your change under the "Unreleased" section (if relevant, depending on the change, this may not be necessary)
  • You've versioned your .sql database schema migration according to Flyway's naming convention (if relevant)

…plicable pull request.

Signed-off-by: Kevin Mellott <[email protected]>
Co-authored-by: Kevin Mellott <[email protected]>
@codecov
Copy link

codecov bot commented Feb 17, 2022

Codecov Report

Merging #1882 (86b0499) into main (11d5e65) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #1882   +/-   ##
=========================================
  Coverage     77.90%   77.90%           
  Complexity      937      937           
=========================================
  Files           193      193           
  Lines          5218     5218           
  Branches        418      418           
=========================================
  Hits           4065     4065           
  Misses          706      706           
  Partials        447      447           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11d5e65...86b0499. Read the comment docs.

.actrc Outdated Show resolved Hide resolved
@@ -0,0 +1,44 @@
name: Lint and Test Chart
Copy link
Member

@wslulciuc wslulciuc Mar 1, 2022

Choose a reason for hiding this comment

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

For workflows, we may want to define a naming convention for .yml files:

build-api.yml         # run build, unit tests, linter
build-client-java.yml # run build, unit tests, linter
test-helm.yml         # run linter, test against kind k8s cluster
...

That is, I would take a general-to-more-specific naming convention [action]-[group]-[module], where [group] is optional. It's a similar approach we took for naming CI jobs in CircleCI. But, that might result in a growing number of workflows (well, maybe not, < 10).

We may also just want to map workflows to Marquez's sub-projects:

api.yml
web.yml
clients.yml
spec.yml
chart.yml

Personally, it might be better to have more discrete workflows, then define them per sub-projects. Thoughts?

Minor, but YAML files outside chart/ are usually defined with the .yml extension.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great idea! I like the option of combining the Marquez sub-module with the action being taken. How about this for the file in this PR?

test-chart.yml

If we were to extend the workflows to include Helm chart releasing, then we could add another file that would be called release-chart.yml. Not planning that right now, just wanted to test how the nomenclature could look.

Copy link
Member

@wslulciuc wslulciuc Mar 1, 2022

Choose a reason for hiding this comment

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

Yeah, let's use test-chart.yml, but with the assumption that things will change. I need to review the docs for GitHub Actions as well. I'm thinking we might have:

.github/workflows/
  ci.yml
  release.yml

as a way to further simply our workflows and avoid the proliferation of workflows. Idk, just a thought of course, but will have a proper discussion when we begin to replace CircleCI with GitHub Actions.

ct.yaml Show resolved Hide resolved
…estions.

Signed-off-by: Kevin Mellott <[email protected]>
Co-authored-by: Kevin Mellott <[email protected]>
@KevinMellott91
Copy link
Contributor Author

@wslulciuc I've uploaded changes based on your comments - thanks for the great suggestions! Note that I also pinned the version of Postgres to 12.1 to match what is being used within the rest of the Marquez project.

Copy link
Member

@wslulciuc wslulciuc left a comment

Choose a reason for hiding this comment

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

LGTM 💯

@wslulciuc wslulciuc merged commit 011341a into MarquezProject:main Mar 2, 2022
@KevinMellott91 KevinMellott91 deleted the feature/github-action-helm branch March 2, 2022 19:52
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