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 goimports config #181

Merged
merged 1 commit into from
Apr 21, 2023
Merged

Conversation

matttrach
Copy link
Contributor

This add a config to get the latest goimports release, update the tag name in the comment and update the commit hash in the go get line of the Dockerfile.

Signed-off-by: Matt Trachier <[email protected]>
@matttrach
Copy link
Contributor Author

Here is my test data:

command$# updatecli diff -v updatecli/values.yaml -c updatecli/updatecli.d/dockerfile_dapper_goimports.yml 


+++++++++++
+ PREPARE +
+++++++++++

Loading Pipeline "updatecli/updatecli.d/dockerfile_dapper_goimports.yml"

SCM repository retrieved: 2


++++++++++++++++++
+ AUTO DISCOVERY +
++++++++++++++++++



++++++++++++
+ PIPELINE +
++++++++++++



#############################################################
# UPDATE THE VERSION OF GOIMPORTS USED IN DOCKERFILE.DAPPER #
#############################################################


SOURCES
=======

latestGoImportsHash
-------------------
Searching for version matching pattern "^gopls\\/v\\d*\\.\\d*\\.\\d*$"
✔ Git tag "611cff71b9afeb81ae6eb16c5ce9376c051b1828" found matching pattern "^gopls\\/v\\d*\\.\\d*\\.\\d*$"

latestGoImportsTag
------------------
Searching for version matching pattern "^gopls\\/v\\d*\\.\\d*\\.\\d*$"
✔ Git tag "gopls/v0.11.0" found matching pattern "^gopls\\/v\\d*\\.\\d*\\.\\d*$"


CONDITIONS:
===========

testHashShouldMatch
-------------------
✗ Content of the file "Dockerfile.dapper" did not match the pattern "go install golang\\.org\\/x\\/tools\\/cmd\\/goimports@611cff71b9afeb81ae6eb16c5ce9376c051b1828"
✗ Condition on file [] did not pass


TARGETS
========

updateDockerfileTag
-------------------

**Dry Run enabled**

⚠ updated the [dry run] content of the file "/tmp/updatecli/github/k3s-io/kine/Dockerfile.dapper"

--- /tmp/updatecli/github/k3s-io/kine/Dockerfile.dapper
+++ /tmp/updatecli/github/k3s-io/kine/Dockerfile.dapper
@@ -3,7 +3,7 @@
 ARG ARCH=amd64
 
 RUN apk -U add bash coreutils git gcc musl-dev docker-cli vim less file curl wget ca-certificates
-# go imports version gopls/v0.9.5
+# go imports version gopls/v0.11.0
 # https://github.com/golang/tools/releases/latest
 RUN go install golang.org/x/tools/cmd/goimports@8a9de1b095ae54649c1dc503f4f718779bddb55f
 RUN rm -rf /go/src /go/pkg


updateDockerfileHash
--------------------

**Dry Run enabled**

⚠ updated the [dry run] content of the file "/tmp/updatecli/github/k3s-io/kine/Dockerfile.dapper"

--- /tmp/updatecli/github/k3s-io/kine/Dockerfile.dapper
+++ /tmp/updatecli/github/k3s-io/kine/Dockerfile.dapper
@@ -5,7 +5,7 @@
 RUN apk -U add bash coreutils git gcc musl-dev docker-cli vim less file curl wget ca-certificates
 # go imports version gopls/v0.9.5
 # https://github.com/golang/tools/releases/latest
-RUN go install golang.org/x/tools/cmd/goimports@8a9de1b095ae54649c1dc503f4f718779bddb55f
+RUN go install golang.org/x/tools/cmd/goimports@611cff71b9afeb81ae6eb16c5ce9376c051b1828
 RUN rm -rf /go/src /go/pkg
 
 RUN if [ "${ARCH}" == "amd64" ]; then \



ACTIONS
========

[Dry Run] An action of kind "github/pullrequest" is expected.

=============================

REPORTS:


⚠ Update the version of goimports used in Dockerfile.dapper:
        Source:
                ✔ [latestGoImportsHash] Get commit hash of latest goimports tag (kind: gittag)
                ✔ [latestGoImportsTag] Get latest goimports tag (kind: gittag)
        Condition:
                ✔ [testHashShouldMatch] Hash should match latest tag's commit hash (kind: file)
        Target:
                ⚠ [updateDockerfileHash] Update the hash in Dockerfile.dapper (kind: file)
                ⚠ [updateDockerfileTag] Update the tag in Dockerfile.dapper (kind: file)


Run Summary
===========
Pipeline(s) run:
  * Changed:    1
  * Failed:     0
  * Skipped:    0
  * Succeeded:  0
  * Total:      1

@matttrach matttrach self-assigned this Apr 20, 2023
@matttrach matttrach requested a review from a team April 20, 2023 18:44
@matttrach
Copy link
Contributor Author

When this triggers it will more than likely generate a PR which updates goimports to v0.11.0

@matttrach
Copy link
Contributor Author

This contributes to k3s-io/k3s#7040

@matttrach matttrach requested a review from macedogm April 20, 2023 18:53
@matttrach matttrach merged commit c561926 into k3s-io:master Apr 21, 2023
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.

3 participants