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

fix: correct updatecli golang manifest to update go.mod #294

Merged
merged 2 commits into from
Oct 3, 2021

Conversation

dduportal
Copy link
Contributor

@dduportal dduportal commented Oct 2, 2021

This should lead to a successful update of #273 once merged.

As explained in #273 (comment), there is an issue with the current go.mod update process:

  • The go.mod file expects a version without the patch (only major and minor) as per ref. https://golang.org/ref/mod#go-mod-file-go
  • Ideally, changing the go version should be done with 2 go mod <..> commands:
    • go mod edit -go=
    • When the go version is changed in the go.mod file, then the command go mod tidy is needed because the internal format can change between minor version (this is the case here with 1.16 to 1.17). It might also update the go.sum.

This PR uses a shell resource as a "source", to update the go version of the go mod in a temp dir, and prints the content of the tidied resuting go.mod file.

Please note that this PR also enables the updatecli workflow for all PR/branches:

  • The updatecli diff command is always executed (to ensure that it's not broken when there are configuration changes)
  • The updatecli apply command is only executed on the main branch of course
    => The goal is to validate that the new shell script resource works as expected (for instance that it successfully installs golang when runing withing its image)

@dduportal dduportal requested a review from olblak October 2, 2021 07:03
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
@dduportal dduportal merged commit e157b5f into updatecli:main Oct 3, 2021
@dduportal dduportal deleted the fix/updatecli-golang-update branch October 3, 2021 06:06
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.

None yet

1 participant