Commit Graph

1355 Commits (78058ce5f301fb5f7acb31eaee16fc85e37911dc)
 

Author SHA1 Message Date
CrazyMax 78058ce5f3
Merge pull request from crazy-max/fix-build-git
build: check reachable git commits
CrazyMax fd5884189c
build: check reachable git commits
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Justin Chadwell ab7a9f008d
Merge pull request from jedevc/bake-fix-error-traces
bake: avoid nesting error diagnostics
CrazyMax a8eb2a7fbe
gitutil: override the locale to ensure consistent output
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Justin Chadwell fbb4f4dec8 bake: avoid nesting error diagnostics
With changes to the lazy evaluation, the evaluation order is no longer
fixed - this means that we can follow long and confusing paths to get to
an error.

Because of the co-recursive nature of the lazy evaluation, we need to
take special care that the original HCL diagnostics are not discarded
and are preserved so that the original source of the error can be
detected. Preserving the full trace is not necessary, and probably not
useful to the user - all of the file that is not lazily loaded will be
eagerly loaded after all struct blocks are loaded - so the error would
be found regardless.

Signed-off-by: Justin Chadwell <me@jedevc.com>
Justin Chadwell 46fd0a61ba
Merge pull request from jedevc/bake-fix-errors
bake: avoid early-exit for resolution failures
Justin Chadwell 6444c813dc
Merge pull request from jedevc/buildx-document-attestation-booleans
build: add docs for boolean attestation flags
Justin Chadwell dc8a2b0398 bake: avoid early-exit for resolution failures
With changes made to allow lazy evaluation, we were early exiting if an
undefined name was detected, either for a variable or a function.

This had two key implications:

1. The error messages changed, and became significantly less
   informative.

   For example, we went from:

   > Unknown variable; There is no variable named "FO". Did you mean "FOO"?, and 1 other diagnostic(s)

   To

   > Invalid expression; undefined variable "FO"

2. Any issues in our function detection from funcCalls which cause JSON
   functions to be erroneously detected cause invalid functions to be
   resolved, which causes new name resolution errors.

To avoid the above problems, we can defer the error from an undefined
name until HCL evaluation - which produces the more informative errors,
and does not suffer from incorrectly detecting JSON functions.

