-
Notifications
You must be signed in to change notification settings - Fork 324
chore(ci/release): Re-factor fluent-operator release process #1950
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
base: master
Are you sure you want to change the base?
Changes from 8 commits
4d037c2
6026045
e04abaf
4211bba
d72fdb8
4f64687
5a7925a
8ec8f8b
55357df
e570135
c38797d
afa4eeb
76ac1d4
9c0ff83
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| ".": "3.7.0" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
| "release-type": "simple", | ||
| "extra-files": [ | ||
| { | ||
| "type": "yaml", | ||
| "path": "charts/fluent-operator/Chart.yaml", | ||
| "jsonpath": "$.appVersion" | ||
| }, | ||
| { | ||
| "type": "yaml", | ||
| "path": "charts/fluent-operator-fluent-bit-crds/Chart.yaml", | ||
| "jsonpath": "$.appVersion" | ||
| }, | ||
| { | ||
| "type": "yaml", | ||
| "path": "charts/fluent-operator-fluentd-crds/Chart.yaml", | ||
| "jsonpath": "$.appVersion" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: Lint PR Title | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - edited | ||
| - synchronize | ||
|
|
||
| permissions: | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Validate PR title | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1 | ||
| id: lint_pr_title | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 # v3.0.4 | ||
| if: always() && (steps.lint_pr_title.outputs.error_message != null) | ||
| with: | ||
| header: pr-title-lint-error | ||
| message: | | ||
| Thank you for your pull request! :wave: | ||
|
|
||
| Your PR title needs to follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format so it can be included correctly in the changelog. | ||
|
|
||
| **Examples of valid titles:** | ||
| - `feat: add support for new filter plugin` | ||
| - `fix: correct nil pointer in controller reconcile` | ||
| - `chore: update dependencies` | ||
| - `docs: improve installation guide` | ||
|
|
||
| **Details:** | ||
| ``` | ||
| ${{ steps.lint_pr_title.outputs.error_message }} | ||
| ``` | ||
|
|
||
| - uses: marocchino/sticky-pull-request-comment@0ea0beb66eb9baf113663a64ec522f60e49231c0 # v3.0.4 | ||
| if: ${{ steps.lint_pr_title.outputs.error_message == null }} | ||
| with: | ||
| header: pr-title-lint-error | ||
| delete: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| workflow_dispatch: | ||
| inputs: | ||
| release-as: | ||
| description: 'Override the next release version (e.g. 3.8.0). Leave empty for automatic versioning from conventional commits.' | ||
| required: false | ||
| type: string | ||
|
|
||
| permissions: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The docs suggest it needs
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I understand: release-please <4.0 did use "issues" to track the replace process but >=4.0 removed the issue-based workflow any only uses PRs/git tags for driving the release process. |
||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| release-please: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for this, had a hand crafted approach for our stuff so useful to know. |
||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| config-file: .github/release-please-config.json | ||
| manifest-file: .github/.release-please-manifest.json | ||
| release-as: ${{ inputs.release-as }} | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: Upload Release Assets | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| upload-assets: | ||
| name: Upload setup.yaml | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| ref: ${{ github.event.release.tag_name }} | ||
|
|
||
| - name: Read version | ||
| id: version | ||
| run: echo "version=$(cat version.txt)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Stamp image tag in setup.yaml | ||
| run: | | ||
| sed -i \ | ||
| 's|ghcr.io/fluent/fluent-operator/fluent-operator:latest|ghcr.io/fluent/fluent-operator/fluent-operator:v${{ steps.version.outputs.version }}|g' \ | ||
| manifests/setup/setup.yaml | ||
|
|
||
| - name: Upload setup.yaml to release | ||
| run: gh release upload "${{ github.event.release.tag_name }}" manifests/setup/setup.yaml --clobber | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,17 +133,17 @@ Kubernetes v1.16.13+ is necessary for running Fluent Operator. | |
| Install the latest stable version | ||
|
|
||
| ```shell | ||
| kubectl apply -f https://raw.githubusercontent.com/fluent/fluent-operator/release-3.7/manifests/setup/setup.yaml | ||
| kubectl apply -f https://github.com/fluent/fluent-operator/releases/latest/download/setup.yaml | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this work now? It used to intercept and provide you with HTML if you did not use the raw endpoint
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah - it looks like it does work now. I wonder if this recently changed. I do recall exactly what you're talking about. |
||
|
|
||
| # You can change the namespace in manifests/setup/kustomization.yaml in corresponding release branch | ||
| # You can change the namespace in manifests/setup/kustomization.yaml | ||
| # and then use command below to install to another namespace | ||
| # kubectl kustomize manifests/setup/ | kubectl apply -f - | ||
| ``` | ||
|
|
||
| Install the development version | ||
|
|
||
| ```shell | ||
| kubectl apply -f https://raw.githubusercontent.com/fluent/fluentbit-operator/master/manifests/setup/setup.yaml | ||
| kubectl apply -f https://raw.githubusercontent.com/fluent/fluent-operator/master/manifests/setup/setup.yaml | ||
|
|
||
| # You can change the namespace in manifests/setup/kustomization.yaml | ||
| # and then use command below to install to another namespace | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is always a concern so let's make sure we're secure with it - it's part of the recent supply chain attacks.
I think we should at least comment why it is required and the mitigations in place for future reviews/changes to ensure we do not open things up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for calling this out -- this is a valid concern.
One key thing here to call out is that this workflow is not checking out any code (eg, using
actions/checkout) which is what allowed attacker-controlled code execution in the mentioned supply chain attacks.I have attempted to harden this workflow a bit in 55357df:
pull_request_targetand a warning against adding checkout functionality to the workflowsynchronizetype since PR title changes only occur onopened,reopenedandeditedevents. Thesynchronizetype fires on every new commit push and is unnecessary for this use-caseCODEOWNERSso that only users who are "Admins" of this repo can modify files in the.github/directory