Skip to content

Commit 6420aff

Browse files
authored
Merge pull request #84 from cbullinger/quick-fix
Copier App: Support for cross-org copy
2 parents bc25daa + 7864687 commit 6420aff

39 files changed

+5675
-562
lines changed

examples-copier/QUICK-REFERENCE.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -410,25 +410,31 @@ gcloud secrets list
410410
```
411411
examples-copier/
412412
├── README.md # Main documentation
413-
├── MIGRATION-GUIDE.md # Migration from legacy
414413
├── QUICK-REFERENCE.md # This file
415-
├── REFACTORING-SUMMARY.md # Feature details
416414
├── docs/
415+
│ ├── ARCHITECTURE.md # Architecture overview
416+
│ ├── CONFIGURATION-GUIDE.md # Complete config reference
417417
│ ├── DEPLOYMENT.md # Deployment guide
418-
│ └── DEPLOYMENT-CHECKLIST.md # Deployment checklist
419-
├── TESTING-SUMMARY.md # Test documentation
418+
│ ├── DEPLOYMENT-CHECKLIST.md # Deployment checklist
419+
│ ├── FAQ.md # Frequently asked questions
420+
│ ├── LOCAL-TESTING.md # Local testing guide
421+
│ ├── PATTERN-MATCHING-GUIDE.md # Pattern matching guide
422+
│ ├── PATTERN-MATCHING-CHEATSHEET.md # Quick pattern reference
423+
│ ├── TROUBLESHOOTING.md # Troubleshooting guide
424+
│ └── WEBHOOK-TESTING.md # Webhook testing guide
420425
├── configs/
421426
│ ├── .env # Environment config
422-
│ ├── .env.example.new # Environment template
423-
│ └── config.example.yaml # Config template
427+
│ ├── env.yaml.example # Environment template
428+
│ └── copier-config.example.yaml # Config template
424429
└── cmd/
425-
└── config-validator/ # CLI tool
430+
├── config-validator/ # CLI validation tool
431+
└── test-webhook/ # Webhook testing tool
426432
```
427433
428434
## Quick Start Checklist
429435
430436
- [ ] Clone repository
431-
- [ ] Copy `.env.example.new` to `.env`
437+
- [ ] Copy `configs/.env.local.example` to `configs/.env`
432438
- [ ] Set required environment variables
433439
- [ ] Create `copier-config.yaml` in source repo
434440
- [ ] Validate config: `./config-validator validate -config copier-config.yaml`
@@ -440,6 +446,8 @@ examples-copier/
440446
## Support
441447
442448
- **Documentation**: [README.md](README.md)
443-
- **Migration**: [MIGRATION-GUIDE.md](./docs/MIGRATION-GUIDE.md)
444-
- **Deployment**: [DEPLOYMENT-GUIDE.md](./docs/DEPLOYMENT-GUIDE.md)
449+
- **Configuration**: [Configuration Guide](./docs/CONFIGURATION-GUIDE.md)
450+
- **Deployment**: [Deployment Guide](./docs/DEPLOYMENT.md)
451+
- **Troubleshooting**: [Troubleshooting Guide](./docs/TROUBLESHOOTING.md)
452+
- **FAQ**: [Frequently Asked Questions](./docs/FAQ.md)
445453

examples-copier/README.md

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,14 @@ go build -o config-validator ./cmd/config-validator
4848

4949
### Configuration
5050

51-
1. **Copy .env example file**
51+
1. **Copy environment example file**
5252

5353
```bash
54-
cp configs/.env.example.new configs/.env
54+
# For local development
55+
cp configs/.env.local.example configs/.env
56+
57+
# Or for YAML-based configuration
58+
cp configs/env.yaml.example env.yaml
5559
```
5660

5761
2. **Set required environment variables**
@@ -387,22 +391,34 @@ COPIER_DEBUG=true ./examples-copier
387391
examples-copier/
388392
├── app.go # Main application entry point
389393
├── cmd/
390-
│ └── config-validator/ # CLI validation tool
394+
│ ├── config-validator/ # CLI validation tool
395+
│ └── test-webhook/ # Webhook testing tool
391396
├── configs/
392397
│ ├── environment.go # Environment configuration
393-
│ ├── .env.example.new # Environment template
394-
│ └── config.example.yaml # Config template
398+
│ ├── .env.local.example # Local environment template
399+
│ ├── env.yaml.example # YAML environment template
400+
│ └── copier-config.example.yaml # Config template
395401
├── services/
396402
│ ├── pattern_matcher.go # Pattern matching engine
397403
│ ├── config_loader.go # Config loading & validation
398404
│ ├── audit_logger.go # MongoDB audit logging
399405
│ ├── health_metrics.go # Health & metrics endpoints
400406
│ ├── file_state_service.go # Thread-safe state management
401407
│ ├── service_container.go # Dependency injection
402-
│ └── webhook_handler_new.go # New webhook handler
403-
└── types/
404-
├── config.go # Configuration types
405-
└── types.go # Core types
408+
│ ├── webhook_handler_new.go # Webhook handler
409+
│ ├── github_auth.go # GitHub authentication
410+
│ ├── github_read.go # GitHub read operations
411+
│ ├── github_write_to_target.go # GitHub write operations
412+
│ └── slack_notifier.go # Slack notifications
413+
├── types/
414+
│ ├── config.go # Configuration types
415+
│ └── types.go # Core types
416+
└── docs/
417+
├── ARCHITECTURE.md # Architecture overview
418+
├── CONFIGURATION-GUIDE.md # Complete config reference
419+
├── DEPLOYMENT.md # Deployment guide
420+
├── FAQ.md # Frequently asked questions
421+
└── ... # Additional documentation
406422
```
407423
408424
### Service Container
@@ -452,9 +468,10 @@ docker run -p 8080:8080 --env-file .env examples-copier
452468

453469
- **[Pattern Matching Cheat Sheet](docs/PATTERN-MATCHING-CHEATSHEET.md)** - Quick pattern syntax reference
454470
- **[Architecture](docs/ARCHITECTURE.md)** - System design and components
455-
- **[Migration Guide](docs/MIGRATION-GUIDE.md)** - Migrate from legacy JSON config
456471
- **[Troubleshooting](docs/TROUBLESHOOTING.md)** - Common issues and solutions
457472
- **[FAQ](docs/FAQ.md)** - Frequently asked questions
473+
- **[Debug Logging](docs/DEBUG-LOGGING.md)** - Debug logging configuration
474+
- **[Deprecation Tracking](docs/DEPRECATION-TRACKING-EXPLAINED.md)** - How deprecation tracking works
458475

459476
### Features
460477

examples-copier/app.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,39 @@ env: flex
66

77
includes:
88
- env.yaml
9+
10+
# Automatic scaling configuration
11+
# Keeps at least 1 instance running to avoid cold starts
12+
automatic_scaling:
13+
min_num_instances: 1
14+
max_num_instances: 10
15+
cool_down_period_sec: 120
16+
cpu_utilization:
17+
target_utilization: 0.6
18+
19+
# Network configuration
20+
network:
21+
session_affinity: true
22+
23+
# Health check configuration
24+
# These ensure the app is ready before receiving traffic
25+
liveness_check:
26+
path: "/health"
27+
check_interval_sec: 30
28+
timeout_sec: 4
29+
failure_threshold: 2
30+
success_threshold: 2
31+
32+
readiness_check:
33+
path: "/health"
34+
check_interval_sec: 5
35+
timeout_sec: 4
36+
failure_threshold: 2
37+
success_threshold: 2
38+
app_start_timeout_sec: 300
39+
40+
# Resources configuration
41+
resources:
42+
cpu: 1
43+
memory_gb: 2
44+
disk_size_gb: 10

examples-copier/cmd/config-validator/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ EOF
338338

339339
## See Also
340340

341-
- [Configuration Setup](../../docs/CONFIG-SETUP.md) - Configuration guide
341+
- [Configuration Guide](../../docs/CONFIGURATION-GUIDE.md) - Complete configuration reference
342342
- [Pattern Matching Guide](../../docs/PATTERN-MATCHING-GUIDE.md) - Pattern matching help
343-
- [Migration Guide](../../docs/MIGRATION-GUIDE.md) - Migrating from JSON
344-
- [Quick Reference](../../docs/QUICK-REFERENCE.md) - All commands
343+
- [FAQ](../../docs/FAQ.md) - Frequently asked questions (includes JSON to YAML conversion)
344+
- [Quick Reference](../../QUICK-REFERENCE.md) - All commands
345345

examples-copier/configs/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Overview of the different environment configuration files and when to use each.
88
|-----------------------|---------------------------------------|---------------------------------|
99
| `env.yaml.example` | Complete reference with all variables | First-time setup, documentation |
1010
| `env.yaml.production` | Production-ready template | Quick deployment to production |
11-
| `.env.example` | Local development template | Local testing and development |
11+
| `.env.local.example` | Local development template | Local testing and development |
1212

1313
---
1414

@@ -61,9 +61,9 @@ Overview of the different environment configuration files and when to use each.
6161

6262
---
6363

64-
## .env.example.new
64+
## .env.local.example
6565

66-
**Location:** `configs/.env.example.new`
66+
**Location:** `configs/.env.local.example`
6767

6868
**Purpose:** Local development template (traditional .env format)
6969

@@ -136,11 +136,11 @@ nano env.yaml # Enable features you need
136136

137137
### Scenario 3: Local Development
138138

139-
**Recommended:** `.env.example.new`
139+
**Recommended:** `.env.local.example`
140140

141141
```bash
142142
# Local development
143-
cp configs/.env.example.new configs/.env
143+
cp configs/.env.local.example configs/.env
144144
nano configs/.env # Add your values
145145
146146
# Run locally
@@ -215,7 +215,7 @@ diff configs/env.yaml.production configs/env.yaml.example
215215

216216
- **Use `env.yaml.production` for quick production deployment**
217217
- **Use `env.yaml.example` as reference documentation**
218-
- **Use `.env.example.new` for local development**
218+
- **Use `.env.local.example` for local development**
219219
- **Add `env.yaml` and `.env` to `.gitignore`**
220220
- **Use Secret Manager for production secrets**
221221
- **Keep comments in your env.yaml for team documentation**
@@ -237,7 +237,7 @@ examples-copier/
237237
├── configs/
238238
│ ├── env.yaml.example # ← Complete reference (all variables)
239239
│ ├── env.yaml.production # ← Production template (essential only)
240-
│ └── .env.example # ← Local development template
240+
│ └── .env.local.example # ← Local development template
241241
├── env.yaml # ← Your actual config (gitignored)
242242
└── .env # ← Your local config (gitignored)
243243
```
@@ -253,7 +253,7 @@ examples-copier/
253253
→ Read `env.yaml.example`
254254
255255
**Need to develop locally?**
256-
→ Use `.env.example.new`
256+
→ Use `.env.local.example`
257257
258258
**Need advanced features?**
259259
→ Start with `env.yaml.example`, customize

examples-copier/docs/ARCHITECTURE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ path_transform: "source/code-examples/${lang}/${category}/${file}"
4242
**Files Created:**
4343
- `types/config.go` - New configuration types
4444
- `services/config_loader.go` - Configuration loader with YAML/JSON support
45-
- `configs/config.example.yaml` - Example YAML configuration
45+
- `configs/copier-config.example.yaml` - Example YAML configuration
4646

4747
**Capabilities:**
4848
- Native YAML support with `gopkg.in/yaml.v3`
@@ -190,7 +190,7 @@ Returns detailed metrics:
190190

191191
```bash
192192
# Validate configuration
193-
config-validator validate -config copier-copier-config.yaml -v
193+
config-validator validate -config copier-config.yaml -v
194194
195195
# Test pattern matching
196196
config-validator test-pattern \

examples-copier/docs/CONFIGURATION-GUIDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,9 +883,10 @@ Error: copy_rules[0]: name is required
883883
884884
- [Pattern Matching Guide](PATTERN-MATCHING-GUIDE.md) - Detailed pattern matching documentation
885885
- [Pattern Matching Cheat Sheet](PATTERN-MATCHING-CHEATSHEET.md) - Quick reference
886-
- [Migration Guide](MIGRATION-GUIDE.md) - Migrating from legacy JSON config
886+
- [FAQ](FAQ.md) - Frequently asked questions (includes JSON to YAML conversion)
887887
- [Quick Reference](../QUICK-REFERENCE.md) - Command reference
888888
- [Deployment Guide](DEPLOYMENT.md) - Deploying the application
889+
- [Architecture](ARCHITECTURE.md) - System architecture overview
889890
890891
---
891892

examples-copier/docs/FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Use the config-validator tool:
7171
./config-validator convert -input config.json -output copier-config.yaml
7272
```
7373

74-
See [Migration Guide](MIGRATION-GUIDE.md) for details.
74+
The tool will automatically convert your legacy JSON configuration to the new YAML format while preserving all settings.
7575

7676
## Pattern Matching
7777

examples-copier/docs/LOCAL-TESTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ make run-local-quick
3434

3535
```bash
3636
# Copy the local template
37-
cp configs/.env.local configs/.env
37+
cp configs/.env.local.example configs/.env
3838

3939
# Edit with your values (optional)
4040
nano configs/.env

0 commit comments

Comments
 (0)