Skip to content

Commit 542c36d

Browse files
Validate and update copilot instructions with corrected workflow references and comprehensive testing (#697)
* Initial plan * Update copilot instructions with validated commands and corrected information Co-authored-by: NorthernMan54 <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: NorthernMan54 <[email protected]>
1 parent 115e6b5 commit 542c36d

File tree

1 file changed

+69
-26
lines changed

1 file changed

+69
-26
lines changed

.github/copilot-instructions.md

Lines changed: 69 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,40 +26,54 @@ This repository creates the official multi-architecture Docker images for Homebr
2626

2727
### Current Build Status - IMPORTANT
2828

29-
**⚠️ LOCAL BUILDS CURRENTLY FAIL** due to `pipx install tzupdate` dependency issue in Dockerfile (fails after ~2 minutes at build step 2/9). Use published images for all testing and validation.
29+
**⚠️ LOCAL BUILDS CURRENTLY FAIL** due to `pipx install tzupdate` dependency issue in Dockerfile (fails after ~89 seconds at build step 2/9). Use published images for all testing and validation.
3030

3131
### Working Validation Commands
3232

3333
**Always run these commands from the repository root.**
3434

3535
1. **Test Stable Release (Published Image):**
3636
```bash
37-
# Uses published stable image - NEVER CANCEL, takes ~25 seconds
37+
# Uses published stable image - NEVER CANCEL, takes ~19 seconds
3838
cd test
3939
export HOMEBRIDGE_IMAGE='ghcr.io/homebridge/homebridge:latest'
4040
docker compose up -d
4141
# Verify UI accessible: curl -s -o /dev/null -w "%{http_code}" http://localhost:8581
4242
# Should return 200
4343
docker compose down
4444
```
45-
- Duration: 25 seconds for image pull, 10 seconds for startup
45+
- Duration: 19 seconds for image pull, 15 seconds for startup
4646
- Validates: Container startup, UI accessibility, Homebridge functionality
4747
- Creates working container accessible at http://localhost:8581
4848

4949
2. **Test Beta Release (Published Image):**
5050
```bash
51-
# Uses published beta image - NEVER CANCEL, takes ~25 seconds
51+
# Uses published beta image - NEVER CANCEL, takes ~20 seconds
5252
cd test
5353
export HOMEBRIDGE_IMAGE='ghcr.io/homebridge/homebridge:beta'
5454
docker compose up -d
5555
# Verify UI accessible: curl -s -o /dev/null -w "%{http_code}" http://localhost:8581
5656
# Should return 200
5757
docker compose down
5858
```
59-
- Duration: 25 seconds for image pull, 10 seconds for startup
59+
- Duration: 20 seconds for image pull, 15 seconds for startup
6060
- Uses beta package versions and latest development features
6161
- Creates beta-tagged container
6262

63+
3. **Test Alpha Release (Published Image):**
64+
```bash
65+
# Uses published alpha image - NEVER CANCEL, takes ~21 seconds
66+
cd test
67+
export HOMEBRIDGE_IMAGE='ghcr.io/homebridge/homebridge:alpha'
68+
docker compose up -d
69+
# Verify UI accessible: curl -s -o /dev/null -w "%{http_code}" http://localhost:8581
70+
# Should return 200
71+
docker compose down
72+
```
73+
- Duration: 21 seconds for image pull, 15 seconds for startup
74+
- Uses alpha package versions for early testing
75+
- Creates alpha-tagged container
76+
6377
### Local Build Commands (Currently Failing - Use Only for Investigation)
6478

6579
**❌ DO NOT USE FOR VALIDATION** - These will fail but are documented for completeness:
@@ -69,7 +83,7 @@ This repository creates the official multi-architecture Docker images for Homebr
6983
# Extracts versions from package.json automatically - WILL FAIL at tzupdate step
7084
./test-build-local.sh
7185
```
72-
- Expected failure at ~113 seconds during `pipx install tzupdate`
86+
- Expected failure at ~89 seconds during `pipx install tzupdate`
7387
- Error: "No matching distribution found for tzupdate"
7488

7589
2. **Beta Build (Will Fail):**
@@ -85,7 +99,7 @@ This repository creates the official multi-architecture Docker images for Homebr
8599
This repository uses the NorthernMan54/Homebridge-Dependency-Bot to automatically update dependencies for stable, beta, and alpha release streams. The bot runs daily via a consolidated workflow and can also be triggered manually.
86100

87101
**Dependency Management Workflow:**
88-
- **Consolidated Workflow** (`dependency_management.yml`):
102+
- **Consolidated Workflow** (`release-stage-1_update_dependencies.yml`):
89103
- Runs daily at 10:00 UTC (6 AM Eastern)
90104
- Updates dependencies for all three release streams: stable, beta, alpha
91105
- Uses NorthernMan54/Homebridge-Dependency-Bot action
@@ -104,7 +118,7 @@ This repository uses the NorthernMan54/Homebridge-Dependency-Bot to automaticall
104118
- Automated process ensures all release streams stay current with upstream changes
105119

106120
**Troubleshooting Dependency Bot:**
107-
- Check workflow run logs in Actions tab for `dependency_management.yml`
121+
- Check workflow run logs in Actions tab for `release-stage-1_update_dependencies.yml`
108122
- Verify JSON syntax with `jq . .github/homebridge-dependency-bot-*.json`
109123
- Manual trigger available via workflow_dispatch in GitHub Actions UI
110124
- Bot requires `GH_TOKEN` secret for PR approval (auto-configured)
@@ -141,14 +155,21 @@ docker build \
141155
cd test
142156
# Test stable
143157
export HOMEBRIDGE_IMAGE='ghcr.io/homebridge/homebridge:latest'
144-
docker compose up -d && sleep 10
158+
docker compose up -d && sleep 15
145159
curl -f http://localhost:8581 || echo "UI not accessible"
146160
docker compose logs --tail 20
147161
docker compose down
148162

149163
# Test beta
150164
export HOMEBRIDGE_IMAGE='ghcr.io/homebridge/homebridge:beta'
151-
docker compose up -d && sleep 10
165+
docker compose up -d && sleep 15
166+
curl -f http://localhost:8581 || echo "UI not accessible"
167+
docker compose logs --tail 20
168+
docker compose down
169+
170+
# Test alpha
171+
export HOMEBRIDGE_IMAGE='ghcr.io/homebridge/homebridge:alpha'
172+
docker compose up -d && sleep 15
152173
curl -f http://localhost:8581 || echo "UI not accessible"
153174
docker compose logs --tail 20
154175
docker compose down
@@ -189,8 +210,8 @@ docker compose down
189210
├── homebridge-dependency-bot-alpha.json # Alpha release dependency configuration
190211
├── dependabot.yml # Deprecated - migrated to dependency bot
191212
└── workflows/
192-
├── build_and_push.yml # Main build and release workflow
193-
└── dependency_management.yml # Consolidated dependency management
213+
├── release-stage-1_update_dependencies.yml # Dependency management workflow
214+
└── release-stage-2_build_and_push_docker_images.yml # Main build and release workflow
194215
```
195216

196217
### Key Configuration Files
@@ -203,7 +224,7 @@ docker compose down
203224

204225
### CI/CD Pipeline
205226

206-
**Main Release Pipeline (.github/workflows/build_and_push.yml):**
227+
**Main Release Pipeline (.github/workflows/release-stage-2_build_and_push_docker_images.yml):**
207228
1. **Version extraction** from package.json files
208229
2. **Multi-architecture builds** (amd64, arm32v7, arm64v8)
209230
3. **Container registry pushes** (GitHub Container Registry + Docker Hub)
@@ -213,10 +234,10 @@ docker compose down
213234
**Manual Trigger Required:** Workflow runs via `workflow_dispatch` only.
214235

215236
**Dependency Management Pipeline:**
216-
- **Consolidated Workflow:** `dependency_management.yml` handles all release streams
237+
- **Consolidated Workflow:** `release-stage-1_update_dependencies.yml` handles all release streams
217238
- **Daily Schedule:** Runs at 10:00 UTC, processes stable/beta/alpha streams
218239
- **Auto-merge:** Enabled for dependency PRs to maintain currency
219-
- **Trigger Builds:** Automatically triggers build_and_push.yml after updates
240+
- **Trigger Builds:** Automatically triggers release-stage-2_build_and_push_docker_images.yml after updates
220241
- **Manual Control:** Support selective stream updates via workflow_dispatch
221242

222243
**Build Matrix:**
@@ -265,7 +286,7 @@ docker compose down
265286

266287
**Always validate:**
267288
- JSON syntax in package.json files (`jq . package.json`)
268-
- JSON syntax in beta bot config (`jq . .github/homebridge-beta-bot.json`)
289+
- JSON syntax in dependency bot configs (`jq . .github/homebridge-dependency-bot-*.json`)
269290
- Shell script syntax (`bash -n script.sh`)
270291
- Published image functionality using test commands above
271292

@@ -306,13 +327,27 @@ docker compose down
306327
docker compose down
307328
```
308329

309-
3. **Version Verification:**
330+
3. **Alpha Version Test:**
331+
```bash
332+
cd test
333+
export HOMEBRIDGE_IMAGE='ghcr.io/homebridge/homebridge:alpha'
334+
docker compose up -d
335+
sleep 15
336+
curl -f http://localhost:8581 > /dev/null && echo "✅ Alpha UI accessible" || echo "❌ Alpha UI failed"
337+
docker compose logs | grep "Homebridge v2" && echo "✅ Alpha version running" || echo "❌ Not alpha version"
338+
docker compose down
339+
```
340+
341+
4. **Version Verification:**
310342
```bash
311343
# Check stable version
312344
docker run --rm ghcr.io/homebridge/homebridge:latest cat /opt/homebridge/Docker.manifest | head -10
313345

314346
# Check beta version
315347
docker run --rm ghcr.io/homebridge/homebridge:beta cat /opt/homebridge/Docker.manifest | head -10
348+
349+
# Check alpha version
350+
docker run --rm ghcr.io/homebridge/homebridge:alpha cat /opt/homebridge/Docker.manifest | head -10
316351
```
317352

318353
## Common Tasks Reference
@@ -321,11 +356,14 @@ docker compose down
321356

322357
### Test Published Images
323358
```bash
324-
# Pull and test stable image (~25 seconds)
359+
# Pull and test stable image (~19 seconds)
325360
cd test && export HOMEBRIDGE_IMAGE='ghcr.io/homebridge/homebridge:latest' && docker compose up -d
326361

327-
# Pull and test beta image (~25 seconds)
362+
# Pull and test beta image (~20 seconds)
328363
cd test && export HOMEBRIDGE_IMAGE='ghcr.io/homebridge/homebridge:beta' && docker compose up -d
364+
365+
# Pull and test alpha image (~21 seconds)
366+
cd test && export HOMEBRIDGE_IMAGE='ghcr.io/homebridge/homebridge:alpha' && docker compose up -d
329367
```
330368

331369
### Verify JSON Configuration
@@ -336,8 +374,13 @@ jq . package.json
336374
# Validate beta package.json syntax
337375
jq . beta/package.json
338376

339-
# Validate beta bot configuration
340-
jq . .github/homebridge-beta-bot.json
377+
# Validate alpha package.json syntax
378+
jq . alpha/package.json
379+
380+
# Validate dependency bot configurations
381+
jq . .github/homebridge-dependency-bot-stable.json
382+
jq . .github/homebridge-dependency-bot-beta.json
383+
jq . .github/homebridge-dependency-bot-alpha.json
341384
```
342385

343386
### Check Repository Structure
@@ -352,7 +395,7 @@ find rootfs/etc/s6-overlay -type f | head -10
352395

353396
# GitHub workflows
354397
ls .github/workflows/
355-
# Output: build_and_push.yml, beta automation workflows
398+
# Output: release-stage-1_update_dependencies.yml, release-stage-2_build_and_push_docker_images.yml, etc.
356399
```
357400

358401
### Test Environment
@@ -369,9 +412,9 @@ grep "image:" test/docker-compose.yml
369412
**CRITICAL REMINDERS:**
370413
- **NEVER attempt local builds** - they will fail due to tzupdate dependency issue
371414
- **ALWAYS use published images** for testing and validation
372-
- **NEVER CANCEL** published image pulls - they take 20-25 seconds and work reliably
373-
- **Always wait 10-15 seconds** after container startup before testing UI
374-
- **Always use `docker compose down`** for clean shutdown (takes ~10 seconds)
415+
- **NEVER CANCEL** published image pulls - they take 19-21 seconds and work reliably
416+
- **Always wait 15 seconds** after container startup before testing UI
417+
- **Always use `docker compose down`** for clean shutdown (takes ~3 seconds)
375418

376419
## Validation Steps
377420

@@ -388,7 +431,7 @@ grep "image:" test/docker-compose.yml
388431

389432
**Always validate:**
390433
- JSON syntax in package.json files (`jq . package.json`)
391-
- JSON syntax in beta bot config (`jq . .github/homebridge-beta-bot.json`)
434+
- JSON syntax in dependency bot configs (`jq . .github/homebridge-dependency-bot-*.json`)
392435
- Shell script syntax (`bash -n script.sh`)
393436
- Docker build completes without errors
394437
- Container starts and reaches healthy state

0 commit comments

Comments
 (0)