Skip to content
Open
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM mcr.microsoft.com/devcontainers/go:1-1.22-bookworm
FROM mcr.microsoft.com/devcontainers/go:1-1.24-bookworm

ENV PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib:/usr/local/lib/pkgconfig
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.53.3
version: v1.64.3
working-directory: ./backend
4 changes: 2 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ FROM --platform=linux/arm64 debian:bookworm as debian-arm64
RUN apt-get update
RUN apt-get install -y libssh2-1-dev libssl-dev zlib1g-dev

FROM --platform=$BUILDPLATFORM golang:1.20.5-bookworm as builder
FROM --platform=$BUILDPLATFORM golang:1.24-bookworm as builder

# docker build --build-arg GOPROXY=https://goproxy.io,direct -t mericodev/lake .
ARG GOPROXY=
Expand All @@ -49,7 +49,7 @@ RUN if [ "$(arch)" != "x86_64" ] ; then \
apt-get install -y gcc-x86-64-linux-gnu binutils-x86-64-linux-gnu ; \
fi

RUN go install github.com/vektra/mockery/v2@v2.20.0
RUN go install github.com/vektra/mockery/v2@v2.43.0
RUN go install github.com/swaggo/swag/cmd/[email protected]

COPY --from=debian-amd64 /usr/include /rootfs-amd64/usr/include
Expand Down
2 changes: 1 addition & 1 deletion backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ all: build
go-dep:
go install github.com/vektra/mockery/[email protected]
go install github.com/swaggo/swag/cmd/[email protected]
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.3

go-dev-tools:
# go install github.com/atombender/go-jsonschema/cmd/gojsonschema@latest
Expand Down
2 changes: 1 addition & 1 deletion backend/core/migration/linter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func firstLineFromFile(path string) string {
for scanner.Scan() {
return scanner.Text()
}
panic(fmt.Errorf("empty file: " + path))
panic(fmt.Errorf("empty file: %s", path))
}

