Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
skip-cache: false
version: v1.61.0
version: v1.64.5
- name: Whitespace check
run: make check-whitespace
- name: go mod tidy check
Expand All @@ -88,7 +88,7 @@ jobs:
cache: false
go-version-file: go.mod
- name: Cache Go Modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
Expand All @@ -97,7 +97,7 @@ jobs:
- name: Test with code coverage
run: make cover=1 test-ci
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23 AS build
FROM golang:1.24 AS build

WORKDIR /src
# enable modules caching in separate layer
Expand All @@ -8,12 +8,12 @@ COPY . ./

RUN make binary

FROM debian:12.7-slim
FROM debian:12.10-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates; \
ca-certificates; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*; \
groupadd -r bee --gid 999; \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23 AS build
FROM golang:1.24 AS build

ARG REACHABILITY_OVERRIDE_PUBLIC=false
ARG BATCHFACTOR_OVERRIDE_PUBLIC=5
Expand All @@ -13,7 +13,7 @@ RUN make binary \
REACHABILITY_OVERRIDE_PUBLIC=${REACHABILITY_OVERRIDE_PUBLIC} \
BATCHFACTOR_OVERRIDE_PUBLIC=${BATCHFACTOR_OVERRIDE_PUBLIC}

FROM debian:12.7-slim
FROM debian:12.10-slim

ENV DEBIAN_FRONTEND=noninteractive

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.goreleaser
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM debian:12.7-slim
FROM debian:12.10-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates; \
ca-certificates; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*; \
groupadd -r bee --gid 999; \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.scratch
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM debian:12.7-slim
FROM debian:12.10-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates; \
ca-certificates; \
groupadd -r bee --gid 999; \
useradd -r -g bee --uid 999 --no-log-init -m bee;

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GO ?= go
GOBIN ?= $$($(GO) env GOPATH)/bin
GOLANGCI_LINT ?= $(GOBIN)/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.61.0
GOLANGCI_LINT_VERSION ?= v1.64.5
Copy link
Member

Choose a reason for hiding this comment

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

Since it is updated, there is also a newer version v1.64.8.

GOGOPROTOBUF ?= protoc-gen-gogofaster
GOGOPROTOBUF_VERSION ?= v1.3.1
BEEKEEPER_INSTALL_DIR ?= $(GOBIN)
Expand Down
45 changes: 20 additions & 25 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/ethersphere/bee/v2

go 1.23

toolchain go1.23.0
go 1.24

require (
contrib.go.opencensus.io/exporter/prometheus v0.4.2
Expand Down Expand Up @@ -56,28 +54,6 @@ require (
resenje.org/web v0.4.3
)

require (
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/pion/datachannel v1.5.10 // indirect
github.com/pion/dtls/v2 v2.2.12 // indirect
github.com/pion/ice/v2 v2.3.37 // indirect
github.com/pion/interceptor v0.1.37 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/mdns v0.0.12 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/rtcp v1.2.15 // indirect
github.com/pion/rtp v1.8.10 // indirect
github.com/pion/sctp v1.8.35 // indirect
github.com/pion/sdp/v3 v3.0.9 // indirect
github.com/pion/srtp/v2 v2.0.20 // indirect
github.com/pion/stun v0.6.1 // indirect
github.com/pion/transport/v2 v2.2.10 // indirect
github.com/pion/transport/v3 v3.0.7 // indirect
github.com/pion/turn/v2 v2.1.6 // indirect
github.com/pion/webrtc/v3 v3.3.5 // indirect
github.com/wlynxg/anet v0.0.5 // indirect
)

require (
github.com/BurntSushi/toml v1.1.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
Expand Down Expand Up @@ -109,6 +85,7 @@ require (
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
Expand Down Expand Up @@ -156,6 +133,23 @@ require (
github.com/opencontainers/runtime-spec v1.2.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/pion/datachannel v1.5.10 // indirect
github.com/pion/dtls/v2 v2.2.12 // indirect
github.com/pion/ice/v2 v2.3.37 // indirect
github.com/pion/interceptor v0.1.37 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/mdns v0.0.12 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/rtcp v1.2.15 // indirect
github.com/pion/rtp v1.8.10 // indirect
github.com/pion/sctp v1.8.35 // indirect
github.com/pion/sdp/v3 v3.0.9 // indirect
github.com/pion/srtp/v2 v2.0.20 // indirect
github.com/pion/stun v0.6.1 // indirect
github.com/pion/transport/v2 v2.2.10 // indirect
github.com/pion/transport/v3 v3.0.7 // indirect
github.com/pion/turn/v2 v2.1.6 // indirect
github.com/pion/webrtc/v3 v3.3.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
Expand All @@ -179,6 +173,7 @@ require (
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/wealdtech/go-multicodec v1.4.0 // indirect
github.com/wlynxg/anet v0.0.5 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/dig v1.18.0 // indirect
go.uber.org/fx v1.23.0 // indirect
Expand Down
15 changes: 6 additions & 9 deletions pkg/api/dirs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestDirs(t *testing.T) {
jsonhttptest.WithRequestBody(bytes.NewReader(nil)),
jsonhttptest.WithRequestHeader(api.SwarmCollectionHeader, "True"),
jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{
Message: api.InvalidRequest.Error(),
Message: api.ErrInvalidRequest.Error(),
Code: http.StatusBadRequest,
}),
jsonhttptest.WithRequestHeader(api.ContentTypeHeader, api.ContentTypeTar),
Expand All @@ -66,7 +66,7 @@ func TestDirs(t *testing.T) {
jsonhttptest.WithRequestBody(file),
jsonhttptest.WithRequestHeader(api.SwarmCollectionHeader, "True"),
jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{
Message: api.DirectoryStoreError.Error(),
Message: api.ErrDirectoryStoreError.Error(),
Code: http.StatusInternalServerError,
}),
jsonhttptest.WithRequestHeader(api.ContentTypeHeader, api.ContentTypeTar),
Expand All @@ -86,7 +86,7 @@ func TestDirs(t *testing.T) {
jsonhttptest.WithRequestBody(tarReader),
jsonhttptest.WithRequestHeader(api.SwarmCollectionHeader, "True"),
jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{
Message: api.InvalidContentType.Error(),
Message: api.ErrInvalidContentType.Error(),
Code: http.StatusBadRequest,
}),
jsonhttptest.WithRequestHeader(api.ContentTypeHeader, "other"),
Expand Down Expand Up @@ -372,7 +372,6 @@ func TestDirs(t *testing.T) {
// check error document
validateAltPath(t, "_non_existent_file_path_", errorDocumentPath)
}

}
t.Run(tc.name, func(t *testing.T) {
t.Run("tar_upload", func(t *testing.T) {
Expand Down Expand Up @@ -520,7 +519,7 @@ func TestDirsEmtpyDir(t *testing.T) {
jsonhttptest.WithRequestHeader(api.SwarmCollectionHeader, "true"),
jsonhttptest.WithRequestHeader(api.ContentTypeHeader, api.ContentTypeTar),
jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{
Message: api.EmptyDir.Error(),
Message: api.ErrEmptyDir.Error(),
Code: http.StatusBadRequest,
}),
)
Expand All @@ -543,7 +542,7 @@ func tarFiles(t *testing.T, files []f) *bytes.Buffer {
// create tar header and write it
hdr := &tar.Header{
Name: filePath,
Mode: 0600,
Mode: 0o600,
Size: int64(len(file.data)),
}
if err := tw.WriteHeader(hdr); err != nil {
Expand Down Expand Up @@ -572,7 +571,7 @@ func tarEmptyDir(t *testing.T) *bytes.Buffer {

hdr := &tar.Header{
Name: "empty/",
Mode: 0600,
Mode: 0o600,
}

if err := tw.WriteHeader(hdr); err != nil {
Expand Down Expand Up @@ -605,11 +604,9 @@ func multipartFiles(t *testing.T, files []f) (*bytes.Buffer, string) {
contentType := file.header.Get(api.ContentTypeHeader)
if contentType != "" {
hdr.Set(api.ContentTypeHeader, contentType)

}
if len(file.data) > 0 {
hdr.Set(api.ContentLengthHeader, strconv.Itoa(len(file.data)))

}
part, err := mw.CreatePart(hdr)
if err != nil {
Expand Down
13 changes: 6 additions & 7 deletions pkg/api/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ type (
)

var (
InvalidContentType = errInvalidContentType
InvalidRequest = errInvalidRequest
DirectoryStoreError = errDirectoryStore
EmptyDir = errEmptyDir
ErrInvalidContentType = errInvalidContentType
ErrInvalidRequest = errInvalidRequest
ErrDirectoryStoreError = errDirectoryStore
ErrEmptyDir = errEmptyDir
)

var (
ContentTypeTar = contentTypeTar
)
var ContentTypeTar = contentTypeTar

var (
ErrNoResolver = errNoResolver
Expand Down Expand Up @@ -138,6 +136,7 @@ type HexInvalidByteError = hexInvalidByteError
func MapStructure(input, output interface{}, hooks map[string]func(v string) (string, error)) error {
return mapStructure(input, output, hooks)
}

func NewParseError(entry, value string, cause error) error {
return newParseError(entry, value, cause)
}
Loading