Skip to content

Register #[Generate] functions as generators - #16

Draft
eunomie wants to merge 1 commit into
check-accepts-workspacefrom
generate-function-role
Draft

eunomie wants to merge 1 commit into
check-accepts-workspacefrom
generate-function-role

Conversation

@eunomie

@eunomie eunomie commented Nov 11, 2026

Copy link
Copy Markdown
Member

A #[Generate] attribute marks a function as a generator, emitted as .withGenerator like #[Check] is as .withCheck. Validation follows the engine's beta.27 rule (validateGeneratorFunction, core/module.go): the function returns a non-null Changeset and requires no argument except a Workspace. The e2e fixture gets selfGenerate(), and generated-entrypoint-call-check asserts dagger generate -l lists it.

Checks, on the beta.27 engine and CLI: sdk-unit-check passed with a temporary filter including DaggerFunctionTest (196 tests, 306 assertions; the repo's filter does not include it, #13 widens it). generated-entrypoint-call-check passed up to its last assertion, which fails on main on beta.27 (fixed in #14), on the first revision; the final revision changed only validation and unit tests.

Not proved: dagger generate applying a changeset; the legacy-runtime registration line.

Signed-off-by: Yves Brissaud <yves@dagger.io>
@eunomie
eunomie force-pushed the generate-function-role branch from 3b5dea4 to b5bf209 Compare November 11, 2026 14:30
@eunomie
eunomie changed the base branch from main to check-accepts-workspace November 11, 2026 14:31
@eunomie
eunomie added this pull request to stack #32 November 11, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant