-
Notifications
You must be signed in to change notification settings - Fork 5
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
Better UX for gale
as lib
#45
Comments
Some thoughts about the topic. Just random thoughts about Improve DX of the projectThe easiest method for setting up the dagger container is utilizing the 'dagger.WithContainerFunc' function. This function requires a function that will be executed using the 'dagger.With' function. The easiest method to standardize this process in the library is to create an interface that includes Interface: // Configurator defines an interface that can be implemented to configure the container.
type Configurator interface {
// WithContainerFunc is a function that can be used to configure the container.
WithContainerFunc(*dagger.Container) *dagger.Container
} An element: var _ Configurator = new(Job)
type Job struct {
// job-related data
}
func (j *Job) WithContainerFunc(container *dagger.Container) *dagger.Container {
// configure the container here
return container
} A simple wrapper to improve readability: func Configure[T Configurator](t T) dagger.WithContainerFunc {
return t.WithContainerFunc
} Usage: container = container.With(gale.Configure(job)) TopicsThese is the main topics we should consider when we re-design DX of the library. EnvironmentThe execution environment contains tools, services, and configurations to run ConfigurationConfiguration of the execution environment, repository, and workflow. This is one of the most complicated parts of the library. We need this to customize the environment and keep it in sync with actual GHA runners. JobRepresentation of the Github Actions Job in StepRepresentation of the Github Actions steps. Atomic execution unit for |
it's not meaningful anymore |
Currently
gale
executed by it's own wrapper like:Current usage of
gale
:This approach creates relatively simpler usage for when working on
Github Actions
but it makes really hard to combine withdagger.Container
workflows or usecustom action
support in your container.Instead of using the wrapper option, we could use a collection of atomic operations like:
The text was updated successfully, but these errors were encountered: