|
| 1 | +# Golangci-lint alauda Branch Development Guide |
| 2 | + |
| 3 | +## Background |
| 4 | + |
| 5 | +Previously, golangci-lint was used as a general-purpose CLI across multiple plugins, each needing to fix vulnerabilities in golangci-lint independently. |
| 6 | + |
| 7 | +To avoid duplicated efforts, we forked the [golangci-lint](https://github.com/golangci/golangci-lint) repository and maintain it through branches named `alauda-vx.xx.xx`. |
| 8 | + |
| 9 | +We use [renovate](https://gitlab-ce.alauda.cn/devops/tech-research/renovate/-/blob/main/docs/quick-start/0002-quick-start.md) to automatically fix vulnerabilities in corresponding versions. |
| 10 | + |
| 11 | +## Repository Structure |
| 12 | + |
| 13 | +Based on the original code, the following content has been added: |
| 14 | + |
| 15 | +- [alauda-auto-tag.yaml](./.github/workflows/alauda-auto-tag.yaml): Automatically tags and triggers goreleaser when a PR is merged into the `alauda-vx.xx.xx` branch |
| 16 | +- [release-alauda.yaml](./.github/workflows/release-alauda.yaml): Supports triggering goreleaser manually or upon tag updates (this pipeline isn't triggered when tags are created by actions due to GitHub Actions design limitations) |
| 17 | +- [reusable-release-alauda.yaml](./.github/workflows/reusable-release-alauda.yaml): Executes goreleaser to create a release |
| 18 | +- [scan-alauda.yaml](.github/workflows/scan-alauda.yaml): Runs trivy vulnerability scans (`rootfs` scans for Go binaries) |
| 19 | +- [.goreleaser-alauda.yml](.goreleaser-alauda.yml): Configuration file for releasing alauda versions |
| 20 | + |
| 21 | +## Special Modifications |
| 22 | + |
| 23 | +None at present |
| 24 | + |
| 25 | +## Pipelines |
| 26 | + |
| 27 | +### Triggered on PR Submission |
| 28 | + |
| 29 | +- [tests.yaml](.github/workflows/tests.yaml): Official testing pipeline including unit tests, integration tests, etc. |
| 30 | + |
| 31 | +### Triggered on Merge to alauda-vx.xx.xx Branch |
| 32 | + |
| 33 | +- [alauda-auto-tag.yaml](.github/workflows/alauda-auto-tag.yaml): Automatically tags and triggers goreleaser |
| 34 | +- [reusable-release-alauda.yaml](.github/workflows/reusable-release-alauda.yaml): Executes goreleaser to create a release (triggered by `alauda-auto-tag.yaml`) |
| 35 | + |
| 36 | +### Scheduled or Manual Triggering |
| 37 | + |
| 38 | +- [scan-alauda.yaml](.github/workflows/scan-alauda.yaml): Runs trivy vulnerability scans (`rootfs` scans for Go binaries) |
| 39 | + |
| 40 | +### Others |
| 41 | + |
| 42 | +Other officially maintained pipelines remain unchanged; some irrelevant pipelines have been disabled on the Actions page. |
| 43 | + |
| 44 | +## Renovate Vulnerability Fix Mechanism |
| 45 | + |
| 46 | +The renovate configuration file is [renovate.json](https://github.com/AlaudaDevops/trivy/blob/main/renovate.json) |
| 47 | + |
| 48 | +1. renovate detects vulnerabilities in the branch and submits a PR for fixes |
| 49 | +2. Tests run automatically on the PR |
| 50 | +3. After all tests pass, renovate automatically merges the PR |
| 51 | +4. After the branch updates, an action automatically tags the commit (e.g., v0.62.1-alauda-0, with patch version and last digit incremented) |
| 52 | +5. goreleaser automatically publishes a release based on the tag |
| 53 | + |
| 54 | +## Maintenance Plan |
| 55 | + |
| 56 | +When upgrading to a new version, follow these steps: |
| 57 | + |
| 58 | +1. Create an alauda branch from the corresponding tag, e.g., tag `v0.62.1` corresponds to branch `alauda-v0.62.1` |
| 59 | +2. Cherry-pick previous alauda branch changes onto the new branch and push |
| 60 | + |
| 61 | +Renovate automatic fix mechanism: |
| 62 | +1. After renovate submits a PR, pipelines run automatically; if all tests pass, the PR will be merged automatically |
| 63 | +2. After merging into the `alauda-v0.62.1` branch, goreleaser will automatically create a `v0.62.2-alauda-0` release (note: not `v0.62.1-alauda-0`, because upgrading the version allows renovate to recognize it) |
| 64 | +3. renovate configured in other plugins will automatically fetch artifacts from the release according to its configuration |
0 commit comments