Signed-off-by: Justin Chadwell <me@jedevc.com>
CrazyMax d9780e27cd
Merge pull request from crazy-max/rm-releases-json
ci: remove releases-json workflow
CrazyMax ab44d03771
ci: remove releases-json workflow
This is now directly handled by our actions-toolkit. We keep
`.github/releases.json` file for now but will be removed on
next v0.11 release.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
crazy-max b53cb256e5
github: update .github/releases.json
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
CrazyMax c3075923f4
Merge pull request from crazy-max/update-compose
update github.com/compose-spec/compose-go to v1.9.0
CrazyMax a32881313b
Merge pull request from crazy-max/builder-fix-validation
builder: fix docker context not validated
Justin Chadwell 07548bc898 build: add docs for boolean attestation flags
Signed-off-by: Justin Chadwell <me@jedevc.com>
CrazyMax 0e544fe835
builder: fix docker context not validated
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
CrazyMax 21ac4c34fb
update github.com/compose-spec/compose-go to v1.9.0
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Justin Chadwell d2fa4a5724
Merge pull request from jedevc/lint-fixups
Linting tidy-ups
Justin Chadwell 4bdf98cf20 lint: ban fmt.Errorf in preference of errors.Errorf
Signed-off-by: Justin Chadwell <me@jedevc.com>
Justin Chadwell 5da09f0c23 lint: enable gosec
Signed-off-by: Justin Chadwell <me@jedevc.com>
Justin Chadwell 48357ee0c6 bake: fix loop references
Signed-off-by: Justin Chadwell <me@jedevc.com>
Justin Chadwell 6506166f02
Merge pull request from jedevc/refactor-controllers
Refactor controllers, moving them into a separate package
Justin Chadwell 5f130b25ad hack: move syntax directive to top of generated-files
Signed-off-by: Justin Chadwell <me@jedevc.com>
Justin Chadwell a9fd128910 controller: move controllers out of commands into separate package
Signed-off-by: Justin Chadwell <me@jedevc.com>
Justin Chadwell cb94298a02
Merge pull request from ktock/monitor-list
monitor: Enable to run build and invoke in background
CrazyMax 046084c0b8
Merge pull request from crazy-max/ci-fix-workflow
ci: fix pr branch name in releases-json workflow
CrazyMax 18760253b9
ci: fix pr branch name in releases-json workflow
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
CrazyMax ded6376ece
Merge pull request from crazy-max/fix-releases-json
ci: add workflow_dispatch in releases-json workflow
CrazyMax a4d60a451d
ci: add workflow_dispatch in releases-json workflow
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Justin Chadwell 0f4030de5d
Merge pull request from crazy-max/ci-update-ver
ci: update buildx and buildkit to latest
CrazyMax f1a5a3ec50
ci: update buildx and buildkit to latest
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
CrazyMax 87beaefbb8
Merge pull request from crazy-max/fix-docs-upstream
ci: fix docs-upstream workflow
CrazyMax 451847183d
ci: fix docs-upstream workflow
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
CrazyMax 7625a3a4b0
Merge pull request from crazy-max/silent-git-no-upstream
build: silently fail if git remote not found
CrazyMax 6db696748b
build: better message output for git provenance
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Tõnis Tiigi 14f9ae679d
Merge pull request from tonistiigi/fix-result-descriptor
build: fix multi-node merge to read descriptor from result
CrazyMax 4789d2219c
build: silently fail if git remote not found
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
CrazyMax eacecf657c
Merge pull request from crazy-max/fix-preferred-platform
build: fix preferred platform not taken into account
CrazyMax 1de0be240f
Merge pull request from crazy-max/releases-json
ci: generate releases.json on release event
CrazyMax ea4bec2bad
github: update .github/releases.json
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
CrazyMax 36d95bd3b9
ci: generate releases.json on release event
We are currently using the GitHub API in our setup-buildx-action
to check for latest and tagged releases to make sure they exist
before download. But this requires using a token to avoid
rate-limit. It's fine for public runners but GHES runners don't
have the `github.token` populated automatically. They need to
create a PAT.

This PR will solve this issue by generating and pushing a
`releases.json` file in this repo when we publish a GitHub Release
that will then be fetched through `raw.githubusercontent.com`
endpoint on `setup-buildx-action` repo. This endpoint is better
served for our purpose with 5000 requests per hour compared to the
GitHub API endpoint that is limited to 60 requests per hour (unauth)
and 1000 request per hour when authenticated.

Also ignore .github/releases.json file on pull request event as an
action in a workflow run can't trigger a new workflow run anyway.
See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#example-using-more-than-one-event

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Tonis Tiigi c33b310b48
build: fix multi-node merge to read descriptor from result
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Justin Chadwell 8af76c68a8
Merge pull request from AkihiroSuda/fix-1562
bake: SOURCE_DATE_EPOCH: fix `panic: assignment to entry in nil map`
Akihiro Suda 1f56f51740
bake: SOURCE_DATE_EPOCH: fix `panic: assignment to entry in nil map`
Fix issue 1562

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
CrazyMax 49b3c0dba5
build: fix preferred platform not taken account
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Tõnis Tiigi a718d07f64
Merge pull request from tonistiigi/update-buildkit-v0.11.2
vendor: update buildkit to v0.11.2
Tonis Tiigi f6da7ee135
vendor: update buildkit to v0.11.2
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
CrazyMax 9f821dabeb
Merge pull request from crazy-max/git-ls-remote
build: set remote origin url
Kohei Tokunaga a27b8395b1 Enable to run build and invoke in background
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
Tõnis Tiigi b1b4e64c97
Merge pull request from jedevc/fix-1497
Refactor BuildWithResultHandler to simplify concurrency usage
CrazyMax c1058c17aa
build: set remote origin url
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>