668 Commits

Author SHA1 Message Date
Christopher Obbard
79bbd0adad Merge pull request #616 from go-debos/dependabot/github_actions/actions/checkout-6
build(deps): bump actions/checkout from 5 to 6
2025-11-21 09:19:35 +00:00
dependabot[bot]
d1e7f14b97 build(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-21 03:03:27 +00:00
Dylan Aïssi
0018877a8e Merge pull request #613 from go-debos/dependabot/github_actions/golangci/golangci-lint-action-9
build(deps): bump golangci/golangci-lint-action from 8 to 9
2025-11-10 09:32:09 +00:00
dependabot[bot]
e04cee425b build(deps): bump golangci/golangci-lint-action from 8 to 9
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 8 to 9.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v8...v9)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-version: '9'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-10 03:03:51 +00:00
Sjoerd Simons
862d06e26e Merge pull request #597 from go-debos/copilot/fix-d5fc231f-957e-4e33-8683-9d0d0b3f27aa
Add overlay-non-existent-destination test to CI
2025-11-01 21:32:52 +00:00
Christopher Obbard
a0b01b22e4 Merge pull request #595 from go-debos/copilot/fix-baab5a68-f61a-4f00-bccd-13ba574abe97
Migrate from unmaintained gopkg.in/yaml.v2 to goccy/go-yaml
2025-11-01 21:31:51 +00:00
Sjoerd Simons
4f6c82a5a0 Switch yaml parsing to goccy/go-yaml
go-yaml/yaml has been deprecated by its maintainer; Move to goccy/go-yaml, which is
an actively maintained from a scratch yaml implementation in pure go. It
should able to parse all yaml file go-yaml could, and more. As an extra
benefit its errors are a lot better.

Fixes: #592
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2025-11-01 22:04:02 +01:00
Sjoerd Simons
1b22166517 tests: templating: Add yaml anchors
Add some yaml anchors in the templating test to ensure those are
correctly handled. This is in preperation for switching the yaml
package.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2025-11-01 22:04:02 +01:00
Sjoerd Simons
a38da6a5d0 Stop build tests for Debian bookworm
Debian bookworm uses golang 1.19, which is rather outdated. In
preperation of switching to go modules that require a newer go stop
build testing with Debian bookworm. Leaving current Debian stable
(trixie), testing (forky) and arch.

Fixes: #564
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2025-11-01 22:01:58 +01:00
Sjoerd Simons
c0181b02ae Merge pull request #596 from go-debos/copilot/fix-296234a1-ad59-43f9-8b4f-cddea1c06c56
Make origin property optional for raw action, default to recipe directory
2025-11-01 15:32:15 +00:00
copilot-swe-agent[bot]
6d347a63b1 Make origin property optional for raw action, default to recipe directory
Co-authored-by: sjoerdsimons <22603932+sjoerdsimons@users.noreply.github.com>
2025-11-01 16:04:11 +01:00
copilot-swe-agent[bot]
ee5d15231b Test overlay-non-existent-destination in CI
Move te overlay-non-existent-destination test to be part of the
various exit_test tests so it can be ran in CI.

Co-authored-by: sjoerdsimons <22603932+sjoerdsimons@users.noreply.github.com>
2025-11-01 14:06:17 +01:00
Sjoerd Simons
0e0fc6774b Merge pull request #521 from go-debos/wip/obbardc/qemu-backports
Upgrade container to trixie
2025-11-01 12:59:25 +00:00
Christopher Obbard
33a432d0d1 Merge pull request #611 from go-debos/dependabot/github_actions/actions/download-artifact-6
build(deps): bump actions/download-artifact from 5 to 6
2025-10-29 10:51:08 +00:00
Christopher Obbard
be3b6d4df8 ci: disable user-mode-linux tests
The user-mode-linux backend appears to be buggy in trixie. Disable
the user-mode-linux backend tests.

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
2025-10-29 10:27:53 +00:00
Christopher Obbard
e5b84f2752 docker: remove user-mode-linux backend support
Since the user-mode-linux backend is flaky in trixie remove the runtime deps
from the docker container so that it cannot be used.

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
2025-10-29 10:27:53 +00:00
Christopher Obbard
a914c547b2 Revert "docker: Manually register binfmts"
With new qemu-user-static from trixie we no longer need to register
the binfmts manually.

This reverts commit 306d2ea194.

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
2025-10-29 10:27:53 +00:00
Christopher Obbard
ed2c4ad3ab docker: upgrade container baseline to trixie
Since Debian trixie has now been released; upgrade the debos container
to the new release.

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
2025-10-29 10:27:53 +00:00
Christopher Obbard
c63434cd11 Merge branch 'main' into dependabot/github_actions/actions/download-artifact-6 2025-10-29 10:26:43 +00:00
Christopher Obbard
a9b348c899 Merge pull request #612 from go-debos/dependabot/go_modules/github.com/go-debos/fakemachine-0.0.12
build(deps): bump github.com/go-debos/fakemachine from 0.0.11 to 0.0.12
2025-10-29 09:24:24 +00:00
dependabot[bot]
727ae70554 build(deps): bump github.com/go-debos/fakemachine from 0.0.11 to 0.0.12
Bumps [github.com/go-debos/fakemachine](https://github.com/go-debos/fakemachine) from 0.0.11 to 0.0.12.
- [Release notes](https://github.com/go-debos/fakemachine/releases)
- [Commits](https://github.com/go-debos/fakemachine/compare/v0.0.11...v0.0.12)

---
updated-dependencies:
- dependency-name: github.com/go-debos/fakemachine
  dependency-version: 0.0.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-29 03:03:53 +00:00
Christopher Obbard
7faaece6d6 Merge pull request #610 from go-debos/dependabot/github_actions/actions/upload-artifact-5
build(deps): bump actions/upload-artifact from 4 to 5
2025-10-28 22:21:43 +00:00
dependabot[bot]
62cfc5dfd3 build(deps): bump actions/download-artifact from 5 to 6
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 03:12:32 +00:00
dependabot[bot]
000aab0a32 build(deps): bump actions/upload-artifact from 4 to 5
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 03:12:29 +00:00
Christopher Obbard
779ae30b21 Merge pull request #605 from go-debos/arm64-docker-build-speedup
Docker: Speed up runner builds by avoiding initramfs
2025-10-26 22:58:37 +00:00
Sjoerd Simons
bc959b65d5 Merge pull request #603 from go-debos/copilot/fix-mmdebstrap-keyring-path
Fix mmdebstrap keyring-files path handling
2025-10-26 10:32:59 +00:00
Sjoerd Simons
b59af4ed28 actions/mmdebstrap_action.go: persist cleaned keyring paths
Let verify (indirectly) save the cleaned keyring paths back to the
action arguments so those are used for the Run as well

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2025-10-26 10:47:46 +01:00
Sjoerd Simons
5b23b34395 Merge pull request #609 from go-debos/copilot/debug-docker-build-issues
Allow copilot coding agent to run integration tests
2025-10-25 22:01:49 +00:00
Sjoerd Simons
dab69c1875 copilot: explain how to run integration tests
Running the docker container build in the copilot coding agent
environment need some workarounds. Document this in more detail for
copilot, while also emphasizing it should always run integration tests
before committing changes.
2025-10-25 23:03:18 +02:00
Sjoerd Simons
136d1760e5 docker: Add hook to allow exposing local ca-certificates
To allow building in environments with TLS MITM proxies add a way to
expose the host cert store to the *build* container. This is needed for
for the copilot coding agent as that seems to run in such an environment
when the recommended firewall is enabled.
2025-10-25 22:29:29 +02:00
Sjoerd Simons
37f5516030 Docker: Speed up runner builds by avoiding initramfs
The runner images install a kernel, which pulls in initramfs-tools to
create an initramfs. For debos we don't need to have an initramfs, we
just need the kernel image. Generating this on the native
architecture (amd64) is reasonably fast. However in emulation, when
building for arm64, this is *very* slow.

In current github actions this change seems to save about 20 minutes per
docker build. For PR triggered runs this (which don't upload the
containers) this should save 20 minutes end-to-end (one build on the
critical path), while for runs that do it should save about 40 minutes
end to end (three builds, of which 2 on the critical path).
2025-10-25 16:11:51 +02:00
Sjoerd Simons
84892a8830 Merge pull request #604 from go-debos/copilot/add-copilot-instructions-file
Add .github/copilot-instructions.md for agent onboarding
2025-10-25 09:49:37 +00:00
copilot-swe-agent[bot]
6de5a0defe Add comprehensive .github/copilot-instructions.md for repository onboarding
Co-authored-by: sjoerdsimons <22603932+sjoerdsimons@users.noreply.github.com>
2025-10-25 10:58:48 +02:00
Sjoerd Simons
26312bca1a Merge pull request #594 from go-debos/copilot/fix-2bceade6-5e0e-4479-9423-9a0f9fb909ea
chore: enable more go linters and fix all issues
2025-10-01 20:14:50 +00:00
copilot-swe-agent[bot]
f566e04888 chore: enable more linters and fix all critical issues
Enabled additional linters from fakemachine configuration:
- errorlint: Error wrapping with %w
- misspell: Spelling checks
- revive: Code quality checks
- whitespace: Formatting checks

Fixed all issues including:
- Error handling: Added proper error checks for all function returns
- Error wrapping: Changed %v to %w for proper error wrapping
- Type assertions: Used errors.As instead of direct type assertions
- Unused parameters: Renamed to underscore where appropriate
- Variable naming: Fixed ALL_CAPS constants and underscored names
- Whitespace: Removed unnecessary leading/trailing newlines
- Code flow: Removed unnecessary else blocks

Renamed types (breaking internal API changes):
- DebosState → State
- DebosContext → Context
- DownloadHttpUrl → DownloadHTTPURL

Fixed struct field naming with proper YAML tags:
- Url → URL (with yaml:"url" tag)
- TlsClientCertPath → TLSClientCertPath (kept yaml:"tls-client-cert-path")
- TlsClientKeyPath → TLSClientKeyPath (kept yaml:"tls-client-key-path")
- validateUrl → validateURL method

Co-authored-by: sjoerdsimons <22603932+sjoerdsimons@users.noreply.github.com>
2025-10-01 21:21:22 +02:00
Sjoerd Simons
1e2e74d88e Merge pull request #593 from jakob-tsd/nspawn--machine
commands: systemd-nspawn: randomize machine name
2025-10-01 09:04:13 +00:00
Jakob Unterwurzacher
af427ef092 commands: systemd-nspawn: randomize machine name
When you have multiple debos chroot builds running at the same time,
you will get something like this:

	2025/09/16 11:17:38 apt | Mount point '/run/systemd/nspawn/unix-export/root' exists already, refusing.
	2025/09/16 11:17:38 Action `recipe` failed at stage Run, error: exit status 1

This because systemd-nspawn will name the container acc. to the root
directory per default, which is always "root" for debos, and wants
to create a subdir inside "/run/systemd/nspawn/unix-export" even
with "--register=no".

To reproduce this problem, you need two copies of a root file system where the
last component of the path has the same name.

The example below was run on Debian Trixie arm64 and uses
~/trixie1/trixie and ~/trixie2/trixie as the root directories:

	1st terminal:

	root@jaguar1:~/trixie1/trixie# systemd-nspawn --register=no bash
	░ Spawning container trixie on /root/trixie1/trixie.
	░ Press Ctrl-] three times within 1s to kill container.
	root@trixie:/#

	2nd terminal:

	root@jaguar1:~/trixie2/trixie# systemd-nspawn --register=no bash
	░ Spawning container trixie on /root/trixie2/trixie.
	░ Press Ctrl-] three times within 1s to kill container.
	Mount point '/run/systemd/nspawn/unix-export/trixie' exists already, refusing.
	# Try again
	root@jaguar1:~/trixie2/trixie# systemd-nspawn --register=no bash
	░ Spawning container trixie on /root/trixie2/trixie.
	░ Press Ctrl-] three times within 1s to kill container.
	Failed to allocate scope: Unit trixie.scope was already loaded or has a fragment file.

To fix this we problem, set the container name via "--machine"
to debos-NNNNN, where NNNNN is a random int63.

This makes name collisions virtually impossible and fixes the problem.

Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher@cherry.de>
2025-09-17 11:52:35 +02:00
Sjoerd Simons
226b78e20d Merge pull request #585 from lool/sha256sum
feat: Optional sha256sum for download action
2025-09-11 19:04:58 +00:00
Christopher Obbard
ce0df3aa05 Merge pull request #591 from lool/govet
govet
2025-09-05 19:27:46 +00:00
Loïc Minier
9e3fd35d3f ci: Enable govet linter in golangci.yml
Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
2025-09-05 13:44:23 +00:00
Loïc Minier
f3b4ced5ee fix: struct literal uses unkeyed fields
Reported by go vet

Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
2025-09-05 13:22:57 +00:00
Loïc Minier
2a40c09840 fix: struct field tag not compatible with reflect.StructTag.Get
Reported by go vet

Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
2025-09-05 13:07:26 +00:00
Loïc Minier
eba3cb0369 feat: sha256sum for download action
Unconditionally log SHA256 sum of downloads and add an optional
sha256sum property. Setting this property will ensure verification of
the downloaded file and delete it on mismatch.

Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
2025-09-05 12:41:15 +00:00
Christopher Obbard
7c55ac601a Merge pull request #584 from lool/misc-fixes
Misc static analysis fixes
2025-09-05 09:16:47 +00:00
Loïc Minier
1f4ad9ca96 docs: Add visualstudiocode to generated gitignore
Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
2025-09-05 09:24:07 +02:00
Loïc Minier
0e06c47161 docs: Refresh generated gitignore section
Sort keywords alphabetically

Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
2025-09-05 09:24:07 +02:00
Loïc Minier
b2aef2a0b6 docs: Add debos to gitignore
Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
2025-09-05 09:24:07 +02:00
Loïc Minier
45fce22762 ci: Enable staticcheck linter in golangci.yml
Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
2025-09-05 09:24:07 +02:00
Loïc Minier
fe573bbeac fix: Omit redundant type from variable declaration (QF1011)
Reported by staticcheck

Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
2025-09-05 09:24:07 +02:00
Loïc Minier
dbd721e41d fix: A value assigned to a variable is never read before being overwritten (SA4006)
Reported by staticcheck

Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
2025-09-05 09:24:07 +02:00