Skip to content

Commit

Permalink
Merge branch 'main' into cp-org-search
Browse files Browse the repository at this point in the history
  • Loading branch information
Rader authored Jan 8, 2025
2 parents 3ed1efa + 87c11be commit 7360daa
Show file tree
Hide file tree
Showing 243 changed files with 39,491 additions and 7,736 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,35 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.23'
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --timeout=5m
swagger:
name: swagger-gen
strategy:
matrix:
go: ["1.23"]
runs-on: ubuntu-latest
steps:
- name: Setup Go
with:
go-version: ${{ matrix.go }}
uses: actions/setup-go@v2

- uses: actions/checkout@v2

- name: Gen
run: |
go install github.com/swaggo/swag/cmd/swag@latest
make swag
test:
name: test
strategy:
matrix:
go: ["1.21.x"]
go: ["1.23"]
runs-on: ubuntu-latest
steps:
- name: Setup Go
Expand Down
236 changes: 149 additions & 87 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,90 +4,152 @@ dir: "_mocks/{{.PackagePath}}"
# https://github.com/vektra/mockery/commit/13fc60740a1eab3fc705fcc131a4b9a6eacfd0fe#diff-4bc8f03915f15ecf2cb9965592fcf933bb06986003613b5633a8dea7962c31a9R40
resolve-type-alias: false
packages:
io:
config:
interfaces:
Reader:
opencsg.com/csghub-server/component:
config:
interfaces:
RepoComponent:
TagComponent:
AccountingComponent:
SpaceComponent:
RuntimeArchitectureComponent:
opencsg.com/csghub-server/user/component:
config:
interfaces:
MemberComponent:
OrganizationComponent:
opencsg.com/csghub-server/builder/store/database:
config:
all: True
opencsg.com/csghub-server/builder/rpc:
config:
interfaces:
UserSvcClient:
ModerationSvcClient:
opencsg.com/csghub-server/builder/sensitive:
config:
interfaces:
GreenClient:
Green2022Client:
SensitiveChecker:
opencsg.com/csghub-server/builder/git/gitserver:
config:
interfaces:
GitServer:
opencsg.com/csghub-server/builder/git/mirrorserver:
config:
interfaces:
MirrorServer:
opencsg.com/csghub-server/builder/git/membership:
config:
interfaces:
GitMemerShip:
opencsg.com/csghub-server/builder/rsa:
config:
interfaces:
KeysReader:
opencsg.com/csghub-server/mirror/cache:
config:
interfaces:
Cache:
opencsg.com/csghub-server/common/types:
config:
interfaces:
SensitiveRequestV2:
opencsg.com/csghub-server/mq:
config:
interfaces:
MessageQueue:
opencsg.com/csghub-server/builder/store/s3:
config:
interfaces:
Client:
opencsg.com/csghub-server/mirror/queue:
config:
interfaces:
PriorityQueue:
opencsg.com/csghub-server/builder/deploy:
config:
interfaces:
Deployer:
opencsg.com/csghub-server/builder/inference:
config:
interfaces:
Client:
opencsg.com/csghub-server/accounting/component:
config:
interfaces:
AccountingUserComponent:
AccountingStatementComponent:
AccountingBillComponent:
AccountingPresentComponent:
opencsg.com/csghub-server/builder/accounting:
config:
interfaces:
AccountingClient:

io:
config:
interfaces:
Reader:
opencsg.com/csghub-server/component:
config:
interfaces:
RepoComponent:
TagComponent:
AccountingComponent:
SpaceComponent:
SpaceResourceComponent:
RuntimeArchitectureComponent:
SensitiveComponent:
CodeComponent:
PromptComponent:
ModelComponent:
UserComponent:
GitHTTPComponent:
DiscussionComponent:
DatasetComponent:
CollectionComponent:
InternalComponent:
MirrorSourceComponent:
MirrorComponent:
ImportComponent:
EvaluationComponent:
RecomComponent:
MultiSyncComponent:
opencsg.com/csghub-server/component/callback:
config:
interfaces:
SyncVersionGenerator:
GitCallbackComponent:
opencsg.com/csghub-server/user/component:
config:
interfaces:
MemberComponent:
OrganizationComponent:

opencsg.com/csghub-server/builder/store/database:
config:
all: True
opencsg.com/csghub-server/builder/rpc:
config:
interfaces:
UserSvcClient:
ModerationSvcClient:
opencsg.com/csghub-server/builder/sensitive:
config:
interfaces:
GreenClient:
Green2022Client:
SensitiveChecker:
opencsg.com/csghub-server/builder/git/gitserver:
config:
interfaces:
GitServer:
opencsg.com/csghub-server/builder/git/mirrorserver:
config:
interfaces:
MirrorServer:
opencsg.com/csghub-server/builder/git/membership:
config:
interfaces:
GitMemerShip:
opencsg.com/csghub-server/builder/rsa:
config:
interfaces:
KeysReader:
opencsg.com/csghub-server/mirror/cache:
config:
interfaces:
Cache:
opencsg.com/csghub-server/common/types:
config:
interfaces:
SensitiveRequestV2:
opencsg.com/csghub-server/mq:
config:
interfaces:
MessageQueue:
opencsg.com/csghub-server/builder/store/s3:
config:
interfaces:
Client:
opencsg.com/csghub-server/mirror/queue:
config:
interfaces:
PriorityQueue:
opencsg.com/csghub-server/builder/deploy:
config:
interfaces:
Deployer:
opencsg.com/csghub-server/builder/deploy/scheduler:
config:
interfaces:
Scheduler:
opencsg.com/csghub-server/builder/deploy/imagerunner:
config:
interfaces:
Runner:
opencsg.com/csghub-server/builder/deploy/imagebuilder:
config:
interfaces:
Builder:
opencsg.com/csghub-server/accounting/component:
config:
interfaces:
AccountingUserComponent:
AccountingStatementComponent:
AccountingBillComponent:
AccountingPresentComponent:
MeteringComponent:
AccountingEventComponent:
AccountingPriceComponent:
AccountingOrderComponent:
opencsg.com/csghub-server/builder/accounting:
config:
interfaces:
AccountingClient:
opencsg.com/csghub-server/builder/parquet:
config:
interfaces:
Reader:
opencsg.com/csghub-server/builder/multisync:
config:
interfaces:
Client:
opencsg.com/csghub-server/builder/store/cache:
config:
interfaces:
RedisClient:
github.com/nats-io/nats.go/jetstream:
config:
interfaces:
Msg:
go.temporal.io/sdk/client:
config:
interfaces:
Client:
opencsg.com/csghub-server/builder/temporal:
config:
interfaces:
Client:
opencsg.com/csghub-server/builder/importer:
config:
interfaces:
Importer:
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
.PHONY: test lint cover mock_wire mock_gen
.PHONY: test lint cover mock_wire mock_gen swag

test:
go test ./...

lint:
golangci-lint run

cover:
go test -coverprofile=cover.out -coverpkg=./... ./...
go test -coverprofile=cover.out ./...
go tool cover -html=cover.out -o cover.html
open cover.html

mock_wire:
@echo "Running wire for component mocks..."
@go run -mod=mod github.com/google/wire/cmd/wire opencsg.com/csghub-server/component
@go run -mod=mod github.com/google/wire/cmd/wire opencsg.com/csghub-server/component/...
@if [ $$? -eq 0 ]; then \
echo "Renaming wire_gen.go to wire_gen_test.go..."; \
echo "Renaming component wire_gen.go to wire_gen_test.go..."; \
mv component/wire_gen.go component/wire_gen_test.go; \
echo "Renaming component/callback wire_gen.go to wire_gen_test.go..."; \
mv component/callback/wire_gen.go component/callback/wire_gen_test.go; \
else \
echo "Wire failed, skipping renaming."; \
fi

mock_gen:
mockery

swag:
swag init --pd -d cmd/csghub-server/cmd/start,api/router,api/handler,builder/store/database,common/types,accounting/handler,user/handler,component -g server.go
Loading

0 comments on commit 7360daa

Please sign in to comment.