Skip to content

Commit 3606890

Browse files
committed
sync: update 9 files from source repository
1 parent f4b333d commit 3606890

9 files changed

+149
-36
lines changed

.github/.env.base

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ ENABLE_BENCHMARKS=true # Run benchmark tests
8181
ENABLE_CACHE_WARMING=true # Warm Go module and build caches
8282
ENABLE_CODE_COVERAGE=true # Generate coverage reports via go-coverage
8383
ENABLE_FUZZ_TESTING=true # Run fuzz tests (Go 1.18+)
84+
ENABLE_GO_TESTS=true # Run Go test suite (unit, integration, matrix)
8485
ENABLE_RACE_DETECTION=true # Enable Go race detector
8586
ENABLE_STATIC_ANALYSIS=true # Run go vet analysis
8687
ENABLE_VERBOSE_TEST_OUTPUT=false # Verbose test output (can slow CI)
@@ -231,14 +232,14 @@ REDIS_CACHE_FORCE_PULL=false # Force pull Redis images even when cache
231232
# 🪄 MAGE-X CONFIGURATION
232233
# ================================================================================================
233234

234-
MAGE_X_VERSION=v1.7.9 # https://github.com/mrz1836/mage-x/releases
235+
MAGE_X_VERSION=v1.7.12 # https://github.com/mrz1836/mage-x/releases
235236
MAGE_X_USE_LOCAL=false # Use local version for development
236237
MAGE_X_AUTO_DISCOVER_BUILD_TAGS=true # Enable auto-discovery of build tags
237238
MAGE_X_AUTO_DISCOVER_BUILD_TAGS_EXCLUDE=race,custom # Comma-separated list of tags to exclude
238239
MAGE_X_FORMAT_EXCLUDE_PATHS=vendor,node_modules,.git,.idea # Format exclusion paths (comma-separated directories to exclude from formatting)
239240
MAGE_X_GITLEAKS_VERSION=8.28.0 # https://github.com/gitleaks/gitleaks/releases
240-
MAGE_X_GOFUMPT_VERSION=v0.9.1 # https://github.com/mvdan/gofumpt/releases
241-
MAGE_X_GOLANGCI_LINT_VERSION=v2.6.0 # https://github.com/golangci/golangci-lint/releases
241+
MAGE_X_GOFUMPT_VERSION=v0.9.2 # https://github.com/mvdan/gofumpt/releases
242+
MAGE_X_GOLANGCI_LINT_VERSION=v2.6.1 # https://github.com/golangci/golangci-lint/releases
242243
MAGE_X_GORELEASER_VERSION=v2.12.7 # https://github.com/goreleaser/goreleaser/releases
243244
MAGE_X_GOVULNCHECK_VERSION=v1.1.4 # https://pkg.go.dev/golang.org/x/vuln
244245
MAGE_X_GO_SECONDARY_VERSION=1.24.x # Secondary Go version for MAGE-X (also our secondary)
@@ -247,7 +248,7 @@ MAGE_X_MOCKGEN_VERSION=v0.6.0 # https://github.c
247248
MAGE_X_NANCY_VERSION=v1.0.52 # https://github.com/sonatype-nexus-community/nancy/releases
248249
MAGE_X_STATICCHECK_VERSION=2025.1.1 # https://github.com/dominikh/go-tools/releases
249250
MAGE_X_SWAG_VERSION=v1.16.6 # https://github.com/swaggo/swag/releases
250-
MAGE_X_YAMLFMT_VERSION=v0.17.2 # https://github.com/google/yamlfmt/releases
251+
MAGE_X_YAMLFMT_VERSION=v0.20.0 # https://github.com/google/yamlfmt/releases
251252

252253
# Runtime variables (set by setup-goreleaser action):
253254
# MAGE_X_GORELEASER_PATH - Path to installed goreleaser binary
@@ -318,8 +319,8 @@ GO_PRE_COMMIT_MAX_FILES_OPEN=100
318319
GO_PRE_COMMIT_ALL_FILES=true
319320

320321
# Tool Versions
321-
GO_PRE_COMMIT_GOLANGCI_LINT_VERSION=v2.6.0 # https://github.com/golangci/golangci-lint
322-
GO_PRE_COMMIT_FUMPT_VERSION=v0.9.1 # https://github.com/mvdan/gofumpt
322+
GO_PRE_COMMIT_GOLANGCI_LINT_VERSION=v2.6.1 # https://github.com/golangci/golangci-lint/releases
323+
GO_PRE_COMMIT_FUMPT_VERSION=v0.9.2 # https://github.com/mvdan/gofumpt/releases
323324
GO_PRE_COMMIT_GOIMPORTS_VERSION=latest # https://github.com/golang/tools
324325

325326
# Build tags for golangci-lint and other tools

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ jobs:
206206
# ----------------------------------------------------------------------------------
207207
lint:
208208
name: ✨ Lint Code
209+
timeout-minutes: 20
209210
if: ${{ inputs.go-lint-enabled == 'true' }}
210211
runs-on: ${{ inputs.primary-runner }}
211212
outputs:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ jobs:
186186
echo "| 🪝 Pre-commit Checks | ${{ env.INPUT_pre-commit-result }} | $([ "${{ env.INPUT_pre-commit-result }}" = "success" ] && echo "✅" || echo "❌") |"
187187
echo "| 🔒 Security Scans | ${{ env.INPUT_security-result }} | $([ "${{ env.INPUT_security-result }}" = "success" ] && echo "✅" || echo "❌") |"
188188
echo "| 📊 Code Quality | ${{ env.INPUT_code-quality-result }} | $([ "${{ env.INPUT_code-quality-result }}" = "success" ] && echo "✅" || echo "❌") |"
189-
echo "| 🧪 Test Suite | ${{ env.INPUT_test-suite-result }} | $([ "${{ env.INPUT_test-suite-result }}" = "success" ] && echo "✅" || echo "❌") |"
189+
echo "| 🧪 Test Suite | ${{ env.INPUT_test-suite-result }} | $([ "${{ env.INPUT_test-suite-result }}" = "success" ] && echo "✅" || ([ "${{ env.INPUT_test-suite-result }}" = "skipped" ] && echo "⏭️" || echo "❌")) |"
190190
} >> final-report.md
191191
192192
# Only show benchmarks row if it was attempted

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
# Download specific artifacts needed for statistics processing
101101
# --------------------------------------------------------------------
102102
- name: 📥 Download test statistics
103-
if: always()
103+
if: always() && env.ENABLE_GO_TESTS == 'true'
104104
uses: ./.github/actions/download-artifact-resilient
105105
with:
106106
pattern: "test-stats-*"
@@ -136,7 +136,7 @@ jobs:
136136
continue-on-error: ${{ env.ARTIFACT_DOWNLOAD_CONTINUE_ON_ERROR }}
137137

138138
- name: 📥 Download internal coverage statistics
139-
if: always() && env.GO_COVERAGE_PROVIDER == 'internal'
139+
if: always() && env.ENABLE_GO_TESTS == 'true' && env.GO_COVERAGE_PROVIDER == 'internal'
140140
uses: ./.github/actions/download-artifact-resilient
141141
with:
142142
pattern: "coverage-stats-internal"
@@ -148,7 +148,7 @@ jobs:
148148
continue-on-error: true
149149

150150
- name: 📥 Download codecov coverage statistics
151-
if: always() && env.GO_COVERAGE_PROVIDER == 'codecov'
151+
if: always() && env.ENABLE_GO_TESTS == 'true' && env.GO_COVERAGE_PROVIDER == 'codecov'
152152
uses: ./.github/actions/download-artifact-resilient
153153
with:
154154
pattern: "coverage-stats-codecov"

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
# Download specific artifacts needed for test analysis
7979
# --------------------------------------------------------------------
8080
- name: 📥 Download test statistics
81-
if: always()
81+
if: always() && env.ENABLE_GO_TESTS == 'true'
8282
uses: ./.github/actions/download-artifact-resilient
8383
with:
8484
pattern: "test-stats-*"
@@ -114,7 +114,7 @@ jobs:
114114
continue-on-error: ${{ env.ARTIFACT_DOWNLOAD_CONTINUE_ON_ERROR }}
115115

116116
- name: 📥 Download test failure artifacts
117-
if: always()
117+
if: always() && env.ENABLE_GO_TESTS == 'true'
118118
uses: ./.github/actions/download-artifact-resilient
119119
with:
120120
pattern: "test-results-unit-*"
@@ -126,7 +126,7 @@ jobs:
126126
continue-on-error: ${{ env.ARTIFACT_DOWNLOAD_CONTINUE_ON_ERROR }}
127127

