Skip to content

Commit bd0b3cb

Browse files
authored
Merge branch 'apache:main' into feature/subprojects-for-monorepo
2 parents 37a0b6e + 0417eee commit bd0b3cb

111 files changed

Lines changed: 4215 additions & 540 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ ENV DEVLAKE_PLUGINS=argocd,bamboo,bitbucket,circleci,customize,dora,gitextractor
2121

2222
RUN apt-get update -y
2323
RUN apt-get install pkg-config python3-dev default-libmysqlclient-dev build-essential libpq-dev cmake -y
24-
RUN git clone -b v1.3.0 https://github.com/libgit2/libgit2.git && cd libgit2 && mkdir build && cd build && cmake .. && make && make install
24+
RUN git clone -b v1.5.0 https://github.com/libgit2/libgit2.git && cd libgit2 && mkdir build && cd build && cmake .. && make && make install

.devcontainer/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ services:
2424
- default
2525
command: sleep infinity
2626
mysql:
27-
image: mysql:8.4.10
27+
image: mysql:8.4.11
2828
volumes:
2929
- mysql-storage:/var/lib/mysql
3030
restart: always

.github/workflows/golangci-lint.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ jobs:
3030
container: mericodev/lake-builder:latest
3131
steps:
3232
- uses: actions/checkout@v6
33+
- name: Set git config
34+
run: git config --global --add safe.directory $(pwd)
35+
- name: Install libgit2 1.5 for git2go v34
36+
run: backend/scripts/install-libgit2.sh
37+
- name: Install Go 1.26.2
38+
run: backend/scripts/install-go.sh
39+
- name: Install mockery 3.7.2
40+
run: backend/scripts/install-mockery.sh
3341
- name: Cache golangci-lint
3442
id: cache-golangci-lint
3543
uses: actions/cache@v5

.github/workflows/test-e2e.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ jobs:
5050
- name: Checkout code
5151
uses: actions/checkout@v6
5252
- run: git config --global --add safe.directory $(pwd)
53+
- name: Install libgit2 1.5 for git2go v34
54+
run: backend/scripts/install-libgit2.sh
55+
- name: Install Go 1.26.2
56+
run: backend/scripts/install-go.sh
5357
- name: Build Python
5458
run: |
5559
cd backend
@@ -90,6 +94,10 @@ jobs:
9094
- name: Checkout code
9195
uses: actions/checkout@v6
9296
- run: git config --global --add safe.directory $(pwd)
97+
- name: Install libgit2 1.5 for git2go v34
98+
run: backend/scripts/install-libgit2.sh
99+
- name: Install Go 1.26.2
100+
run: backend/scripts/install-go.sh
93101
- name: Build Python
94102
run: |
95103
cd backend

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ jobs:
4747
uses: actions/checkout@v6
4848
- name: Set git config
4949
run: git config --global --add safe.directory $(pwd)
50+
- name: Install libgit2 1.5 for git2go v34
51+
run: backend/scripts/install-libgit2.sh
52+
- name: Install Go 1.26.2
53+
run: backend/scripts/install-go.sh
54+
- name: Install mockery 3.7.2
55+
run: backend/scripts/install-mockery.sh
5056
- name: Build Python
5157
run: |
5258
cd backend

backend/.mockery.core.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# mockery v3 configuration for the ./core tree.
17+
#
18+
# Replaces the v2 command line
19+
# mockery --recursive --keeptree --dir=./core --output=./mocks/core \
20+
# --unroll-variadic=false --name='.*'
21+
# and reproduces the exact same layout: backend/mocks/core/<pkg>/<Interface>.go
22+
# with package name `mocks` and an un-prefixed mock struct name.
23+
#
24+
# NOTE: this config is deliberately kept separate from `.mockery.helpers.yml`.
25+
# `helpers/unithelper` imports the generated `mocks/core/...` packages, so the
26+
# core mocks have to exist before the helpers tree can be type-checked by
27+
# mockery v3 (which, unlike v2, loads packages via go/packages).
28+
all: true
29+
recursive: true
30+
template: testify
31+
dir: "mocks/{{.InterfaceDirRelative}}"
32+
filename: "{{.InterfaceName}}.go"
33+
pkgname: "mocks"
34+
structname: "{{.InterfaceName}}"
35+
template-data:
36+
unroll-variadic: false
37+
packages:
38+
github.com/apache/incubator-devlake/core:

backend/.mockery.helpers.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# mockery v3 configuration for the ./helpers tree.
17+
#
18+
# Replaces the v2 command line
19+
# mockery --recursive --keeptree --dir=./helpers --output=./mocks/helpers \
20+
# --unroll-variadic=false --name='.*'
21+
# and reproduces the exact same layout: backend/mocks/helpers/<pkg>/<Interface>.go
22+
# with package name `mocks` and an un-prefixed mock struct name.
23+
#
24+
# Must run *after* `.mockery.core.yml` — see the note there.
25+
all: true
26+
recursive: true
27+
template: testify
28+
dir: "mocks/{{.InterfaceDirRelative}}"
29+
filename: "{{.InterfaceName}}.go"
30+
pkgname: "mocks"
31+
structname: "{{.InterfaceName}}"
32+
template-data:
33+
unroll-variadic: false
34+
packages:
35+
github.com/apache/incubator-devlake/helpers:

backend/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ RUN if [ "$(arch)" != "x86_64" ] ; then \
4949
apt-get install -y gcc-x86-64-linux-gnu binutils-x86-64-linux-gnu ; \
5050
fi
5151

52-
RUN go install github.com/vektra/mockery/v2@v2.53.6
52+
RUN go install github.com/vektra/mockery/v3@v3.7.2
5353
RUN go install github.com/swaggo/swag/cmd/swag@v1.16.6
5454

5555
COPY --from=debian-amd64 /usr/include /rootfs-amd64/usr/include
@@ -63,8 +63,8 @@ COPY --from=debian-arm64 /lib/aarch64-linux-gnu /rootfs-arm64/lib/aarch64-linux-
6363

6464
RUN for arch in aarch64 x86_64 ; do \
6565
mkdir -p /tmp/build/${arch} && cd /tmp/build/${arch} && \
66-
wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.3.0.tar.gz -O - | tar -xz && \
67-
cd libgit2-1.3.0 && \
66+
wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.5.0.tar.gz -O - | tar -xz && \
67+
cd libgit2-1.5.0 && \
6868
mkdir build && cd build && \
6969
if [ "$arch" = "aarch64" ] ; then \
7070
cmake .. -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \

backend/Dockerfile.local

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ RUN apt-get update && apt-get install -y \
4040

4141
# Install libgit2 for native platform only
4242
RUN mkdir -p /tmp/build && cd /tmp/build && \
43-
wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.3.0.tar.gz -O - | tar -xz && \
44-
cd libgit2-1.3.0 && \
43+
wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.5.0.tar.gz -O - | tar -xz && \
44+
cd libgit2-1.5.0 && \
4545
mkdir build && cd build && \
4646
cmake .. -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local && \
4747
make -j$(nproc) install && \
4848
ldconfig
4949

50-
RUN go install github.com/vektra/mockery/v2@v2.53.6
50+
RUN go install github.com/vektra/mockery/v3@v3.7.2
5151
RUN go install github.com/swaggo/swag/cmd/swag@v1.16.6
5252

5353
WORKDIR /app

backend/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ PYTHON_DIR ?= "./python"
2727
all: build
2828

2929
go-dep:
30-
go install github.com/vektra/mockery/v2@v2.53.6
30+
go install github.com/vektra/mockery/v3@v3.7.2
3131
go install github.com/swaggo/swag/cmd/swag@v1.16.6
3232
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2
3333

@@ -73,8 +73,12 @@ debug: build-plugin-debug
7373

7474
mock:
7575
rm -rf mocks
76-
mockery --recursive --keeptree --dir=./core --output=./mocks/core --unroll-variadic=false --name='.*'
77-
mockery --recursive --keeptree --dir=./helpers --output=./mocks/helpers --unroll-variadic=false --name='.*'
76+
# mockery v3 is configured via YAML instead of CLI flags. Two invocations are
77+
# required (and must run in this order): `helpers/unithelper` imports the
78+
# generated `mocks/core/...` packages, and v3 type-checks the sources it
79+
# parses, so the core mocks have to exist before the helpers tree loads.
80+
mockery --config .mockery.core.yml
81+
mockery --config .mockery.helpers.yml
7882

7983
test: unit-test e2e-test
8084

0 commit comments

Comments
 (0)