-
Notifications
You must be signed in to change notification settings - Fork 23
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: Remove magic strings from Source
types
#57
feat: Remove magic strings from Source
types
#57
Commits on Jan 12, 2024
-
The source variants, with all sub-fields, have been added to the `Source` struct. Note that this code does not yet work, and will not compile. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 4cfa108 - Browse repository at this point
Copy the full SHA 4cfa108View commit details -
Add
GetRef
andSetRef
methods toSource
These are basic getters and setters for the `Ref` subfields on various `Source` variants. Because any one of these variants could be non-nil, we first have to determine which is in use. Not all Source vaiants have a `.Ref` field, so those cases need to be handled as well. These methods each return an additional `bool` value depending on whether or not the `.Ref` field exists in the Source variant. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 5a22b1c - Browse repository at this point
Copy the full SHA 5a22b1cView commit details -
Switch on embedded union variant
Change switch on scheme to union variant in `source2LLBGetter` (`source.go`). Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 91022b6 - Browse repository at this point
Copy the full SHA 91022b6View commit details -
Implement switching logic on
Source
variantsContinue implementing the necessary switches. This code compiles. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for c804300 - Browse repository at this point
Copy the full SHA c804300View commit details -
Remove
KeepGitDir
field fromSource
.This field is now found on `Source.Git`. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for f0036cf - Browse repository at this point
Copy the full SHA f0036cfView commit details -
Rename fields on some Source variants
Also, remove `Source.Source` and `SourceAnotherSource`. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for a51da27 - Browse repository at this point
Copy the full SHA a51da27View commit details -
* Remove source.GetRef and source.SetRef * Add source.processArgs and use it where necessary Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 945ff2f - Browse repository at this point
Copy the full SHA 945ff2fView commit details -
Add
SourceLocal
(local Source variant)It's often convenient to use files and directories from the local filesystem as a source. This commit essentially exposes `llb.Local(...)` to the user via the spec. This implementation may be incomplete, and should be reviewed. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for d0f6817 - Browse repository at this point
Copy the full SHA d0f6817View commit details -
Validate that a source does not have multiple variants defined, and that it has at least one variant defined. If there's a more elegant implementation, feel free to suggest it. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for f31c8d0 - Browse repository at this point
Copy the full SHA f31c8d0View commit details -
Allow
Cmd
subfield on docker image sources onlyIt may be necessary in the future to allow specification of commands on `Build` and `Context` source variants. For now, it is only possible for Docker images. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 851331c - Browse repository at this point
Copy the full SHA 851331cView commit details -
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 320f146 - Browse repository at this point
Copy the full SHA 320f146View commit details -
The format has changed, and this check is no longer correct. This commit also re-runs the `go generate` command and commits the changes. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for e649cad - Browse repository at this point
Copy the full SHA e649cadView commit details -
Match some tests fixtures to new spec format
Note: Only some of the tests will run properly. The logic for `SourceBuild` needs to be re-tooled in order to run one of the tests properly. I will come back later to edit the rest of the test fixtures. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 30aa0b8 - Browse repository at this point
Copy the full SHA 30aa0b8View commit details -
`SourceBuild` needs a base state of some sort, in which the specified Dockerfile will be executed. This implementation allows the base state to be made up of a local path, a build context, or another source. This may not be final, and it's likely that there are mistakes in here. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 5a723c7 - Browse repository at this point
Copy the full SHA 5a723c7View commit details -
The tests are still not completing successfully, so more troubleshooting is needed. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 19aefe6 - Browse repository at this point
Copy the full SHA 19aefe6View commit details -
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for b3570a2 - Browse repository at this point
Copy the full SHA b3570a2View commit details -
After discussion with Brian, this is the correct struct layout for this. The context string is a path which will be used as the `.` context for the dockerfile build. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for b33b3af - Browse repository at this point
Copy the full SHA b33b3afView commit details -
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 7b6a875 - Browse repository at this point
Copy the full SHA 7b6a875View commit details -
Configuration menu - View commit details
-
Copy full SHA for b84de6f - Browse repository at this point
Copy the full SHA b84de6fView commit details -
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 1612df8 - Browse repository at this point
Copy the full SHA 1612df8View commit details -
To pass the linter Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for fa813ed - Browse repository at this point
Copy the full SHA fa813edView commit details -
Update comment for autogenerated docs
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 74db6e1 - Browse repository at this point
Copy the full SHA 74db6e1View commit details -
Update patching test to reflect new spec format
Because of the patching PR. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for ac0bffb - Browse repository at this point
Copy the full SHA ac0bffbView commit details -
We can no longer reference other sources. Instead, we can specify a `local` source with the current directory in order to build the frontend. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 1076923 - Browse repository at this point
Copy the full SHA 1076923View commit details -
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for f068072 - Browse repository at this point
Copy the full SHA f068072View commit details -
Fix example spec files and accompanying docs
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 991772e - Browse repository at this point
Copy the full SHA 991772eView commit details -
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 8b795d1 - Browse repository at this point
Copy the full SHA 8b795d1View commit details -
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 007524c - Browse repository at this point
Copy the full SHA 007524cView commit details -
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 44084e4 - Browse repository at this point
Copy the full SHA 44084e4View commit details -
Additionally, ensure that the defaults are filled correctly for the `context` source type (which made the `local` type redundant). Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 9554d2b - Browse repository at this point
Copy the full SHA 9554d2bView commit details -
We're no longer using the schemes Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 4519995 - Browse repository at this point
Copy the full SHA 4519995View commit details -
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for e40bf10 - Browse repository at this point
Copy the full SHA e40bf10View commit details -
Use strings for DockerFile/Inline on build sources
Use them instead of pointers. Also, validate them up-front in the `validate` function, so that they do not need to be checked later. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 8380747 - Browse repository at this point
Copy the full SHA 8380747View commit details -
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for a3ddd8a - Browse repository at this point
Copy the full SHA a3ddd8aView commit details -
Allow
Build
Source type to use any Source as the contextSigned-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 140a9a9 - Browse repository at this point
Copy the full SHA 140a9a9View commit details -
Also, validate sources recursively. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 1a864c1 - Browse repository at this point
Copy the full SHA 1a864c1View commit details -
Remove
Path
field fromSourceContext
Also: - update `processArgs` to do substitutions inline. - update `fillDefaults` to set the default Source.Path to `"."` when the Source type is Context. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for d76f447 - Browse repository at this point
Copy the full SHA d76f447View commit details -
Make yaml specs conform to Git source type layout
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for c2a8230 - Browse repository at this point
Copy the full SHA c2a8230View commit details -
Remove unused default cases from switch statements
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for b3a2642 - Browse repository at this point
Copy the full SHA b3a2642View commit details