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 gomod-sync #1954

Merged
merged 4 commits into from
Jan 13, 2022
Merged

Add gomod-sync #1954

merged 4 commits into from
Jan 13, 2022

Conversation

andrerfcsantos
Copy link
Member

@andrerfcsantos andrerfcsantos commented Nov 10, 2021

Part of #1881

This PR introduces a new tool to the repo: gomod-sync. This is a little program to:

  • List go.mod files and the Go versions they are declaring via the gomod-sync list command.
  • Check if all go.mod files from the exercises are set to a specific version, with the gomod-sync check command. The desired version can be set with the --goversion flag.
  • Update all go.mod files to a specific version with the gomod-sync update command. The desired version for the update can be set with the --goversion flag.

Right now these 3 commands are working. The update command was ran against the repo to update all exercises to 1.16, and the result is #1955

Tasks

  • list, check and update commands
  • Setup the use of the check command in CI
  • Documentation for the tool
  • Add a way to allow specific go versions for specific exercises
  • Tests

@github-actions
Copy link
Contributor

Dear andrerfcsantos

Thank you for contributing to the Go track on Exercism! 💙
You will see some automated feedback below 🤖. It would be great if you can make sure your PR covers those points. This will save your reviewer some time and your change can be merged quicker.

  • ✍️ If your PR is not related to an existing issue (and is not self-explaining like a typo fix), please make sure the description explains why the change you made is necessary.

  • 🔤 If your PR fixes an easy to identify typo, if would be great if you could check for that typo in the whole repo. For example, if you found Unicdoe, use "replace all" in your editor (or command line magic) to fix it consistently.

Dear Reviewer/Maintainer

  • 📏 Make sure you set the appropriate x:size label for the PR. (This also works after merging, in case you forgot about it.)

  • 🔍 Don't be too nit-picky. If the PR is a clear improvement compared to the status quo, it should be approved as clear signal this is good to be merged even if the minor comments you might have are not addressed by the contributor. Further improvement ideas can be captured in issues (if important enough) and implemented via additional PRs.

  • 🤔 After reviewing the diff in the "Files changed" section, take a moment to think about whether there are changes missing from the diff. Does something need to be adjusted in other places so the code or content stays consistent?

Automated comment created by PR Commenter 🤖.

@andrerfcsantos andrerfcsantos added the x:size/medium Medium amount of work label Nov 13, 2021
@andrerfcsantos andrerfcsantos force-pushed the gomod-sync branch 8 times, most recently from 9e0d88d to c1b8564 Compare November 14, 2021 00:54
@andrerfcsantos andrerfcsantos added the status/awaiting-contributor This pull request is waiting on the contributor. label Nov 16, 2021
@andrerfcsantos andrerfcsantos force-pushed the gomod-sync branch 3 times, most recently from aef77e6 to 1ca7f2a Compare November 21, 2021 11:47
@andrerfcsantos andrerfcsantos force-pushed the gomod-sync branch 13 times, most recently from 6a8a940 to 11efb05 Compare December 30, 2021 00:01
@andrerfcsantos andrerfcsantos marked this pull request as ready for review December 30, 2021 00:06
@andrerfcsantos
Copy link
Member Author

Ready for review 🚀

This one is on the bigger side, so feel free to take your time, there is no rush.

This is what the output of the check looks like when it fails: https://github.com/exercism/go/runs/4662874598?check_suite_focus=true

For the output in case everything is fine, see the go.mod check below ⬇️

gomod-sync/.gitignore Outdated Show resolved Hide resolved
gomod-sync/README.md Outdated Show resolved Hide resolved
@junedev junedev added x:size/large Large amount of work and removed x:size/medium Medium amount of work labels Dec 30, 2021
gomod-sync/.gitignore Outdated Show resolved Hide resolved
@andrerfcsantos

This comment has been minimized.

@andrerfcsantos andrerfcsantos force-pushed the gomod-sync branch 2 times, most recently from 9c66dd0 to 0079e44 Compare December 30, 2021 22:49
@junedev

This comment has been minimized.

@junedev junedev requested a review from a team January 1, 2022 19:42
@andrerfcsantos

This comment has been minimized.

Copy link
Member

@junedev junedev left a comment

Choose a reason for hiding this comment

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

I tried to do a review. I don't know anything about cobra though so I can't comment on that. The part that I could understand looked good to me, just some minor comments.

gomod-sync/cmd/config/load_test.go Outdated Show resolved Hide resolved
gomod-sync/cmd/config/version.go Outdated Show resolved Hide resolved
gomod-sync/cmd/config/version.go Outdated Show resolved Hide resolved
gomod-sync/cmd/config/version_test.go Outdated Show resolved Hide resolved
gomod-sync/cmd/config/version.go Outdated Show resolved Hide resolved
gomod-sync/config.sample.json Outdated Show resolved Hide resolved
gomod-sync/gomod/find.go Outdated Show resolved Hide resolved
gomod-sync/gomod/version.go Outdated Show resolved Hide resolved
gomod-sync/gomod/version.go Outdated Show resolved Hide resolved
gomod-sync/gomod/version.go Outdated Show resolved Hide resolved
@andrerfcsantos andrerfcsantos force-pushed the gomod-sync branch 2 times, most recently from 31c927e to b5c120a Compare January 12, 2022 22:09
@andrerfcsantos
Copy link
Member Author

@junedev Thanks! Applied all the changes. Left comments in the conversations, feel free to un-resolve any of them or suggest further changes if there's something that can be further improved.

@junedev
Copy link
Member

junedev commented Jan 13, 2022

@andrerfcsantos Thanks for addressing all the comments. Feel free to merge whenever you like. (I don't think there will be more reviews if we wait longer tbh.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:size/large Large amount of work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants