-
Notifications
You must be signed in to change notification settings - Fork 557
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
CI dogfood improvements #1984
CI dogfood improvements #1984
Conversation
5e9f1cd
to
2333709
Compare
Dogfooding notes/wishlist @shykes @helderco @samalba:
|
f1765ac
to
54b77ba
Compare
aa526e7
to
fbad661
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement, I added a few comments and questions
) | ||
|
||
// Lint using golangci-lint | ||
#Lint: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
golangci-lint
can take a lot of flags to configure the lint. That would be useful to expose go.#Container
instead of putting it in container
key so the user can add fields to command.flags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're already exposing go.#Container
in container
, not sure what you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone want to customise flag, he will need to do
go.#Lint & {
container: {
flags: ...
}
)
But if go.#Container
isn't in container
key, he'll just have to do
go.#Lint & {
flags: ...
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, agree with you. I followed the same convention as go.#Build
though -- should we update that one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The difference is that go.#Build
produce an output that isn't an image but binaries so I didn't wanted to make users think they can use go.#Build
as part of docker.#Build
.
In you case, it's should be possible so I'm not sure we should update go.#Build
; just updating go.#Lint
is enough IMO
Very useful feedback, could you make it a separate issue so we don't lose it? Thanks! |
fbad661
to
c9be445
Compare
c9be445
to
1c1eff1
Compare
Great stuff 🙂
Me too! And it makes it more portable. (windows anyone?)
Yeah, that's also what I've been doing. You know I'm partial to this 🙂
Not aware of this. Want to know more.
This has been mentioned by multiple users.
Interesting. I've been through this in January a lot, but it was because of the nesting issue. I know how frustrating it is to break those steps into correctly hooked fields. One small typo and you have an error that's not the root cause (incorrect
Yes, if there was a generic thing to hook any
I'll look into that more closely.
Yes, and having full reference docs could help as well. |
Thanks for the response @helderco :) I logged this into a separate issue: #1993 EDIT: @helderco mind copy pasting your message into that issue? I just added I'd like to migrate our own CI to dagger ASAP so we can feel the pain :) |
c3fc85b
to
d51b09f
Compare
Update:
dagger CI linting is on par with Makefile linting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a little comment, another question : package that you create specially for a plan should be in cue.mod/pkg
or cue.mod/usr
?
If I remember well, cue.mod/pkg
is only for external dependencies
In this case I decided to add my packages to |
Clear! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Love the factoring out into sub-packages
- Reverting back to
client.filesystem.".."
is a regression (unnecessary tight coupling to current workdir).
- "**.sh" | ||
- "**.bash" | ||
- "**.go" | ||
- "**.cue" | ||
- "**.bats" | ||
- "Makefile" | ||
- "go.mod" | ||
- "go.sum" | ||
- ".github/workflows/dagger-ci.yml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't wait to remove those and just rely on Dagger to do its thing...
ci/main.cue
Outdated
contents: core.#CacheDir & { | ||
id: "go mod cache" | ||
} | ||
_source: client.filesystem["../"].read.contents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above: access ..
for this is an anti-pattern.
ci/main.cue
Outdated
# Check that all formatted files where committed | ||
test -z $(git status -s . | grep -e '^ M' | grep .cue | cut -d ' ' -f3) | ||
"""# | ||
cue: docker.#Build & { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a FIXME to spin this out into a cuelangci
package like the equivalent golangci
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
- Use official Go package - Use golangci-lint package - Fix node_modules exclusion for local source - Improve CUE performance by optimizing cache hits Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
1fd0f92
to
a8ccf33
Compare
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
a8ccf33
to
93d2224
Compare
DEPENDS ON #1983 and #1971
Improve CI configuration:
/cc @samalba @marcosnils
To make this happen, there's also some other universe changes:
/cc @helderco @shykes