Commit Graph

570 Commits

Author SHA1 Message Date
Tianon Gravi e6e3a3dc22 Fix test
"example.com" no longer has multiple lines, so switch to "docker.com"
2025-10-20 14:32:21 -07:00
yosifkit 2482a2062f
Merge pull request #121 from infosiftr/go-git
Update go-git (to fix failing test)
2025-08-18 11:39:28 -07:00
Tianon Gravi 7720612406 Update go-git (to fix failing test)
One of the repositories we test against renamed their upstream branch, which is failing the tests (but cloning it correctly is fixed in newer go-git).
2025-08-18 10:05:24 -07:00
Tianon Gravi 5e4f19fe07
Merge pull request #120 from infosiftr/gitfs-submodules
Add support for submodules in gitfs
2025-08-13 09:35:22 -07:00
Tianon Gravi fb05da102f Add support for submodules in gitfs
For now, these emulate the support that `git archive` has for them (namely, that they present as empty directories, which are otherwise impossible to create/represent in Git).
2025-08-12 13:57:33 -07:00
Tianon Gravi d422b8fddd
Merge pull request #119 from infosiftr/gha-windows-2019
Remove "windows-2019" support from GHA scripts
2025-07-07 12:10:59 -07:00
Tianon Gravi 96f46d7113 Remove "windows-2019" support from GHA scripts 2025-07-01 21:46:41 -07:00
Tianon Gravi 82fcc47ccb Remove Windows 2019 from GHA matrix (EOL on GitHub's side) 2025-06-16 10:54:12 -07:00
Tianon Gravi bfea863b9c
Merge pull request #118 from infosiftr/go-mod-verify
Remove `go mod verify`
2025-05-29 16:21:01 -07:00
Tianon Gravi 695db42956 Remove `go mod verify`
(it verifies that the downloaded modules have not been tampered with since `go mod download`, which we do literally just prior so it is verifying nothing)
2025-05-29 16:13:30 -07:00
Tianon Gravi dbc5c3eee6 Remove `ubuntu-20.04` from CI
See https://github.com/actions/runner-images/issues/11101
2025-04-21 15:15:00 -07:00
Tianon Gravi 4485636e95 Apply `gofmt` 2025-03-06 15:32:23 -08:00
yosifkit cf3e388496
Merge pull request #117 from tianon/i-hate-go-yes-i-do-i-hate-go-how-bout-u
Rename "Example" tests to satisfy Go 1.24's new vet rule
2025-03-05 14:04:50 -08:00
Tianon Gravi 6505490e65 Rename "Example" tests to satisfy Go 1.24's new vet rule
In Go 1.24, there's a new `go vet` rule that complains about `Example*` test functions that don't follow the documented naming convention.  Combine that with `go test` running `go vet` by default, and you've got a perfect storm.

This renames our "example" tests to satisfy Go's naming convention.
2025-03-05 11:30:57 -08:00
Tianon Gravi 41ddc6d3d2 Update example `group:` value to match GitHub's recommendation 2025-02-27 09:32:24 -08:00
Tianon Gravi 86212cac91 Bump version to 0.1.14 (post-release) 2025-01-17 16:56:52 -08:00
yosifkit 9eef708e6a
Merge pull request #110 from infosiftr/bashbrew-arch-to-goenv
Update `bashbrew-arch-to-goenv.sh` with more edge cases
2025-01-16 17:15:35 -08:00
yosifkit 882b15e031
Merge pull request #113 from infosiftr/run-mount-from-image
Move Dockerfile parsing to a dedicated package, add support for `RUN --mount=type=bind,from=...`
2025-01-16 16:51:39 -08:00
Tianon Gravi 60ee93caf8 Simplify `pkg/dockerfile` interface by ditching pointer
This means slightly more typing in "zero-value" cases (`nil` vs `dockerfile.Metadata{}`), but the tradeoff is that it's simpler to use and reason about (and all the struct members are pointer-type map/slice values anyhow, so copying the struct is still pretty cheap).

This also swaps the scanner error handling to return the partially parsed Metadata object alongside the scanner error -- the error already tells us the object isn't fully complete data, so it's fair/fine to return and will likely just be ignored by the caller instead.  This also allows us to get to 100% code coverage. 👀

This also updates our "treat `oci-import` just like `FROM scratch`" code to *actually* parse `FROM scratch` so we can't accidentally cause "missing data" bugs there in the future, and I implemented that using `sync.OnceValues` which requires upgrading to Go 1.21, but IMO that's a worthwhile tradeoff (because `sync.OnceValues` makes that code so clean/simple).
2025-01-09 16:20:49 -08:00
Tianon Gravi 7ddf2bef73 Fix very minor continuation bugs for better coverage
There were some very minor/subtle bugs in how I implemented continuation that wouldn't affect any real-world parsing we did, but still bothered me because I'm me.  This fixes them (and further increases test coverage as a result).
2025-01-09 15:40:00 -08:00
Tianon Gravi 0e00438cf2 Implement parsing for `RUN --mount=type=bind,from=...` 2025-01-09 13:06:16 -08:00
Tianon Gravi 0c6df94b46 Move `Dockerfile` parsing to a dedicated package
Also, add a bunch of test cases / code coverage
2025-01-09 13:06:11 -08:00
Tianon Gravi 98f6610daa Upload coverage files to GHA so they're easier to inspect 2025-01-09 12:52:12 -08:00
Tianon Gravi 9939a32336
Merge pull request #112 from infosiftr/windows-2025
Add support for Windows 2025 in GHA scripts
2025-01-08 11:40:01 -08:00
yosifkit f4bda73464
Merge pull request #111 from infosiftr/os-matrix
Update OS matrix in smoke test
2025-01-07 16:42:56 -08:00
Tianon Gravi 828989bcc1 Add support for Windows 2025 in GHA scripts 2024-12-19 23:46:48 -08:00
Tianon Gravi 516951ac06 Update OS matrix in smoke test
This adds more explicit Ubuntu variants + Windows 2025
2024-12-19 23:41:14 -08:00
Tianon Gravi baa0648dc0 Update `bashbrew-arch-to-goenv.sh` with more edge cases
Also, Go updates (`GOAMD64`, `GOARM64`, etc)

```console
$ for bashbrewArch in $(grep -oE '^[[:space:]]+"[^[:space:]]+":' architecture/oci-platform.go | cut -d'"' -f2); do echo "# $bashbrewArch"; ./scripts/bashbrew-arch-to-goenv.sh "$bashbrewArch"; echo; done
# amd64
export GOARCH=amd64 GOAMD64=v1 GOOS=linux
unset GO386 GOARM GOMIPS64 GOARM64 GORISCV64 GOPPC64

# arm32v5
export GOARCH=arm GOARM=5 GOOS=linux
unset GO386 GOMIPS64 GOARM64 GORISCV64 GOAMD64 GOPPC64

# arm32v6
export GOARCH=arm GOARM=6 GOOS=linux
unset GO386 GOMIPS64 GOARM64 GORISCV64 GOAMD64 GOPPC64

# arm32v7
export GOARCH=arm GOARM=7 GOOS=linux
unset GO386 GOMIPS64 GOARM64 GORISCV64 GOAMD64 GOPPC64

# arm64v8
export GOARCH=arm64 GOARM64=v8.0 GOOS=linux
unset GO386 GOARM GOMIPS64 GORISCV64 GOAMD64 GOPPC64

# i386
export GOARCH=386 GOOS=linux
unset GO386 GOARM GOMIPS64 GOARM64 GORISCV64 GOAMD64 GOPPC64

# mips64le
export GOARCH=mips64le GOOS=linux
unset GO386 GOARM GOMIPS64 GOARM64 GORISCV64 GOAMD64 GOPPC64

# ppc64le
export GOARCH=ppc64le GOOS=linux
unset GO386 GOARM GOMIPS64 GOARM64 GORISCV64 GOAMD64 GOPPC64

# riscv64
export GOARCH=riscv64 GOOS=linux
unset GO386 GOARM GOMIPS64 GOARM64 GORISCV64 GOAMD64 GOPPC64

# s390x
export GOARCH=s390x GOOS=linux
unset GO386 GOARM GOMIPS64 GOARM64 GORISCV64 GOAMD64 GOPPC64

# windows-amd64
export GOARCH=amd64 GOAMD64=v1 GOOS=windows
unset GO386 GOARM GOMIPS64 GOARM64 GORISCV64 GOPPC64
```
2024-12-04 11:19:50 -08:00
yosifkit f71d6ef63e
Merge pull request #107 from infosiftr/bashbrew-buildkit-syntax
Remove `.bashbrew-buildkit-syntax` fallback in GHA
2024-10-14 16:26:53 -07:00
Tianon Gravi d114db232b Remove `.bashbrew-buildkit-syntax` fallback in GHA
This was left in intentionally as a backwards-compatibility shim during the transition to the script, but is no longer necessary.
2024-10-07 15:23:52 -07:00
yosifkit b0b055e5ca
Merge pull request #106 from infosiftr/BASHBREW_LIBRARY
Fix behavior around `BASHBREW_LIBRARY` in GHA
2024-09-30 11:52:45 -07:00
Tianon Gravi d64a9e81b0 Fix behavior around `BASHBREW_LIBRARY` in GHA
This script needs/uses a custom `BASHBREW_LIBRARY` directory, but it stores that value in the exported environment slightly too soon such that `generate-stackbrew-library.sh` picks it up (and shouldn't be).

We often use "`BASHBREW_LIBRARY` is unset (or empty)" as a conditional for whether to fall back to using "https://github.com/docker-library/official-images/raw/HEAD/library/" as an explicit prefix for querying "source of truth" values for things like supported parent architectures.

These two things collided in cc2dc88e04 (and similar commits) because the script saw `BASHBREW_LIBRARY` set, trusted it, but then fails to find the parent image.

This is the cleanest place to fix this such that `generate-stackbrew-library.sh` can take `BASHBREW_LIBRARY` from the provided environment instead of using our generated value.
2024-09-30 11:46:48 -07:00
yosifkit 7afe152f6d
Merge pull request #105 from infosiftr/explicit-full-gitcommit
Enforce that `GitCommit` must be a *full* commit hash
2024-08-13 12:58:32 -07:00
Tianon Gravi 5f27132981 Enforce that `GitCommit` must be a *full* commit hash
I thought this was already the behavior, but I guess it was relaxed because previous iterations of this validation had to apply to the older format where we'd been less meticulous about enforcing this.  Since those are all gone now, we can safely update the validation to enforce that commit hashes *must* be fully qualified.
2024-08-13 11:27:28 -07:00
yosifkit 63bf7cff3d
Merge pull request #103 from infosiftr/codecov
Disable Codecov (for now)
2024-07-10 14:25:48 -07:00
Tianon Gravi a00d28f873 Disable Codecov (for now)
It's been failing to upload for a while, and I don't think the failures are *completely* their fault (GitHub's got to share some of the blame, I think), but the end result is that we don't really have any good options for continuing to use the service (bad/unacceptable options include install an app with way too many privileges on the org/repo or add a "secret" with a personal access token ... and make that available to Pull Requests too 🙃).
2024-07-10 12:19:33 -07:00
Tianon Gravi 573448144c Update to actions/checkout@v4 🙃
(this is effectively a functional no-op solving a "problem" that really ought to be solved at a different level within GHA)
2024-07-09 15:42:00 -07:00
yosifkit 10343d331c
Merge pull request #96 from infosiftr/rpm-host-arch
Add RPM support to `bashbrew-host-arch.sh` (via querying RPM's own architecture)
2024-05-29 14:31:33 -07:00
Tianon Gravi 6c47dbbb89 Add RPM support to `bashbrew-host-arch.sh` (via querying RPM's own architecture)
This should be more reliable/correct than `uname -m` (because we're almost always looking for the *userspace* architecture, not the kernel architecture).
2024-05-29 10:34:48 -07:00
Tianon Gravi 12c758028e
Merge pull request #94 from gdams/patch-1
actions: bump setup-go to v5
2024-03-14 10:54:01 -07:00
George Adams eb75ef6ada
actions: bump setup-go to v5
Removes the warnings about Node.js 16 actions being deprecated
2024-03-13 16:01:24 +00:00
Tianon Gravi ab71ba78bf Bump version to 0.1.13 (post-release) 2024-03-05 11:16:54 -08:00
yosifkit d23b94357e
Merge pull request #93 from infosiftr/gitfs-symlinks
Fix gitfs symlink handling
2024-02-26 13:55:19 -08:00
Tianon Gravi 722f7d6464 Fix gitfs symlink handling
In my refactoring to use `go-git`'s `Tree` objects, I missed this edge case (that symlinks get resolved to be relative to the Git root, but our `Tree` object is a subdirectory).
2024-02-22 15:47:41 -08:00
yosifkit ca0647654e
Merge pull request #92 from infosiftr/oci-import-stagefroms
Fix `ArchLastStageFrom` with `oci-import` builder
2024-02-02 16:12:56 -08:00
Tianon Gravi 2ff16d5c5c Fix `ArchLastStageFrom` with `oci-import` builder
Before:

```console
$ bashbrew cat --format '{{ .ArchLastStageFrom arch .TagEntry }}' ubuntu:latest
failed executing template for repo "ubuntu:latest"
template: --format:1:3: executing "--format" at <.ArchLastStageFrom>: error calling ArchLastStageFrom: runtime error: index out of range [-1]
```

After:

```console
$ bashbrew cat --format '{{ .ArchLastStageFrom arch .TagEntry }}' ubuntu:latest
scratch
```
2024-01-30 09:44:14 -08:00
Tianon Gravi 5152c0df68 Bump version to 0.1.12 (post-release) 2024-01-22 11:29:29 -08:00
Tianon Gravi 91633b567d
Merge pull request #91 from infosiftr/sha256sum-test
Add test for sha256sum function
2024-01-22 10:53:01 -08:00
Tianon Gravi b9a5bd8a9c Add test for sha256sum function 2024-01-22 09:46:30 -08:00
Tianon Gravi bc4c23b04c
Merge pull request #90 from infosiftr/sha256sum
Add `sha256sum` template function
2024-01-22 09:43:56 -08:00