Skip to content

Commit

Permalink
Update repository
Browse files Browse the repository at this point in the history
- upgrade go to 1.23
- upgrade github reunners to ubuntu:24.04
- use golangsci-lint v1.61

Upgrade dependencies

Direct:

github.com/plgd-dev/device/v2 v2.5.3-0.20240912113932-acfea60431b9
go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo v0.55.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0
go.opentelemetry.io/otel v1.30.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0
go.opentelemetry.io/otel/metric v1.30.0
go.opentelemetry.io/otel/sdk v1.30.0
go.opentelemetry.io/otel/trace v1.30.0
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0
golang.org/x/net v0.29.0
google.golang.org/grpc v1.66.2

Indirect:
github.com/go-json-experiment/json v0.0.0-20240815175050-ebd3a8989ca1
github.com/jhump/protoreflect v1.17.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0
golang.org/x/crypto v0.27.0
  • Loading branch information
Danielius1922 committed Sep 12, 2024
1 parent bd44498 commit 00e88e4
Show file tree
Hide file tree
Showing 25 changed files with 92 additions and 106 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-publish-cfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ env:

jobs:
build-and-publish-with-cfg:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:

jobs:
build-www:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
template-file: ${{ matrix.template-file }}

generate-sbom:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ jobs:
matrix:
include:
# check support for oldest supported golang version
- name: go1.22
go-version: "~1.22"
runs-on: ubuntu-latest
- name: go1.23
go-version: "~1.23"
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version || '^1.22' }}
go-version: ${{ matrix.go-version || '^1.23' }}
check-latest: true

- run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/checkFormat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
format:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: CPU Info
Expand All @@ -22,7 +22,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: "^1.22" # The Go version to download (if necessary) and use.
go-version: "^1.23" # The Go version to download (if necessary) and use.
check-latest: true

- name: Check formatting
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ghcr-cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
pull-request-ghcr-cleanup:
if: ${{ github.event_name == 'pull_request' }}
name: Delete images related to closed PR
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Delete images related to closed PR (1)
id: run-1
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
nightly-ghcr-cleanup:
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
name: Delete stale or untagged images
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: CPU Info
run: |
Expand All @@ -24,13 +24,13 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "^1.22" # The Go version to download (if necessary) and use.
go-version: "^1.23" # The Go version to download (if necessary) and use.
check-latest: true
cache: false

- run: go version
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
version: v1.61 # switch to latest if development is unfreezed
args: --timeout=5m
4 changes: 2 additions & 2 deletions .github/workflows/measureMemory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# This workflow contains a single job called "build"
generateSummary:
needs: coapGateway
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
coapGateway:
# The type of runner that the job will run on
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
fail-fast: false
# max number of running jobs is 20 for a single organization, so lets keep at least 4 available to all other repositories
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publishDockerImagesGhcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ env:

jobs:
build-and-publish-image:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/releaseHelmCharts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
release-charts:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: CPU Info
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ env:

jobs:
run-bundle:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/staticAnalysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
analysis:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: CPU Info
Expand All @@ -20,26 +20,13 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "^1.22" # The Go version to download (if necessary) and use.
go-version: "^1.23" # The Go version to download (if necessary) and use.
check-latest: true
- run: go version

- name: Run go vet
run: go vet ./...

- name: Install and run gocyclo
run: |
export PATH=${PATH}:`go env GOPATH`/bin
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
gocyclo -over 15 -ignore ".pb(.gw)?.go$|_test.go$|wsproxy" . || echo "gocyclo detected too complex functions"
- name: Install and run misspell
run: |
# check misspelling in all files in repository
export PATH=${PATH}:`go env GOPATH`/bin
go install github.com/client9/misspell/cmd/misspell@latest
find . -type f -exec misspell {} \;
- name: Check yaml field names and yaml tags
run: tools/validate/validateYaml.py || echo "invalid yaml field name(s) detected"

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# This workflow contains a single job called "build"
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
if-no-files-found: warn

test-helm:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:
coverage-sonar-cloud-scan:
needs: test
# The type of runner that the job will run on
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
Expand Down
7 changes: 5 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ linters-settings:
default-signifies-exhaustive: true
gocyclo:
min-complexity: 15
gomoddirectives:
replace-allow-list:
- github.com/pion/dtls/v2
gomodguard:
blocked:
modules:
Expand Down Expand Up @@ -48,7 +51,7 @@ linters:
- gofumpt # Gofumpt checks whether code was gofumpt-ed.
- goheader # Checks is file header matches to pattern
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports
# - gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.
- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.
- gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations.
- goprintffuncname # Checks that printf-like functions are named with `f` at the end
- gosec # Inspects source code for security problems
Expand Down Expand Up @@ -175,4 +178,4 @@ issues:
# fix: true

