Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial DX for gale #49

Closed
wants to merge 10 commits into from

Conversation

aweris
Copy link
Owner

@aweris aweris commented Jul 18, 2023

The initial version of the new DX of the gale

Introduces:

  • With interface that can be implemented by any type that can be used to configure a dagger container.
type With interface {
	WithContainerFunc(container *dagger.Container) *dagger.Container
}
  • gale.Env() to configure the execution environment
env := gale.Env()

container = container.With(gale.Load(env)) // configures all tools, services and env values required by `gale`
  • gale.Job() to configure the jobs to execute
job, err := g.Job().Load(ctx, "example-golangci-lint", "golangci-lint")
if err != nil {
  return err
}

container = container.With(gale.Load(job))

An example workflow:

job, err := g.Job().Load(ctx, "example-golangci-lint", "golangci-lint")
if err != nil {
  return err
}

dagger.Container().
  From(<runner-image>).
  With(gale.Load(gale.Env()).
  With(gale.Load(job)).
  Sync(ctx)

Depends on #48
Related to #45

There is no benefit using RetentionDays as int and converting.
This is an intermediate step to transitioning to new DX
... to avoid side effects on passed values to each other
This interface would allow us to configure gale
 without breaking chaining of dagger.Container
... to allow us to configure gale env with container.With(gale.Load(gale.Env())
@github-actions
Copy link

This PR/issue depends on:

@aweris aweris force-pushed the aweris/initial-dx-for-gale branch from f46beb7 to 6a2a906 Compare July 18, 2023 15:53
@github-actions github-actions bot added feature and removed feature labels Jul 18, 2023
@aweris aweris closed this Aug 1, 2023
@aweris aweris deleted the aweris/initial-dx-for-gale branch August 1, 2023 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant