Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ dist/
smoke-report/
.playwright-mcp/
.claude/worktrees/
dist/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The 'dist/' directory is already ignored on line 14. This duplicate entry is redundant and can be safely removed.

5 changes: 3 additions & 2 deletions claude-specification/project/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ cora/
### 命令生成机制

- 命令树在运行时从 OpenAPI Spec 动态生成,**不手写具体 API 命令**
- 资源名由三层推导(详见 `spec/spec-optimization-design.md`)
- 资源名由三层推导:
1. **Path 优先**:path 中有明确子资源段(如 `/pulls/`、`/issues/`)的,优先采用 path 信号
2. **Tag 规范化**:对 tag 做归一化(与 path 交叉验证、同义词映射、单复数统一)
3. **Fallback**:path 最后非参数段
Expand All @@ -84,6 +84,8 @@ cora/
- Discourse:注入 `Api-Key` / `Api-Username` 请求头
- Etherpad:注入 `?apikey=` query 参数
- GitCode:注入 `?access_token=` query 参数
- GitHub:注入 `Authorization: Bearer <token>` 请求头
- Jenkins / EUR:注入 `Authorization: Basic <base64(user:token)>` 请求头
- 认证参数(`Api-Key`、`access_token` 等)不生成 CLI flag,由 executor 自动注入

### 内置服务
Expand Down Expand Up @@ -238,7 +240,6 @@ go run ./cmd/cora -- <service> <resource> <verb> [flags] # 直接运行
| 日志系统设计 | `spec/logging-design.md` |
| API Token 调研 | `spec/api-token-investigation.md` |
| CLI 设计参考 | `spec/reference-cli-design-patterns.md` |
| Spec 优化设计 | `spec/spec-optimization-design.md` |

---

Expand Down
16 changes: 8 additions & 8 deletions cmd/cora/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import (
"os"
"strings"

"github.com/cncf/cora/internal/output/color"
"github.com/opensourceways/cora/internal/output/color"

"github.com/spf13/cobra"

"github.com/cncf/cora/internal/builder"
"github.com/cncf/cora/internal/config"
"github.com/cncf/cora/internal/executor"
"github.com/cncf/cora/internal/log"
"github.com/cncf/cora/internal/registry"
"github.com/cncf/cora/internal/view"
"github.com/cncf/cora/pkg/errs"
"github.com/opensourceways/cora/internal/builder"
"github.com/opensourceways/cora/internal/config"
"github.com/opensourceways/cora/internal/executor"
"github.com/opensourceways/cora/internal/log"
"github.com/opensourceways/cora/internal/registry"
"github.com/opensourceways/cora/internal/view"
"github.com/opensourceways/cora/pkg/errs"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/cora/services_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"

"github.com/cncf/cora/internal/registry"
"github.com/opensourceways/cora/internal/registry"
)

// buildServicesCmd returns the `cora services` command tree.
Expand Down
2 changes: 1 addition & 1 deletion cmd/smoke/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"time"

"github.com/cncf/cora/internal/smoke"
"github.com/opensourceways/cora/internal/smoke"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cncf/cora
module github.com/opensourceways/cora

go 1.23.0

Expand Down
9 changes: 6 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/getkin/kin-openapi v0.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3MAREY=
Expand All @@ -13,6 +15,8 @@ github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=
github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso=
Expand Down Expand Up @@ -52,14 +56,13 @@ github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=
github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=
github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
Expand Down
6 changes: 4 additions & 2 deletions internal/auth/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"io"
"net/http"

"github.com/cncf/cora/internal/config"
"github.com/cncf/cora/internal/log"
"github.com/opensourceways/cora/internal/config"
"github.com/opensourceways/cora/internal/log"
)

// InjectAuth adds authentication credentials to an outgoing request based on
Expand All @@ -19,6 +19,8 @@ import (
// Etherpad: injects ?apikey= into the request URL's query string.
// GitCode: injects ?access_token= into the request URL's query string.
// GitHub: injects Authorization: Bearer <token> header.
// Jenkins: injects Authorization: Basic <base64(user:token)> header.
// EUR: injects Authorization: Basic <base64(user:token)> header.
//
// All providers inject credentials unconditionally when present; the server
// ignores them for public endpoints and enforces them for protected ones.
Expand Down
2 changes: 1 addition & 1 deletion internal/auth/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/url"
"testing"

"github.com/cncf/cora/internal/config"
"github.com/opensourceways/cora/internal/config"
)

