Keep Go readiness separate from publication file checks

This commit is contained in:
2026-12-06 03:39:11 +00:00
parent d733298bd9
commit 697cd27cde
3 changed files with 37 additions and 3 deletions

View File

@@ -68,8 +68,9 @@ these boundaries and ordinary production-release immutability.
**Completed:** Readiness shares candidate and selector configuration checks
with execution, requires the rehearsal CI declaration, and preserves narrower
delivery scope. CLI regression cases, affected internal suites, and the compiled
API/dependency check pass.
delivery and Go-only scope. CLI regression cases, affected internal suites,
the facade's operation-scoping regression, and the compiled API/dependency check
pass. CLI profile parsing retains its existing configuration validation.
**Priority:** P2. **Stages:** 1, 3, 6, 7, 14.

View File

@@ -107,7 +107,12 @@ func Run(ctx context.Context, request Request) Report {
report.note("source", "configuration", "skipped", "dependency", "repository unavailable")
}
if repoErr == nil && sourceErr == nil && (selected["publication"] || selected["go"]) {
report.record("candidate-configuration", "publication", "configuration", validation.ValidateConfiguration(request.Validation, source.GoEnabled))
settings, operation := request.Validation, "publication"
if !selected["publication"] {
settings.FileSize = nil
operation = "go"
}
report.record("candidate-configuration", operation, "configuration", validation.ValidateConfiguration(settings, source.GoEnabled))
}
if selected["rehearsal"] {
report.record("ci-credential-declaration", "rehearsal", "configuration", CheckCIConfigured(request.CIConfigured))

View File

@@ -17,3 +17,31 @@ func TestValidatePreservesPartialReportAndCancellation(t *testing.T) {
t.Fatalf("report=%+v error=%v", report, err)
}
}
func TestValidateGoScopeKeepsFileValidationSeparate(t *testing.T) {
repo := newPublishFixture(t)
limit := int64(-1)
for _, operation := range []releasekit.ReadinessOperation{releasekit.ReadinessGo, releasekit.ReadinessPublication} {
report, err := releasekit.Validate(t.Context(), releasekit.ValidateRequest{
RepositoryDir: repo.work, Product: "Sample App", Offline: true,
Operations: []releasekit.ReadinessOperation{operation},
Validation: releasekit.ValidationSpec{FileSize: &releasekit.FileSizeValidationSpec{LimitBytes: &limit}},
})
wantFailed := operation == releasekit.ReadinessPublication
if (err != nil) != wantFailed {
t.Fatalf("operation=%s report=%+v error=%v", operation, report, err)
}
found := false
for _, check := range report.Checks {
if check.ID == "candidate-configuration" {
found = true
if check.Operation != operation || (check.Status == releasekit.ReadinessFailed) != wantFailed {
t.Fatalf("operation=%s check=%+v", operation, check)
}
}
}
if !found {
t.Fatalf("selected configuration was not checked: %+v", report.Checks)
}
}
}