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
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ jobs:
run: backend/scripts/install-libgit2.sh
- name: Install Go 1.26.6
run: backend/scripts/install-go.sh
- name: Check go.mod is tidy without generated mocks
run: |
cd backend
go mod tidy
git diff --exit-code -- go.mod go.sum
- name: Install mockery 3.7.4
run: backend/scripts/install-mockery.sh
- name: Build Python
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ libgit2
.playwright-cli/

# auto generated code
backend/mocks/
# backend/mocks: only the doc.go placeholders are tracked, they keep the mock
# import paths resolvable for `go mod tidy` on a fresh clone
backend/mocks/**/*.go
!backend/mocks/**/doc.go
backend/server/api/docs/swagger.json
backend/server/api/docs/swagger.yaml
backend/server/api/docs/docs.go
Expand Down
4 changes: 3 additions & 1 deletion backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ debug: build-plugin-debug
dlv debug server/main.go

mock:
rm -rf mocks
# Remove previously generated mocks but keep the tracked doc.go placeholders,
# which keep the mock import paths resolvable for `go mod tidy`.
if [ -d mocks ]; then find mocks -type f ! -name doc.go -delete && find mocks -type d -empty -delete; fi
# mockery v3 is configured via YAML instead of CLI flags. Two invocations are
# required (and must run in this order): `helpers/unithelper` imports the
# generated `mocks/core/...` packages, and v3 type-checks the sources it
Expand Down
25 changes: 25 additions & 0 deletions backend/mocks/core/context/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package mocks holds the mockery-generated mocks for
// github.com/apache/devlake/core/context.
//
// Only this file is tracked. The mocks themselves are generated by
// `make mock` and git-ignored; this placeholder keeps the import path
// resolvable inside the main module, so that `go mod tidy` works on a
// fresh clone.
package mocks
25 changes: 25 additions & 0 deletions backend/mocks/core/dal/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package mocks holds the mockery-generated mocks for
// github.com/apache/devlake/core/dal.
//
// Only this file is tracked. The mocks themselves are generated by
// `make mock` and git-ignored; this placeholder keeps the import path
// resolvable inside the main module, so that `go mod tidy` works on a
// fresh clone.
package mocks
25 changes: 25 additions & 0 deletions backend/mocks/core/log/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package mocks holds the mockery-generated mocks for
// github.com/apache/devlake/core/log.
//
// Only this file is tracked. The mocks themselves are generated by
// `make mock` and git-ignored; this placeholder keeps the import path
// resolvable inside the main module, so that `go mod tidy` works on a
// fresh clone.
package mocks
25 changes: 25 additions & 0 deletions backend/mocks/core/plugin/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package mocks holds the mockery-generated mocks for
// github.com/apache/devlake/core/plugin.
//
// Only this file is tracked. The mocks themselves are generated by
// `make mock` and git-ignored; this placeholder keeps the import path
// resolvable inside the main module, so that `go mod tidy` works on a
// fresh clone.
package mocks
25 changes: 25 additions & 0 deletions backend/mocks/helpers/pluginhelper/api/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package mocks holds the mockery-generated mocks for
// github.com/apache/devlake/helpers/pluginhelper/api.
//
// Only this file is tracked. The mocks themselves are generated by
// `make mock` and git-ignored; this placeholder keeps the import path
// resolvable inside the main module, so that `go mod tidy` works on a
// fresh clone.
package mocks
Loading