Built-in check for generate functions#12923
Conversation
|
If I understand it correctly this turns all |
Yes, but that's exactly the purpose of generate functions, to generate files that should be committed. |
kpenfound
left a comment
There was a problem hiding this comment.
LGTM. Some conflicts though
0b57609 to
ac214f6
Compare
9cdb3a1 to
7b10400
Compare
971629e to
3537b00
Compare
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 <yves@dagger.io>
Signed-off-by: Yves Brissaud <yves@dagger.io>
Signed-off-by: Yves Brissaud <yves@dagger.io>
|
I'm merging the PR:
Once dagger cloud will run on a version including those changes, we will be able to fully remove the |
Currently we have one single function in
.daggermain module that runs all the generate functions and ensure the result is empty.Those changes handle that in the engine: all
generatefunctions are now automatically handled as acheckfunction. 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 generateanddagger checkswill work.You can still use
dagger check --no-generateif you don't want to include the generate functions.