Skip to content

feat: Add support for checking out release tags - #35

Closed
j4n wants to merge 14 commits into
j4n/incus-container-hardeningfrom
j4n/source-ref-sha-support
Closed

feat: Add support for checking out release tags#35
j4n wants to merge 14 commits into
j4n/incus-container-hardeningfrom
j4n/source-ref-sha-support

Conversation

@j4n

@j4n j4n commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Add

feat(driver_base): support SHA-based source refs in init_builder

When the source ref is a full 40-char SHA, e.g. from CI dispatch, the git-main clone may not carry it if it is not reachable from a fetched branch. Detect that case and fetch just that commit with --depth 1 before checkout.

fix(init_builder): skip git reset --hard for SHA refs

git reset --hard origin/{ref} is only meaningful for branch refs. For a SHA it always fails silently, since there is no remote tracking branch. Only run it for branch refs.

fix(driver_base): fetch tags so RELAY_REF and --source can checkout release tags

Needed to build Docker images of release tags. It also hardens @latest from #31, which resolves against git tag -l in the builder's cache clone, so the refresh fetch has to bring tags in explicitly.

Refactor, helper

fix(driver_base): validate refs before they reach the builder shell

Refs are interpolated into git fetch and git checkout inside bash -ec on the builder, so restrict them to the characters git actually permits in a ref.

feat(cli): auto-detect RUNNER_DEBUG for verbose output

Pass -vvv when the runner is in debug mode.

@j4n j4n self-assigned this Aug 3, 2026
@j4n
j4n force-pushed the j4n/incus-container-hardening branch from 6e58c52 to 0f9dd1c Compare August 5, 2026 10:32
@j4n
j4n force-pushed the j4n/source-ref-sha-support branch from 19a2e2a to e1c990e Compare August 5, 2026 10:32
@j4n
j4n force-pushed the j4n/incus-container-hardening branch from 0f9dd1c to 74ab76e Compare August 5, 2026 11:43
@j4n
j4n force-pushed the j4n/source-ref-sha-support branch from e1c990e to c1c5884 Compare August 5, 2026 11:43
@j4n
j4n force-pushed the j4n/incus-container-hardening branch from 74ab76e to d7cb3cf Compare August 5, 2026 11:57
@j4n
j4n force-pushed the j4n/source-ref-sha-support branch from c1c5884 to 9f7ecb5 Compare August 5, 2026 11:57
@j4n j4n changed the title Add support for checking out release tags feat: Add support for checking out release tags Aug 5, 2026
@j4n
j4n force-pushed the j4n/source-ref-sha-support branch 2 times, most recently from f3cac4b to ee9d4ba Compare August 6, 2026 11:23
@j4n
j4n force-pushed the j4n/incus-container-hardening branch from b54535a to a2eb39e Compare August 6, 2026 11:23
@j4n
j4n force-pushed the j4n/source-ref-sha-support branch from ee9d4ba to 5bb1716 Compare August 6, 2026 11:35
@j4n
j4n force-pushed the j4n/incus-container-hardening branch from a2eb39e to 2604f7d Compare August 6, 2026 11:35
@j4n
j4n force-pushed the j4n/source-ref-sha-support branch from 5bb1716 to b1969ca Compare August 11, 2026 10:39
@j4n
j4n force-pushed the j4n/incus-container-hardening branch from 2604f7d to 9ed3326 Compare August 11, 2026 10:39
@hpk42
hpk42 force-pushed the j4n/incus-container-hardening branch from 9ed3326 to 11c8d1a Compare August 11, 2026 12:36
@hpk42
hpk42 force-pushed the j4n/source-ref-sha-support branch from b1969ca to bce82b0 Compare August 11, 2026 12:36
@hpk42
hpk42 force-pushed the j4n/incus-container-hardening branch from 11c8d1a to d2759fe Compare August 11, 2026 12:53
@hpk42
hpk42 force-pushed the j4n/source-ref-sha-support branch from bce82b0 to 65db096 Compare August 11, 2026 12:53
j4n added 11 commits August 12, 2026 08:33
Resolve it from the git main clone that prep_builder already fetched and update
the source spec to records the tag instead of "latest".
- Dropped v1 support entirely rather
- Go toolchain block replaced with rustup, installed if missing or below
  Cargo.toml's requirement
- Web admin UI build is handled by the main build process now
- on_init_relay now tries a download first when the resolved source is a
  released tag (`^v\d+\.\d+\.\d+$`, using the musl static asset;
  otherwise, and on download failure, falls back to the source build.
- driver_base.py: pass source through on_init_relay() so drivers can
  inspect source.kind/source.ref to decide whether a download is
  possible.
…g behavior

test_delivery_port_blocked: Updated journal grep pattern to current values.

test_hide_senders_ip_address: imap_tools.MailBox.fetch() uses UID SEARCH,
implement workaround with raw imaplib sequence-range FETCH ("1:*"); allows us
to drop imaplib import.
Gate the prebuilt-binary download on the checked-out commit via
`git describe --tags --exact-match --dirty` instead of matching the
requested ref textually. Madmail's semantic-release tags the version-bump
commit on main, so the @main default still hits the download; when main is
ahead of the last release we build from source.
The -git-main cache clone is only ever fetched, never checked out, so
test-madmail ran a stale test suite against a freshly built binary.
A cold run that compiles madmail in the builder does not fit in 30.
Containers with Docker or other networking can expose IPs on multiple
interfaces. Extend _extract_ip() to accepts an optional subnet filter and add
bridge_subnet() to get the bridge subnet so wait_ready() and list_managed()
only pick addresses on incusbr0.
Move the initialization check (DNS container running + base image
present) from cli._check_init() into Incus.check_init() so
drivers can call it without depending on the CLI module.
…ure()

Allows drivers to pass additional Incus config keys (e.g.
security.nesting=true for Docker-in-LXC) when launching containers.
Passed through Container and RelayContainer.
When the source ref is a full 40-char SHA, e.g., from CI dispatch,
the shallow git-main clone won't have it. Detect this case and
fetch just that commit with --depth 1 before checkout.
The `git reset --hard origin/{ref}` is only useful for branch refs,
for SHA refs it always fails silently since there's no remote tracking branch.
Only run it for branch refs.
j4n added 3 commits August 12, 2026 08:42
Every @ref ends up in `bash -ec` inside `git fetch/checkout` on the builder.
Route all three remote SourceSpec construction sites through _remote_spec(),
which makes it safe and surfaces typos cleanly as ValueError.
@j4n
j4n force-pushed the j4n/incus-container-hardening branch from d2759fe to 118563f Compare August 12, 2026 07:04
@j4n
j4n force-pushed the j4n/source-ref-sha-support branch from 65db096 to aa78a29 Compare August 12, 2026 07:04
@j4n
j4n force-pushed the j4n/incus-container-hardening branch 2 times, most recently from 41ca883 to ea8d2c2 Compare August 13, 2026 15:46
@j4n

j4n commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Moved these commits into other PRs: 626f560 (fetch --tags) -> #31; 692199d (ref validation), 324314c (RUNNER_DEBUG) -> #33; 5b684d8, 8be1d64 (SHA support) -> #37 as 98be301, 18e1a9f

@j4n j4n closed this Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant