Problem Statement
The apt.hatlabs.fi repository workflow has critical metadata issues during full rebuilds:
- Metadata loss: No information about target distro/channel/component during full rebuild
- Incorrect routing: Same packages copied to all 6 distributions
- Missing unstable packages: Pre-releases not properly detected
During dispatch-based updates (when component repos trigger updates), metadata is provided in the payload. During full rebuilds, this metadata doesn't exist, causing incorrect package placement.
Solution: Extended Naming Convention
Filename Format: {package}_{version}_{arch}+{distro}+{component}.deb
Examples:
halpi2-daemon_1.0.0-1_all+any+hatlabs.deb
signalk-server-container_2.17.2-1_all+trixie+main.deb
cockpit-apt_0.2.0-1_all+trixie+main.deb
Why channel is omitted: Channel (stable/unstable) is determined by GitHub release type, not at build time. The same binary can be in both a pre-release (unstable) and a release (stable).
Design Decisions
Three-Dimensional Routing: (distro, channel, component)
Distro dimension:
any - Deploy to ALL current and future distros (bookworm, trixie, forky)
trixie, bookworm, forky - Specific distro only
Channel dimension (from GitHub release type):
stable - Regular GitHub releases
unstable - Pre-releases
Component dimension:
main - General packages (marine apps, third-party software)
hatlabs - Hat Labs product packages (HALPI2 daemon, firmware)
Special Routing Rules
Legacy compatibility (stable/main and unstable/main):
These repos are ONLY for Hat Labs product packages. Routing to legacy repos happens ONLY when:
component = "hatlabs" AND
distro = "any"
Example: halpi2-daemon+any+hatlabs.deb (pre-release) routes to:
unstable/main (legacy)
bookworm-unstable/hatlabs
trixie-unstable/hatlabs
forky-unstable/hatlabs (when available)
Example: signalk+trixie+main.deb routes ONLY to:
trixie-stable/main (if release) OR
trixie-unstable/main (if pre-release)
Suffix Stripping
The suffix is stripped when packages are stored in the APT repository.
- Download:
halpi2-daemon_1.0.0-1_all+any+hatlabs.deb
- Parse suffix for routing:
distro=any, component=hatlabs
- Extract canonical metadata from .deb control file
- Rename to:
halpi2-daemon_1.0.0-1_all.deb
- Store in appropriate pool directories
Rationale: The suffix is routing metadata. Once routed to the correct pool/dist location, it's no longer needed. APT repository maintains standard Debian naming.
Fallback Behavior
For packages without suffix (backward compatibility):
- Route to bare
stable/ or unstable/ repos
- Future: Require suffix, reject packages without
Implementation Phases
- Core Infrastructure - Update apt.hatlabs.fi workflow
- Pilot - Test with cockpit-apt
- Rollout - Update all 7 component repos
- Cleanup - Remove non-hatlabs packages from stable/main
References
Implementation Requirements
MANDATORY: Follow docs/IMPLEMENTATION_CHECKLIST.md during implementation.
This includes:
- Exploration phase WITHOUT coding
- Planning with "think hard"
- Test-Driven Development (write tests first)
- Verification with subagents
- References to SPEC.md and ARCHITECTURE.md
Problem Statement
The apt.hatlabs.fi repository workflow has critical metadata issues during full rebuilds:
During dispatch-based updates (when component repos trigger updates), metadata is provided in the payload. During full rebuilds, this metadata doesn't exist, causing incorrect package placement.
Solution: Extended Naming Convention
Filename Format:
{package}_{version}_{arch}+{distro}+{component}.debExamples:
halpi2-daemon_1.0.0-1_all+any+hatlabs.debsignalk-server-container_2.17.2-1_all+trixie+main.debcockpit-apt_0.2.0-1_all+trixie+main.debWhy channel is omitted: Channel (stable/unstable) is determined by GitHub release type, not at build time. The same binary can be in both a pre-release (unstable) and a release (stable).
Design Decisions
Three-Dimensional Routing: (distro, channel, component)
Distro dimension:
any- Deploy to ALL current and future distros (bookworm, trixie, forky)trixie,bookworm,forky- Specific distro onlyChannel dimension (from GitHub release type):
stable- Regular GitHub releasesunstable- Pre-releasesComponent dimension:
main- General packages (marine apps, third-party software)hatlabs- Hat Labs product packages (HALPI2 daemon, firmware)Special Routing Rules
Legacy compatibility (stable/main and unstable/main):
These repos are ONLY for Hat Labs product packages. Routing to legacy repos happens ONLY when:
component = "hatlabs"ANDdistro = "any"Example:
halpi2-daemon+any+hatlabs.deb(pre-release) routes to:unstable/main(legacy)bookworm-unstable/hatlabstrixie-unstable/hatlabsforky-unstable/hatlabs(when available)Example:
signalk+trixie+main.debroutes ONLY to:trixie-stable/main(if release) ORtrixie-unstable/main(if pre-release)Suffix Stripping
The suffix is stripped when packages are stored in the APT repository.
halpi2-daemon_1.0.0-1_all+any+hatlabs.debdistro=any,component=hatlabshalpi2-daemon_1.0.0-1_all.debRationale: The suffix is routing metadata. Once routed to the correct pool/dist location, it's no longer needed. APT repository maintains standard Debian naming.
Fallback Behavior
For packages without suffix (backward compatibility):
stable/orunstable/reposImplementation Phases
References
Implementation Requirements
MANDATORY: Follow
docs/IMPLEMENTATION_CHECKLIST.mdduring implementation.This includes: