Skip to content

Commit d7ec09c

Browse files
[WIP] ✨ Set up Copilot instructions (#180)
* Initial plan * Complete comprehensive .github/copilot-instructions.md with validated commands Co-authored-by: NorthernMan54 <19808920+NorthernMan54@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NorthernMan54 <19808920+NorthernMan54@users.noreply.github.com>
1 parent b648e54 commit d7ec09c

File tree

1 file changed

+77
-2
lines changed

1 file changed

+77
-2
lines changed

.github/copilot-instructions.md

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Copilot Instructions for homebridge-apt-pkg
22

3+
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
4+
35
## Repository Summary
46

57
This repository builds and publishes Debian/Ubuntu APT packages for Homebridge, a HomeKit bridge server. It's primarily a **packaging repository**, not a source code repository. The main purpose is to create self-contained APT packages that bundle Node.js, Homebridge, and Homebridge UI together for easy installation on Debian-based systems.
@@ -29,22 +31,26 @@ docker run --rm --privileged multiarch/qemu-user-static:register --reset
2931

3032
#### Build for x86_64 (AMD64)
3133
```bash
32-
# Build Docker image
34+
# Build Docker image - NEVER CANCEL: Takes 5-10 minutes. Set timeout to 15+ minutes.
3335
docker build -f build/Dockerfile --build-arg BASE_IMAGE=library/debian:bullseye --build-arg QEMU_ARCH=x86_64 -t package-build .
3436

35-
# Build package (takes ~10-15 minutes)
37+
# Build package - NEVER CANCEL: Takes 10-15 minutes. Set timeout to 30+ minutes.
3638
docker run --rm -v $(pwd):/repo -e PKG_RELEASE_TYPE="stable" -e PKG_RELEASE_VERSION="1.0.0" package-build
3739
```
3840

3941
#### Build for ARM64
4042
```bash
43+
# NEVER CANCEL: Takes 5-10 minutes. Set timeout to 15+ minutes.
4144
docker build -f build/Dockerfile --build-arg BASE_IMAGE=arm64v8/debian:bullseye --build-arg QEMU_ARCH=aarch64 -t package-build .
45+
# NEVER CANCEL: Takes 10-15 minutes. Set timeout to 30+ minutes.
4246
docker run --rm -v $(pwd):/repo -e PKG_RELEASE_TYPE="stable" -e PKG_RELEASE_VERSION="1.0.0" package-build
4347
```
4448

4549
#### Build for ARM32 (Raspberry Pi)
4650
```bash
51+
# NEVER CANCEL: Takes 5-10 minutes. Set timeout to 15+ minutes.
4752
docker build -f build/Dockerfile --build-arg BASE_IMAGE=balenalib/raspberrypi3-debian:bullseye --build-arg QEMU_ARCH=arm -t package-build .
53+
# NEVER CANCEL: Takes 10-15 minutes. Set timeout to 30+ minutes.
4854
docker run --rm -v $(pwd):/repo -e PKG_RELEASE_TYPE="stable" -e PKG_RELEASE_VERSION="1.0.0" package-build
4955
```
5056

@@ -234,6 +240,7 @@ The `homebridge-beta-bot` automatically manages beta dependency updates via `.gi
234240
- **Long build times:** Package builds download Node.js and compile native modules (~10-15 min per arch)
235241
- **Network connectivity:** Docker builds require internet access to download dependencies
236242
- **No rollback:** Force push not available, use new commits for fixes
243+
- **No linting:** This repository has no linting tools or scripts configured
237244

238245
## Validation Steps
239246

@@ -254,9 +261,77 @@ The `homebridge-beta-bot` automatically manages beta dependency updates via `.gi
254261
4. **UI Test:** Web interface accessible on port 8581 (default)
255262
5. **Plugin Test:** Basic plugin installation works via UI
256263

264+
## Testing Changelog Generation
265+
266+
You can test the changelog generation feature outside of the full release process:
267+
268+
```bash
269+
# Test stable changelog generation
270+
./test/test-changelog.sh
271+
272+
# Test beta changelog generation
273+
PKG_RELEASE_TYPE=beta ./test/test-changelog.sh
274+
275+
# Test with custom parameters
276+
PKG_RELEASE_TYPE=beta PKG_RELEASE_VERSION=1.2.3-beta.1 OUTPUT_FILE=my-test.md ./test/test-changelog.sh
277+
```
278+
279+
The test script:
280+
- Replicates the exact changelog logic from `build.sh`
281+
- Allows testing different release types (stable/beta)
282+
- Shows which tags and commits would be included
283+
- Generates a sample manifest file for review
284+
- Provides helpful output about available tags and commit counts
285+
286+
This is useful for:
287+
- Validating changelog logic changes before releases
288+
- Understanding what commits will be included in upcoming releases
289+
- Testing edge cases (no tags, no commits, etc.)
290+
291+
## Manual Validation Scenarios
292+
293+
After making any changes to package scripts or configuration, always run through these validation scenarios:
294+
295+
1. **Changelog Generation Test** (< 10 seconds):
296+
```bash
297+
./test/test-changelog.sh
298+
PKG_RELEASE_TYPE=beta ./test/test-changelog.sh
299+
```
300+
301+
2. **Build Script Analysis** (< 30 seconds):
302+
```bash
303+
# Verify build script syntax
304+
bash -n build.sh
305+
306+
# Check that build.sh downloads correct Node.js version
307+
cat package.json | jq -r '.dependencies.node'
308+
```
309+
310+
3. **Package Structure Validation** (< 30 seconds):
311+
```bash
312+
# Verify Debian package files exist and are valid
313+
find deb/ -name "*.install" -o -name "control" -o -name "preinst" -o -name "postinst" -o -name "postrm"
314+
315+
# Check systemd service file syntax
316+
systemd-analyze verify deb/etc/systemd/system/homebridge.service || echo "systemd-analyze not available - validation skipped"
317+
```
318+
319+
4. **Dependencies Validation** (< 30 seconds):
320+
```bash
321+
# Verify all package.json files are valid JSON
322+
jq empty package.json beta/32bit/package.json beta/64bit/package.json
323+
324+
# Check version consistency
325+
echo "Stable deps:" && jq -r '.dependencies | keys[]' package.json
326+
echo "Beta 64-bit deps:" && jq -r '.dependencies | keys[]' beta/64bit/package.json
327+
```
328+
329+
**NOTE:** Full Docker builds take 10-40 minutes and require network access. Use these quick validation steps for iterative development.
330+
257331
## Additional Notes
258332

259333
- This repository uses **functional testing only** - no unit tests
334+
- **No linting tools** - no eslint, shellcheck, or similar tools configured
260335
- Changes trigger expensive build processes (~40+ minutes)
261336
- Most validation happens in CI/CD pipelines, not locally
262337
- The package creates an isolated Node.js environment at `/opt/homebridge/`

0 commit comments

Comments
 (0)