Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

GH-820: Strictly lint helm files #63

Merged
merged 15 commits into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions .github/workflows/helmchart-test.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/pr-helm-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This workflow triggers helm linting on PRs and master branch pushes
# that affect helm files
name: Helm Chart Linting on Pull Requests and Master

on:
push:
branches:
- master
paths:
- helm/wfl/**
pull_request:
paths:
- helm/wfl/**
Comment on lines +5 to +13
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm targeting helm/wfl specifically because we'd have to reconfigure this action a bit if we added other charts. Basic linting (just errors) will work on everything because chart-testing has logic to find charts based on ct.yaml, but the strict linting is just done via command line and uses a working directory of helm/wfl.


jobs:
lint:
runs-on: ubuntu-latest
container:
image: quay.io/helmpack/chart-testing:v3.0.0-rc.1
steps:
- name: Checkout
uses: actions/checkout@v2

# `ct lint` likes to find charts on its own using git
# history.
- name: Fetch History
run: git fetch --prune --unshallow

# We keep this around because it does version bump and
# maintenance checks outside of what `helm lint` does.
# It is separate because this needs to be at the top of
# the repo, and it is cleaner to use the
# working-directory directive below.
- name: Chart Test Basic Lint
run: ct lint --config ct.yaml

# These are each actually run by `ct lint`, but we want
# to see their output and set arguments ourselves
# (--strict). Because this GitHub Action is infrequently
# run, duplicating the checks for the sake of keeping
# this Action simple is worth it.
- name: Helm Chart Strict Lint
working-directory: ./helm/wfl
run: |
helm lint --strict --namespace default
yamale --schema /etc/ct/chart_schema.yaml Chart.yaml
yamllint --config-file /etc/ct/lintconf.yaml --strict Chart.yaml values.yaml

# We could theoretically run `ct install` or
# something else here, but there were breadcrumbs
# in previous Helm lint actions that installing
# fails on hyphenated names, so more work would
# need to be done to eliminate hyphens from
# generated names
4 changes: 2 additions & 2 deletions helm/wfl/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ description: A Helm chart for deploy WorkFlow Launcher on Kubernetes

type: application

version: 0.2.6
version: 0.2.7

home: https://github.com/broadinstitute/wfl
appVersion: 0.2.6
appVersion: 0.2.7
Comment on lines +7 to +10
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even though my change to values.yaml is a no-op, the linting wants a version bump here. If we want, we can revert afa751a to get rid of this version bump (linting will complain but it won't affect anything).

keywords:
- clojure
- cloud
Expand Down
4 changes: 4 additions & 0 deletions helm/wfl/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Default values for wfl.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
fullnameOverride: ""
nameOverride: ""

replicaCount: 1
revisionHistoryLimit: 1

Expand Down Expand Up @@ -103,6 +106,7 @@ rbac:
serviceAccount:
# Specifies whether a service account should be created
create: false
name: ""

podSecurityContext: {}
# fsGroup: 2000
Expand Down