Skip to content

Commit b6ee036

Browse files
authored
fix(spec): keep project contract at v1 (#201)
1 parent 57afcab commit b6ee036

115 files changed

Lines changed: 507 additions & 7037 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.

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
run: |
150150
./ob-smoke${{ runner.os == 'Windows' && '.exe' || '' }} version
151151
./ob-smoke${{ runner.os == 'Windows' && '.exe' || '' }} --help
152-
./ob-smoke${{ runner.os == 'Windows' && '.exe' || '' }} schema --out "${{ runner.temp }}/onebox.run-v2.schema.json"
152+
./ob-smoke${{ runner.os == 'Windows' && '.exe' || '' }} schema --out "${{ runner.temp }}/onebox.run-v1.schema.json"
153153
154154
e2e:
155155
name: End-to-end (Docker)

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ Starting from an existing Compose project, `ob init` writes the first draft.
7575
This is a complete single-workload project:
7676

7777
```yaml
78-
# yaml-language-server: $schema=https://raw.githubusercontent.com/labstack/onebox/main/docs/onebox.run-v2.schema.json
79-
api_version: onebox.run/v2
78+
# yaml-language-server: $schema=https://raw.githubusercontent.com/labstack/onebox/main/docs/onebox.run-v1.schema.json
79+
api_version: onebox.run/v1
8080
app: shop
8181
environments:
8282
production:

‎cmd/ob-docgen/main.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
// So this program is the only writer of `site/src/content/docs/reference/`
1111
// — the field pages, `drivers.mdx`, `errors.mdx` and `cli.mdx` — and of the
12-
// schema published at `site/public/onebox.run-v2.schema.json`. Those pages carry
12+
// schema published at `site/public/onebox.run-v1.schema.json`. Those pages carry
1313
// a generated marker,
1414
// which `--check` reads in both directions: it fails when a page differs from
1515
// what this binary would produce, and when a marked page survives that no
@@ -67,7 +67,7 @@ func main() {
6767
os.Exit(1)
6868
}
6969
schema = append(schema, '\n')
70-
publicFiles := map[string]string{"onebox.run-v2.schema.json": string(schema)}
70+
publicFiles := map[string]string{"onebox.run-v1.schema.json": string(schema)}
7171

7272
if check {
7373
if err := verify(out, files); err != nil {

‎cmd/ob-docgen/main_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,12 @@ func TestPublishedSchemaMatchesTheCheckedInCopy(t *testing.T) {
318318
}
319319
// Skipping on a read failure would turn "someone moved the file" into a
320320
// passing test, which is the drift this exists to catch.
321-
onDisk, err := os.ReadFile(filepath.Join("..", "..", "docs", "onebox.run-v2.schema.json"))
321+
onDisk, err := os.ReadFile(filepath.Join("..", "..", "docs", "onebox.run-v1.schema.json"))
322322
if err != nil {
323323
t.Fatalf("the checked-in schema must be readable: %v", err)
324324
}
325325
if strings.TrimSpace(string(generated)) != strings.TrimSpace(string(onDisk)) {
326-
t.Error("the published schema differs from docs/onebox.run-v2.schema.json")
326+
t.Error("the published schema differs from docs/onebox.run-v1.schema.json")
327327
}
328328
}
329329

‎cmd/ob/commands_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func writeProject(t *testing.T) string {
6363
t.Helper()
6464
dir := t.TempDir()
6565
obYAML := `
66-
api_version: onebox.run/v2
66+
api_version: onebox.run/v1
6767
app: demo
6868
environments: { production: { server: deploy@example.invalid } }
6969
workloads:
@@ -102,7 +102,7 @@ func TestValidateOK(t *testing.T) {
102102
func TestPreflightBlocksDeploy(t *testing.T) {
103103
dir := writeProject(t)
104104
obYAML := `
105-
api_version: onebox.run/v2
105+
api_version: onebox.run/v1
106106
app: demo
107107
environments: { production: { server: deploy@example.invalid } }
108108
workloads:

‎cmd/ob/doctor_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func doctorTestDependencies(t *testing.T) doctorDependencies {
3131
oldBinary := filepath.Join(oldDir, "ob")
3232
currentBinary := filepath.Join(currentDir, "ob")
3333
cfg := &app.Spec{
34-
APIVersion: "onebox.run/v2",
34+
APIVersion: "onebox.run/v1",
3535
Name: "demo",
3636
Environments: map[string]app.Environment{
3737
"production": {
@@ -195,7 +195,7 @@ func TestDoctorReportsIncompatibleProjectPolicy(t *testing.T) {
195195
deps := doctorTestDependencies(t)
196196
deps.loadConfig = func(string) (*app.Spec, error) {
197197
return &app.Spec{
198-
APIVersion: "onebox.run/v2",
198+
APIVersion: "onebox.run/v1",
199199
Environments: map[string]app.Environment{
200200
"production": {Policy: app.Policy{MinOneboxVersion: "v2027.1.0"}},
201201
},

‎cmd/ob/init.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func runInit(ctx context.Context, cmd *cobra.Command, g *globalFlags) error {
9898
// errors from the moment the file exists rather than after someone finds
9999
// out it could.
100100
fmt.Fprintf(&b, "# yaml-language-server: $schema=%s\n", app.SchemaID)
101-
b.WriteString("api_version: onebox.run/v2\n")
101+
b.WriteString("api_version: onebox.run/v1\n")
102102
fmt.Fprintf(&b, "app: %s\n", application)
103103
b.WriteString("environments:\n production:\n server: deploy@CHANGE-ME\n")
104104
b.WriteString("workloads:\n")

‎cmd/ob/init_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestInitClassifiesAndDoctors(t *testing.T) {
4848
}
4949
y := string(b)
5050
for _, want := range []string{
51-
"api_version: onebox.run/v2",
51+
"api_version: onebox.run/v1",
5252
"server: deploy@CHANGE-ME",
5353
"workloads:",
5454
"role: application",

‎cmd/ob/main_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import (
88
"testing"
99
)
1010

11-
const mainTestProject = `api_version: onebox.run/v2
11+
const mainTestProject = `api_version: onebox.run/v1
1212
app: demo
1313
environments: {production: {server: deploy@example.invalid}}
1414
image: nginx:1.27
1515
proxy: {kind: none}
1616
`
1717

18-
const mainTestBuildProject = `api_version: onebox.run/v2
18+
const mainTestBuildProject = `api_version: onebox.run/v1
1919
app: demo
2020
environments: {production: {server: deploy@example.invalid}}
2121
workloads:

‎cmd/ob/ops_contract_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func writeOpsContractProject(t *testing.T, dir string, encrypted bool) string {
2424
}
2525
}
2626
path := filepath.Join(dir, "project.yml")
27-
if err := os.WriteFile(path, []byte(`api_version: onebox.run/v2
27+
if err := os.WriteFile(path, []byte(`api_version: onebox.run/v1
2828
app: shop
2929
environments:
3030
production: {server: deploy@example.invalid}
@@ -169,7 +169,7 @@ func TestDestroyConfirmationMismatchIsCancelledBeforeTargetContact(t *testing.T)
169169
func TestServiceLogsAndExecNDJSONTagChannelsAndTargetKind(t *testing.T) {
170170
dir := t.TempDir()
171171
config := filepath.Join(dir, "project.yml")
172-
if err := os.WriteFile(config, []byte(`api_version: onebox.run/v2
172+
if err := os.WriteFile(config, []byte(`api_version: onebox.run/v1
173173
app: shop
174174
environments:
175175
production: {server: deploy@example.invalid}

0 commit comments

Comments
 (0)