GeezerVison is showing github.com — Built-in check for generate functions by eunomie · Pull Request #12923 · dagger/dagger
Conversation
eunomie
commented
Apr 8, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Currently we have one single function in .dagger main module that runs all the generate functions and ensure the result is empty.
Those changes handle that in the engine: all generate functions are now automatically handled as a check function. When they are run, it will succeed if the resulting changeset is empty.
This allows to always ensure all generated functions are correctly run on CI, without to introduce a new module or concept.
Just declare your checks and generates and both dagger generate and dagger checks will work.
You can still use dagger check --no-generate if you don't want to include the generate functions.
$ dagger check -l
Name Description
ci:bootstrap Build dagger from source, and check that it can bootstrap its own CI
cli:release-dry-run Verify that the CLI builds without actually publishing anything
docs:lint-markdown Lint documentation files
elixir-sdk:codegen-test Run dagger_codegen tests
elixir-sdk:lint Lint the SDK
elixir-sdk:release-dry-run Test the publishing process
elixir-sdk:sdk-test Run the SDK tests
...
typescript-sdk:test-nodejs-lts Test the SDK with LTS version of Node
typescript-sdk:test-nodejs-prev-lts Test the SDK with previous LTS version of Node
Generators
changelog:generate Generate the changelog with 'changie merge'. Only run this manually, at release time.
docs:references Regenerate the API schema and CLI reference docs
engine-dev:generate Generate any engine-related files
go-sdk:generate Regenerate the Go SDK API
...
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
If I understand it correctly this turns all +generate functions into +check functions.
It may be useful to have some granular control over it.
For example if generated files are not committed, a check would fail, right?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
For example if generated files are not committed, a check would fail, right?
Yes, but that's exactly the purpose of generate functions, to generate files that should be committed.
On dagger/dagger for instance we always have a check that runs all the generate functions and check it's empty. It's just that but better, more explicit, and more control on top of it as it allows to dagger check my-generate-function as it wasn't possible previously.
|
kpenfound reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Some conflicts though
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Extend check discovery to include +generate functions. When listing
or running checks, generator functions are automatically included.
A generate-as-check passes when the generator produces an empty
changeset and fails otherwise.
- Add IsGenerate field to Check, CheckType() returning "check"/"generate"
- Add RunGeneratorAsCheck on ModTreeNode with check telemetry spans
- Add scale-out support via tryRunGeneratorAsCheckScaleOut
- Add noGenerate param through Module.Checks, Env.Checks, and all
schema resolvers (workspace, module, env)
- Add checkType GraphQL resolver on Check
- Add --no-generate CLI flag to dagger check
- Split check list output with dedicated "Generators" section
- Deduplicate when a function has both +check and +generate annotations
- ignoreChecks toolchain config also applies to generate-as-checks
- Add integration tests with Go test module, including ignoreChecks tests
Signed-off-by: Yves Brissaud <[email protected]>
|
I'm merging the PR:
- ✔️
cli:release-dry-run manually validated
- ✔️
engine-dev:release-dry-run manually validated
- ✔️
dagger-dev:generated manually validated
Once dagger cloud will run on a version including those changes, we will be able to fully remove the engine-dev:generated check as it will be a duplication of the built-in checks.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|