apache / couchdb-helm

Apache CouchDB Helm Chart
https://couchdb.apache.org/
Apache License 2.0
49 stars 64 forks source link

Fix ci permissions #87

Closed colearendt closed 2 years ago

colearendt commented 2 years ago

What this PR does / why we need it:

The Apache Foundation has guidance that was missed on my first PR for GitHub Actions usage. This PR addresses that feedback.

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

Special notes for your reviewer:

A couple of questions:

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.

colearendt commented 2 years ago

A note about the way that CI is currently set up:

(so the "check" here is somewhat of a "false positive")

Would it be preferable to set it up so that if there are changes to the .github/workflows directory, the "all" lint/installs run? (Not sure how hard/tedious this is to detect off-hand...). An alternative way to test more thoroughly would be to create a dummy PR with a chart change (or add a commit that changes the chart and then remove it / revert it)

Alternatively, we could just have it run CI on the chart every time... or only trigger the CI if changes are in the chart directory / the .github/workflows or .github/actions folder (i.e. remove the "change detection" since you just have a single chart). This latter approach seems like a cleaner solution to me.

i.e. run "always" / remove conditional checks but only trigger the workflow, so it runs on every commit to main, but on PRs that change the chart or CI definitions :

on:
  push:
    branches:
      - main
  pull_request:
    paths:
      - '.github/workflows/chart-test.yaml'
      - '.github/actions/**'
      - 'couchdb/**'

EDIT: I talked myself into it and added to the PR đŸ˜…

colearendt commented 2 years ago

It looks like CI is happy... although I'll defer to you if you think there is anything we should improve about the logs here before we move on: https://github.com/apache/couchdb-helm/runs/6947632474?check_suite_focus=true

It seems like it succeeded... but I suspect there are some things that can be done long term to improve / ensure that we are picking up health of the service / etc. helm test is probably needed, as alluded to here. Maybe those are best as follow-ups?

willholley commented 2 years ago

or only trigger the CI if changes are in the chart directory / the .github/workflows or .github/actions folder (i.e. remove the "change detection" since you just have a single chart). This latter approach seems like a cleaner solution to me.

Agree this sounds cleaner. +1

willholley commented 2 years ago

Thanks for this follow up @colearendt. On helm test, is this not covered by the ct install --upgrade step?

colearendt commented 2 years ago

@willholley helm test is covered by the ct install --upgrade step. The trick is that the couchdb helm chart doesn't have any "test hooks" included in it. As a result, helm test currently does nothing - ct just checks that the install "worked". By writing test jobs / hooks, we can run couchdb specific checks (in Kubernetes jobs) to be sure that the service is up / happy / has a user provisioned, etc.