128128
- name: 📥 Download fuzz test failure artifacts
129-
if: always()
129+
if: always() && env.ENABLE_GO_TESTS == 'true' && env.ENABLE_FUZZ_TESTING == 'true'
130130
uses: ./.github/actions/download-artifact-resilient
131131
with:
132132
pattern: "test-results-fuzz-*"
@@ -333,19 +333,25 @@ jobs:
333333
echo "failure-metrics={\"total_failures\":$TOTAL_FAILURES,\"has_error_output\":$HAS_ERROR_OUTPUT}" >> $GITHUB_OUTPUT
334334
fi
335335
else
336-
# No test statistics available - likely fork PR with skipped test suite
336+
# No test statistics available - check if tests were disabled or fork PR
337337
{
338338
echo ""
339339
echo ""
340340
echo "### 🧪 Test Results Summary"
341341
echo ""
342342
echo "| Status | Details |"
343343
echo "|--------|---------|"
344-
echo "| **Test Suite** | ⚠️ Skipped - No test statistics available |"
345-
echo "| **Reason** | Tests may have been skipped for fork PR security restrictions |"
346-
echo "| **Note** | Repository maintainers can run full tests on merged code |"
347-
echo ""
348-
echo "_For security reasons, fork PRs do not have access to test execution secrets._"
344+
if [[ "${{ env.ENABLE_GO_TESTS }}" == "false" ]]; then
345+
echo "| **Test Suite** | ❌ Disabled - Set ENABLE_GO_TESTS=true to enable |"
346+
echo "| **Reason** | Tests are disabled via configuration flag |"
347+
echo "| **Note** | Enable ENABLE_GO_TESTS in .env.custom or .env.base to run tests |"
348+
else
349+
echo "| **Test Suite** | ⚠️ Skipped - No test statistics available |"
350+
echo "| **Reason** | Tests may have been skipped for fork PR security restrictions |"
351+
echo "| **Note** | Repository maintainers can run full tests on merged code |"
352+
echo ""
353+
echo "_For security reasons, fork PRs do not have access to test execution secrets._"
354+
fi
349355
} >> tests-section.md
350356
fi
351357

