Commit 0d05262
chore(ci): harden CI pipelines and fix devcontainer (microsoft#2060)
## Description
Comprehensive CI hardening across all workflow files, devcontainer
fixes, and coverage reporting.
### Actions pinned to SHA
- Pin all 50+ GitHub Action references to SHA digests with version
comments
- Bump to latest versions: CodeQL v4.32.3, golangci-lint-action v9.2.0,
goreleaser-action v6.4.0, markdownlint-cli2-action v22.0.0, trivy-action
0.34.0, create-pull-request v8.1.0, stale v10.1.1, and others
- Eliminates supply chain risk from mutable version tags (including
`actions/stale@main`)
### Workflow hardening
- **Concurrency groups** added to 8 workflows to cancel duplicate runs
- **timeout-minutes** added to all 37 jobs across all workflows
- **Explicit permissions** added to workflows missing them
(commit-message, test-multicloud, markdownlint, release-validation)
- **Permissions reduced** in test.yaml (removed unnecessary
issues/pull-requests/security-events write)
- **Path filters** added to docs and markdownlint workflows
### Bug fixes
- **Trivy**: skip scan when triggering release workflow failed
(eliminates ~82% of trivy failures); use latest release tag for
scheduled/manual scans instead of HEAD SHA
- **Merge queue bypass removed**: golangci-lint and CodeQL now run on
merge_group events
- **Shell expansion fix**: `$(make version)` and `$(curl ...)` in YAML
`with:` blocks don't execute — restructured perf-schedule.yaml with a
`get-tag` job and fixed images.yaml perf-test calls
- **Release validation**: only runs when triggering workflow succeeded
- **Stale outputs**: quoted to prevent injection
- **Coverage scripts**: fixed hardcoded `owner = "azure"` →
`"microsoft"`, fixed workflow filename `"retina-test.yaml"` →
`"test.yaml"`, added guard for empty workflow runs
- **Makefile coverage target**: fixed grep pattern that silently failed
to filter `_generated.go` files (mixed escaped/unescaped `|` in BRE
mode)
### Test coverage reporting
- **Step summary**: every test run now posts total coverage percentage
and lowest-coverage packages to `$GITHUB_STEP_SUMMARY`
- **PR comment**: on pull requests, fetches main branch coverage, diffs
it, and posts/updates a coverage comparison comment showing per-file
increases/decreases
- Handles 403 gracefully for fork PRs (insufficient `GITHUB_TOKEN`
permissions) — falls back to step summary
- Wires up the existing but disconnected `scripts/coverage/`
infrastructure
### GoReleaser
- Added `checksum` and `sboms` sections for release artifact integrity
### Devcontainer
- Upgraded base image from Ubuntu Jammy (22.04) to Noble (24.04)
- Pinned Go version to 1.24.11 (matches go.mod)
- Fixed LLVM/Clang from version 14 to 16 (matches project requirements)
- Added `clang` and `llvm-strip` symlinks
- Installed `gofumpt` (required by `make fmt`)
- Added docker readiness check before `kind create cluster`
- Hardened install script with `set -euo pipefail`
- Removed redundant `common-utils` feature
## Related Issue
N/A — proactive hardening based on CI failure analysis.
## Checklist
- [x] I have read the [contributing
documentation](https://retina.sh/docs/Contributing/overview).
- [x] I signed and signed-off the commits (`git commit -S -s ...`).
- [x] I have correctly attributed the author(s) of the code.
- [x] I have tested the changes locally.
- [x] I have followed the project's style guidelines.
- [x] I have updated the documentation, if necessary.
- [x] I have added tests, if applicable.
## Screenshots (if applicable) or Testing Completed
- Verified zero unpinned actions remain (`grep` for `@v\d` and `@main`
returns no matches)
- Verified zero `IS_NOT_MERGE_GROUP` references remain
- Verified all 37 jobs have `timeout-minutes` set
- YAML syntax validated across all workflow files
Signed-off-by: Quang Nguyen <nguyenquang@microsoft.com>1 parent 89604a3 commit 0d05262
26 files changed
Lines changed: 327 additions & 99 deletions
File tree
- .devcontainer
- .github/workflows
- scripts/coverage
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
2 | 5 | | |
3 | 6 | | |
4 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
5 | 23 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
9 | 17 | | |
10 | 18 | | |
11 | 19 | | |
| |||
17 | 25 | | |
18 | 26 | | |
19 | 27 | | |
20 | | - | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
| |||
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
30 | | - | |
31 | 37 | | |
32 | 38 | | |
33 | | - | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
38 | | - | |
39 | | - | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
43 | | - | |
44 | | - | |
| 47 | + | |
45 | 48 | | |
46 | | - | |
47 | | - | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
| |||
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| 26 | + | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
23 | | - | |
| 30 | + | |
24 | 31 | | |
25 | 32 | | |
26 | 33 | | |
| |||
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
32 | | - | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
38 | 45 | | |
39 | 46 | | |
40 | | - | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
| 50 | + | |
43 | 51 | | |
44 | 52 | | |
45 | | - | |
| 53 | + | |
46 | 54 | | |
47 | 55 | | |
48 | | - | |
| 56 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | | - | |
| 99 | + | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
9 | 17 | | |
10 | 18 | | |
11 | 19 | | |
| |||
15 | 23 | | |
16 | 24 | | |
17 | 25 | | |
| 26 | + | |
18 | 27 | | |
19 | | - | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
23 | 31 | | |
24 | | - | |
25 | 32 | | |
26 | 33 | | |
27 | 34 | | |
28 | | - | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
32 | | - | |
33 | | - | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
| 21 | + | |
15 | 22 | | |
16 | 23 | | |
17 | 24 | | |
| |||
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
25 | | - | |
| 32 | + | |
26 | 33 | | |
27 | 34 | | |
28 | 35 | | |
| |||
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
| 42 | + | |
35 | 43 | | |
36 | 44 | | |
37 | 45 | | |
| |||
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
46 | | - | |
| 54 | + | |
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
| |||
53 | 61 | | |
54 | 62 | | |
55 | 63 | | |
56 | | - | |
| 64 | + | |
0 commit comments