run:
go: "1.22"
go: "1.23"
2 changes: 1 addition & 1 deletion Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /
# apt: ca-certificates git make sudo
RUN git clone https://github.com/udhos/update-golang.git \
&& cd update-golang \
&& sudo RELEASE=1.22.3 ./update-golang.sh \
&& sudo RELEASE=1.23.1 ./update-golang.sh \
&& ln -s /usr/local/go/bin/go /usr/bin/go
WORKDIR $GOPATH/src/github.com/plgd-dev/hub
COPY go.mod go.sum ./
Expand Down
2 changes: 1 addition & 1 deletion bundle/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM golang:1.22.3-alpine AS build
FROM golang:1.23.1-alpine AS build
RUN apk add --no-cache build-base curl git
WORKDIR $GOPATH/src/github.com/plgd-dev/hub
COPY go.mod go.sum ./
Expand Down
46 changes: 21 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/plgd-dev/hub/v2

go 1.22
go 1.23

toolchain go1.22.0
toolchain go1.23.0

require (
github.com/favadi/protoc-go-inject-tag v1.4.0
Expand Down Expand Up @@ -32,7 +32,7 @@ require (
github.com/panjf2000/ants/v2 v2.10.0
github.com/pion/dtls/v2 v2.2.8-0.20240701035148-45e16a098c47
github.com/pion/logging v0.2.2
github.com/plgd-dev/device/v2 v2.5.3-0.20240904102627-4c2719d9d856
github.com/plgd-dev/device/v2 v2.5.3-0.20240912113932-acfea60431b9
github.com/plgd-dev/go-coap/v3 v3.3.5-0.20240904100911-1afdeb72cb92
github.com/plgd-dev/kit/v2 v2.0.0-20211006190727-057b33161b90
github.com/pseudomuto/protoc-gen-doc v1.5.1
Expand All @@ -44,23 +44,23 @@ require (
github.com/vincent-petithory/dataurl v1.0.0
github.com/web-of-things-open-source/thingdescription-go v0.0.0-20240513190706-79b5f39190eb
go.mongodb.org/mongo-driver v1.16.1
go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo v0.54.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0
go.opentelemetry.io/otel v1.29.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0
go.opentelemetry.io/otel/metric v1.29.0
go.opentelemetry.io/otel/sdk v1.29.0
go.opentelemetry.io/otel/trace v1.29.0
go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo v0.55.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0
go.opentelemetry.io/otel v1.30.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.30.0
go.opentelemetry.io/otel/metric v1.30.0
go.opentelemetry.io/otel/sdk v1.30.0
go.opentelemetry.io/otel/trace v1.30.0
go.uber.org/atomic v1.11.0
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948
golang.org/x/net v0.28.0
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0
golang.org/x/net v0.29.0
golang.org/x/oauth2 v0.23.0
golang.org/x/sync v0.8.0
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1
google.golang.org/grpc v1.66.0
google.golang.org/grpc v1.66.2
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1
google.golang.org/protobuf v1.34.2
gopkg.in/yaml.v3 v3.0.1
Expand All @@ -79,7 +79,7 @@ require (
github.com/dsnet/golib/memfile v1.0.0 // indirect
github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect
github.com/fredbi/uri v1.1.0 // indirect
github.com/go-json-experiment/json v0.0.0-20240815174924-0599f16bf0e2 // indirect
github.com/go-json-experiment/json v0.0.0-20240815175050-ebd3a8989ca1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/goccy/go-json v0.10.3 // indirect
Expand All @@ -94,7 +94,7 @@ require (
github.com/imdario/mergo v0.3.4 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/itchyny/timefmt-go v0.1.6 // indirect
github.com/jhump/protoreflect v1.16.0 // indirect
github.com/jhump/protoreflect v1.17.0 // indirect
github.com/jonboulle/clockwork v0.4.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
Expand Down Expand Up @@ -135,21 +135,17 @@ require (
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.18.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)

replace (
// last version for Go 1.22
github.com/go-json-experiment/json => github.com/go-json-experiment/json v0.0.0-20240815174924-0599f16bf0e2
// note: github.com/pion/dtls/v2/pkg/net package is not yet available in release branches,
// so we force to the use of the pinned master branch
github.com/pion/dtls/v2 => github.com/pion/dtls/v2 v2.2.8-0.20240701035148-45e16a098c47
)
// note: github.com/pion/dtls/v2/pkg/net package is not yet available in release branches,
// so we force to the use of the pinned master branch
replace github.com/pion/dtls/v2 => github.com/pion/dtls/v2 v2.2.8-0.20240701035148-45e16a098c47
Loading

0 comments on commit 00e88e4

Please sign in to comment.