.github/workflows/fortress-setup-config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ on:
6868
fuzz-testing-enabled:
6969
description: "Whether fuzz testing is enabled"
7070
value: ${{ jobs.setup-config.outputs.fuzz-testing-enabled }}
71+
go-tests-enabled:
72+
description: "Whether Go tests are enabled"
73+
value: ${{ jobs.setup-config.outputs.go-tests-enabled }}
7174
go-primary-version:
7275
description: "Primary Go version"
7376
value: ${{ jobs.setup-config.outputs.go-primary-version }}
@@ -190,6 +193,7 @@ jobs:
190193
coverage-provider: ${{ steps.config.outputs.coverage-provider }}
191194
cache-warming-enabled: ${{ steps.config.outputs.cache-warming-enabled }}
192195
fuzz-testing-enabled: ${{ steps.config.outputs.fuzz-testing-enabled }}
196+
go-tests-enabled: ${{ steps.config.outputs.go-tests-enabled }}
193197
go-primary-version: ${{ steps.config.outputs.go-primary-version }}
194198
go-secondary-version: ${{ steps.config.outputs.go-secondary-version }}
195199
go-sum-file: ${{ steps.config.outputs.go-sum-file }}
@@ -510,6 +514,7 @@ jobs:
510514
echo "gitleaks-enabled=${{ env.ENABLE_SECURITY_SCAN_GITLEAKS }}" >> $GITHUB_OUTPUT
511515
echo "static-analysis-enabled=${{ env.ENABLE_STATIC_ANALYSIS }}" >> $GITHUB_OUTPUT
512516
echo "fuzz-testing-enabled=${{ env.ENABLE_FUZZ_TESTING }}" >> $GITHUB_OUTPUT
517+
echo "go-tests-enabled=${{ env.ENABLE_GO_TESTS }}" >> $GITHUB_OUTPUT
513518
echo "pre-commit-enabled=${{ env.ENABLE_GO_PRE_COMMIT }}" >> $GITHUB_OUTPUT
514519
515520
# Detect if this is a release run
@@ -680,6 +685,7 @@ jobs:
680685
echo "| **Cache Warming** | $([ "${{ env.ENABLE_CACHE_WARMING }}" == "true" ] && echo "✅ Enabled" || echo "❌ Disabled") | Go module and build caches will $([ "${{ env.ENABLE_CACHE_WARMING }}" == "true" ] && echo "be pre-warmed for faster test execution" || echo "not be pre-warmed (saves memory)") |" >> $GITHUB_STEP_SUMMARY
681686
echo "| **Code Coverage** | $([ "${{ env.ENABLE_CODE_COVERAGE }}" == "true" ] && echo "✅ Enabled" || echo "❌ Disabled") | Coverage will $([ "${{ env.ENABLE_CODE_COVERAGE }}" == "true" ] && echo "use $([ "${{ env.GO_COVERAGE_PROVIDER }}" == "codecov" ] && echo "**Codecov**" || echo "**go-coverage**") (${{ env.GO_COVERAGE_THRESHOLD }}% threshold)" || echo "be skipped") |" >> $GITHUB_STEP_SUMMARY
682687
echo "| **Fuzz Testing** | $([ "${{ env.ENABLE_FUZZ_TESTING }}" == "true" ] && echo "✅ Enabled" || echo "❌ Disabled") | Fuzz tests will $([ "${{ env.ENABLE_FUZZ_TESTING }}" == "true" ] && echo "run in parallel job on Linux with primary Go version" || echo "be skipped") |" >> $GITHUB_STEP_SUMMARY
688+
echo "| **Go Tests** | $([ "${{ env.ENABLE_GO_TESTS }}" == "true" ] && echo "✅ Enabled" || echo "❌ Disabled") | Test suite will $([ "${{ env.ENABLE_GO_TESTS }}" == "true" ] && echo "run across matrix configurations" || echo "be skipped") |" >> $GITHUB_STEP_SUMMARY
683689
echo "| **Gitleaks (Secret Scan)** | $([ "${{ env.ENABLE_SECURITY_SCAN_GITLEAKS }}" == "true" ] && echo "✅ Enabled" || echo "❌ Disabled") | Gitleaks will $([ "${{ env.ENABLE_SECURITY_SCAN_GITLEAKS }}" == "true" ] && echo "scan for leaked secrets" || echo "be skipped") |" >> $GITHUB_STEP_SUMMARY
684690
echo "| **Go Linting** | $([ "${{ env.ENABLE_GO_LINT }}" == "true" ] && echo "✅ Enabled" || echo "❌ Disabled") | golangci-lint via MAGE-X will $([ "${{ env.ENABLE_GO_LINT }}" == "true" ] && echo "analyze code quality" || echo "be skipped") |" >> $GITHUB_STEP_SUMMARY
685691
echo "| **Govulncheck** | $([ "${{ env.ENABLE_SECURITY_SCAN_GOVULNCHECK }}" == "true" ] && echo "✅ Enabled" || echo "❌ Disabled") | govulncheck via MAGE-X will $([ "${{ env.ENABLE_SECURITY_SCAN_GOVULNCHECK }}" == "true" ] && echo "scan for Go vulnerabilities" || echo "be skipped") |" >> $GITHUB_STEP_SUMMARY

.github/workflows/fortress-test-suite.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ on:
5656
description: "Whether fuzz testing is enabled"
5757
required: true
5858
type: string
59+
go-tests-enabled:
60+
description: "Whether Go tests are enabled"
61+
required: true
62+
type: string
5963
redis-enabled:
6064
description: "Whether Redis service is enabled"
6165
required: false
@@ -119,6 +123,7 @@ jobs:
119123
# ----------------------------------------------------------------------------------
120124
execute-test-matrix:
121125
name: 🧪 Execute Test Matrix
126+
if: inputs.go-tests-enabled == 'true'
122127
uses: ./.github/workflows/fortress-test-matrix.yml
123128
with:
124129
env-json: ${{ inputs.env-json }}
@@ -143,6 +148,7 @@ jobs:
143148
# ----------------------------------------------------------------------------------
144149
execute-fuzz-tests:
145150
name: 🎯 Execute Fuzz Tests
151+
if: inputs.go-tests-enabled == 'true' && inputs.fuzz-testing-enabled == 'true'
146152
uses: ./.github/workflows/fortress-test-fuzz.yml
147153
with:
148154
env-json: ${{ inputs.env-json }}
@@ -158,7 +164,7 @@ jobs:
158164
validate-test-results:
159165
name: 🔍 Validate Test Results
160166
needs: [execute-test-matrix, execute-fuzz-tests]
161-
if: always() # Always run to validate results even if tests failed
167+
if: always() && inputs.go-tests-enabled == 'true' # Always run to validate results even if tests failed
162168
uses: ./.github/workflows/fortress-test-validation.yml
163169
with:
164170
env-json: ${{ inputs.env-json }}
@@ -171,7 +177,7 @@ jobs:
171177
process-coverage:
172178
name: 📊 Process Coverage
173179
needs: [execute-test-matrix, validate-test-results]
174-
if: inputs.code-coverage-enabled == 'true' && !startsWith(github.ref, 'refs/tags/')
180+
if: inputs.go-tests-enabled == 'true' && inputs.code-coverage-enabled == 'true' && !startsWith(github.ref, 'refs/tags/')
175181
permissions:
176182
contents: write # Write repository content and push to gh-pages branch for coverage processing
177183
pull-requests: write # Required: Coverage workflow needs to create PR comments

.github/workflows/fortress.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ jobs:
241241
needs.setup.result == 'success' &&
242242
needs.test-magex.result == 'success' &&
243243
(needs.warm-cache.result == 'success' || needs.warm-cache.result == 'skipped') &&
244-
needs.setup.outputs.is-fork-pr != 'true'
244+
needs.setup.outputs.is-fork-pr != 'true' &&
245+
needs.setup.outputs.go-tests-enabled == 'true'
245246
permissions:
246247
contents: write # Write repository content and push to gh-pages branch for test execution
247248
pull-requests: write # Required: Coverage workflow needs to create PR comments
@@ -255,6 +256,7 @@ jobs:
255256
coverage-provider: ${{ needs.setup.outputs.coverage-provider }}
256257
env-json: ${{ needs.load-env.outputs.env-json }}
257258
fuzz-testing-enabled: ${{ needs.setup.outputs.fuzz-testing-enabled }}
259+
go-tests-enabled: ${{ needs.setup.outputs.go-tests-enabled }}
258260
go-primary-version: ${{ needs.setup.outputs.go-primary-version }}
259261
go-secondary-version: ${{ needs.setup.outputs.go-secondary-version }}
260262
primary-runner: ${{ needs.setup.outputs.primary-runner }}
@@ -332,7 +334,7 @@ jobs:
332334
echo "| 🔒 Security | ${{ needs.security.result }} | Required |"
333335
echo "| 📊 Code Quality | ${{ needs.code-quality.result }} | Required |"
334336
echo "| 🪝 Pre-commit | ${{ needs.pre-commit.result }} | ${{ needs.setup.outputs.pre-commit-enabled == 'true' && 'Required' || 'Skipped' }} |"
335-
echo "| 🧪 Test Suite | ${{ needs.test-suite.result }} | Required |"
337+
echo "| 🧪 Test Suite | ${{ needs.test-suite.result }} | ${{ needs.setup.outputs.go-tests-enabled == 'true' && 'Required' || 'Skipped' }} |"
336338
echo "| 🏃 Benchmarks | ${{ needs.benchmarks.result }} | Optional ⚠️ |"
337339
echo ""
338340
if [[ "${{ needs.benchmarks.result }}" == "failure" ]]; then
@@ -376,9 +378,12 @@ jobs:
376378
FAILED=true
377379
fi
378380
379-
if [[ "${{ needs.test-suite.result }}" == "failure" || "${{ needs.test-suite.result }}" == "cancelled" ]]; then
380-
echo "❌ Test suite failed or was cancelled" >&2
381-
FAILED=true
381+
# Only check test-suite if it was enabled
382+
if [[ "${{ needs.setup.outputs.go-tests-enabled }}" == "true" ]]; then
383+
if [[ "${{ needs.test-suite.result }}" == "failure" || "${{ needs.test-suite.result }}" == "cancelled" ]]; then
384+
echo "❌ Test suite failed or was cancelled" >&2
385+
FAILED=true
386+
fi
382387
fi
383388
384389
# Check benchmarks (currently optional - just warn if they fail)

0 commit comments

Comments
 (0)