Skip to content

api: Deprecate Exec in favor of WithExec. Make args mandatory. - #3928

Merged
aluzzardi merged 1 commit into
dagger:mainfrom
aluzzardi:withexec-mandatory-args
Nov 21, 2022
Merged

aluzzardi merged 1 commit into
dagger:mainfrom
aluzzardi:withexec-mandatory-args

Conversation

@aluzzardi

@aluzzardi aluzzardi commented Nov 18, 2022 •

Copy link
Copy Markdown
Contributor

Before:

ctr.Exec(dagger.ContainerExecOpts{
  Args: []string{"ls"},
})

After:

ctr.WithExec([]string{"ls"})

/cc @vikram-dagger @kpenfound @helderco @dolanor

@aluzzardi
aluzzardi marked this pull request as draft November 18, 2022 23:31
@aluzzardi aluzzardi added the kind/breaking Breaking Change label Nov 18, 2022
@aluzzardi
aluzzardi force-pushed the withexec-mandatory-args branch 3 times, most recently from 282f908 to 50cd86a Compare November 19, 2022 01:58
Comment thread sdk/python/README.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supposed to be with_exec?

Comment thread sdk/python/experimental/hello/main.py Outdated
Comment on lines 20 to 21

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snake_case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went crazy with replacing and did the same as TS. Fixed

@aluzzardi
aluzzardi force-pushed the withexec-mandatory-args branch from 50cd86a to 6683393 Compare November 19, 2022 02:45
Comment thread internal/mage/engine.go Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @sipsma

Here's the catch 22: We basically have to wrap everything under WithDevEngine, otherwise it just fails (because of WithExec not existing in regular).

#3755 addresses this (/cc @vito) but I was a bit concerned about the "leaking layers".

Giving the bit of experience we gained with our pipelines, how about this alternative:

  • We ditch mage. We're not really using it anymore
    • It's already our own main
    • Had to ditch mg.Deps() because of false negatives
    • We're doing weird stuff with sdk:all as "meta" targets
  • Our needs are pretty simple:
    • Have a "main" do 1) bootstrap 2) dagger.Connect() (stop connecting everywhere) 3) dispatch to the right target
    • Provide simple target registration/dispatching (e.g. func init() { target.Register("engine:test", Test) })

@aluzzardi
aluzzardi force-pushed the withexec-mandatory-args branch 3 times, most recently from c38fcd4 to 423c8a1 Compare November 19, 2022 03:08
@aluzzardi
aluzzardi marked this pull request as ready for review November 19, 2022 03:42
@aluzzardi

Copy link
Copy Markdown
Contributor Author

CI is finally green

@vikram-dagger vikram-dagger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Go SDK get started also includes references to Exec() in the text. Could you please change those @aluzzardi or I can do it in a follow-up PR?

@aluzzardi
aluzzardi force-pushed the withexec-mandatory-args branch 3 times, most recently from 947c0c9 to a63bae8 Compare November 19, 2022 22:46
@aluzzardi
aluzzardi merged commit 3f75a5e into dagger:main Nov 21, 2022
@aluzzardi
aluzzardi deleted the withexec-mandatory-args branch November 21, 2022 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/breaking Breaking Change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants