Skip to content

Commit

Permalink
chore: bump to use go1.23 (#485)
Browse files Browse the repository at this point in the history
* chore: bump to use go1.23

Signed-off-by: Rui Chen <[email protected]>

* Accept PR comments from #483

* Update lint to fix lint

* Keep lint happy

* Lengthen timeout

---------

Signed-off-by: Rui Chen <[email protected]>
Co-authored-by: Rui Chen <[email protected]>
  • Loading branch information
malcolmholmes and chenrui333 authored Sep 3, 2024
1 parent f3f0b72 commit cef1273
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 20 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ jobs:
arch:
- amd64
- arm64

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: go.mod
cache-dependency-path: go.sum
- run: GOOS=linux GOARCH=${{ matrix.arch }} make static
- name: Docker meta
id: meta
Expand All @@ -57,7 +58,7 @@ jobs:
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: grafana/shared-workflows/actions/dockerhub-login@main

- name: Build and push by digest
id: build
uses: docker/build-push-action@v5
Expand All @@ -75,7 +76,7 @@ jobs:
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
touch "/tmp/digests/${digest#sha256:}"
echo "artifact_name=digests-linux/${{ matrix.arch }}" | sed -e 's/\//-/g' >> "$GITHUB_OUTPUT"
- name: Upload digest
Expand All @@ -86,11 +87,11 @@ jobs:
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

merge:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
needs:
needs:
- build
steps:
- name: Download digests (linux/amd64)
Expand All @@ -113,7 +114,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
Expand All @@ -128,7 +129,7 @@ jobs:
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
3 changes: 3 additions & 0 deletions .github/workflows/publish-techdocs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Publish TechDocs

on:
push:
branches:
Expand All @@ -8,9 +9,11 @@ on:
- 'mkdocs.yml'
- 'catalog-info.yaml'
- '.github/workflows/publish-techdocs.yaml'

concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true

jobs:
publish-docs:
uses: grafana/shared-workflows/.github/workflows/publish-techdocs.yaml@main
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/public

3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: go.mod
cache-dependency-path: go.sum
- run: make cross
- id: docker_tag
run: echo "DOCKER_TAG=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: run tests

on:
pull_request: {}
pull_request:

jobs:
lint:
Expand All @@ -10,7 +10,8 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Lint
run: make lint
tests:
Expand All @@ -19,7 +20,8 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Make
run: make test
integration:
Expand All @@ -28,6 +30,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Make
run: make integration
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.5
FROM golang:1.23.0
ARG JSONNET_VERSION=v0.19.1
ARG JB_VERSION=v0.5.1
RUN CGO_ENABLED=0 go install github.com/google/go-jsonnet/cmd/jsonnet@${JSONNET_VERSION} && \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lint:
--rm \
--volume "$(shell pwd):/src" \
--workdir "/src" \
golangci/golangci-lint:v1.57 golangci-lint run ./... -v
golangci/golangci-lint:v1.60.3 golangci-lint run ./... -v --timeout 2m

run-test-image-locally: test-clean
$(DOCKER_COMPOSE) up --force-recreate --detach --remove-orphans --wait
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/grafana/grizzly

go 1.22
go 1.23

require (
github.com/fatih/color v1.15.0
Expand Down
4 changes: 2 additions & 2 deletions pkg/grafana/dashboard-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,11 @@ func (h *DashboardHandler) RootDashboardPageHandler(s grizzly.Server) http.Handl

if resp.StatusCode == 302 {
w.WriteHeader(http.StatusUnauthorized)
fmt.Fprintf(w, msg+"<p>Authentication error</p>")
fmt.Fprintf(w, "%s<p>Authentication error</p>", msg)
} else {
body, _ := io.ReadAll(resp.Body)
w.WriteHeader(resp.StatusCode)
fmt.Fprintf(w, msg+string(body))
fmt.Fprintf(w, "%s%s", msg, string(body))
}
}
}
Expand Down

0 comments on commit cef1273

Please sign in to comment.