Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions .ci/updatecli/bump-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ scms:

sources:
minor:
name: Get minor version in .go-version
name: Get minor version in go.mod
kind: shell
transformers:
- findsubmatch:
pattern: '^\d+.(\d+).\d+$'
pattern: '^go \d+\.(\d+)\.\d+$'
captureindex: 1
spec:
command: cat .go-version
command: grep '^go ' go.mod

latestGoVersion:
name: Get Latest Go Release
Expand Down Expand Up @@ -72,18 +72,9 @@ conditions:
kind: shell
sourceid: latestGoVersion
spec:
command: 'grep -v -q {{ source "latestGoVersion" }} .go-version #'
command: 'grep -v -q {{ source "latestGoVersion" }} go.mod #'

targets:
update-go-version:
name: 'Update .go-version with Golang version {{ source "latestGoVersion" }}'
sourceid: latestGoVersion
scmid: default
kind: file
spec:
content: '{{ source "latestGoVersion" }}'
file: .go-version
matchpattern: '\d+.\d+.\d+'

update-gomod:
name: 'Update go.mod files'
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ jobs:
GH_TOKEN: ${{ github.token }}
- run: make publish-docker-images

# Only for forked PRs, when changing the .go-version, then we need to note that the wolfi docker image needs to be
# validated
# Only for forked PRs/dependabot, when changing the Go version in go.mod, we need to note that the
# wolfi docker image needs to be validated.
validate-wolfi-docker-image:
runs-on: ubuntu-latest
if: ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true ) || github.actor == 'dependabot[bot]'
Expand All @@ -217,15 +217,16 @@ jobs:
id: changed-files
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47.0.5
with:
files: .go-version
files: go.mod
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is gonna run quite often :(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

that's true 😞


- name: If .go-version changed validate docker image is available.
- name: If go.mod changed validate wolfi docker image is available.
if: steps.changed-files.outputs.any_changed == 'true'
run: |
echo "If you change the .go-version please use a branch in the upstream repository to validate the wolfi images with test-package-and-push."
GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}')
echo "If you change the Go version in go.mod please use a branch in the upstream repository to validate the wolfi images with test-package-and-push."
echo "Otherwise, this validation will run and fail the CI build."
echo "Please validate the wolfi image is available by running the following command:"
echo "::notice::docker pull docker.elastic.co/wolfi/go:$(cat .go-version)"
echo "::notice::docker pull docker.elastic.co/wolfi/go:${GO_VERSION}"
echo "If they are available you could skip this validation."
echo "However, we recommend to use an upstream branch to run the CI specialised steps for the packaging system."
exit 1
1 change: 0 additions & 1 deletion .go-version

This file was deleted.

2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ script_dir = os.path.join(config.main_dir, 'script')
default_kibana_port = 5601
kibana_host = "localhost"
kibana_base_path = ""
golang_version = str(read_file('./.go-version')).strip()
golang_version = str(local("grep '^go ' go.mod | awk '{print $2}'", quiet=True, echo_off=True)).strip()

# checks whether (dev mode) kibana is already running at given port,
# and returns the URL it is redirected to
Expand Down
Loading