Commit Graph
204 Commits
Author SHA1 Message Date
Tonis Tiigi 3281dce28c tests: cover imagetools dry-run
Add dry-run assertions to imagetools merge and platform filter
integration tests to verify emitted manifest JSON before push.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-10 21:11:08 -07:00
Tonis Tiigi d84544176d tests: cover imagetools file input
Add integration coverage for imagetools create --file and verify a
descriptor read from disk resolves to the expected copied manifest.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-10 21:05:57 -07:00
Tonis Tiigi b90d59a2e9 tests: cover imagetools append
Add integration coverage for imagetools create --append and verify the
target is rewritten as a two-platform manifest list.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-10 21:01:48 -07:00
Tonis Tiigi 0d82d2b115 tests: cover imagetools platform filtering
Add integration coverage for imagetools create --platform on an attested
multi-platform image and verify only the matching attestation remains.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-10 20:53:04 -07:00
Tonis Tiigi 0a5fccb7be tests: cover imagetools signature referrers
Add integration coverage for copying attestation referrers with fake
sigstore signature manifests on a multi-platform source image.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-10 20:43:35 -07:00
Tonis Tiigi 5b2a4ccd2d tests: add single arch attestation fallback case to test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-10 20:29:22 -07:00
Tonis Tiigi b43520b4ca tests: add imagetools test for merged create
With and without attestations.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-10 20:25:57 -07:00
Tonis Tiigi 2682d345fa tests: tighten imagetools copy assertions
Verify copied index content keeps the same digest and descriptor metadata.
Add function comments to clarify each imagetools integration test case.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-10 19:24:59 -07:00
Tõnis TiigiandGitHub b046c3934c Merge pull request #3712 from jsternberg/dap-skip-context-without-source
dap: skip the load build context step when it doesn't have an associated source line
2026-03-10 18:39:57 -07:00
Tõnis TiigiandGitHub 1e2b0688db Merge pull request #3709 from jsternberg/dap-loaded-source-path
dap: properly map source paths to client side paths
2026-03-10 18:08:19 -07:00
Jonathan A. Sternberg 3e4bd229ab dap: skip the load build context step when it doesn't have an associated source line
Skip the load build context step when it doesn't have an associated
source line. This caused an extra branch to be created in an otherwise
pretty straightforward dockerfile where stepping in on a copy
instruction that used the context would stay on the same line because it
"stepped into" the context loading rather than being treated the same as
step next.

This resulted in some bad and confusing ergonomics with the cursor
position that were a bit confusing and unexpected.

There might be more areas to try and prune but the most common one, a
single branch instruction that doesn't have a location, now gets skipped
which is the exact thing that was generated for loading the context.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2026-03-10 12:35:13 -05:00
Jonathan A. Sternberg 4f3de79c13 dap: properly map source paths to client side paths
Properly map the source paths from the metadata in the solve to the
client side paths. The source path returns is relative to the context
that gets uploaded which is usually a subdirectory. The original code
noticed this when mapping the paths but made the invalid assumption that
the dockerfile would always be in the context path so it combined the
dockerfile name with the context path.

It is possible for the dockerfile to be in a subdirectory of the
context. In which case, we computed the paths incorrectly.

This modifies DAP to instead use the `DockerfileMappingDst` and
`DockerfileMappingSrc` which are special included variables to the
inputs that get filled in during the build for the purpose of mapping
the source path to the client side path.

Tests have also been added for this functionality to ensure it doesn't
break again. This should work with both absolute and relative paths
although absolute paths should probably be preferred for usage just
because they're less likely to result in weird things happening.

The sources are also normalized to always convert the source filenames
to absolute paths and DAP itself will accept relative paths but will
only ever communicate in absolute paths. When you set a breakpoint, it
will convert it to an absolute path and reference it in that way rather
than a relative path.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2026-03-10 09:17:42 -05:00
Jonathan A. Sternberg b521a083ba dap: detect breakpoints for files when the case differs
Case insensitive filesystems can cause breakpoints to not be seen or
verified. This is particularly true on Windows where the drive letter
can also participate in the filepath.

Change the detection logic for a breakpoint to be case insensitive. At
the same time, report the name of the source as part of the breakpoint
so that the editor can be told which casing we're expecting to be used.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2026-03-06 14:01:32 -06:00
Tonis Tiigi 5478703490 tests: test updates after compose update
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-05 17:58:56 -08:00
CrazyMax 2ed4ece865 build: reuse build session for policy source resolution
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-04 17:21:20 +01:00
CrazyMax 50fa13d859 bake: preserve git subdir in remote bake context paths
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-03 17:47:07 +01:00
Tonis Tiigi d39a81e456 bake: fix remote named context subdir handling
Fix using CopyDirContentsOnly when projecting remote named contexts so
subdir contexts keep the same root semantics as local bake runs.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-27 17:06:32 -08:00
Tonis Tiigi b62fc30524 build: resolve policy files from context state and unified FS
Support remote context policy files via resolved context state and cwd:// override.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-23 16:22:19 -08:00
Tonis Tiigi 9f59d5b789 policy: add progress vertex error integration test
Refactor policy error unit tests to table-driven subtests with slug names.
Add rawjson integration coverage to verify policy vertex captures DENY build
errors in progress output.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-19 18:13:58 -08:00
Tonis Tiigi 499261eed5 build: avoid empty line when -q used with --call
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-13 17:11:35 -08:00
Tonis Tiigi 8d605dcd87 policy: add image.provenance input type
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-12 11:59:06 -08:00
CrazyMaxandGitHub 53882aec96 Merge pull request #3649 from tonistiigi/update-buildkit-dev
vendor: update buildkit to v0.28-dev-9836771d0c5b
2026-02-12 10:06:45 +01:00
Tonis Tiigi a5b712b275 confutil: fix toml rewriting in new package
Seems marshalling the typed struct causes empty fields
e.g. gcpolicy = [] that (old versions of?) BuildKit do no allow.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-11 21:47:11 -08:00
Tõnis TiigiandGitHub bcb8583078 Merge pull request #3638 from crazy-max/imagetools-create-digest
imagetools: metadata-file flag
2026-02-11 10:59:38 -08:00
CrazyMax a2f3c6a1b8 imagetools: metadata-file flag
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-10 13:52:00 +01:00
CrazyMax f60c7c9069 bake: set input:context for remote builds
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-09 13:50:19 +01:00
Tonis Tiigi 86885cd8a2 policy: add docker_github_builder_tag builtin helper
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-16 11:48:55 -08:00
Tonis Tiigi 1d19f3e2dd policy: add docker_github_builder builtin helper
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-16 11:48:55 -08:00
Tonis Tiigi c5322ca727 bake: add --var flag for setting variable values
This provides alternative way to set values for Bake
variables without adding them the global environment variables.
This can also be used then environment variable access
is disabled with BUILDX_BAKE_DISABLE_VARS_ENV_LOOKUP.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-15 23:17:28 -08:00
Tonis Tiigi 88359c58a0 tests: add TestBakeDisableEnvLookup
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-15 22:46:30 -08:00
Tonis Tiigi c6ecdc08cf commands: implement policy test command
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 10:31:12 -08:00
Tonis Tiigi 9f1daffb32 policy: implement policy support for bake
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:34:23 -08:00
Tonis Tiigi 6f9a1cfb17 tests: add git based policy tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:34:15 -08:00
Tonis Tiigi 6d80e701f6 tests: add tests checking combinations of --policy flag
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:34:09 -08:00
Tonis Tiigi 071ce556a5 tests: add http based policy eval tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:34:01 -08:00
Tonis Tiigi 4b4f2aa682 tests: add http policy integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:33:49 -08:00
Tonis Tiigi e5116c1555 tests: update policy tests matrix to require modern buildkit
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:10:35 -08:00
Tonis Tiigi 30b63522d1 tests: add policy eval integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:10:35 -08:00
Tonis Tiigi 02719d045c tests: add image and env based policy build tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:10:35 -08:00
Tonis Tiigi ae86c584b4 tests: add policy flag integration test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:10:35 -08:00
CrazyMaxandGitHub 2406c8cc80 Merge pull request #3584 from tonistiigi/go1.25-lint
update linters for go1.25 base version
2026-01-11 00:12:22 +01:00
Tonis Tiigi c5154b3169 update linters for go1.25 base version
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-09 18:54:15 -08:00
Jonathan A. Sternberg 8ad75dc485 dap: fill in breakpoint reason for being unverified
When a breakpoint fails to be verified, it will switch the reason to
"failed". It starts off the reason as "pending".

The `reason` field for a breakpoint was added some time after the last
release of `go-dap` which has only been updated once in the last year so
this uses the `main` branch version which contains the field.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2026-01-08 15:21:54 -06:00
Jonathan A. Sternberg fdfba3014d tests: add integration tests for dap build
This adds integration tests for the `dap build` command to test various
behavior associated with the command. We start the build and the
integration test acts as a dap client to send requests and check that
the output is what we expect.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-12-17 10:56:30 -06:00
CrazyMax 1b9791f6fe fix empty provenance metadata for multi-platform builds
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-11-25 17:39:46 +01:00
Tõnis TiigiandGitHub 484a32f259 Merge pull request #3478 from crazy-max/fix-tar-output
build: create parent directories for tar output in lazy writer
2025-11-05 16:42:44 -08:00
CrazyMax 7652057da2 docker-container: write github actions payload to container for provenance
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-10-24 10:52:49 +02:00
CrazyMax 28b6750599 build: create parent directories for tar output in lazy writer
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-10-22 11:50:32 +02:00
CrazyMax c40f9d9802 history: input:context attribute support
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-10-11 23:04:01 +02:00
Tonis Tiigi 3bea8ce3ad vendor: update buildkit to v0.25.0-rc1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-09-23 13:32:44 -07:00