Skip to content

Commit ed4d296

Browse files
authored
Merge pull request #3697 from xmudrii/stage-cli
Move CLI into a staging repository
2 parents 1b50cf7 + 157ea41 commit ed4d296

File tree

45 files changed

+333
-75
lines changed

Some content is hidden

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

45 files changed

+333
-75
lines changed

.goreleaser.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ builds:
1818
# plugin builds
1919
- id: "kubectl-kcp"
2020
main: ./cmd/kubectl-kcp
21-
dir: cli
21+
dir: staging/src/github.com/kcp-dev/cli
2222
binary: bin/kubectl-kcp
2323
ldflags:
2424
- "{{ .Env.LDFLAGS }}"
@@ -34,7 +34,7 @@ builds:
3434

3535
- id: "kubectl-ws"
3636
main: ./cmd/kubectl-ws
37-
dir: cli
37+
dir: staging/src/github.com/kcp-dev/cli
3838
binary: bin/kubectl-ws
3939
ldflags:
4040
- "{{ .Env.LDFLAGS }}"
@@ -50,7 +50,7 @@ builds:
5050

5151
- id: "kubectl-create-workspace"
5252
main: ./cmd/kubectl-create-workspace
53-
dir: cli
53+
dir: staging/src/github.com/kcp-dev/cli
5454
binary: bin/kubectl-create-workspace
5555
ldflags:
5656
- "{{ .Env.LDFLAGS }}"
@@ -66,7 +66,7 @@ builds:
6666

6767
- id: apigen
6868
main: ./cmd/apigen
69-
dir: sdk
69+
dir: staging/src/github.com/kcp-dev/sdk
7070
binary: bin/apigen
7171
ldflags:
7272
- "{{ .Env.LDFLAGS }}"

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ ENV GOPROXY=$goproxy
2828
# Copy the Go Modules manifests
2929
COPY go.mod go.mod
3030
COPY go.sum go.sum
31-
COPY cli/go.mod cli/go.mod
32-
COPY cli/go.sum cli/go.sum
3331
COPY staging/src/github.com/kcp-dev/apimachinery/go.mod staging/src/github.com/kcp-dev/apimachinery/go.mod
3432
COPY staging/src/github.com/kcp-dev/apimachinery/go.sum staging/src/github.com/kcp-dev/apimachinery/go.sum
33+
COPY staging/src/github.com/kcp-dev/cli/go.mod staging/src/github.com/kcp-dev/cli/go.mod
34+
COPY staging/src/github.com/kcp-dev/cli/go.sum staging/src/github.com/kcp-dev/cli/go.sum
3535
COPY staging/src/github.com/kcp-dev/client-go/go.mod staging/src/github.com/kcp-dev/client-go/go.mod
3636
COPY staging/src/github.com/kcp-dev/client-go/go.sum staging/src/github.com/kcp-dev/client-go/go.sum
3737
COPY staging/src/github.com/kcp-dev/code-generator/go.mod staging/src/github.com/kcp-dev/code-generator/go.mod

FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ Shards in kcp represent a single apiserver and etcd/db instance. This is how kc
6767

6868
## Where can I get the kubectl ws plugin?
6969

70-
You're in the right place. Clone this repo and run `make install WHAT=./cli/cmd/kubectl-kcp`.
70+
You're in the right place. Clone this repo and run `make install WHAT=./staging/src/github.com/kcp-dev/cli/cmd/kubectl-kcp`.
7171

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ ldflags:
106106
require-%:
107107
@if ! command -v $* 1> /dev/null 2>&1; then echo "$* not found in ${PATH}"; exit 1; fi
108108

109-
build: WHAT ?= ./cmd/... ./cli/cmd/... ./staging/src/github.com/kcp-dev/sdk/cmd/...
109+
build: WHAT ?= ./cmd/... ./staging/src/github.com/kcp-dev/cli/cmd/... ./staging/src/github.com/kcp-dev/sdk/cmd/...
110110
build: require-jq require-go require-git verify-go-versions ## Build the project
111111
set -x; for W in $(WHAT); do \
112112
pushd . && cd $${W%..}; \
@@ -119,7 +119,7 @@ build: require-jq require-go require-git verify-go-versions ## Build the project
119119
build-all:
120120
GOOS=$(OS) GOARCH=$(ARCH) $(MAKE) build WHAT='./cmd/...'
121121

122-
install: WHAT ?= ./cmd/... ./cli/cmd/... ./staging/src/github.com/kcp-dev/sdk/cmd/...
122+
install: WHAT ?= ./cmd/... ./staging/src/github.com/kcp-dev/cli/cmd/... ./staging/src/github.com/kcp-dev/sdk/cmd/...
123123
install: require-jq require-go require-git verify-go-versions ## Install the project
124124
set -x; for W in $(WHAT); do \
125125
pushd . && cd $${W%..}; \

docs/content/contributing/guides/publishing-a-new-kcp-release.md

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ description: >
1717
2. <https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account>
1818
3. <https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key>
1919

20-
### Create the Tags
20+
### Create the Tag
2121

22-
kcp has 2 go modules, and a unique tag is needed for each module every time we create a new release.
22+
!!! note
23+
kcp used two have two submodules (`sdk` and `cli`) which were tagged separately in addition to the main kcp module.
24+
With the introduction of the monorepo, those two submodules became staging repositories. Their tags are now handled
25+
automatically by publishing-bot, so it's only needed to create one tag for the main kcp module.
2326

2427
1. `git fetch` from the main kcp repository (kcp-dev/kcp) to ensure you have the latest commits
2528
2. Tag the main module
@@ -33,28 +36,12 @@ kcp has 2 go modules, and a unique tag is needed for each module every time we c
3336
git tag --sign --message "$TAG" "$TAG" "$REF"
3437
```
3538

36-
3. Tag the `sdk` module, following the same logic as above for `REF` and `TAG`
37-
38-
```shell
39-
REF=upstream/main
40-
TAG=v1.2.3
41-
git tag --sign --message "sdk/$TAG" "sdk/$TAG" "$REF"
42-
```
43-
44-
4. Tag the `cli` module, following the same logic as above for `REF` and `TAG`
45-
46-
```shell
47-
REF=upstream/main
48-
TAG=v1.2.3
49-
git tag --sign --message "cli/$TAG" "cli/$TAG" "$REF"
50-
```
51-
52-
### Push the Tags
39+
### Push the Tag
5340

5441
```shell
5542
REMOTE=upstream
5643
TAG=v1.2.3
57-
git push "$REMOTE" "$TAG" "sdk/$TAG" "cli/$TAG"
44+
git push "$REMOTE" "$TAG"
5845
```
5946

6047
## If it's a New Minor Version

docs/generators/cli-doc/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ go 1.24.0
44

55
require (
66
github.com/kcp-dev/kcp v0.0.0-00010101000000-000000000000
7-
github.com/kcp-dev/kcp/cli v0.0.0-00010101000000-000000000000
7+
github.com/kcp-dev/cli v0.0.0-00010101000000-000000000000
88
github.com/spf13/cobra v1.9.1
99
)
1010

1111
replace (
1212
github.com/charmbracelet/colorprofile => github.com/charmbracelet/colorprofile v0.2.2
1313
github.com/charmbracelet/x/ansi => github.com/charmbracelet/x/ansi v0.8.0
14+
github.com/kcp-dev/cli => ../../../staging/src/github.com/kcp-dev/cli
1415
github.com/kcp-dev/kcp => ../../../
15-
github.com/kcp-dev/kcp/cli => ../../../cli
1616
github.com/kcp-dev/sdk => ../../../staging/src/github.com/kcp-dev/sdk
1717
)
1818

docs/generators/cli-doc/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ import (
2424

2525
"github.com/spf13/cobra"
2626

27-
kubectlCreateWorkspace "github.com/kcp-dev/kcp/cli/cmd/kubectl-create-workspace/cmd"
28-
kubectlKcp "github.com/kcp-dev/kcp/cli/cmd/kubectl-kcp/cmd"
29-
kubectlWs "github.com/kcp-dev/kcp/cli/cmd/kubectl-ws/cmd"
27+
kubectlCreateWorkspace "github.com/kcp-dev/cli/cmd/kubectl-create-workspace/cmd"
28+
kubectlKcp "github.com/kcp-dev/cli/cmd/kubectl-kcp/cmd"
29+
kubectlWs "github.com/kcp-dev/cli/cmd/kubectl-ws/cmd"
30+
3031
"github.com/kcp-dev/kcp/hack/third_party/github.com/spf13/cobra/doc"
3132
)
3233

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!--
2+
3+
⚠️ This is an automatically published staged repository for kcp. ⚠️
4+
5+
Contributions, including issues and pull requests, should be made to the main kcp repository:
6+
https://github.com/kcp-dev/kcp
7+
8+
This repository is read-only for importing, and not used for direct contributions.
9+
10+
See the monorepo structure document for more details:
11+
https://docs.kcp.io/kcp/main/contributing/monorepo/
12+
13+
-->
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Contributing
2+
3+
cli is [Apache 2.0 licensed](LICENSE), and we accept contributions via
4+
GitHub pull requests.
5+
6+
Please read the following guide if you're interested in contributing.
7+
8+
## Certificate of Origin
9+
10+
By contributing to this project you agree to the Developer Certificate of
11+
Origin (DCO). This document was created by the Linux Kernel community and is a
12+
simple statement that you, as a contributor, have the legal right to make the
13+
contribution. See the [DCO](DCO) file for details.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Developer Certificate of Origin
2+
Version 1.1
3+
4+
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
5+
6+
Everyone is permitted to copy and distribute verbatim copies of this
7+
license document, but changing it is not allowed.
8+
9+
10+
Developer's Certificate of Origin 1.1
11+
12+
By making a contribution to this project, I certify that:
13+
14+
(a) The contribution was created in whole or in part by me and I
15+
have the right to submit it under the open source license
16+
indicated in the file; or
17+
18+
(b) The contribution is based upon previous work that, to the best
19+
of my knowledge, is covered under an appropriate open source
20+
license and I have the right under that license to submit that
21+
work with modifications, whether created in whole or in part
22+
by me, under the same open source license (unless I am
23+
permitted to submit under a different license), as indicated
24+
in the file; or
25+
26+
(c) The contribution was provided directly to me by some other
27+
person who certified (a), (b) or (c) and I have not modified
28+
it.
29+
30+
(d) I understand and agree that this project and the contribution
31+
are public and that a record of the contribution (including all
32+
personal information I submit with it, including my sign-off) is
33+
maintained indefinitely and may be redistributed consistent with
34+
this project or the open source license(s) involved.

0 commit comments

Comments
 (0)