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

add GH action workflows #80

Merged
merged 2 commits into from
Jan 18, 2024
Merged

add GH action workflows #80

merged 2 commits into from
Jan 18, 2024

Conversation

szuecs
Copy link
Member

@szuecs szuecs commented Jan 17, 2024

add GH action workflows:

  • dependabot to keep dependencies up to date
  • PR workflow to run tests and lint

fix: linter findings

- dependabot to keep dependencies up to date
- PR workflow to run tests and lint

fix: linter findings
Signed-off-by: Sandor Szücs <[email protected]>
Signed-off-by: Sandor Szücs <[email protected]>
@szuecs
Copy link
Member Author

szuecs commented Jan 17, 2024

👍

Copy link
Member

@tkrop tkrop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, I'm wondering what the commented code is contributing here. Shouldn't it be removed?

@@ -0,0 +1,43 @@
name: pr
on: [ pull_request ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be [ push ] to compile on any new commit?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It updates on each push but online if there's an open pr

Comment on lines +19 to +21
check-race:
runs-on: ubuntu-latest
steps:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you propose to test two times: with and without -race?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Race takes significant longer and that's why it makes sense to break out.

Comment on lines +22 to +23
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just an official release version instead of an unclear commit?

      uses: actions/checkout@v3
      uses: actions/setup-go@v3

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for security reasons. Usage of v3 opens up possibility for script injections into CI/CD. +1 for commit usage in Zalando context.

@@ -21,14 +21,18 @@ var AccessTuples []AccessTuple
// AccessTuple is the type defined for use in AccessTuples.
type AccessTuple struct {
Realm string `yaml:"realm,omitempty"` // p.e. "employees", "services"
Uid string `yaml:"uid,omitempty"` // UnixName
Cn string `yaml:"cn,omitempty"` // RealName
//lint:ignore ST1003 public interface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that disabling is setting a bad example here? Better to fix the linter violations here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be a breaking change

- run: go vet ./github ./google ./zalando
- run: go test ./...
- run: go install honnef.co/go/tools/cmd/staticcheck@latest
- run: staticcheck -checks "all" ./github ./google ./zalando
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the staticcheck be in own step. You can use the action from dominikh/staticcheck-action@xxx

@fogfish
Copy link
Member

fogfish commented Jan 18, 2024

👍

1 similar comment
@szuecs
Copy link
Member Author

szuecs commented Jan 18, 2024

👍

@szuecs szuecs closed this Jan 18, 2024
@szuecs szuecs reopened this Jan 18, 2024
@mikkeloscar
Copy link
Member

👍

if si, ok := data["error_description"]; ok {
s, ok := si.(string)
if !ok {
s = ""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you expect this line to be executed? If yes, why is it okay to ignore data["error_description"]?

@RomanZavodskikh
Copy link

👍

@szuecs szuecs merged commit 08a65ae into master Jan 18, 2024
9 checks passed
@szuecs szuecs deleted the ci/enable-dependabot branch January 18, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants