Skip to content

Commit

Permalink
vendor: go 1.23, goreleaser v2 (#6456)
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Santos <nick.santos@docker.com>
  • Loading branch information
nicks authored Oct 31, 2024
1 parent 793f831 commit 5285ead
Show file tree
Hide file tree
Showing 22 changed files with 36 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .circleci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM cimg/go:1.22-node
FROM cimg/go:1.23-node

# --- DEPENDENCIES ---
USER root
Expand Down Expand Up @@ -30,4 +30,4 @@ RUN go install github.com/google/wire/cmd/wire@latest \
&& go install golang.org/x/tools/cmd/goimports@latest \
&& go clean -cache -modcache

RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.56.0
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0
4 changes: 2 additions & 2 deletions .circleci/Dockerfile.integration
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM cimg/go:1.22-node
FROM cimg/go:1.23-node

USER root

Expand Down Expand Up @@ -38,7 +38,7 @@ RUN curl -fL "https://github.com/docker/compose/releases/download/${DOCKER_COMPO
&& docker-compose version

# install Kind (Kubernetes in Docker)
ENV KIND_VERSION=v0.21.0
ENV KIND_VERSION=v0.24.0
RUN curl -fLo ./kind-linux-amd64 https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64 \
&& chmod +x ./kind-linux-amd64 \
&& mv ./kind-linux-amd64 /usr/local/bin/kind \
Expand Down
14 changes: 6 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build-linux:
resource_class: medium+
docker:
- image: docker/tilt-ci@sha256:d5862a9bfdad294feb50849bae1d9add22b1f5d0e750273c24683cc5edc2c4fa
- image: docker/tilt-ci@sha256:04e2f5ed618d5e17d72a6674a7e2645c3f8c3fead1cfbd9fa8f73a841f5bcf5b
# apiserver code generation scripts require being in GOPATH
working_directory: /home/circleci/go/src/github.com/tilt-dev/tilt

Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:

check-docs:
docker:
- image: docker/tilt-ci@sha256:d5862a9bfdad294feb50849bae1d9add22b1f5d0e750273c24683cc5edc2c4fa
- image: docker/tilt-ci@sha256:04e2f5ed618d5e17d72a6674a7e2645c3f8c3fead1cfbd9fa8f73a841f5bcf5b
steps:
- checkout
- setup_remote_docker
Expand All @@ -73,7 +73,7 @@ jobs:
steps:
- run: |
choco install -y make kustomize kubernetes-helm docker-compose
choco upgrade -y --allow-downgrade golang --version=1.22.2
choco upgrade -y --allow-downgrade golang --version=1.23.2
# mingw 13 seems to have broken gcc installs
# https://community.chocolatey.org/packages/mingw#comment-6290804217
Expand All @@ -100,7 +100,7 @@ jobs:
build-integration:
resource_class: medium+
docker:
- image: docker/tilt-integration-ci@sha256:17d2fc2c7de751bbc6aa750a362e556c6b4277c168457460a67d6d31455eec4d
- image: docker/tilt-integration-ci@sha256:16f9d26ea50cecfc184ecced4370885c9ae6c6dd30ca3cad1c4ec765e0f61b28
steps:
- checkout
- run: echo 'export PATH=/go/bin:$PATH' >> $BASH_ENV
Expand Down Expand Up @@ -155,16 +155,14 @@ jobs:
resource_class: medium+
docker:
# keep image in sync with build.toast.yml
- image: docker/tilt-releaser@sha256:e626c30b4b6d42056182f530563eaf80df72441bc37f49e7a707395428aab725
environment:
DOCKER_CLI_EXPERIMENTAL: enabled
- image: docker/tilt-releaser@sha256:838b82383bab402b5a68c64d14f09558951230db3dc2f492fd3803581b5dcad6
steps:
- setup_remote_docker
# https://discuss.circleci.com/t/arm-version-of-remote-docker/41624
- run: ssh remote-docker "sudo apt-get update; sudo apt-get install -y qemu-user-static binfmt-support"
- checkout
- run: make build-js
- run: goreleaser --debug --clean --skip-publish --snapshot
- run: goreleaser --verbose --clean --skip=publish --snapshot
- slack/notify-on-failure:
only_for_branches: main

Expand Down
16 changes: 8 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# options for analysis running
run:
timeout: 10m
go: "1.20"
skip-files:
go: "1.23"
exclude-files:
- "zz_generated.*\\.go$"
- "vendored_openapi\\.go$"
allow-parallel-runners: true
modules-download-mode: vendor
build-tags:
- integration

# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number
formats:
- format: colored-line-number

# print lines of code with issue, default is true
print-issued-lines: true
Expand Down Expand Up @@ -49,22 +50,21 @@ linters-settings:
ignore-words:
- servantes
- cancelled # British spelling used in Kubernetes code

linters:
disable-all: true
enable:
- copyloopvar
- errcheck
- exportloopref
- goimports
- gosimple
- govet
- ineffassign
- megacheck
- staticcheck
- misspell
- unconvert
- unused

issues:
exclude-rules:
- linters:
Expand Down
4 changes: 2 additions & 2 deletions build.toast.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# keep image in sync with .circleci/config.yml
image: docker/tilt-releaser@sha256:e626c30b4b6d42056182f530563eaf80df72441bc37f49e7a707395428aab725
image: docker/tilt-releaser@sha256:838b82383bab402b5a68c64d14f09558951230db3dc2f492fd3803581b5dcad6
location: /go/src/github.com/tilt-dev/tilt
command_prefix: set -euo pipefail
tasks:
Expand All @@ -22,7 +22,7 @@ tasks:
GR_ARGS: ""
dependencies:
- build-js
command: goreleaser --debug build --snapshot --clean $GR_ARGS
command: goreleaser --verbose build --snapshot --clean $GR_ARGS
input_paths:
- .git/
- cmd/
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/tilt-dev/tilt

go 1.22.0

toolchain go1.22.1
go 1.23.0

require (
github.com/adrg/xdg v0.4.0
Expand Down
4 changes: 0 additions & 4 deletions internal/controllers/core/cmd/execer_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package cmd

import (
"os"
"runtime"
"strconv"
"strings"
"syscall"
Expand All @@ -17,9 +16,6 @@ import (
)

func TestStopsBackgroundGrandchildren(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("no bash on windows")
}
f := newProcessExecFixture(t)

f.start(`bash -c 'sleep 100 &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ func populateContainerPorts(pft *v1alpha1.PortForwardTemplateSpec, pod *v1alpha1
func PickBestPortForwardPod(kd *v1alpha1.KubernetesDiscovery) *v1alpha1.Pod {
var bestPod *v1alpha1.Pod
for _, pod := range kd.Status.Pods {
pod := pod
if pod.Name == "" {
continue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,11 @@ func (bd *DockerComposeBuildAndDeployer) BuildAndDeploy(ctx context.Context, st
}

dcManagedBuild := plan.dockerComposeImageTarget != nil
var stepName string
if dcManagedBuild {
stepName = "Building & deploying"
ps.StartPipelineStep(ctx, "Building & deploying")
} else {
stepName = "Deploying"
ps.StartPipelineStep(ctx, "Deploying")
}
ps.StartPipelineStep(ctx, stepName)

status := bd.dcsr.ForceApply(ctx, dcTargetNN, dcTarget.Spec, imageMapSet, dcManagedBuild)
ps.EndPipelineStep(ctx)
Expand Down
2 changes: 1 addition & 1 deletion internal/engine/dockerprune/docker_pruner.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func prettyPrintContainersPruneReport(report types.ContainersPruneReport, l logg
l.Infof("[Docker Prune] removed %d containers, reclaimed %s",
len(report.ContainersDeleted), humanSize(report.SpaceReclaimed))
if len(report.ContainersDeleted) > 0 {
l.Debugf(sliceutils.BulletedIndentedStringList(report.ContainersDeleted))
l.Debugf("%s", sliceutils.BulletedIndentedStringList(report.ContainersDeleted))
}
}

Expand Down
3 changes: 0 additions & 3 deletions internal/hud/webview/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func CompleteView(ctx context.Context, client ctrlclient.Client, st store.RStore
}

for _, item := range resourceList.Items {
item := item
ret.UiResources = append(ret.UiResources, &item)
}

Expand All @@ -62,7 +61,6 @@ func CompleteView(ctx context.Context, client ctrlclient.Client, st store.RStore
}

for _, item := range buttonList.Items {
item := item
ret.UiButtons = append(ret.UiButtons, &item)
}

Expand All @@ -73,7 +71,6 @@ func CompleteView(ctx context.Context, client ctrlclient.Client, st store.RStore
}

for _, item := range clusterList.Items {
item := item
ret.Clusters = append(ret.Clusters, &item)
}

Expand Down
4 changes: 2 additions & 2 deletions internal/k8s/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func TestUpsertToTerminatingNamespaceForbidden(t *testing.T) {
// field error. Make sure we treat it as what it is and bail out of `kubectl apply`
// rather than trying to --force
errStr := `Error from server (Forbidden): error when creating "STDIN": deployments.apps "sancho" is forbidden: unable to create new content in namespace sancho-ns because it is being terminated`
f.resourceClient.updateErr = fmt.Errorf(errStr)
f.resourceClient.updateErr = errors.New(errStr)

_, err = f.k8sUpsert(f.ctx, postgres)
if assert.NotNil(t, err) {
Expand Down Expand Up @@ -252,7 +252,7 @@ func TestServerHealth(t *testing.T) {
}, nil
}
err := fmt.Errorf("unsupported request: %s", req.URL.Path)
t.Fatalf(err.Error())
t.Fatal(err.Error())
return nil, err
})

Expand Down
1 change: 0 additions & 1 deletion internal/k8s/watch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ func TestSupportsPartialMeta(t *testing.T) {
partialMetaTestCase{"garbage", false},
}
for _, c := range cases {
c := c
t.Run(c.v, func(t *testing.T) {
assert.Equal(t, c.expected, supportsPartialMetadata(&version.Info{GitVersion: c.v}))
})
Expand Down
2 changes: 1 addition & 1 deletion internal/store/engine_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ func (e *EngineState) HasBuild() bool {
}

func (e *EngineState) InitialBuildsCompleted() bool {
if e.ManifestTargets == nil || len(e.ManifestTargets) == 0 {
if len(e.ManifestTargets) == 0 {
return false
}

Expand Down
1 change: 0 additions & 1 deletion internal/store/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ func (l *subscriberList) NotifyAll(ctx context.Context, store *Store, summary Ch
l.mu.Unlock()

for _, s := range subscribers {
s := s
isPending := s.claimPending(summary)
if isPending {
SafeGo(store, func() {
Expand Down
4 changes: 2 additions & 2 deletions internal/tiltfile/tiltfile_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,11 +647,11 @@ func (s *tiltfileState) assertAllImagesMatched(us model.UpdateSettings) error {
dcSvcCount := s.dc.ServiceCount()

if dcSvcCount == 0 && len(s.k8s) == 0 && len(s.k8sUnresourced) == 0 {
return fmt.Errorf(unmatchedImageNoConfigsWarning)
return errors.New(unmatchedImageNoConfigsWarning)
}

if len(s.k8s) == 0 && len(s.k8sUnresourced) != 0 {
return fmt.Errorf(unmatchedImageAllUnresourcedWarning)
return errors.New(unmatchedImageAllUnresourcedWarning)
}

configType := "Kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/core/v1alpha1/uibutton_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func (in *UIInputSpec) Validate(_ context.Context, path *field.Path) field.Error
}
if in.Choice != nil {
numInputTypes += 1
if in.Choice.Choices == nil || len(in.Choice.Choices) == 0 {
if len(in.Choice.Choices) == 0 {
fieldErrors = append(fieldErrors, field.Invalid(path, in, "must specify choices if input type is choice"))
}
}
Expand Down
1 change: 0 additions & 1 deletion pkg/logger/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func TestPrepareEnv(t *testing.T) {
{"so-many-lines", []string{"LINES=20000"}, []string{"LINES=20000", "COLUMNS=80", "PYTHONUNBUFFERED=1"}},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
assert.ElementsMatch(t, tt.expected, PrepareEnv(Get(ctx), tt.env))
})
Expand Down
2 changes: 1 addition & 1 deletion scripts/goreleaser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ docker run --rm --privileged \
-v "$PWD:/src/tilt:delegated" \
-v /var/run/docker.sock:/var/run/docker.sock \
docker/tilt-releaser \
--rm-dist
--clean
2 changes: 1 addition & 1 deletion scripts/protobuf-helper.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22
FROM golang:1.23

ENV GOPATH=/go
WORKDIR /go/src
Expand Down
6 changes: 3 additions & 3 deletions scripts/release.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
# osxcross contains the MacOSX cross toolchain for xx
FROM crazymax/osxcross:11.3-debian AS osxcross

FROM golang:1.22-bullseye as musl-cross
FROM golang:1.23-bullseye as musl-cross
WORKDIR /musl
# https://more.musl.cc/GCC-MAJOR-VERSION/HOST-ARCH-linux-musl/CROSS-ARCH-linux-musl-cross.tgz
RUN curl -sf https://more.musl.cc/11/x86_64-linux-musl/aarch64-linux-musl-cross.tgz | tar zxf -
RUN curl -sf https://more.musl.cc/11/x86_64-linux-musl/x86_64-linux-musl-cross.tgz | tar zxf -

FROM golang:1.22-bullseye
FROM golang:1.23-bullseye

RUN apt-get update && \
apt-get install -y -q --no-install-recommends \
Expand Down Expand Up @@ -52,7 +52,7 @@ RUN set -exu \
&& apt update \
&& apt install -y docker-ce-cli=5:25.0.3-1~debian.11~bullseye docker-buildx-plugin

ENV GORELEASER_VERSION=v1.24.0
ENV GORELEASER_VERSION=v2.3.0
RUN set -exu \
&& URL="https://github.com/goreleaser/goreleaser/releases/download/${GORELEASER_VERSION}/goreleaser_Linux_x86_64.tar.gz" \
&& echo goreleaser URL: $URL \
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ docker run --rm -v "$(pwd)":/go/src/github.com/tilt-dev/tilt \
docker run --rm -e "CODEGEN_UID=$(id -u)" -e "CODEGEN_GID=$(id -g)" -v "$(pwd)":/go/src/github.com/tilt-dev/tilt \
--workdir /go/src/github.com/tilt-dev/tilt \
--entrypoint ./scripts/update-codegen-helper.sh \
golang:1.22
golang:1.23

0 comments on commit 5285ead

Please sign in to comment.