diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index d4e479e..71961b3 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -43,7 +43,7 @@ are prepared. If the new tool dependency itself requires a higher minimum, handle that compatibility change together with the cutover rather than leaving the current release checker unusable. -## Stage 2: Add ConfigKit's ReleaseKit profile +## Stage 2: Add ConfigKit's ReleaseKit profile — Complete 1. Add `releasekit.json` at the repository root with `product` set to `ConfigKit`, `remote` set to `origin`, and `expected_push_url` set to diff --git a/releasekit.json b/releasekit.json new file mode 100644 index 0000000..07b6602 --- /dev/null +++ b/releasekit.json @@ -0,0 +1,12 @@ +{ + "product": "ConfigKit", + "remote": "origin", + "expected_push_url": "https://gitea.maximumdirect.net/eric/ConfigKit.git", + "validation": { + "go": { + "race": true, + "full_vet": true, + "compile_targets": ["linux/amd64", "linux/arm64"] + } + } +} diff --git a/releasekit_profile_test.go b/releasekit_profile_test.go new file mode 100644 index 0000000..b7cea7a --- /dev/null +++ b/releasekit_profile_test.go @@ -0,0 +1,53 @@ +package configkit + +import ( + "bytes" + "encoding/json" + "os" + "reflect" + "testing" +) + +func TestReleaseKitProfile(t *testing.T) { + data, err := os.ReadFile("releasekit.json") + if err != nil { + t.Fatal(err) + } + + var profile struct { + Product string `json:"product"` + Remote string `json:"remote"` + ExpectedPushURL string `json:"expected_push_url"` + Validation struct { + Go struct { + Race bool `json:"race"` + FullVet bool `json:"full_vet"` + CompileTargets []string `json:"compile_targets"` + } `json:"go"` + } `json:"validation"` + } + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + if err := decoder.Decode(&profile); err != nil { + t.Fatalf("decode release profile: %v", err) + } + + if profile.Product != "ConfigKit" { + t.Errorf("product = %q, want ConfigKit", profile.Product) + } + if profile.Remote != "origin" { + t.Errorf("remote = %q, want origin", profile.Remote) + } + if profile.ExpectedPushURL != "https://gitea.maximumdirect.net/eric/ConfigKit.git" { + t.Errorf("expected push URL = %q", profile.ExpectedPushURL) + } + goValidation := profile.Validation.Go + if !goValidation.Race || !goValidation.FullVet { + t.Errorf("race and full vet must be selected: race=%t full_vet=%t", goValidation.Race, goValidation.FullVet) + } + wantTargets := []string{"linux/amd64", "linux/arm64"} + if !reflect.DeepEqual(goValidation.CompileTargets, wantTargets) { + t.Errorf("compile targets = %v, want %v", goValidation.CompileTargets, wantTargets) + } +}