Skip to content

Commit 48f5744

Browse files
authored
Move public APIs under api/<api-name>/v1. (#2996)
All public APIs now live in one tree, with a version in every package, so a future version can sit next to v1. * Proto packages are `substrate.<api-name>.v1`, so gRPC method names change, for example to `/substrate.ateapi.v1.Control/GetActor`. * Go packages for the protos are named after the API, for example `package ateapi`. * CRDs move from `ate.dev/v1alpha1` to `ate.dev/v1`. They live in `api/infra/k8s/ate/v1`. AI use: AI-assisted, I reviewed and tested it (test automation). Fixes #2753
1 parent ddab01e commit 48f5744

513 files changed

Lines changed: 15923 additions & 15949 deletions

File tree

Some content is hidden

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

‎.agents/skills/review-crds/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Your output should be a list of violations conforming to the following JSON form
2929

3030
## Hints
3131

32-
- All CRDs are defined in `pkg/api/v1alpha1`.
32+
- All CRDs are defined in `api/infra/k8s/ate/v1`.
3333

3434
## References
3535
- [Kubernetes API Conventions](references/api-conventions.md)

‎.agents/skills/triage-issues/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Apply all areas that are touched. Most issues need one or two; a few need more.
4848

4949
| Label | Scope |
5050
|---|---|
51-
| `area/api` | User-facing Substrate API (`pkg/proto/ateapipb/`, proto definitions, API semantics, versioning) |
51+
| `area/api` | User-facing Substrate API (`api/ateapi/v1/`, proto definitions, API semantics, versioning) |
5252
| `area/api-machinery` | API server internals: RPC handlers, storage layer, syncer, controllers (`cmd/ateapi/`, `cmd/atecontroller/`) |
5353
| `area/network` | Networking: atenet-router, Envoy, ext_proc, DNS, xDS, ingress (`cmd/atenet/`) |
5454
| `area/node` | Node agent and worker lifecycle: atelet, sandbox launch, OCI, cgroups (`cmd/atelet/`) |

‎.golangci-kal.yaml‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
# Config for kube-api-linter (github.com/kubernetes-sigs/kube-api-linter),
16-
# run by hack/verify/kube-api-linter.sh against the API types in pkg/api/.
16+
# run by hack/verify/kube-api-linter.sh against the API types in api/infra/.
1717
# It is a separate file from .golangci.yaml because the kubeapilinter module
1818
# plugin only exists in the golangci-lint-kube-api-linter binary, not in the
1919
# regular golangci-lint one.
@@ -75,34 +75,34 @@ linters:
7575
rules:
7676
# Pre-existing findings from rules that require Go API changes
7777
# (pointer fields, omitempty/omitzero tags, map-to-list refactors)
78-
# on the existing v1alpha1 types. Each rule names the fields it
78+
# on the existing ate/v1 types. Each rule names the fields it
7979
# excuses, so a field added to one of these types is still checked.
8080
# Fixing these on the existing types is tracked in issue #207.
81-
- path: 'pkg/api/v1alpha1/sandboxconfig_types\.go'
81+
- path: 'api/infra/k8s/ate/v1/sandboxconfig_types\.go'
8282
text: '^requiredfields: .*\bAssetFile\.(SHA256|URL)\b'
83-
- path: 'pkg/api/v1alpha1/sandboxconfig_types\.go'
83+
- path: 'api/infra/k8s/ate/v1/sandboxconfig_types\.go'
8484
text: '^(optionalfields|requiredfields): .*\bSandboxConfigSpec\.SandboxClass\b'
85-
- path: 'pkg/api/v1alpha1/sandboxconfig_types\.go'
85+
- path: 'api/infra/k8s/ate/v1/sandboxconfig_types\.go'
8686
text: '^(nomaps|optionalfields): .*\bSandboxVersionConfig\.Assets\b'
87-
- path: 'pkg/api/v1alpha1/sandboxconfig_types\.go'
87+
- path: 'api/infra/k8s/ate/v1/sandboxconfig_types\.go'
8888
text: '^(nonpointerstructs|requiredfields): .*\bSandboxConfig\.Spec\b'
89-
- path: 'pkg/api/v1alpha1/csidriverconfig_types\.go'
89+
- path: 'api/infra/k8s/ate/v1/csidriverconfig_types\.go'
9090
text: '^requiredfields: .*\bCSIDriverConfigSpec\.(ControllerEndpoint|DriverName)\b'
91-
- path: 'pkg/api/v1alpha1/csidriverconfig_types\.go'
91+
- path: 'api/infra/k8s/ate/v1/csidriverconfig_types\.go'
9292
text: '^optionalfields: .*\bCSIDriverConfigSpec\.NodeSocketOverride\b'
93-
- path: 'pkg/api/v1alpha1/csidriverconfig_types\.go'
93+
- path: 'api/infra/k8s/ate/v1/csidriverconfig_types\.go'
9494
text: '^requiredfields: .*\bCSIDriverTLSConfig\.Enabled\b'
95-
- path: 'pkg/api/v1alpha1/csidriverconfig_types\.go'
95+
- path: 'api/infra/k8s/ate/v1/csidriverconfig_types\.go'
9696
text: '^optionalfields: .*\bCSIDriverTLSConfig\.(ServerName|UsePodIdentity)\b'
97-
- path: 'pkg/api/v1alpha1/csidriverconfig_types\.go'
97+
- path: 'api/infra/k8s/ate/v1/csidriverconfig_types\.go'
9898
text: '^(nonpointerstructs|requiredfields): .*\bCSIDriverConfig\.Spec\b'
99-
- path: 'pkg/api/v1alpha1/workerpool_types\.go'
99+
- path: 'api/infra/k8s/ate/v1/workerpool_types\.go'
100100
text: '^optionalfields: .*\bWorkerPoolPodTemplate\.PriorityClassName\b'
101-
- path: 'pkg/api/v1alpha1/workerpool_types\.go'
101+
- path: 'api/infra/k8s/ate/v1/workerpool_types\.go'
102102
text: '^(optionalfields|requiredfields): .*\bWorkerPoolSpec\.(Replicas|WorkerImage)\b'
103-
- path: 'pkg/api/v1alpha1/workerpool_types\.go'
103+
- path: 'api/infra/k8s/ate/v1/workerpool_types\.go'
104104
text: '^optionalfields: .*\bWorkerPoolStatus\.(ReadyReplicas|Replicas|Selector)\b'
105-
- path: 'pkg/api/v1alpha1/workerpool_types\.go'
105+
- path: 'api/infra/k8s/ate/v1/workerpool_types\.go'
106106
text: '^(optionalfields|requiredfields): .*\bWorkerPool\.(Spec|Status)\b'
107107

108108
issues:

‎AGENTS.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ See `hack/install-ate.sh` and `tools/setup-gcp` for provisioning and deploying c
6969
## Repository Layout
7070

7171
```
72+
api/ # Public APIs: protos and CRD types, one directory per API and version
7273
cmd/ # One subdirectory per binary (ateapi, atelet, atenet, …)
7374
internal/ # Shared packages, internal to this module only
7475
pkg/ # Shared packages intended for external import
@@ -87,11 +88,12 @@ tools/ # Standalone Go tools (go run ./tools/<name>) for Dev/CI
8788
| Only used by one binary | `cmd/<binary>/internal/<pkg>` |
8889
| Shared across binaries, not for external import | `internal/<pkg>` |
8990
| Public API for external consumers | `pkg/<pkg>` |
90-
| Public proto (control-plane gRPC API) | `pkg/proto/<name>` |
91+
| Public gRPC API | `api/<name>/<version>` |
92+
| Kubernetes CRD types | `api/infra/k8s/<group>/<version>` |
9193
| Internal proto (atelet / ateworker) | `internal/proto/<name>` |
9294
| Dev/CI scripts | `hack/` |
9395
| Standalone Go dev/CI tools | `tools/<name>` with its own `go.mod` |
94-
| Self-contained plugin that nothing in the repo depends on | `internal/plugins/<name>` with its own `go.mod`, importing only `pkg/`; see `internal/plugins/README.md` |
96+
| Self-contained plugin that nothing in the repo depends on | `internal/plugins/<name>` with its own `go.mod`, importing only `api/` and `pkg/`; see `internal/plugins/README.md` |
9597

9698
See `docs/dev/code-layout.md` for the full rationale and per-directory details.
9799

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ateapipb
1+
# ateapi
22

33
`ateapi.proto` defines Substrate's public API.
44

0 commit comments

Comments
 (0)