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
Code clean-up #831
Comments
@cplee, i appreciate any thoughts you have on this |
@catthehacker thanks for taking initiative with this. Here's some thoughts:
|
That probably was me going off from bad memory since I already cleaned that up in #679 😄
Few points I noticed over time:
func TestRunDifferentArch(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}
ctx := context.Background()
client, err := container.GetDockerClient(ctx)
assert.NoError(t, err)
err = container.NewDockerPullExecutor(container.NewDockerPullExecutorInput{
Image: "tonistiigi/binfmt:latest",
})(ctx)
assert.NoError(t, err)
var platSpecs *specs.Platform
_, err = client.ContainerCreate(ctx, &typesContainer.Config{
Cmd: []string{"--install", "linux/arm64"},
Image: "tonistiigi/binfmt:latest",
}, &typesContainer.HostConfig{
AutoRemove: true,
Privileged: true,
}, &network.NetworkingConfig{}, platSpecs, "binfmt")
assert.NoError(t, err)
err = client.ContainerStart(ctx, "binfmt", types.ContainerStartOptions{})
assert.NoError(t, err)
platforms := map[string]string{
"ubuntu-latest": baseImage,
}
log.SetLevel(log.DebugLevel)
runTestJobFile(ctx, t, TestJobFileInfo{"testdata", "basic", "push", "", platforms, "linux/arm64"})
}
|
We seem to have multiple nolint formatting in our codebase. I'm not shure, which is our prefered formatting of them.
The docu of golang-cilint seem to use the first option in examples. |
I'm not the best person to describe things so pardon mess below
nolint
amount of code with disabled linting keeps increasing, it should be checked if we can prevent that
act/cmd/root.go
Lines 152 to 153 in 7a426a0
act/pkg/common/git.go
Lines 276 to 279 in 7a426a0
act/pkg/container/docker_run.go
Lines 549 to 550 in 7a426a0
act/pkg/model/planner.go
Lines 92 to 94 in 7a426a0
act/pkg/model/workflow.go
Lines 214 to 217 in 7a426a0
act/pkg/runner/expression.go
Lines 131 to 142 in 7a426a0
act/pkg/runner/step_context.go
Lines 454 to 455 in 7a426a0
add missing error checking where possible, where definitely sure it's not required/helpful, annotate it with a commenttestdata shouldn't be duplicated and cross-testing should help prevent issue
it's fine if we have dedicated tests for some functions but most of it could be verified by all packages
something like this?
currently logging in whole
act
is a mess (IMO), debug/info messages have been enabled/disabled/moved, error checking is missing in places, terminal is clogged with git and other spammy idea is to re-work all logging into central package (
common/logger
) and implement debug levels (e.g.:1
- minimal debug info,2
- additional debugging,3
- all debug), it should be fine for local development to run with level1
/2
, in some extreme cases one can enable3
(which would be also default for CI)act/pkg/container/docker_logger.go
Lines 25 to 76 in 7a426a0
act/pkg/runner/runner_test.go
Line 123 in 7a426a0
The text was updated successfully, but these errors were encountered: