diff --git a/.gitpod.yml b/.gitpod.yml index b68fa054..4e85e60f 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,4 +1,4 @@ -# See https://www.gitpod.io/docs/configure/workspaces + tasks: - init: make init-env install-precheck before: IMG_TOOL=docker GOPROXY= make build-ext copy-ext build-image @@ -6,3 +6,7 @@ tasks: ports: - port: 5713 # console interactive port + +vscode: + extensions: + - golang.goteractive port diff --git a/.remarkrc b/.remarkrc new file mode 100644 index 00000000..81c7c819 --- /dev/null +++ b/.remarkrc @@ -0,0 +1 @@ +listItemIndent=one diff --git a/CONTRIBUTION.md b/CONTRIBUTION.md index a15e4bdc..643af4de 100644 --- a/CONTRIBUTION.md +++ b/CONTRIBUTION.md @@ -50,4 +50,9 @@ docker run -p 12800:12800 -p 9412:9412 \ -e SW_STORAGE=banyandb \ -e SW_STORAGE_BANYANDB_HOST=192.168.1.98 \ docker.io/apache/skywalking-oap-server -``` \ No newline at end of file +``` + +## FAQ + +* Got sum missing match error of go. + * Run command: `go clean -modcache && go mod tidy` diff --git a/Dockerfile b/Dockerfile index 7208acf6..c8f3dfb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,14 +36,15 @@ COPY --from=ui /workspace/dist/assets/*.css cmd/data/index.css COPY --from=sk /usr/local/bin/skywalking-go-agent /usr/local/bin/skywalking-go-agent -RUN GOPROXY=${GOPROXY} go mod download -RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -toolexec="skywalking-go-agent" -a -ldflags "-w -s -X github.com/linuxsuren/api-testing/pkg/version.version=${VERSION}\ +# RUN GOPROXY=${GOPROXY} go mod download +RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -v -toolexec="skywalking-go-agent" -a -ldflags "-w -s -X github.com/linuxsuren/api-testing/pkg/version.version=${VERSION}\ -X github.com/linuxsuren/api-testing/pkg/version.date=$(date +%Y-%m-%d)" -o atest . -RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s" -o atest-collector extensions/collector/main.go -RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s" -o atest-store-orm extensions/store-orm/main.go -RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s" -o atest-store-s3 extensions/store-s3/main.go -RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s" -o atest-store-etcd extensions/store-etcd/main.go -RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -toolexec="skywalking-go-agent" -a -ldflags "-w -s" -o atest-store-git extensions/store-git/main.go +RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -v -ldflags "-w -s" -o atest-collector extensions/collector/main.go +RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -v -ldflags "-w -s" -o atest-store-orm extensions/store-orm/main.go +RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -v -ldflags "-w -s" -o atest-store-s3 extensions/store-s3/main.go +RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -v -ldflags "-w -s" -o atest-store-etcd extensions/store-etcd/main.go +RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -v -ldflags "-w -s" -o atest-store-mongodb extensions/store-mongodb/main.go +RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -v -toolexec="skywalking-go-agent" -a -ldflags "-w -s" -o atest-store-git extensions/store-git/main.go FROM docker.io/library/ubuntu:23.04 @@ -64,6 +65,7 @@ COPY --from=builder /workspace/atest-store-orm /usr/local/bin/atest-store-orm COPY --from=builder /workspace/atest-store-s3 /usr/local/bin/atest-store-s3 COPY --from=builder /workspace/atest-store-etcd /usr/local/bin/atest-store-etcd COPY --from=builder /workspace/atest-store-git /usr/local/bin/atest-store-git +COPY --from=builder /workspace/atest-store-mongodb /usr/local/bin/atest-store-mongodb COPY --from=builder /workspace/LICENSE /LICENSE COPY --from=builder /workspace/README.md /README.md diff --git a/Makefile b/Makefile index bd8b7916..737d1d00 100644 --- a/Makefile +++ b/Makefile @@ -9,16 +9,18 @@ APP_VERSION?=v0.0.13 HELM_REPO?=docker.io/linuxsuren fmt: + go mod tidy go fmt ./... cd extensions/store-etcd && go mod tidy && go fmt ./... cd extensions/store-git && go mod tidy && go fmt ./... cd extensions/store-orm && go mod tidy && go fmt ./... cd extensions/store-s3 && go mod tidy && go fmt ./... + cd extensions/store-mongodb && go mod tidy && go fmt ./... build: mkdir -p bin rm -rf bin/atest CGO_ENABLED=0 go build ${TOOLEXEC} -a ${BUILD_FLAG} -o bin/${BINARY} main.go -build-ext: build-ext-git build-ext-orm build-ext-s3 build-ext-etcd +build-ext: build-ext-git build-ext-orm build-ext-s3 build-ext-etcd build-ext-mongodb build-ext-git: CGO_ENABLED=0 go build -ldflags "-w -s" -o bin/atest-store-git extensions/store-git/main.go build-ext-orm: @@ -27,6 +29,8 @@ build-ext-etcd: CGO_ENABLED=0 go build -ldflags "-w -s" -o bin/atest-store-etcd extensions/store-etcd/main.go build-ext-s3: CGO_ENABLED=0 go build -ldflags "-w -s" -o bin/atest-store-s3 extensions/store-s3/main.go +build-ext-mongodb: + CGO_ENABLED=0 go build -ldflags "-w -s" -o bin/atest-store-mongodb extensions/store-mongodb/main.go build-ui: cd console/atest-ui && npm i && npm run build-only embed-ui: diff --git a/console/atest-ui/src/App.vue b/console/atest-ui/src/App.vue index ddf38e0a..7a953981 100644 --- a/console/atest-ui/src/App.vue +++ b/console/atest-ui/src/App.vue @@ -293,8 +293,22 @@ const suiteKinds = [{ }] const appVersion = ref('') +const appVersionLink = ref('https://github.com/LinuxSuRen/api-testing') API.GetVersion((d) => { appVersion.value = d.message + const version = d.message.match('^v\\d*.\\d*.\\d*') + const dirtyVersion = d.message.match('^v\\d*.\\d*.\\d*-\\d*-g') + + if (!version && !dirtyVersion) { + return + } + + console.log(dirtyVersion) + if (dirtyVersion && dirtyVersion.length > 0) { + appVersionLink.value = appVersionLink.value + '/commit/' + d.message.replace(dirtyVersion[0], '') + } else if (version && version.length > 0) { + appVersionLink.value = appVersionLink.value + '/releases/tag/' + version[0] + } }) @@ -363,7 +377,7 @@ API.GetVersion((d) => {
- {{appVersion}} + {{appVersion}}
diff --git a/console/atest-ui/src/views/StoreManager.vue b/console/atest-ui/src/views/StoreManager.vue index 089c955b..da7820f4 100644 --- a/console/atest-ui/src/views/StoreManager.vue +++ b/console/atest-ui/src/views/StoreManager.vue @@ -50,11 +50,15 @@ interface Store { properties: Pair[] } +const storesLoading = ref(false) function loadStores() { + storesLoading.value = true API.GetStores((e) => { stores.value = e.data }, (e) => { ElMessage.error('Oops, ' + e) + }, () => { + storesLoading.value = false }) } loadStores() @@ -148,7 +152,7 @@ const submitForm = async (formEl: FormInstance | undefined) => { function storeVerify(formEl: FormInstance | undefined) { if (!formEl) return - API.VerifyStore(setStoreForm.name, (e) => { + API.VerifyStore(storeForm.name, (e) => { if (e.ready) { ElMessage({ message: 'Verified!', @@ -180,7 +184,7 @@ function updateKeys() { {{t('button.new')}} {{t('button.refresh')}} - +