const (
Expand Down
2 changes: 1 addition & 1 deletion backend/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/apache/incubator-devlake

go 1.20
go 1.24

require (
github.com/aws/aws-sdk-go v1.55.6
Expand Down
56 changes: 28 additions & 28 deletions backend/helpers/srvhelper/scope_service_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,39 +268,39 @@ func (scopeSrv *ScopeSrvHelper[C, S, SC]) getAffectedTables() ([]string, errors.
if err != nil {
return nil, err
}
if pluginModel, ok := meta.(plugin.PluginModel); !ok {
pluginModel, ok := meta.(plugin.PluginModel)
if !ok {
panic(errors.Default.New(fmt.Sprintf("plugin \"%s\" does not implement listing its tables", scopeSrv.pluginName)))
} else {
// Unfortunately, can't cache the tables because Python creates some tables on a per-demand basis, so such a cache would possibly get outdated.
// It's a rare scenario in practice, but might as well play it safe and sacrifice some performance here
var allTables []string
if allTables, err = scopeSrv.db.AllTables(); err != nil {
return nil, err
}
// collect raw tables
for _, table := range allTables {
if strings.HasPrefix(table, "_raw_"+scopeSrv.pluginName) {
tables = append(tables, table)
}
}
// Unfortunately, can't cache the tables because Python creates some tables on a per-demand basis, so such a cache would possibly get outdated.
// It's a rare scenario in practice, but might as well play it safe and sacrifice some performance here
var allTables []string
if allTables, err = scopeSrv.db.AllTables(); err != nil {
return nil, err
}
// collect raw tables
for _, table := range allTables {
if strings.HasPrefix(table, "_raw_"+scopeSrv.pluginName) {
tables = append(tables, table)
}
// collect tool tables
toolModels := pluginModel.GetTablesInfo()
for _, toolModel := range toolModels {
if !isScopeModel(toolModel) && hasField(toolModel, "RawDataParams") {
tables = append(tables, toolModel.TableName())
}
}
// collect tool tables
toolModels := pluginModel.GetTablesInfo()
for _, toolModel := range toolModels {
if !isScopeModel(toolModel) && hasField(toolModel, "RawDataParams") {
tables = append(tables, toolModel.TableName())
}
// collect domain tables
for _, domainModel := range domaininfo.GetDomainTablesInfo() {
// we only care about tables with RawOrigin
ok = hasField(domainModel, "RawDataParams")
if ok {
tables = append(tables, domainModel.TableName())
}
}
// collect domain tables
for _, domainModel := range domaininfo.GetDomainTablesInfo() {
// we only care about tables with RawOrigin
ok = hasField(domainModel, "RawDataParams")
if ok {
tables = append(tables, domainModel.TableName())
}
// additional tables
tables = append(tables, models.CollectorLatestState{}.TableName())
}
// additional tables
tables = append(tables, models.CollectorLatestState{}.TableName())
scopeSrv.log.Debug("Discovered %d tables used by plugin \"%s\": %v", len(tables), scopeSrv.pluginName, tables)
return tables, nil
}
Expand Down
14 changes: 7 additions & 7 deletions backend/impls/logruslog/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ func init() {
if basePath == "" {
basePath = "./logs"
}
if abs, err := filepath.Abs(basePath); err != nil {
panic(err)
} else {
basePath = filepath.Join(abs, "devlake.log")
}
var err errors.Error
Global, err = NewDefaultLogger(inner)
abs, err := filepath.Abs(basePath)
if err != nil {
panic(err)
}
basePath = filepath.Join(abs, "devlake.log")
var errLogger errors.Error
Global, errLogger = NewDefaultLogger(inner)
if errLogger != nil {
panic(errLogger)
}
stream, err := GetFileStream(basePath)
if err != nil {
stream = os.Stdout
Expand Down
4 changes: 2 additions & 2 deletions backend/impls/logruslog/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ func (l *DefaultLogger) Info(format string, a ...interface{}) {
}

func (l *DefaultLogger) Warn(err error, format string, a ...interface{}) {
l.Log(log.LOG_WARN, formatMessage(err, format, a...))
l.Log(log.LOG_WARN, "%s", formatMessage(err, format, a...))
}

func (l *DefaultLogger) Error(err error, format string, a ...interface{}) {
l.Log(log.LOG_ERROR, formatMessage(err, format, a...))
l.Log(log.LOG_ERROR, "%s", formatMessage(err, format, a...))
}

func (l *DefaultLogger) SetStream(config *log.LoggerStreamConfig) {
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/github_graphql/tasks/issue_extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func convertGithubIssue(milestoneMap map[int]int, issue *GraphqlQueryIssue, conn
GithubCreatedAt: issue.CreatedAt,
GithubUpdatedAt: issue.UpdatedAt,
}
if issue.AssigneeList.Assignees != nil && len(issue.AssigneeList.Assignees) > 0 {
if len(issue.AssigneeList.Assignees) > 0 {
githubIssue.AssigneeId = issue.AssigneeList.Assignees[0].Id
githubIssue.AssigneeName = issue.AssigneeList.Assignees[0].Login
}
Expand Down
2 changes: 1 addition & 1 deletion backend/server/api/shared/api_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func ApiOutputSuccess(c *gin.Context, body interface{}, status int) {
func ApiOutputAbort(c *gin.Context, err error) {
if e, ok := err.(errors.Error); ok {
logruslog.Global.Error(err, "HTTP %d abort-error", e.GetType().GetHttpCode())
_ = c.AbortWithError(e.GetType().GetHttpCode(), fmt.Errorf(e.Messages().Format()))
_ = c.AbortWithError(e.GetType().GetHttpCode(), fmt.Errorf("%s", e.Messages().Format()))
} else {
logruslog.Global.Error(err, "HTTP %d abort-error (native)", http.StatusInternalServerError)
_ = c.AbortWithError(http.StatusInternalServerError, err)
Expand Down
2 changes: 1 addition & 1 deletion backend/server/services/remote/plugin/plugin_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (p *remotePluginImpl) PrepareTaskData(taskCtx plugin.TaskContext, options m
}, nil
}

func (p *remotePluginImpl) getScopeAndConfig(db dal.Dal, connectionId uint64, scopeId string) (interface{}, interface{}, errors.Error) {
func (p *remotePluginImpl) getScopeAndConfig(db dal.Dal, connectionId uint64, scopeId string) (resultScope interface{}, resultScopeConfig interface{}, resultErr errors.Error) {
wrappedScope := p.scopeTabler.New()
err := api.CallDB(db.First, wrappedScope, dal.Where("connection_id = ? AND id = ?", connectionId, scopeId))
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions devops/docker/lake-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ FROM --platform=linux/amd64 debian:bullseye as debian-amd64
RUN apt-get -y update && apt -y upgrade &&\
apt-get install -y libssh2-1-dev libssl-dev zlib1g-dev

FROM golang:1.20.4-bullseye as builder
FROM golang:1.24-bullseye as builder

# Base dependencies
RUN apt-get -y update && apt -y upgrade &&\
Expand Down Expand Up @@ -55,14 +55,14 @@ COPY --from=builder /tmp/deps/include/ /usr/include/
ENV PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig

# Install Golang
RUN curl -L https://git.io/vQhTU | bash -s -- --version 1.20.4
RUN curl -L https://git.io/vQhTU | bash -s -- --version 1.24.0
RUN mv /root/go /go &&\
mv /root/.go /usr/local/go &&\
ln -sf /usr/local/go/bin/* /usr/bin

# Install Golang Tools
RUN export GOPATH=/go && \
go install github.com/vektra/mockery/v2@v2.20.0 && \
go install github.com/vektra/mockery/v2@v2.43.0 && \
go install github.com/swaggo/swag/cmd/[email protected]

# Golang Env
Expand Down
Loading