Verify vendored recovery after launcher cleanup
This commit is contained in:
@@ -52,18 +52,29 @@ func TestVendoredAPIOnlyPublicationRecovery(t *testing.T) {
|
|||||||
if err := os.WriteFile(filepath.Join(remote, "hooks", "pre-receive"), []byte("#!/bin/sh\nexit 1\n"), 0700); err != nil {
|
if err := os.WriteFile(filepath.Join(remote, "hooks", "pre-receive"), []byte("#!/bin/sh\nexit 1\n"), 0700); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
var out, diagnostics bytes.Buffer
|
launcherStore := t.TempDir()
|
||||||
if status := run(t.Context(), []string{"publish", "--repo", repo, "v1.2.3"}, &out, &diagnostics); status != 1 {
|
launcherArgs, err := gotool.RecoveryTool(t.Context(), repo, launcherStore)
|
||||||
t.Fatalf("publication status=%d: %s", status, &diagnostics)
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
command := outputLineValue(diagnostics.String(), "recovery command: ")
|
launcher := exec.Command(goBinary, append(launcherArgs, "publish", "--repo", repo, "v1.2.3")...)
|
||||||
|
launcher.Dir = t.TempDir()
|
||||||
|
publicationOutput, err := launcher.CombinedOutput()
|
||||||
|
var exitError *exec.ExitError
|
||||||
|
if !errors.As(err, &exitError) || exitError.ExitCode() != 1 {
|
||||||
|
t.Fatalf("vendored publication: %v: %s", err, publicationOutput)
|
||||||
|
}
|
||||||
|
// The later handoff owns different launch metadata from the original driver.
|
||||||
|
if err := os.RemoveAll(launcherStore); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
command := outputLineValue(string(publicationOutput), "recovery command: ")
|
||||||
if command == "" {
|
if command == "" {
|
||||||
t.Fatalf("no handoff: %s", &diagnostics)
|
t.Fatalf("no handoff: %s", publicationOutput)
|
||||||
}
|
}
|
||||||
recovery := exec.Command("sh", "-c", command)
|
recovery := exec.Command("sh", "-c", command)
|
||||||
recovery.Dir = t.TempDir()
|
recovery.Dir = t.TempDir()
|
||||||
recovered, err := recovery.CombinedOutput()
|
recovered, err := recovery.CombinedOutput()
|
||||||
var exitError *exec.ExitError
|
|
||||||
if !errors.As(err, &exitError) || exitError.ExitCode() != 1 || !strings.Contains(string(recovered), "module=example.com/cli-candidate tag=v1.2.3 state=not_published") {
|
if !errors.As(err, &exitError) || exitError.ExitCode() != 1 || !strings.Contains(string(recovered), "module=example.com/cli-candidate tag=v1.2.3 state=not_published") {
|
||||||
t.Fatalf("vendored recovery: %v: %s", err, recovered)
|
t.Fatalf("vendored recovery: %v: %s", err, recovered)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -583,3 +583,12 @@ recovery workflow satisfy this plan and the feature roadmap. The final report
|
|||||||
should identify implemented interfaces, validation results, and any remaining
|
should identify implemented interfaces, validation results, and any remaining
|
||||||
limitations. Subsequent architecture review and release/testing decisions take
|
limitations. Subsequent architecture review and release/testing decisions take
|
||||||
place after this complete initial implementation.
|
place after this complete initial implementation.
|
||||||
|
|
||||||
|
**Follow-up verification completed:** R14–R17 corrections and their assigned
|
||||||
|
regression coverage are complete. The vendored API-only workflow runs through
|
||||||
|
a private Go-tool launcher, removes the original launcher metadata, and then
|
||||||
|
executes its printed recovery command. Native and cold Go-tool cancellation,
|
||||||
|
fallback, setup-error classifications, and byte-field format validation are
|
||||||
|
covered. The full offline suite and compiled facade/dependency checks passed
|
||||||
|
with Go 1.26.8; prose whitespace, local links, and fragment destinations were
|
||||||
|
checked. See [remediation completion records](remediation.md).
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
# Publication reconciliation remediation
|
# Publication reconciliation remediation
|
||||||
|
|
||||||
Status: all corrections are implemented and individually verified; final
|
Status: complete. R01–R17 are implemented and verified. The full offline suite
|
||||||
assembled verification is pending. R01–R13 retain their completion evidence.
|
and compiled facade/dependency checks passed with Go 1.26.8 after the follow-up
|
||||||
R14–R17 describe the subsequent stage-by-stage review of `363f7cd` and its fixes.
|
corrections. R01–R13 retain their original completion evidence; R14–R17 describe
|
||||||
|
the subsequent stage-by-stage review of `363f7cd` and its fixes.
|
||||||
|
|
||||||
R01–R13 describe commits `4dff808` through `599ad81`, against planning baseline
|
R01–R13 describe commits `4dff808` through `599ad81`, against planning baseline
|
||||||
`447b42a`. Their audit evidence and defect descriptions refer to that reviewed
|
`447b42a`. Their audit evidence and defect descriptions refer to that reviewed
|
||||||
@@ -16,7 +17,8 @@ implementation. The broad package structure is in place: the root facade owns
|
|||||||
public evidence and recovery types, `internal/publish` owns observation,
|
public evidence and recovery types, `internal/publish` owns observation,
|
||||||
recording, and discovery, `internal/git` owns scoped endpoints and ref queries,
|
recording, and discovery, `internal/git` owns scoped endpoints and ref queries,
|
||||||
and the CLI owns command parsing, presentation, and exit classification.
|
and the CLI owns command parsing, presentation, and exit classification.
|
||||||
The findings below identify remaining correctness, boundary, and contract gaps.
|
Each finding records its reviewed defect, implemented correction, and
|
||||||
|
verification.
|
||||||
|
|
||||||
## Review evidence
|
## Review evidence
|
||||||
|
|
||||||
@@ -607,7 +609,10 @@ correctness for these additional combinations.
|
|||||||
**Completed:** API-only recovery uses a private module root with preserved module
|
**Completed:** API-only recovery uses a private module root with preserved module
|
||||||
settings and relocated local replacements. Vendored API-only, relative/versioned
|
settings and relocated local replacements. Vendored API-only, relative/versioned
|
||||||
replacement, cold Go-tool, native handoff, and source-module entry-point tests
|
replacement, cold Go-tool, native handoff, and source-module entry-point tests
|
||||||
passed. Stage 7/8 instructions and consumer/internal guidance are updated.
|
passed. The assembled vendored case also runs publication through a private
|
||||||
|
Go-tool launcher, removes its metadata, and executes the later handoff from
|
||||||
|
another directory. Stage 7/8 instructions and consumer/internal guidance are
|
||||||
|
updated.
|
||||||
|
|
||||||
**Relevant code:** `internal/gotool/recovery.go:95–107`; the command assembly in
|
**Relevant code:** `internal/gotool/recovery.go:95–107`; the command assembly in
|
||||||
`cmd/releasekit/main.go:126–145`. Affects Stage 7 and its Stage 8 coverage.
|
`cmd/releasekit/main.go:126–145`. Affects Stage 7 and its Stage 8 coverage.
|
||||||
@@ -773,25 +778,25 @@ tests rather than duplicating their fixtures.
|
|||||||
|
|
||||||
## Implementation plan and verification follow-through
|
## Implementation plan and verification follow-through
|
||||||
|
|
||||||
When implementing R14–R17, update [implementation.md](implementation.md) alongside
|
**Completed:** [implementation.md](implementation.md) records the R14–R17
|
||||||
the corresponding changes:
|
corrections alongside their implementation:
|
||||||
|
|
||||||
- Stage 1: record the cause-based endpoint setup classification from R16.
|
- Stage 1 records the cause-based endpoint setup classification from R16.
|
||||||
- Stage 2: describe ordinary version-1 records and version-2 byte-preserving
|
- Stage 2 describes ordinary version-1 records and version-2 byte-preserving
|
||||||
records, including the structural validation from R17.
|
records, including the structural validation from R17.
|
||||||
- Stage 6: align typed failures, human guidance, and structured diagnostics with
|
- Stage 6 aligns typed failures, human guidance, and structured diagnostics with
|
||||||
R16; retain the implemented JSON output-failure handling from R06.
|
R16 and retains the implemented JSON output-failure handling from R06.
|
||||||
- Stage 7: replace the original executable-only handoff instructions with R07's
|
- Stage 7 replaces the original executable-only handoff instructions with R07's
|
||||||
module-selected/durable API-only approach, extended for vendoring and
|
module-selected/durable API-only approach, extended for vendoring and
|
||||||
cancellation by R14 and R15. Retain a usable native fallback and explicit
|
cancellation by R14 and R15, including native fallback and explicit record
|
||||||
record selection.
|
selection.
|
||||||
- Stage 8: add the regression coverage assigned above, update affected canonical
|
- Stage 8 includes the regression coverage assigned above and updated canonical
|
||||||
documentation as behavior lands, and run the offline suite and compiled
|
documentation. Final assembly passed `go test ./...`,
|
||||||
facade/dependency checks after assembly. Review local links and prose changes.
|
`go run ./internal/apicheck`, and `git diff --check`; local links and fragment
|
||||||
|
destinations were checked. Validation used Go 1.26.8 with offline dependencies.
|
||||||
|
|
||||||
Preserve earlier completion evidence and distinguish these follow-up corrections
|
Earlier completion evidence and the distinction between original and follow-up
|
||||||
from the original completed implementation. Add completion markers as the new
|
corrections are retained. Each issue has a completion marker. The corrections
|
||||||
issues are addressed. The corrections retain the existing public facade,
|
retain the existing public facade, publication completion point, separate
|
||||||
publication completion point, separate recording failures, and operator-owned
|
recording failures, and operator-owned recovery choices; they introduce no
|
||||||
recovery choices; they introduce no consumer pilot, intermediate release, or
|
consumer pilot, intermediate release, or external review gate.
|
||||||
external review gate.
|
|
||||||
|
|||||||
Reference in New Issue
Block a user