func newGETRequest(t *testing.T, rawURL string) *http.Request {
Expand Down
10 changes: 5 additions & 5 deletions internal/builder/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"github.com/getkin/kin-openapi/openapi3"
"github.com/spf13/cobra"

"github.com/cncf/cora/assets"
"github.com/cncf/cora/internal/config"
"github.com/cncf/cora/internal/executor"
"github.com/cncf/cora/internal/spec"
"github.com/cncf/cora/internal/view"
"github.com/opensourceways/cora/assets"
"github.com/opensourceways/cora/internal/config"
"github.com/opensourceways/cora/internal/executor"
"github.com/opensourceways/cora/internal/spec"
"github.com/opensourceways/cora/internal/view"
)

// ── helpers ──────────────────────────────────────────────────────────────────
Expand Down
8 changes: 4 additions & 4 deletions internal/builder/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"github.com/getkin/kin-openapi/openapi3"
"github.com/spf13/cobra"

"github.com/cncf/cora/internal/auth"
"github.com/cncf/cora/internal/config"
"github.com/cncf/cora/internal/executor"
"github.com/cncf/cora/internal/view"
"github.com/opensourceways/cora/internal/auth"
"github.com/opensourceways/cora/internal/config"
"github.com/opensourceways/cora/internal/executor"
"github.com/opensourceways/cora/internal/view"
)

// Build returns a *cobra.Command for the given service, populated with one
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/joho/godotenv"
"github.com/spf13/viper"

"github.com/cncf/cora/internal/log"
"github.com/opensourceways/cora/internal/log"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/executor/execute_more_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strings"
"testing"

"github.com/cncf/cora/internal/config"
"github.com/cncf/cora/internal/view"
"github.com/opensourceways/cora/internal/config"
"github.com/opensourceways/cora/internal/view"
)

func svcConfig(serverURL string) *config.Config {
Expand Down
12 changes: 6 additions & 6 deletions internal/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
"strings"
"time"

"github.com/cncf/cora/internal/auth"
"github.com/cncf/cora/internal/config"
"github.com/cncf/cora/internal/log"
"github.com/cncf/cora/internal/output"
"github.com/cncf/cora/internal/view"
"github.com/cncf/cora/pkg/errs"
"github.com/opensourceways/cora/internal/auth"
"github.com/opensourceways/cora/internal/config"
"github.com/opensourceways/cora/internal/log"
"github.com/opensourceways/cora/internal/output"
"github.com/opensourceways/cora/internal/view"
"github.com/opensourceways/cora/pkg/errs"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"testing"
"time"

"github.com/cncf/cora/internal/config"
"github.com/cncf/cora/pkg/errs"
"github.com/opensourceways/cora/internal/config"
"github.com/opensourceways/cora/pkg/errs"
)

// cliErr extracts a *errs.CLIError from err; fails the test if not found.
Expand Down
4 changes: 2 additions & 2 deletions internal/output/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/olekukonko/tablewriter"
"gopkg.in/yaml.v3"

"github.com/cncf/cora/internal/output/color"
"github.com/cncf/cora/internal/view"
"github.com/opensourceways/cora/internal/output/color"
"github.com/opensourceways/cora/internal/view"
)

// Print renders raw JSON response bytes in the requested format.
Expand Down
2 changes: 1 addition & 1 deletion internal/output/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package output
import (
"testing"

"github.com/cncf/cora/internal/view"
"github.com/opensourceways/cora/internal/view"
)

// --- extractItems ---
Expand Down
6 changes: 3 additions & 3 deletions internal/registry/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package registry
import (
"time"

"github.com/cncf/cora/assets"
"github.com/cncf/cora/internal/config"
"github.com/cncf/cora/internal/spec"
"github.com/opensourceways/cora/assets"
"github.com/opensourceways/cora/internal/config"
"github.com/opensourceways/cora/internal/spec"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/getkin/kin-openapi/openapi3"

"github.com/cncf/cora/internal/config"
"github.com/cncf/cora/internal/spec"
"github.com/opensourceways/cora/internal/config"
"github.com/opensourceways/cora/internal/spec"
)

// Entry holds metadata and the spec loader for one backend service.
Expand Down
4 changes: 2 additions & 2 deletions internal/spec/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

"github.com/getkin/kin-openapi/openapi3"

"github.com/cncf/cora/internal/log"
"github.com/cncf/cora/pkg/errs"
"github.com/opensourceways/cora/internal/log"
"github.com/opensourceways/cora/pkg/errs"
)

// Loader loads an OpenAPI spec from a URL or local file, using a local cache
Expand Down
2 changes: 1 addition & 1 deletion internal/view/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ var builtinViews = map[string]map[string]ViewConfig{
},

"etherpad": {
"pads/list": {
"pad/list-all-pads": {
Columns: []ViewColumn{
{Field: "padID", Label: "Pad ID"},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/errs/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"testing"

"github.com/cncf/cora/pkg/errs"
"github.com/opensourceways/cora/pkg/errs"
)

// --- CLIError.Error() ---
Expand Down
Loading
Loading