Skip to content

Commit 4238ce6

Browse files
committed
Merge remote-tracking branch 'origin/master' into refactor/components
2 parents c7c435a + 3a9bde8 commit 4238ce6

Some content is hidden

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

83 files changed

+7933
-2077
lines changed

.github/workflows/docs.yaml

Lines changed: 56 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: Hugo Docs
22
on:
33
push:
44
branches:
5-
- "master"
5+
- "master"
66
pull_request:
77
branches:
8-
- "master"
8+
- "master"
99
paths:
10-
- 'docs/site/**'
11-
- 'tools/make/docs.mk'
10+
- "docs/site/**"
11+
- "tools/make/docs.mk"
1212

1313
permissions:
1414
contents: read
@@ -17,63 +17,64 @@ jobs:
1717
docs-lint:
1818
runs-on: ubuntu-22.04
1919
steps:
20-
- name: Check out code
21-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
22-
with:
23-
ref: ${{ github.event.pull_request.head.sha }}
20+
- name: Check out code
21+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
22+
with:
23+
ref: ${{ github.event.pull_request.head.sha }}
2424

25-
- uses: ./tools/github-actions/setup-deps
25+
- uses: ./tools/github-actions/setup-deps
2626

27-
- name: Run markdown linter
28-
uses: nosborn/github-action-markdown-cli@9b5e871c11cc0649c5ac2526af22e23525fa344d # v3.3.0
29-
with:
30-
files: docs/site/content/*
31-
config_file: ".github/markdown_lint_config.json"
27+
- name: Run markdown linter
28+
uses: nosborn/github-action-markdown-cli@9b5e871c11cc0649c5ac2526af22e23525fa344d # v3.3.0
29+
with:
30+
files: docs/site/content/*
31+
config_file: ".github/markdown_lint_config.json"
3232

33-
- name: Install linkinator
34-
run: npm install -g [email protected]
33+
- name: Install linkinator
34+
run: npm install -g [email protected]
3535

36-
- name: Check links
37-
run: make docs # docs-check-links
36+
- name: Check links
37+
run: make docs # docs-check-links
3838

3939
docs-build:
4040
runs-on: ubuntu-latest
4141
needs: docs-lint
4242
permissions:
4343
contents: write
4444
steps:
45-
- name: Git checkout
46-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
47-
with:
48-
submodules: true
49-
ref: ${{ github.event.pull_request.head.sha }}
50-
51-
- uses: ./tools/github-actions/setup-deps
52-
53-
- name: Setup Hugo
54-
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
55-
with:
56-
hugo-version: 'latest'
57-
extended: true
58-
59-
- name: Setup Node
60-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.1.0
61-
with:
62-
node-version: '18'
63-
64-
- name: Install Site Dependencies and Build Site
65-
run: |
66-
cp docs/api-testing-schema.json docs/site/static/api-testing-schema.json
67-
make docs # docs-check-links
68-
69-
# Upload docs for GitHub Pages
70-
- name: Upload GitHub Pages artifact
71-
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
72-
with:
73-
# Path of the directory containing the static assets.
74-
path: docs/site/public
75-
# Duration after which artifact will expire in days.
76-
# retention-days: # optional, default is 1
45+
- name: Git checkout
46+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
47+
with:
48+
submodules: true
49+
ref: ${{ github.event.pull_request.head.sha }}
50+
51+
- uses: ./tools/github-actions/setup-deps
52+
53+
- name: Setup Hugo
54+
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
55+
with:
56+
hugo-version: "latest"
57+
extended: true
58+
59+
- name: Setup Node
60+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.1.0
61+
with:
62+
node-version: "18"
63+
64+
- name: Install Site Dependencies and Build Site
65+
run: |
66+
cp docs/api-testing-schema.json docs/site/static/api-testing-schema.json
67+
cp docs/api-testing-mock-schema.json docs/site/static/api-testing-mock-schema.json
68+
make docs # docs-check-links
69+
70+
# Upload docs for GitHub Pages
71+
- name: Upload GitHub Pages artifact
72+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
73+
with:
74+
# Path of the directory containing the static assets.
75+
path: docs/site/public
76+
# Duration after which artifact will expire in days.
77+
# retention-days: # optional, default is 1
7778

7879
# This workflow contains a single job called "build"
7980
docs-publish:
@@ -83,16 +84,16 @@ jobs:
8384

8485
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
8586
permissions:
86-
pages: write # to deploy to Pages
87+
pages: write # to deploy to Pages
8788
deployments: write
88-
id-token: write # to verify the deployment originates from an appropriate source
89+
id-token: write # to verify the deployment originates from an appropriate source
8990

9091
# Deploy to the github-pages environment
9192
environment:
9293
name: github-pages
9394
url: ${{ steps.deployment.outputs.page_url }}
9495

9596
steps:
96-
- name: Deploy to GitHub Pages
97-
id: deployment
98-
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
97+
- name: Deploy to GitHub Pages
98+
id: deployment
99+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

.github/workflows/stale.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ COPY console/atest-ui .
55
RUN npm install --ignore-scripts --registry=https://registry.npmmirror.com
66
RUN npm run build-only
77

8-
FROM docker.io/golang:1.22.2 AS builder
8+
FROM docker.io/golang:1.22.4 AS builder
99

1010
ARG VERSION
1111
ARG GOPROXY

cmd/extension.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type extensionOption struct {
3535
os string
3636
arch string
3737
timeout time.Duration
38+
imagePrefix string
3839
}
3940

4041
func createExtensionCommand(ociDownloader downloader.PlatformAwareOCIDownloader) (c *cobra.Command) {
@@ -55,13 +56,15 @@ func createExtensionCommand(ociDownloader downloader.PlatformAwareOCIDownloader)
5556
flags.StringVarP(&opt.os, "os", "", runtime.GOOS, "The OS")
5657
flags.StringVarP(&opt.arch, "arch", "", runtime.GOARCH, "The architecture")
5758
flags.DurationVarP(&opt.timeout, "timeout", "", time.Minute, "The timeout of downloading")
59+
flags.StringVarP(&opt.imagePrefix, "image-prefix", "", "linuxsuren", "The prefix for the image address")
5860
return
5961
}
6062

6163
func (o *extensionOption) runE(cmd *cobra.Command, args []string) (err error) {
6264
o.ociDownloader.WithOS(o.os)
6365
o.ociDownloader.WithArch(o.arch)
6466
o.ociDownloader.WithRegistry(o.registry)
67+
o.ociDownloader.WithImagePrefix(o.imagePrefix)
6568
o.ociDownloader.WithTimeout(o.timeout)
6669
o.ociDownloader.WithContext(cmd.Context())
6770

cmd/server.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import (
4242
"github.com/linuxsuren/api-testing/pkg/downloader"
4343
"github.com/linuxsuren/api-testing/pkg/logging"
4444
"github.com/linuxsuren/api-testing/pkg/mock"
45-
"github.com/linuxsuren/api-testing/pkg/oauth"
45+
atestoauth "github.com/linuxsuren/api-testing/pkg/oauth"
4646
template "github.com/linuxsuren/api-testing/pkg/render"
4747
"github.com/linuxsuren/api-testing/pkg/server"
4848
"github.com/linuxsuren/api-testing/pkg/service"
@@ -51,6 +51,7 @@ import (
5151
"github.com/linuxsuren/api-testing/pkg/testing/remote"
5252
"github.com/linuxsuren/api-testing/pkg/util"
5353
fakeruntime "github.com/linuxsuren/go-fake-runtime"
54+
"github.com/linuxsuren/oauth-hub"
5455

5556
"github.com/prometheus/client_golang/prometheus"
5657
"github.com/prometheus/client_golang/prometheus/collectors"
@@ -182,7 +183,7 @@ func (o *serverOption) preRunE(cmd *cobra.Command, args []string) (err error) {
182183
return
183184
}
184185

185-
grpcOpts = append(grpcOpts, oauth.NewAuthInterceptor(o.oauthGroup))
186+
grpcOpts = append(grpcOpts, atestoauth.NewAuthInterceptor(o.oauthGroup))
186187
}
187188
if o.tls {
188189
if o.tlsCert != "" && o.tlsKey != "" {
@@ -468,7 +469,7 @@ func debugHandler(mux *runtime.ServeMux, remoteServer server.RunnerServer) {
468469
Name: sub,
469470
})
470471
if err == nil {
471-
w.Header().Set("Content-Type", "application/octet-stream")
472+
w.Header().Set(util.ContentType, "application/octet-stream")
472473
w.Write(data.Data)
473474
} else {
474475
w.WriteHeader(http.StatusBadRequest)

0 commit comments

Comments
 (0)