WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Commit 303a2ee

Browse files
committed
docs: update CLI tool documentation for current config system
- Update config-validator README to clarify it validates workflow configs, not main configs - Update test-webhook README to remove outdated CONFIG_FILE references - Update all example commands to reflect current usage - Add note that main config validation is built into the app
1 parent 046f1c2 commit 303a2ee

File tree

2 files changed

+35
-43
lines changed

2 files changed

+35
-43
lines changed

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

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# config-validator
22

3-
Command-line tool for validating and testing examples-copier configurations.
3+
Command-line tool for validating and testing examples-copier workflow configurations.
4+
5+
> **Note:** This tool validates individual workflow config files. It does not validate main config files. Main config validation is built into the application itself.
46
57
## Overview
68

79
The `config-validator` tool helps you:
8-
- Validate configuration files
10+
- Validate workflow configuration files
911
- Test pattern matching
1012
- Test path transformations
1113
- Convert legacy JSON configs to YAML
@@ -36,13 +38,13 @@ Validate a configuration file.
3638
**Examples:**
3739

3840
```bash
39-
# Validate YAML config
40-
./config-validator validate -config copier-config.yaml
41+
# Validate workflow config
42+
./config-validator validate -config .copier/workflows/config.yaml
4143

4244
# Validate with verbose output
43-
./config-validator validate -config copier-config.yaml -v
45+
./config-validator validate -config .copier/workflows/config.yaml -v
4446

45-
# Validate JSON config
47+
# Validate legacy JSON config
4648
./config-validator validate -config config.json
4749
```
4850

@@ -192,20 +194,20 @@ Convert legacy JSON configuration to YAML format.
192194
**Example:**
193195

194196
```bash
195-
./config-validator convert -input config.json -output copier-config.yaml
197+
./config-validator convert -input config.json -output workflow-config.yaml
196198
```
197199

198200
**Output:**
199201
```
200202
✅ Conversion successful!
201203
202204
Converted 2 legacy rules to YAML format.
203-
Output written to: copier-config.yaml
205+
Output written to: workflow-config.yaml
204206
205207
Next steps:
206-
1. Review the generated copier-config.yaml
208+
1. Review the generated workflow-config.yaml
207209
2. Enhance with new features (regex patterns, path transforms)
208-
3. Validate: ./config-validator validate -config copier-config.yaml
210+
3. Validate: ./config-validator validate -config workflow-config.yaml
209211
```
210212

211213
## Common Use Cases
@@ -250,8 +252,8 @@ When files are copied to wrong locations:
250252
Before deploying a new configuration:
251253

252254
```bash
253-
# Validate the config
254-
./config-validator validate -config copier-config.yaml -v
255+
# Validate the workflow config
256+
./config-validator validate -config .copier/workflows/config.yaml -v
255257

256258
# Test with sample file paths
257259
./config-validator test-pattern \
@@ -270,10 +272,10 @@ Before deploying a new configuration:
270272

271273
```bash
272274
# Convert
273-
./config-validator convert -input config.json -output copier-config.yaml
275+
./config-validator convert -input config.json -output workflow-config.yaml
274276

275277
# Validate
276-
./config-validator validate -config copier-config.yaml -v
278+
./config-validator validate -config workflow-config.yaml -v
277279

278280
# Test patterns
279281
./config-validator test-pattern \
@@ -304,8 +306,8 @@ Before deploying a new configuration:
304306
### Complete Workflow
305307

306308
```bash
307-
# 1. Create config
308-
cat > copier-config.yaml << EOF
309+
# 1. Create workflow config
310+
cat > workflow-config.yaml << EOF
309311
workflows:
310312
- name: "Copy Go examples"
311313
source:
@@ -321,7 +323,7 @@ workflows:
321323
EOF
322324

323325
# 2. Validate
324-
./config-validator validate -config copier-config.yaml -v
326+
./config-validator validate -config workflow-config.yaml -v
325327

326328
# 3. Test pattern
327329
./config-validator test-pattern \
@@ -338,8 +340,7 @@ EOF
338340

339341
## See Also
340342

341-
- [Configuration Guide](../../docs/CONFIGURATION-GUIDE.md) - Complete configuration reference
343+
- [Main Config README](../../configs/copier-config-examples/MAIN-CONFIG-README.md) - Main config documentation
342344
- [Pattern Matching Guide](../../docs/PATTERN-MATCHING-GUIDE.md) - Pattern matching help
343-
- [FAQ](../../docs/FAQ.md) - Frequently asked questions (includes JSON to YAML conversion)
344-
- [Quick Reference](../../QUICK-REFERENCE.md) - All commands
345+
- [FAQ](../../docs/FAQ.md) - Frequently asked questions
345346

examples-copier/cmd/test-webhook/README.md

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Test your configuration locally before deploying:
108108

109109
```bash
110110
# 1. Start app in dry-run mode
111-
DRY_RUN=true CONFIG_FILE=copier-config.yaml make run-local-quick
111+
DRY_RUN=true make run-local-quick
112112

113113
# 2. In another terminal, send test webhook
114114
./test-webhook -payload test-payloads/example-pr-merged.json
@@ -122,8 +122,8 @@ tail -f logs/app.log
122122
Test if your patterns match real PR files:
123123

124124
```bash
125-
# 1. Start app with your config
126-
CONFIG_FILE=copier-config.yaml make run-local-quick
125+
# 1. Start app
126+
make run-local-quick
127127

128128
# 2. Send webhook with real PR data
129129
export GITHUB_TOKEN=ghp_...
@@ -139,7 +139,7 @@ Verify files are copied to correct locations:
139139

140140
```bash
141141
# 1. Start app in dry-run mode
142-
DRY_RUN=true CONFIG_FILE=copier-config.yaml ./examples-copier &
142+
DRY_RUN=true ./examples-copier &
143143

144144
# 2. Send test webhook
145145
./test-webhook -payload test-payloads/example-pr-merged.json
@@ -155,7 +155,7 @@ Test Slack integration:
155155
```bash
156156
# 1. Start app with Slack enabled
157157
export SLACK_WEBHOOK_URL="https://hooks.slack.com/services/..."
158-
CONFIG_FILE=copier-config.yaml ./examples-copier &
158+
./examples-copier &
159159

160160
# 2. Send test webhook
161161
./test-webhook -payload test-payloads/example-pr-merged.json
@@ -170,7 +170,7 @@ Debug webhook processing:
170170
```bash
171171
# 1. Enable debug logging
172172
export LOG_LEVEL=debug
173-
CONFIG_FILE=copier-config.yaml ./examples-copier &
173+
./examples-copier &
174174

175175
# 2. Send test webhook
176176
./test-webhook -payload test-payloads/example-pr-merged.json
@@ -233,29 +233,20 @@ vim test-payloads/my-test.json
233233
### Complete Testing Workflow
234234

235235
```bash
236-
# 1. Validate configuration
237-
./config-validator validate -config copier-config.yaml -v
238-
239-
# 2. Test pattern matching
240-
./config-validator test-pattern \
241-
-type regex \
242-
-pattern "^examples/(?P<lang>[^/]+)/(?P<file>.+)$" \
243-
-file "examples/go/main.go"
244-
245-
# 3. Start app in dry-run mode
246-
DRY_RUN=true CONFIG_FILE=copier-config.yaml ./examples-copier &
236+
# 1. Start app in dry-run mode
237+
DRY_RUN=true ./examples-copier &
247238

248-
# 4. Test with example payload
239+
# 2. Test with example payload
249240
./test-webhook -payload test-payloads/example-pr-merged.json
250241

251-
# 5. Check metrics
242+
# 3. Check metrics
252243
curl http://localhost:8080/metrics | jq
253244

254-
# 6. Test with real PR
245+
# 4. Test with real PR
255246
export GITHUB_TOKEN=ghp_...
256247
./test-webhook -pr 42 -owner myorg -repo myrepo
257248

258-
# 7. Review logs
249+
# 5. Review logs
259250
grep "matched" logs/app.log
260251
```
261252

@@ -353,7 +344,7 @@ cat > run-tests.sh << 'EOF'
353344
set -e
354345
355346
echo "Starting app..."
356-
DRY_RUN=true CONFIG_FILE=copier-config.yaml ./examples-copier &
347+
DRY_RUN=true ./examples-copier &
357348
APP_PID=$!
358349
sleep 2
359350
@@ -399,7 +390,7 @@ jobs:
399390
400391
- name: Test
401392
run: |
402-
DRY_RUN=true CONFIG_FILE=copier-config.yaml ./examples-copier &
393+
DRY_RUN=true ./examples-copier &
403394
sleep 2
404395
./test-webhook -payload test-payloads/example-pr-merged.json
405396
```

0 commit comments

Comments
 (0)