Skip to content

Update to using Go 1.17 for project #352

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

Merged
merged 3 commits into from
Mar 15, 2022
Merged

Update to using Go 1.17 for project #352

merged 3 commits into from
Mar 15, 2022

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Mar 12, 2022

1.17 is now the preferred Go version for Arduino tooling projects.

per1234 added 3 commits March 12, 2022 14:21
1.17 is now the preferred Go version for Arduino tooling projects.
`go mod tidy` has an inexplicable default behavior:

https://go.dev/ref/mod#go-mod-tidy

>By default, go mod tidy will check that the selected versions of modules do not change when the module graph is loaded
> by the Go version immediately preceding the version indicated in the go directive.

The `go` directive indicates the version of Go the project is written for. The `go mod tidy` command should not fail if
the module is configured in a manner that is incompatible with an unsupported Go version.

So it is necessary use use the `-compat=1.17` flag to cause the `go mod tidy` command to behave correctly and check for
compatibility with the version of Go that is in use.

Previously, I had thought that `go mod tidy` was straightforward enough that it did not make sense to wrap it in a task.
This is no longer true, so it is moved to the `go:tidy` task so that the developer does not need to think about what
obscure flags are required to make it behave correctly and to be aligned with the results of the "Check Go" CI workflow.
For the convenience of the developer, some "umbrella" tasks have been defined, which run all the specific tasks of a basic class:

- `check`: run all automated checks for issues
- `fix`: make automated corrections for issues where possible

The project contains multiple Go modules in different folders:

- `github.com/arduino/arduino-lint`: root folder
- `github.com/arduino/arduino-lint/docsgen`: docsgen subfolder
- `github.com/arduino/arduino-lint/ruledocsgen`: ruledocsgen subfolder

`go` commands are applied to the module in the current working directory. The tasks are configured so that the working directory can be specified, defaulting to the root.

Previously, the "umbrella" tasks only ran the `go:*` tasks with the default, meaning only the
`github.com/arduino/arduino-lint` module was covered by these tasks. This is contrary to the intended purpose of these
"umbrella" tasks, which is to allow the developer to run a couple of standardized commands to find or fix all problems,
trading efficiency for convenience.
@per1234 per1234 added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels Mar 12, 2022
@per1234 per1234 requested review from silvanocerza and umbynos March 12, 2022 22:22
@per1234 per1234 self-assigned this Mar 12, 2022
@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2022

Codecov Report

Merging #352 (80bf21e) into main (b139ce8) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #352   +/-   ##
=======================================
  Coverage   90.01%   90.01%           
=======================================
  Files          44       44           
  Lines        6770     6770           
=======================================
  Hits         6094     6094           
  Misses        553      553           
  Partials      123      123           
Flag Coverage Δ
unit 90.01% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5d7bb8...80bf21e. Read the comment docs.

@per1234
Copy link
Contributor Author

per1234 commented Mar 12, 2022

The link check failure is unrelated and will be fixed by #351

@per1234 per1234 merged commit 99a075f into arduino:main Mar 15, 2022
@per1234 per1234 deleted the bump-go branch March 15, 2022 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants