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

GH Actions CI Additions + Linter fixups #242

Merged
merged 6 commits into from
Sep 14, 2022

Conversation

philipaconrad
Copy link
Contributor

Hello gqlparser maintainers!

This PR includes:

  • 3x new GH Actions workflows (tested on my own fork).
  • A bunch of fixups/ignore comments to placate almost all of the golangci-lint errors.

Let me know if this PR needs additional improvements/revisions, and I'll cut out some time to make those modifications. 😄

Closes: #240

This commit adds two manual Github Actions workflows, and one automated
workflow that runs both jobs on every PR commit.

The workflows include:

 - Automated linting with golangci-lint
 - Automated `go test ./...`

Signed-off-by: Philip Conrad <[email protected]>
Signed-off-by: Philip Conrad <[email protected]>
@philipaconrad
Copy link
Contributor Author

Looks like the CircleCI pipeline is broken, and there's 3x suggestions from the golangci-lint run. I'll patch those shortly.

# When a new revision is pushed to a PR, cancel all in-progress CI runs for that
# PR. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ooooo! Ok, this is super fancy! I'm stealing this for use at my day job. Thanks!

@philipaconrad philipaconrad force-pushed the gh-actions-ci branch 2 times, most recently from 50bfde4 to ed0b70c Compare September 14, 2022 18:43
@philipaconrad
Copy link
Contributor Author

Finally placated the linter. 😅

uses: actions/checkout@v3

- name: Golang Style and Lint Check
run: docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.46.2 golangci-lint run -v
Copy link
Collaborator

Choose a reason for hiding this comment

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

So I wonder why you are choosing to run the docker image, rather than the golangci-lint GitHub action from the marketplace? Does the docker version also annotate the PR with inline comments the way the action marketplace golangci-lint does?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll admit, I just copied that part of the workflow over wholesale from OPA's pull-request workflow, and lifted up the underlying shell command for the make check target (the Docker command you saw). 😅

I'll try out the Github action, and see if that works equally well. The less fiddly commands in those workflows, the less stuff that can break.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like the Github actions version works okay. I pinned it to latest on the linter version.

Signed-off-by: Philip Conrad <[email protected]>
@philipaconrad
Copy link
Contributor Author

@StevenACoffman Thank you for taking the time to triage this PR! 😄

Let me know if you'd like me to squash-rebase my commit chain for a cleaner merge commit.

Copy link
Collaborator

@StevenACoffman StevenACoffman left a comment

Choose a reason for hiding this comment

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

Thanks!

@StevenACoffman StevenACoffman merged commit b3be96f into vektah:master Sep 14, 2022
github-merge-queue bot referenced this pull request in infratographer/x Jul 14, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[github.com/vektah/gqlparser/v2](https://togithub.com/vektah/gqlparser)
| require | patch | `v2.5.1` -> `v2.5.6` |

---

### Release Notes

<details>
<summary>vektah/gqlparser (github.com/vektah/gqlparser/v2)</summary>

###
[`v2.5.6`](https://togithub.com/vektah/gqlparser/releases/tag/v2.5.6)

[Compare
Source](https://togithub.com/vektah/gqlparser/compare/v2.5.5...v2.5.6)

#### What's Changed

- feat: support end of definition comment and end of file comment by
[@&#8203;Warashi](https://togithub.com/Warashi) in
[https://github.com/vektah/gqlparser/pull/264](https://togithub.com/vektah/gqlparser/pull/264)
- feat(formatter): preserve spaces at the head of comments by
[@&#8203;Warashi](https://togithub.com/Warashi) in
[https://github.com/vektah/gqlparser/pull/265](https://togithub.com/vektah/gqlparser/pull/265)

**Full Changelog**:
vektah/gqlparser@v2.5.5...v2.5.6

###
[`v2.5.5`](https://togithub.com/vektah/gqlparser/releases/tag/v2.5.5)

[Compare
Source](https://togithub.com/vektah/gqlparser/compare/v2.5.4...v2.5.5)

#### What's Changed

- feat: format with comments by
[@&#8203;Warashi](https://togithub.com/Warashi) in
[https://github.com/vektah/gqlparser/pull/263](https://togithub.com/vektah/gqlparser/pull/263)

**Full Changelog**:
vektah/gqlparser@v2.5.4...v2.5.5

###
[`v2.5.4`](https://togithub.com/vektah/gqlparser/releases/tag/v2.5.4)

[Compare
Source](https://togithub.com/vektah/gqlparser/compare/v2.5.3...v2.5.4)

#### What's Changed

- feat(lexer): comment token support by
[@&#8203;Warashi](https://togithub.com/Warashi) in
[https://github.com/vektah/gqlparser/pull/261](https://togithub.com/vektah/gqlparser/pull/261)

#### New Contributors

- [@&#8203;Warashi](https://togithub.com/Warashi) made their first
contribution in
[https://github.com/vektah/gqlparser/pull/261](https://togithub.com/vektah/gqlparser/pull/261)

**Full Changelog**:
vektah/gqlparser@v2.5.3...v2.5.4

###
[`v2.5.3`](https://togithub.com/vektah/gqlparser/releases/tag/v2.5.3)

[Compare
Source](https://togithub.com/vektah/gqlparser/compare/v2.5.2...v2.5.3)

#### What's Changed

- Update modules by
[@&#8203;StevenACoffman](https://togithub.com/StevenACoffman) in
[https://github.com/vektah/gqlparser/pull/259](https://togithub.com/vektah/gqlparser/pull/259)

**Full Changelog**:
vektah/gqlparser@v2.5.2...v2.5.3

###
[`v2.5.2`](https://togithub.com/vektah/gqlparser/releases/tag/v2.5.2)

[Compare
Source](https://togithub.com/vektah/gqlparser/compare/v2.5.1...v2.5.2)

#### What's Changed

- Add github actions to lint by
[@&#8203;StevenACoffman](https://togithub.com/StevenACoffman) in
[https://github.com/vektah/gqlparser/pull/241](https://togithub.com/vektah/gqlparser/pull/241)
- GH Actions CI Additions + Linter fixups by
[@&#8203;philipaconrad](https://togithub.com/philipaconrad) in
[https://github.com/vektah/gqlparser/pull/242](https://togithub.com/vektah/gqlparser/pull/242)
- Prefer to wrap third party errors by
[@&#8203;StevenACoffman](https://togithub.com/StevenACoffman) in
[https://github.com/vektah/gqlparser/pull/243](https://togithub.com/vektah/gqlparser/pull/243)
- Remove a duplicate line in lexer_test.yml by
[@&#8203;ryicoh](https://togithub.com/ryicoh) in
[https://github.com/vektah/gqlparser/pull/244](https://togithub.com/vektah/gqlparser/pull/244)
- Point to the right GraphQL spec by
[@&#8203;Khyme](https://togithub.com/Khyme) in
[https://github.com/vektah/gqlparser/pull/250](https://togithub.com/vektah/gqlparser/pull/250)
- Bump json5 from 2.2.0 to 2.2.3 in /validator/imported by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/vektah/gqlparser/pull/251](https://togithub.com/vektah/gqlparser/pull/251)
- support [@&#8203;defer](https://togithub.com/defer) directive by
[@&#8203;fiatjaf](https://togithub.com/fiatjaf) in
[https://github.com/vektah/gqlparser/pull/255](https://togithub.com/vektah/gqlparser/pull/255)
- Don't drop repeatable keyword when formatting directive by
[@&#8203;tadeokondrak](https://togithub.com/tadeokondrak) in
[https://github.com/vektah/gqlparser/pull/256](https://togithub.com/vektah/gqlparser/pull/256)
- Validate directive arguments during schema parsing by
[@&#8203;fredzqm](https://togithub.com/fredzqm) in
[https://github.com/vektah/gqlparser/pull/258](https://togithub.com/vektah/gqlparser/pull/258)
- Validate enum values directive are legit by
[@&#8203;fredzqm](https://togithub.com/fredzqm) in
[https://github.com/vektah/gqlparser/pull/257](https://togithub.com/vektah/gqlparser/pull/257)

#### New Contributors

- [@&#8203;ryicoh](https://togithub.com/ryicoh) made their first
contribution in
[https://github.com/vektah/gqlparser/pull/244](https://togithub.com/vektah/gqlparser/pull/244)
- [@&#8203;Khyme](https://togithub.com/Khyme) made their first
contribution in
[https://github.com/vektah/gqlparser/pull/250](https://togithub.com/vektah/gqlparser/pull/250)
- [@&#8203;fiatjaf](https://togithub.com/fiatjaf) made their first
contribution in
[https://github.com/vektah/gqlparser/pull/255](https://togithub.com/vektah/gqlparser/pull/255)
- [@&#8203;tadeokondrak](https://togithub.com/tadeokondrak) made their
first contribution in
[https://github.com/vektah/gqlparser/pull/256](https://togithub.com/vektah/gqlparser/pull/256)
- [@&#8203;fredzqm](https://togithub.com/fredzqm) made their first
contribution in
[https://github.com/vektah/gqlparser/pull/258](https://togithub.com/vektah/gqlparser/pull/258)

**Full Changelog**:
vektah/gqlparser@v2.5.1...v2.5.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/infratographer/x).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMTAuMCIsInVwZGF0ZWRJblZlciI6IjM1LjE0MS4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

Github Actions for code linting / testing of PRs?
2 participants