Skip to content

Commit 5b752e4

Browse files
committed
chore(copier): update go.mod versions
1 parent 31e5b2e commit 5b752e4

File tree

13 files changed

+99
-151
lines changed

13 files changed

+99
-151
lines changed

examples-copier/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM golang:1.23.4-alpine AS builder
2+
FROM golang:1.24.0-alpine AS builder
33

44
# Install build dependencies
55
RUN apk add --no-cache git ca-certificates

examples-copier/configs/copier-config-examples/MAIN-CONFIG-README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Main Config Architecture Guide
22

3-
This guide explains the new main config architecture that supports centralized configuration with distributed workflow definitions.
3+
This guide explains the main config architecture that supports centralized configuration with distributed workflow definitions.
44

55
## Table of Contents
66

examples-copier/configs/copier-config-examples/QUICK-START-MAIN-CONFIG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Quick Start: Main Config Architecture
22

3-
Get started with the new main config architecture in 5 minutes.
3+
Get started with the main config architecture in 5 minutes.
44

55
## What is Main Config?
66

examples-copier/configs/copier-config-examples/copier-config-workflow.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MFlix Workflow Configuration
2-
# This is the NEW workflow-based format with multi-org support
3-
# Replaces the legacy copy_rules format
2+
# This is the workflow-based format with multi-org support
3+
# Replaces the default copy_rules format
44

55
# Global defaults (apply to all workflows unless overridden)
66
defaults:

examples-copier/configs/copier-config-examples/main-config-example.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,13 @@ workflow_configs:
142142
#
143143
# Required in env.yaml:
144144
# MAIN_CONFIG_FILE: "main-config.yaml"
145-
# USE_MAIN_CONFIG: "true"
145+
# USE_MAIN_CONFIG: "true" # if "false", use optional CONFIG_FILE instead
146146
# CONFIG_REPO_OWNER: "mongodb"
147147
# CONFIG_REPO_NAME: "code-copier-config"
148148
# CONFIG_REPO_BRANCH: "main"
149149
#
150-
# Optional (for backward compatibility):
151-
# CONFIG_FILE: "copier-config.yaml" # Legacy format
150+
# Optional:
151+
# CONFIG_FILE: "copier-config.yaml" # if USE_MAIN_CONFIG: "false"
152152
#
153153
# ============================================================================
154154
# EXAMPLE DIRECTORY STRUCTURE

examples-copier/configs/copier-config-examples/reusable-components/excludes-example.yaml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -113,30 +113,6 @@
113113
# - "!important.js" - include this file even if excluded by other patterns
114114
#
115115
# ============================================================================
116-
# BENEFITS
117-
# ============================================================================
118-
#
119-
# 1. CONSISTENCY
120-
# - All workflows use the same exclude patterns
121-
# - No accidental copying of sensitive files
122-
# - Standardized across projects
123-
#
124-
# 2. MAINTAINABILITY
125-
# - Update patterns in one place
126-
# - Affects all workflows using this file
127-
# - Easy to add new patterns
128-
#
129-
# 3. SECURITY
130-
# - Centralized list of sensitive files
131-
# - Easy to audit
132-
# - Reduces risk of leaking secrets
133-
#
134-
# 4. CLARITY
135-
# - Self-documenting
136-
# - Easy to understand what's excluded
137-
# - Comments explain why
138-
#
139-
# ============================================================================
140116
# COMMON EXCLUDE PATTERN SETS
141117
# ============================================================================
142118
#

examples-copier/configs/copier-config-examples/reusable-components/strategy-example.yaml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -94,28 +94,4 @@ auto_merge: false
9494
# auto_merge: false
9595
#
9696
# ============================================================================
97-
# BENEFITS
98-
# ============================================================================
99-
#
100-
# 1. CONSISTENCY
101-
# - All workflows use the same PR format
102-
# - Standardized messaging
103-
# - Easy to maintain
104-
#
105-
# 2. REUSABILITY
106-
# - Define once, use many times
107-
# - Update in one place
108-
# - Affects all workflows using this strategy
109-
#
110-
# 3. FLEXIBILITY
111-
# - Can override specific fields
112-
# - Mix and match strategies
113-
# - Easy to create new strategies
114-
#
115-
# 4. DOCUMENTATION
116-
# - Strategy is self-documenting
117-
# - Clear what each PR will contain
118-
# - Easy to understand and review
119-
#
120-
# ============================================================================
12197

examples-copier/configs/env.yaml.example

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ env_variables:
4747
# Configuration Files
4848
CONFIG_FILE: "copier-config.yaml" # Config file name in config repo (default: copier-config.yaml)
4949

50-
# Main Config (NEW - for centralized config with workflow references)
50+
# Main Config (for centralized config with workflow references)
5151
# MAIN_CONFIG_FILE: "main-config.yaml" # Main config file with workflow references (optional)
5252
# MAIN_CONFIG_FILE: ".copier/config.yaml" # Can be any path in the config repo
5353
# USE_MAIN_CONFIG: "true" # Enable main config format (default: false, auto-enabled if MAIN_CONFIG_FILE is set)
@@ -203,10 +203,10 @@ env_variables:
203203
# See docs/DEPLOYMENT-CHECKLIST.md for step-by-step checklist
204204
#
205205
# =============================================================================
206-
# MAIN CONFIG ARCHITECTURE (NEW)
206+
# MAIN CONFIG ARCHITECTURE
207207
# =============================================================================
208208
#
209-
# The new main config architecture supports centralized configuration with
209+
# The main config architecture supports centralized configuration with
210210
# distributed workflow definitions. This enables:
211211
#
212212
# - Centralized defaults in a main config file
@@ -232,7 +232,7 @@ env_variables:
232232
# inherit source.repo and source.branch from the workflow config reference.
233233
# No need to repeat this information in every workflow!
234234
#
235-
# To use the new architecture:
235+
# To use the architecture:
236236
# 1. Set MAIN_CONFIG_FILE to your main config file path (any path in config repo)
237237
# 2. Set USE_MAIN_CONFIG to "true" (or leave unset - auto-enabled)
238238
# 3. Create main config file with workflow references
@@ -243,6 +243,6 @@ env_variables:
243243
# - See configs/copier-config-examples/main-config-example.yaml
244244
# - See configs/copier-config-examples/source-repo-workflows-example.yaml
245245
#
246-
# The legacy CONFIG_FILE format is still supported for backward compatibility.
246+
# The default CONFIG_FILE format is still supported.
247247
#
248248

examples-copier/configs/env.yaml.production

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ MONGO_URI_SECRET_NAME: "projects/1054147886816/secrets/mongo-uri/versions/latest
2828
WEBSERVER_PATH: "/events"
2929
CONFIG_FILE: "copier-config.yaml"
3030

31-
# Main Config (NEW - for centralized config with workflow references)
32-
# Uncomment to use the new main config architecture:
31+
# Main Config (for centralized config with workflow references)
32+
# Uncomment to use the main config architecture:
3333
# MAIN_CONFIG_FILE: "main-config.yaml" # Main config file with workflow references
3434
# MAIN_CONFIG_FILE: ".copier/config.yaml" # Can be any path in the config repo
3535
# USE_MAIN_CONFIG: "true" # Auto-enabled if MAIN_CONFIG_FILE is set

examples-copier/configs/environment.go

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ type Config struct {
3434
DefaultPRMerge bool
3535
DefaultCommitMessage string
3636

37-
// New features
38-
DryRun bool
39-
AuditEnabled bool
40-
MongoURI string
41-
MongoURISecretName string
42-
AuditDatabase string
43-
AuditCollection string
44-
MetricsEnabled bool
37+
// Optional features
38+
DryRun bool
39+
AuditEnabled bool
40+
MongoURI string
41+
MongoURISecretName string
42+
AuditDatabase string
43+
AuditCollection string
44+
MetricsEnabled bool
4545

4646
// Slack notifications
47-
SlackWebhookURL string
48-
SlackChannel string
49-
SlackUsername string
50-
SlackIconEmoji string
51-
SlackEnabled bool
47+
SlackWebhookURL string
48+
SlackChannel string
49+
SlackUsername string
50+
SlackIconEmoji string
51+
SlackEnabled bool
5252

5353
// GitHub API retry configuration
5454
GitHubAPIMaxRetries int
@@ -60,61 +60,61 @@ type Config struct {
6060
}
6161

6262
const (
63-
EnvFile = "ENV"
64-
Port = "PORT"
65-
ConfigRepoName = "CONFIG_REPO_NAME"
66-
ConfigRepoOwner = "CONFIG_REPO_OWNER"
67-
AppId = "GITHUB_APP_ID"
68-
AppClientId = "GITHUB_APP_CLIENT_ID"
69-
InstallationId = "INSTALLATION_ID"
70-
CommitterName = "COMMITTER_NAME"
71-
CommitterEmail = "COMMITTER_EMAIL"
72-
ConfigFile = "CONFIG_FILE"
73-
MainConfigFile = "MAIN_CONFIG_FILE"
74-
UseMainConfig = "USE_MAIN_CONFIG"
75-
DeprecationFile = "DEPRECATION_FILE"
76-
WebserverPath = "WEBSERVER_PATH"
77-
ConfigRepoBranch = "CONFIG_REPO_BRANCH"
78-
PEMKeyName = "PEM_NAME"
79-
WebhookSecretName = "WEBHOOK_SECRET_NAME"
80-
WebhookSecret = "WEBHOOK_SECRET"
81-
CopierLogName = "COPIER_LOG_NAME"
82-
GoogleCloudProjectId = "GOOGLE_CLOUD_PROJECT_ID"
83-
DefaultRecursiveCopy = "DEFAULT_RECURSIVE_COPY"
84-
DefaultPRMerge = "DEFAULT_PR_MERGE"
85-
DefaultCommitMessage = "DEFAULT_COMMIT_MESSAGE"
86-
DryRun = "DRY_RUN"
87-
AuditEnabled = "AUDIT_ENABLED"
88-
MongoURI = "MONGO_URI"
89-
MongoURISecretName = "MONGO_URI_SECRET_NAME"
90-
AuditDatabase = "AUDIT_DATABASE"
91-
AuditCollection = "AUDIT_COLLECTION"
92-
MetricsEnabled = "METRICS_ENABLED"
93-
SlackWebhookURL = "SLACK_WEBHOOK_URL"
94-
SlackChannel = "SLACK_CHANNEL"
95-
SlackUsername = "SLACK_USERNAME"
96-
SlackIconEmoji = "SLACK_ICON_EMOJI"
97-
SlackEnabled = "SLACK_ENABLED"
98-
GitHubAPIMaxRetries = "GITHUB_API_MAX_RETRIES"
99-
GitHubAPIInitialRetryDelay = "GITHUB_API_INITIAL_RETRY_DELAY"
100-
PRMergePollMaxAttempts = "PR_MERGE_POLL_MAX_ATTEMPTS"
101-
PRMergePollInterval = "PR_MERGE_POLL_INTERVAL"
63+
EnvFile = "ENV"
64+
Port = "PORT"
65+
ConfigRepoName = "CONFIG_REPO_NAME"
66+
ConfigRepoOwner = "CONFIG_REPO_OWNER"
67+
AppId = "GITHUB_APP_ID"
68+
AppClientId = "GITHUB_APP_CLIENT_ID"
69+
InstallationId = "INSTALLATION_ID"
70+
CommitterName = "COMMITTER_NAME"
71+
CommitterEmail = "COMMITTER_EMAIL"
72+
ConfigFile = "CONFIG_FILE"
73+
MainConfigFile = "MAIN_CONFIG_FILE"
74+
UseMainConfig = "USE_MAIN_CONFIG"
75+
DeprecationFile = "DEPRECATION_FILE"
76+
WebserverPath = "WEBSERVER_PATH"
77+
ConfigRepoBranch = "CONFIG_REPO_BRANCH"
78+
PEMKeyName = "PEM_NAME"
79+
WebhookSecretName = "WEBHOOK_SECRET_NAME"
80+
WebhookSecret = "WEBHOOK_SECRET"
81+
CopierLogName = "COPIER_LOG_NAME"
82+
GoogleCloudProjectId = "GOOGLE_CLOUD_PROJECT_ID"
83+
DefaultRecursiveCopy = "DEFAULT_RECURSIVE_COPY"
84+
DefaultPRMerge = "DEFAULT_PR_MERGE"
85+
DefaultCommitMessage = "DEFAULT_COMMIT_MESSAGE"
86+
DryRun = "DRY_RUN"
87+
AuditEnabled = "AUDIT_ENABLED"
88+
MongoURI = "MONGO_URI"
89+
MongoURISecretName = "MONGO_URI_SECRET_NAME"
90+
AuditDatabase = "AUDIT_DATABASE"
91+
AuditCollection = "AUDIT_COLLECTION"
92+
MetricsEnabled = "METRICS_ENABLED"
93+
SlackWebhookURL = "SLACK_WEBHOOK_URL"
94+
SlackChannel = "SLACK_CHANNEL"
95+
SlackUsername = "SLACK_USERNAME"
96+
SlackIconEmoji = "SLACK_ICON_EMOJI"
97+
SlackEnabled = "SLACK_ENABLED"
98+
GitHubAPIMaxRetries = "GITHUB_API_MAX_RETRIES"
99+
GitHubAPIInitialRetryDelay = "GITHUB_API_INITIAL_RETRY_DELAY"
100+
PRMergePollMaxAttempts = "PR_MERGE_POLL_MAX_ATTEMPTS"
101+
PRMergePollInterval = "PR_MERGE_POLL_INTERVAL"
102102
)
103103

104104
// NewConfig returns a new Config instance with default values
105105
func NewConfig() *Config {
106106
return &Config{
107-
Port: "8080",
108-
CommitterName: "Copier Bot",
109-
CommitterEmail: "bot@example.com",
110-
ConfigFile: "copier-config.yaml",
111-
DeprecationFile: "deprecated_examples.json",
112-
WebserverPath: "/webhook",
113-
ConfigRepoBranch: "main", // Default branch to fetch config file from
114-
PEMKeyName: "projects/1054147886816/secrets/CODE_COPIER_PEM/versions/latest", // default secret name for GCP Secret Manager
115-
WebhookSecretName: "projects/1054147886816/secrets/webhook-secret/versions/latest", // default webhook secret name for GCP Secret Manager
116-
CopierLogName: "copy-copier-log", // default log name for logging to GCP
117-
GoogleCloudProjectId: "github-copy-code-examples", // default project ID for logging to GCP
107+
Port: "8080",
108+
CommitterName: "Copier Bot",
109+
CommitterEmail: "bot@example.com",
110+
ConfigFile: "copier-config.yaml",
111+
DeprecationFile: "deprecated_examples.json",
112+
WebserverPath: "/webhook",
113+
ConfigRepoBranch: "main", // Default branch to fetch config file from
114+
PEMKeyName: "projects/1054147886816/secrets/CODE_COPIER_PEM/versions/latest", // default secret name for GCP Secret Manager
115+
WebhookSecretName: "projects/1054147886816/secrets/webhook-secret/versions/latest", // default webhook secret name for GCP Secret Manager
116+
CopierLogName: "copy-copier-log", // default log name for logging to GCP
117+
GoogleCloudProjectId: "github-copy-code-examples", // default project ID for logging to GCP
118118
DefaultRecursiveCopy: true, // system-wide default for recursive copying that individual config entries can override.
119119
DefaultPRMerge: false, // system-wide default for PR merge without review that individual config entries can override.
120120
DefaultCommitMessage: "Automated PR with updated examples", // default commit message used when per-config commit_message is absent.
@@ -178,7 +178,7 @@ func LoadEnvironment(envFile string) (*Config, error) {
178178
config.GoogleCloudProjectId = getEnvWithDefault(GoogleCloudProjectId, config.GoogleCloudProjectId)
179179
config.DefaultCommitMessage = getEnvWithDefault(DefaultCommitMessage, config.DefaultCommitMessage)
180180

181-
// New features
181+
// Optional features
182182
config.DryRun = getBoolEnvWithDefault(DryRun, false)
183183
config.AuditEnabled = getBoolEnvWithDefault(AuditEnabled, false)
184184
config.MongoURI = os.Getenv(MongoURI)

0 commit comments

Comments
 (0)