Skip to content

Commit f3a4b09

Browse files
authored
[Sync] Update project files from source repository (ac305ad) (#39)
* sync(ci): update workflows and tooling versions * fix(lint): fix gosec G115 and nolintlint issues Add missing nolint directives for integer overflow conversions in test files, and remove stale nolint directives that are no longer needed.
1 parent d16234c commit f3a4b09

19 files changed

+201
-82
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ tmp
6767
.golangci.yml
6868
.goreleaser.yml
6969
.vscode
70-
docs
7170
LICENSE
7271
README.md
7372
codecov.yml
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# ------------------------------------------------------------------------------------
2+
# Upload Artifact with Resilience (Composite Action) (GoFortress)
3+
#
4+
# Purpose: Provide resilient artifact uploads with step-level retry logic to handle
5+
# transient GitHub infrastructure failures (including non-retryable 403 errors from
6+
# CDN/proxy intermediaries during artifact finalization).
7+
#
8+
# This action handles:
9+
# - Step-level retry (3 attempts) to recover from non-retryable errors (e.g., 403)
10+
# - Escalating delays (10s, 30s) between retries for transient infrastructure issues
11+
# - overwrite: true on all attempts to handle partially-finalized artifacts
12+
# - ACTIONS_UPLOAD_RETRY_COUNT=3 for defense-in-depth against 5xx errors
13+
# - Configurable continue-on-error for critical vs non-critical artifacts
14+
#
15+
# Maintainer: @mrz1836
16+
#
17+
# ------------------------------------------------------------------------------------
18+
19+
name: "Upload Artifact with Resilience"
20+
description: "Uploads GitHub Actions artifacts with step-level retry logic for transient infrastructure failures"
21+
22+
inputs:
23+
artifact-name:
24+
description: "Name of the artifact (will be displayed in GitHub UI)"
25+
required: true
26+
artifact-path:
27+
description: "Path to the artifact file(s) to upload"
28+
required: true
29+
retention-days:
30+
description: "Number of days to retain the artifact (1-90 days)"
31+
required: false
32+
default: "7"
33+
if-no-files-found:
34+
description: "Behavior when no files match the path (warn, error, ignore)"
35+
required: false
36+
default: "ignore"
37+
compression-level:
38+
description: "Compression level for the artifact (0-9, 6 is default)"
39+
required: false
40+
default: "6"
41+
continue-on-error:
42+
description: "Continue workflow if all upload attempts fail (true for non-critical artifacts)"
43+
required: false
44+
default: "true"
45+
46+
runs:
47+
using: "composite"
48+
steps:
49+
# ------------------------------------------------------------------
50+
# Attempt 1
51+
# ------------------------------------------------------------------
52+
- name: "📤 Upload ${{ inputs.artifact-name }} (attempt 1)"
53+
id: attempt1
54+
continue-on-error: true
55+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
56+
with:
57+
name: ${{ inputs.artifact-name }}
58+
path: ${{ inputs.artifact-path }}
59+
retention-days: ${{ inputs.retention-days }}
60+
if-no-files-found: ${{ inputs.if-no-files-found }}
61+
compression-level: ${{ inputs.compression-level }}
62+
overwrite: true
63+
env:
64+
ACTIONS_UPLOAD_RETRY_COUNT: 3
65+
66+
# ------------------------------------------------------------------
67+
# Delay before retry
68+
# ------------------------------------------------------------------
69+
- name: "⏳ Wait before retry (${{ inputs.artifact-name }})"
70+
if: steps.attempt1.outcome == 'failure'
71+
shell: bash
72+
run: |
73+
echo "::warning::Upload attempt 1 for '${{ inputs.artifact-name }}' failed, retrying in 10s..."
74+
sleep 10
75+
76+
# ------------------------------------------------------------------
77+
# Attempt 2
78+
# ------------------------------------------------------------------
79+
- name: "📤 Upload ${{ inputs.artifact-name }} (attempt 2)"
80+
id: attempt2
81+
if: steps.attempt1.outcome == 'failure'
82+
continue-on-error: true
83+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
84+
with:
85+
name: ${{ inputs.artifact-name }}
86+
path: ${{ inputs.artifact-path }}
87+
retention-days: ${{ inputs.retention-days }}
88+
if-no-files-found: ${{ inputs.if-no-files-found }}
89+
compression-level: ${{ inputs.compression-level }}
90+
overwrite: true
91+
env:
92+
ACTIONS_UPLOAD_RETRY_COUNT: 3
93+
94+
# ------------------------------------------------------------------
95+
# Delay before final retry
96+
# ------------------------------------------------------------------
97+
- name: "⏳ Wait before final retry (${{ inputs.artifact-name }})"
98+
if: steps.attempt1.outcome == 'failure' && steps.attempt2.outcome == 'failure'
99+
shell: bash
100+
run: |
101+
echo "::warning::Upload attempt 2 for '${{ inputs.artifact-name }}' failed, retrying in 30s..."
102+
sleep 30
103+
104+
# ------------------------------------------------------------------
105+
# Attempt 3 (final -- continue-on-error depends on criticality input)
106+
# ------------------------------------------------------------------
107+
- name: "📤 Upload ${{ inputs.artifact-name }} (attempt 3 - final)"
108+
id: attempt3
109+
if: steps.attempt1.outcome == 'failure' && steps.attempt2.outcome == 'failure'
110+
continue-on-error: ${{ inputs.continue-on-error == 'true' }}
111+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
112+
with:
113+
name: ${{ inputs.artifact-name }}
114+
path: ${{ inputs.artifact-path }}
115+
retention-days: ${{ inputs.retention-days }}
116+
if-no-files-found: ${{ inputs.if-no-files-found }}
117+
compression-level: ${{ inputs.compression-level }}
118+
overwrite: true
119+
env:
120+
ACTIONS_UPLOAD_RETRY_COUNT: 3

.github/env/10-coverage.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ GO_COVERAGE_PROVIDER=internal
3232
CODECOV_TOKEN_REQUIRED=false
3333

3434
# Go Coverage Tool Version
35-
GO_COVERAGE_VERSION=v1.3.5
35+
GO_COVERAGE_VERSION=v1.3.7
3636
GO_COVERAGE_USE_LOCAL=false
3737

3838
# ================================================================================================

.github/env/10-mage-x.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
# ================================================================================================
3737

3838
# MAGE-X version
39-
MAGE_X_VERSION=v1.20.4
39+
MAGE_X_VERSION=v1.20.7
4040

4141
# For mage-x development, set to 'true' to use local version instead of downloading from releases
4242
MAGE_X_USE_LOCAL=false
@@ -61,7 +61,7 @@ MAGE_X_FORMAT_EXCLUDE_PATHS=vendor,node_modules,.git,.idea
6161

6262
MAGE_X_GITLEAKS_VERSION=8.30.0
6363
MAGE_X_GOFUMPT_VERSION=v0.9.2
64-
MAGE_X_GOLANGCI_LINT_VERSION=v2.9.0
64+
MAGE_X_GOLANGCI_LINT_VERSION=v2.10.1
6565
MAGE_X_GORELEASER_VERSION=v2.13.3
6666
MAGE_X_GOVULNCHECK_VERSION=v1.1.4
6767
MAGE_X_GO_SECONDARY_VERSION=1.24.x

.github/env/10-pre-commit.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# 🪝 PRE-COMMIT TOOL VERSION
2727
# ================================================================================================
2828

29-
GO_PRE_COMMIT_VERSION=v1.6.1
29+
GO_PRE_COMMIT_VERSION=v1.6.2
3030
GO_PRE_COMMIT_USE_LOCAL=false
3131

3232
# ================================================================================================
@@ -52,7 +52,7 @@ GO_PRE_COMMIT_ALL_FILES=true
5252
# 🛠️ TOOL VERSIONS
5353
# ================================================================================================
5454

55-
GO_PRE_COMMIT_GOLANGCI_LINT_VERSION=v2.9.0
55+
GO_PRE_COMMIT_GOLANGCI_LINT_VERSION=v2.10.1
5656
GO_PRE_COMMIT_FUMPT_VERSION=v0.9.2
5757
GO_PRE_COMMIT_GOIMPORTS_VERSION=latest
5858
GO_PRE_COMMIT_GITLEAKS_VERSION=v8.30.0

.github/workflows/fortress-benchmarks.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -390,19 +390,19 @@ jobs:
390390
# --------------------------------------------------------------------
391391
- name: 📤 Upload benchmark statistics
392392
if: always()
393-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
393+
uses: ./.github/actions/upload-artifact-resilient
394394
with:
395-
name: bench-stats-${{ matrix.os }}-${{ matrix.go-version }}
396-
path: bench-stats-${{ matrix.os }}-${{ matrix.go-version }}.json
397-
retention-days: 7
395+
artifact-name: bench-stats-${{ matrix.os }}-${{ matrix.go-version }}
396+
artifact-path: bench-stats-${{ matrix.os }}-${{ matrix.go-version }}.json
397+
retention-days: "7"
398398

399399
# --------------------------------------------------------------------
400400
# Upload raw benchmark results
401401
# --------------------------------------------------------------------
402402
- name: 📤 Upload benchmark results
403403
if: always()
404-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
404+
uses: ./.github/actions/upload-artifact-resilient
405405
with:
406-
name: bench-results-${{ matrix.os }}-${{ matrix.go-version }}
407-
path: bench-results-${{ matrix.os }}-${{ matrix.go-version }}.txt
408-
retention-days: 7 # Keep raw results longer for analysis
406+
artifact-name: bench-results-${{ matrix.os }}-${{ matrix.go-version }}
407+
artifact-path: bench-results-${{ matrix.os }}-${{ matrix.go-version }}.txt
408+
retention-days: "7"

.github/workflows/fortress-code-quality.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,11 @@ jobs:
226226
# --------------------------------------------------------------------
227227
- name: 📤 Upload go vet results
228228
if: always()
229-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
229+
uses: ./.github/actions/upload-artifact-resilient
230230
with:
231-
name: govet-results
232-
path: govet-output.log
233-
retention-days: 7
231+
artifact-name: govet-results
232+
artifact-path: govet-output.log
233+
retention-days: "7"
234234
if-no-files-found: ignore
235235

236236
# --------------------------------------------------------------------
@@ -513,11 +513,11 @@ jobs:
513513
# --------------------------------------------------------------------
514514
- name: 📤 Upload lint results
515515
if: always()
516-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
516+
uses: ./.github/actions/upload-artifact-resilient
517517
with:
518-
name: lint-results
519-
path: lint-output.log
520-
retention-days: 7
518+
artifact-name: lint-results
519+
artifact-path: lint-output.log
520+
retention-days: "7"
521521
if-no-files-found: ignore
522522

523523
# --------------------------------------------------------------------
@@ -765,11 +765,11 @@ jobs:
765765
# --------------------------------------------------------------------
766766
- name: 📤 Upload format check results
767767
if: always()
768-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
768+
uses: ./.github/actions/upload-artifact-resilient
769769
with:
770-
name: format-check-results
771-
path: format-output.log
772-
retention-days: 7
770+
artifact-name: format-check-results
771+
artifact-path: format-output.log
772+
retention-days: "7"
773773
if-no-files-found: ignore
774774

775775
# --------------------------------------------------------------------

.github/workflows/fortress-completion-statistics.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -685,11 +685,11 @@ jobs:
685685
# --------------------------------------------------------------------
686686
- name: 📤 Upload LOC Stats JSON
687687
if: always() && hashFiles('loc-stats.json') != ''
688-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
688+
uses: ./.github/actions/upload-artifact-resilient
689689
with:
690-
name: loc-stats
691-
path: loc-stats.json
692-
retention-days: 7
690+
artifact-name: loc-stats
691+
artifact-path: loc-stats.json
692+
retention-days: "7"
693693

694694
- name: 📤 Upload Statistics Section
695695
id: upload-section

.github/workflows/fortress-coverage.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2367,22 +2367,22 @@ jobs:
23672367
# --------------------------------------------------------------------
23682368
- name: 📤 Upload performance cache statistics
23692369
if: always()
2370-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
2370+
uses: ./.github/actions/upload-artifact-resilient
23712371
with:
2372-
name: cache-stats-coverage
2373-
path: cache-stats-coverage.json
2374-
retention-days: 1
2372+
artifact-name: cache-stats-coverage
2373+
artifact-path: cache-stats-coverage.json
2374+
retention-days: "1"
23752375

23762376
# --------------------------------------------------------------------
23772377
# Upload coverage statistics for completion report
23782378
# --------------------------------------------------------------------
23792379
- name: 📤 Upload coverage statistics
23802380
if: always()
2381-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
2381+
uses: ./.github/actions/upload-artifact-resilient
23822382
with:
2383-
name: coverage-stats-internal
2384-
path: coverage-stats-internal-*.json
2385-
retention-days: 1
2383+
artifact-name: coverage-stats-internal
2384+
artifact-path: coverage-stats-internal-*.json
2385+
retention-days: "7"
23862386

23872387
# --------------------------------------------------------------------
23882388
# Upload coverage history for future runs (WORKING SYSTEM - PRESERVED)
@@ -2410,13 +2410,12 @@ jobs:
24102410
- name: 📤 Upload coverage history artifacts
24112411
# Upload history for all branches to preserve trend data
24122412
if: github.event_name == 'push'
2413-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
2413+
uses: ./.github/actions/upload-artifact-resilient
24142414
with:
2415-
name: coverage-history-${{ inputs.commit-sha }}
2416-
path: .github/coverage/history/*.json
2417-
retention-days: 90
2418-
compression-level: 9
2419-
continue-on-error: true
2415+
artifact-name: coverage-history-${{ inputs.commit-sha }}
2416+
artifact-path: .github/coverage/history/*.json
2417+
retention-days: "90"
2418+
compression-level: "9"
24202419
# ----------------------------------------------------------------------------------
24212420
# Upload Coverage to Codecov (External Provider)
24222421
# ----------------------------------------------------------------------------------
@@ -2594,8 +2593,8 @@ jobs:
25942593
25952594
- name: 📤 Upload coverage statistics (Codecov)
25962595
if: always()
2597-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
2596+
uses: ./.github/actions/upload-artifact-resilient
25982597
with:
2599-
name: coverage-stats-codecov
2600-
path: coverage-stats-codecov-*.json
2601-
retention-days: 7
2598+
artifact-name: coverage-stats-codecov
2599+
artifact-path: coverage-stats-codecov-*.json
2600+
retention-days: "7"

.github/workflows/fortress-security-scans.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,11 @@ jobs:
219219
# --------------------------------------------------------------------
220220
- name: 📤 Upload Nancy scan results
221221
if: always()
222-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
222+
uses: ./.github/actions/upload-artifact-resilient
223223
with:
224-
name: nancy-scan-results
225-
path: nancy-output.log
226-
retention-days: 7
224+
artifact-name: nancy-scan-results
225+
artifact-path: nancy-output.log
226+
retention-days: "7"
227227
if-no-files-found: ignore
228228

229229
# --------------------------------------------------------------------
@@ -458,11 +458,11 @@ jobs:
458458
# --------------------------------------------------------------------
459459
- name: 📤 Upload govulncheck results
460460
if: always()
461-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
461+
uses: ./.github/actions/upload-artifact-resilient
462462
with:
463-
name: govulncheck-scan-results
464-
path: govulncheck-output.log
465-
retention-days: 7
463+
artifact-name: govulncheck-scan-results
464+
artifact-path: govulncheck-output.log
465+
retention-days: "7"
466466
if-no-files-found: ignore
467467

468468
# --------------------------------------------------------------------

0 commit comments

Comments
 (0)