Skip to content

Commit 16fa1ef

Browse files
committed
sync: update 42 files from source repository
1 parent e6b8a92 commit 16fa1ef

42 files changed

Lines changed: 1909 additions & 975 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/.env.base

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@
1212
#
1313
# Tools:
1414
# - GoFortress
15+
# - go-sanitize
1516
# - go-coverage
1617
# - go-pre-commit
17-
# - GitHub Workflows
18+
# - MAGE-X
19+
# - Gitleaks, Nancy, Govulncheck
20+
# - GitHub Workflows (Dependabot, Stale, Sync Labels, Auto-Merge, PR Management)
21+
# - Redis Service (optional)
1822
#
1923
# Maintainer: @mrz1836
2024
#
@@ -32,6 +36,15 @@ GO_PRIMARY_VERSION=1.24.x
3236
# Set to same as primary to test with single version only
3337
GO_SECONDARY_VERSION=1.24.x
3438

39+
# ================================================================================================
40+
# 📦 GO MODULE CONFIGURATION
41+
# ================================================================================================
42+
43+
# Go sum file location for dependency verification and caching
44+
# Default: go.sum (standard location in repository root)
45+
# Custom examples: lib/go.sum, backend/go.sum, services/api/go.sum
46+
GO_SUM_FILE=go.sum
47+
3548
# ================================================================================================
3649
# 🖥️ RUNNER CONFIGURATION
3750
# ================================================================================================
@@ -80,25 +93,17 @@ ENABLE_SECURITY_SCAN_NANCY=true # Dependency vulnerability checks
8093
ENABLE_GODOCS_PUBLISHING=true # Publish to pkg.go.dev on tag/releases
8194

8295
# ================================================================================================
83-
# ⚙️ TEST CONFIGURATION
96+
# 📦 ARTIFACT DOWNLOAD CONFIGURATION
8497
# ================================================================================================
8598

86-
# Test Output Configuration
87-
TEST_OUTPUT_MODE=SMART # Options: FULL, FAILURES_ONLY, SMART
88-
TEST_OUTPUT_SMART_THRESHOLD=500 # Switch to failure-only mode above this test count
89-
TEST_FAILURE_DETAIL_COUNT=50 # How many failures to show with full details
90-
TEST_FAILURE_ANNOTATION_COUNT=10 # GitHub annotations (hard limit is 50)
91-
TEST_OUTPUT_COMPRESS_ARTIFACTS=true # Gzip large outputs
92-
TEST_OUTPUT_ARTIFACT_RETENTION_DAYS=7 # Keep test artifacts for debugging
93-
94-
# Test Execution Timeouts
95-
TEST_TIMEOUT=30m # Go test timeout for standard tests
96-
TEST_TIMEOUT_RACE_COVER=30m # Timeout for tests with race+coverage (most intensive)
97-
TEST_TIMEOUT_UNIT=20m # Timeout for unit tests only
98-
TEST_TIMEOUT_FUZZ=5m # Timeout for fuzz tests
99+
# Artifact Download Resilience Settings
100+
ARTIFACT_DOWNLOAD_RETRIES=3 # Number of retry attempts for failed downloads
101+
ARTIFACT_DOWNLOAD_RETRY_DELAY=10 # Initial retry delay in seconds (uses exponential backoff)
102+
ARTIFACT_DOWNLOAD_TIMEOUT=300 # Download timeout in seconds (5 minutes)
103+
ARTIFACT_DOWNLOAD_CONTINUE_ON_ERROR=false # Continue workflow execution even if artifact download fails
99104

100105
# ================================================================================================
101-
# 🏃 BENCHMARK CONFIGURATION
106+
# ⚙️ BENCHMARK & TEST CONFIGURATION
102107
# ================================================================================================
103108

104109
# Benchmark execution timeout in minutes
@@ -107,15 +112,20 @@ BENCHMARK_TIMEOUT=20 # Minutes
107112
# Benchmark mode
108113
BENCHMARK_MODE=quick # Options: quick, full, normal
109114

115+
# Test Execution Timeouts
116+
TEST_TIMEOUT=30m # Go test timeout for standard tests
117+
TEST_TIMEOUT_RACE_COVER=30m # Timeout for tests with race+coverage (most intensive)
118+
TEST_TIMEOUT_UNIT=20m # Timeout for unit tests only
119+
TEST_TIMEOUT_FUZZ=5m # Timeout for fuzz tests
120+
110121
# ================================================================================================
111-
# 📦 ARTIFACT DOWNLOAD CONFIGURATION
122+
# 📡 GO-BROADCAST CONFIGURATION (go-sanitize)
112123
# ================================================================================================
113124

114-
# Artifact Download Resilience Settings
115-
ARTIFACT_DOWNLOAD_RETRIES=3 # Number of retry attempts for failed downloads
116-
ARTIFACT_DOWNLOAD_RETRY_DELAY=10 # Initial retry delay in seconds (uses exponential backoff)
117-
ARTIFACT_DOWNLOAD_TIMEOUT=300 # Download timeout in seconds (5 minutes)
118-
ARTIFACT_DOWNLOAD_CONTINUE_ON_ERROR=false # Continue workflow execution even if artifact download fails
125+
# Automerge Labels Configuration
126+
# When using --automerge flag, these labels will be added to created PRs
127+
# Comma-separated list of labels to apply for automatic merging
128+
GO_BROADCAST_AUTOMERGE_LABELS=automerge
119129

120130
# ================================================================================================
121131
# 📊 COVERAGE SYSTEM CONFIGURATION (go-coverage)
@@ -211,25 +221,16 @@ REDIS_HEALTH_CHECK_TIMEOUT=5 # Health check timeout in seconds
211221
# Redis Cache Configuration
212222
REDIS_CACHE_FORCE_PULL=false # Force pull Redis images even when cached (true/false)
213223

214-
# ================================================================================================
215-
# 🔧 TOOL VERSIONS
216-
# ================================================================================================
217-
218-
# Security Tools
219-
GITLEAKS_VERSION=8.28.0 # https://github.com/gitleaks/gitleaks/releases
220-
GOVULNCHECK_VERSION=v1.1.4 # https://pkg.go.dev/golang.org/x/vuln
221-
NANCY_VERSION=v1.0.51 # https://github.com/sonatype-nexus-community/nancy/releases
222-
223224
# ================================================================================================
224225
# 🪄 MAGE-X CONFIGURATION
225226
# ================================================================================================
226227

227-
MAGE_X_VERSION=v1.6.1 # https://github.com/mrz1836/mage-x/releases
228+
MAGE_X_VERSION=v1.7.0 # https://github.com/mrz1836/mage-x/releases
228229
MAGE_X_AUTO_DISCOVER_BUILD_TAGS=true # Enable auto-discovery of build tags
229230
MAGE_X_AUTO_DISCOVER_BUILD_TAGS_EXCLUDE=race,custom # Comma-separated list of tags to exclude
230231
MAGE_X_FORMAT_EXCLUDE_PATHS=vendor,node_modules,.git,.idea # Format exclusion paths (comma-separated directories to exclude from formatting)
231232
MAGE_X_GITLEAKS_VERSION=8.28.0 # https://github.com/gitleaks/gitleaks/releases
232-
MAGE_X_GOFUMPT_VERSION=v0.8.0 # https://github.com/mvdan/gofumpt/releases
233+
MAGE_X_GOFUMPT_VERSION=v0.9.1 # https://github.com/mvdan/gofumpt/releases
233234
MAGE_X_GOLANGCI_LINT_VERSION=v2.4.0 # https://github.com/golangci/golangci-lint/releases
234235
MAGE_X_GORELEASER_VERSION=v2.12.0 # https://github.com/goreleaser/goreleaser/releases
235236
MAGE_X_GOVULNCHECK_VERSION=v1.1.4 # https://pkg.go.dev/golang.org/x/vuln
@@ -246,7 +247,7 @@ MAGE_X_YAMLFMT_VERSION=v0.17.2 # https://github.c
246247
# MAGE_X_GORELEASER_INSTALLED - Set to 'true' when goreleaser is available
247248
# MAGE_X_GORELEASER_CACHED_VERSION - Version of installed goreleaser
248249

249-
# Optional Overrides (uncomment to override defaults)
250+
# Optional Overrides (use .env.custom to override these defaults)
250251
# MAGE_X_BINARY_NAME=magex
251252
# MAGE_X_BUILD_TAGS=mage
252253
# MAGE_X_DOWNLOAD_BACKOFF=2.0
@@ -261,7 +262,7 @@ MAGE_X_YAMLFMT_VERSION=v0.17.2 # https://github.c
261262
# MAGE_X_VERBOSE=true
262263

263264
# ================================================================================================
264-
# 🔒 SECURITY CONFIGURATION
265+
# 🔒 SECURITY CONFIGURATION & TOOLS
265266
# ================================================================================================
266267

267268
# Gitleaks Configuration
@@ -273,12 +274,17 @@ GITLEAKS_CONFIG_FILE=
273274
# Nancy CVE Exclusions (known acceptable vulnerabilities)
274275
NANCY_EXCLUDES=CVE-2024-38513,CVE-2023-45142
275276

277+
# Security Tools
278+
GITLEAKS_VERSION=8.28.0 # https://github.com/gitleaks/gitleaks/releases
279+
GOVULNCHECK_VERSION=v1.1.4 # https://pkg.go.dev/golang.org/x/vuln
280+
NANCY_VERSION=v1.0.51 # https://github.com/sonatype-nexus-community/nancy/releases
281+
276282
# ================================================================================================
277283
# 🪝 PRE-COMMIT SYSTEM CONFIGURATION (go-pre-commit)
278284
# ================================================================================================
279285

280286
# Pre-Commit System
281-
GO_PRE_COMMIT_VERSION=v1.2.0 # https://github.com/mrz1836/go-pre-commit
287+
GO_PRE_COMMIT_VERSION=v1.2.3 # https://github.com/mrz1836/go-pre-commit
282288
GO_PRE_COMMIT_USE_LOCAL=false # Use local version for development
283289

284290
# System Settings
@@ -298,7 +304,7 @@ GO_PRE_COMMIT_ALL_FILES=true
298304

299305
# Tool Versions
300306
GO_PRE_COMMIT_GOLANGCI_LINT_VERSION=v2.4.0 # https://github.com/golangci/golangci-lint
301-
GO_PRE_COMMIT_FUMPT_VERSION=v0.8.0 # https://github.com/mvdan/gofumpt
307+
GO_PRE_COMMIT_FUMPT_VERSION=v0.9.1 # https://github.com/mvdan/gofumpt
302308
GO_PRE_COMMIT_GOIMPORTS_VERSION=latest # https://github.com/golang/tools
303309

304310
# Build Configuration
@@ -383,10 +389,10 @@ AUTO_MERGE_ALLOWED_MERGE_TYPES=squash
383389
AUTO_MERGE_DELETE_BRANCH=true
384390
AUTO_MERGE_SKIP_DRAFT=true
385391
AUTO_MERGE_SKIP_WIP=true
386-
AUTO_MERGE_WIP_LABELS=work-in-progress,wip,do-not-merge
392+
AUTO_MERGE_WIP_LABELS=work-in-progress,wip,do-not-merge,requires-manual-review,security
387393
AUTO_MERGE_COMMENT_ON_ENABLE=true
388394
AUTO_MERGE_COMMENT_ON_DISABLE=true
389-
AUTO_MERGE_LABELS_TO_ADD=auto-merge-enabled
395+
AUTO_MERGE_LABELS_TO_ADD=automerge-enabled
390396
AUTO_MERGE_SKIP_BOT_PRS=true
391397

392398
# ================================================================================================
@@ -400,7 +406,7 @@ PR_MANAGEMENT_APPLY_SIZE_LABELS=true
400406
PR_MANAGEMENT_APPLY_TYPE_LABELS=true
401407
PR_MANAGEMENT_CLEAN_CACHE_ON_CLOSE=true
402408
PR_MANAGEMENT_DELETE_BRANCH_ON_MERGE=true
403-
PR_MANAGEMENT_PROTECTED_BRANCHES=master,main,development
409+
PR_MANAGEMENT_PROTECTED_BRANCHES=master,main,development,production
404410

405411
# PR Size Thresholds
406412
PR_MANAGEMENT_SIZE_XS_THRESHOLD=10

.github/actions/cache-redis-image/action.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ outputs:
6363
runs:
6464
using: "composite"
6565
steps:
66-
# ————————————————————————————————————————————————————————————————
66+
# --------------------------------------------------------------------
6767
# Initialize operation tracking
68-
# ————————————————————————————————————————————————————————————————
68+
# --------------------------------------------------------------------
6969
- name: ⏱️ Initialize operation tracking
7070
id: operation-start
7171
shell: bash
@@ -80,9 +80,9 @@ runs:
8080
echo " • Force Pull: ${{ inputs.force-pull }}"
8181
echo ""
8282
83-
# ————————————————————————————————————————————————————————————————
83+
# --------------------------------------------------------------------
8484
# Configure cache settings and keys
85-
# ————————————————————————————————————————————————————————————————
85+
# --------------------------------------------------------------------
8686
- name: 🔧 Configure cache settings
8787
id: cache-config
8888
shell: bash
@@ -120,9 +120,9 @@ runs:
120120
echo "cache-path=$CACHE_PATH" >> $GITHUB_OUTPUT
121121
echo "normalized-version=$NORMALIZED_VERSION" >> $GITHUB_OUTPUT
122122
123-
# ————————————————————————————————————————————————————————————————
123+
# --------------------------------------------------------------------
124124
# Restore Redis image from cache
125-
# ————————————————————————————————————————————————————————————————
125+
# --------------------------------------------------------------------
126126
- name: 💾 Restore Redis image from cache
127127
if: contains(inputs.cache-mode, 'restore')
128128
id: restore-redis-image
@@ -131,9 +131,9 @@ runs:
131131
path: ${{ steps.cache-config.outputs.cache-path }}
132132
key: ${{ steps.cache-config.outputs.cache-key }}
133133

134-
# ————————————————————————————————————————————————————————————————
134+
# --------------------------------------------------------------------
135135
# Load cached Redis image into Docker
136-
# ————————————————————————————————————————————————————————————————
136+
# --------------------------------------------------------------------
137137
- name: 📦 Load cached Redis image
138138
if: contains(inputs.cache-mode, 'restore') && steps.restore-redis-image.outputs.cache-hit == 'true' && inputs.force-pull != 'true'
139139
id: load-cached-image
@@ -160,9 +160,9 @@ runs:
160160
exit 1
161161
fi
162162
163-
# ————————————————————————————————————————————————————————————————
163+
# --------------------------------------------------------------------
164164
# Pull Redis image if not cached or force-pull enabled
165-
# ————————————————————————————————————————————————————————————————
165+
# --------------------------------------------------------------------
166166
- name: 📥 Pull Redis image from Docker Hub
167167
if: (contains(inputs.cache-mode, 'restore') && steps.restore-redis-image.outputs.cache-hit != 'true') || inputs.force-pull == 'true'
168168
id: pull-redis-image
@@ -183,9 +183,9 @@ runs:
183183
exit 1
184184
fi
185185
186-
# ————————————————————————————————————————————————————————————————
186+
# --------------------------------------------------------------------
187187
# Save Redis image to cache
188-
# ————————————————————————————————————————————————————————————————
188+
# --------------------------------------------------------------------
189189
- name: 💾 Save Redis image to cache
190190
if: contains(inputs.cache-mode, 'save') && (steps.pull-redis-image.outputs.image-pulled == 'true' || inputs.force-pull == 'true')
191191
id: save-redis-image
@@ -217,19 +217,19 @@ runs:
217217
exit 1
218218
fi
219219
220-
# ————————————————————————————————————————————————————————————————
220+
# --------------------------------------------------------------------
221221
# Save cache using actions/cache (only if cache wasn't already hit)
222-
# ————————————————————————————————————————————————————————————————
222+
# --------------------------------------------------------------------
223223
- name: 🗄️ Save Redis image cache
224224
if: contains(inputs.cache-mode, 'save') && steps.save-redis-image.outputs.image-saved == 'true' && steps.restore-redis-image.outputs.cache-hit != 'true'
225225
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
226226
with:
227227
path: ${{ steps.cache-config.outputs.cache-path }}
228228
key: ${{ steps.cache-config.outputs.cache-key }}
229229

230-
# ————————————————————————————————————————————————————————————————
230+
# --------------------------------------------------------------------
231231
# Verify Redis image availability
232-
# ————————————————————————————————————————————————————————————————
232+
# --------------------------------------------------------------------
233233
- name: 🔍 Verify Redis image availability
234234
id: image-verification
235235
shell: bash
@@ -247,9 +247,9 @@ runs:
247247
exit 1
248248
fi
249249
250-
# ————————————————————————————————————————————————————————————————
250+
# --------------------------------------------------------------------
251251
# Gather image information and metrics
252-
# ————————————————————————————————————————————————————————————————
252+
# --------------------------------------------------------------------
253253
- name: 📊 Gather image information
254254
id: image-info
255255
shell: bash
@@ -276,9 +276,9 @@ runs:
276276
echo "image-id=$IMAGE_ID" >> $GITHUB_OUTPUT
277277
echo "image-created=$IMAGE_CREATED" >> $GITHUB_OUTPUT
278278
279-
# ————————————————————————————————————————————————————————————————
279+
# --------------------------------------------------------------------
280280
# Operation summary and timing
281-
# ————————————————————————————————————————————————————————————————
281+
# --------------------------------------------------------------------
282282
- name: ✅ Operation summary
283283
id: operation-summary
284284
shell: bash

.github/actions/collect-cache-stats/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ outputs:
9090
runs:
9191
using: "composite"
9292
steps:
93-
# ————————————————————————————————————————————————————————————————
93+
# --------------------------------------------------------------------
9494
# Collect cache statistics with size calculation
95-
# ————————————————————————————————————————————————————————————————
95+
# --------------------------------------------------------------------
9696
- name: 📊 Collect cache statistics
9797
id: collect
9898
shell: bash

.github/actions/configure-redis/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ outputs:
7070
runs:
7171
using: "composite"
7272
steps:
73-
# ————————————————————————————————————————————————————————————————
73+
# --------------------------------------------------------------------
7474
# Extract and configure Redis settings
75-
# ————————————————————————————————————————————————————————————————
75+
# --------------------------------------------------------------------
7676
- name: 🗄️ Configure Redis Settings
7777
id: redis-config
7878
shell: bash

0 commit comments

Comments
 (0)