fix(detail): the raw manifest editor showed {} for every app and saved to a dead field - #67
Merged
Merged
Conversation
…d to a dead field
`ApplicationManifestTab.vue` seeded its buffer from
`JSON.stringify(app.manifest || {}, null, 2)`. Under the versioned model
(ADR-002) the manifest lives on the ApplicationVersion, and the Application
record carries no `manifest` key at all — ApplicationsController says so itself:
"reading `applicationArray['manifest']` directly returns null for every app".
So the integrator-facing raw JSON editor displayed `{}` for EVERY application,
and Save then wrote that through `obPatchApp({ manifest })` onto a field nothing
reads back. Empty on read, dead on write.
This is the same root cause as the "Save as template" defect fixed in #63 — the
Application record is not where the manifest lives — now found in a third
consumer. The tab loads and saves through `/api/applications/{slug}/manifest`,
which resolves the active version. Note the endpoint's asymmetry, which the code
comments: GET returns the manifest bare, PUT expects it wrapped in
`{ manifest }`. A failed load falls back to the record and surfaces the error
rather than blanking the editor.
The defect was diagnosed (not fixed) by whoever wrote the skip on
`REQ-OBR-005 — a valid edit is PUT to OR and survives a reload`; that test is
now un-skipped and green. It asserts the editor loads the REAL manifest (the
exact thing that broke), that a valid edit reaches the SERVER, and that it
survives a reload — then restores the fixture.
tests/e2e/application-editor.spec.ts is deleted. It was kept as a signpost to
this REQ-OBR-005 coverage while that coverage was skipped; now that the
replacement runs, the pointer is just a second, dead name for the same scenario.
Verified: 18 passed / 13 skipped across openbuild-runtime, save-as-template and
rbac-403 on the Vue 3 instance.
…est API
The code half of the previous commit (its `git add` aborted on the deleted
pointer file, so only the deletion landed). Repoints ApplicationManifestTab at
GET/PUT /api/applications/{slug}/manifest and un-skips the REQ-OBR-005
persistence test that the defect had blocked.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The defect
ApplicationManifestTab.vueseeded its buffer fromJSON.stringify(app.manifest || {}, null, 2). Under the versioned model (ADR-002) the manifest lives on the ApplicationVersion, and the Application record carries nomanifestkey at all —ApplicationsControllersays so itself: "readingapplicationArray['manifest']directly returns null for every app".So the integrator-facing raw JSON editor displayed
{}for every application, and Save wrote that throughobPatchApp({ manifest })onto a field nothing reads back. Empty on read, dead on write.This is the same root cause as the Save-as-template defect fixed in #63 — the Application record is not where the manifest lives — now found in a third consumer. The tab loads and saves through
/api/applications/{slug}/manifest, which resolves the active version. Note the endpoint asymmetry, which the code comments: GET returns the manifest bare, PUT expects it wrapped in{ manifest }. A failed load falls back to the record and surfaces the error rather than blanking the editor.Credit where due
The defect was diagnosed (not fixed) by whoever wrote the skip on
REQ-OBR-005 — a valid edit is PUT to OR and survives a reload, with the evidence spelled out in the skip body. That test is now un-skipped and green: it asserts the editor loads the real manifest (the exact thing that broke), that a valid edit reaches the server, and that it survives a reload — then restores the fixture.Cleanup
tests/e2e/application-editor.spec.tsis deleted. It was kept as a signpost to this REQ-OBR-005 coverage while that coverage was skipped; now that the replacement runs, the pointer is a second, dead name for the same scenario.Verification
18 passed / 13 skipped across
openbuild-runtime,save-as-templateandrbac-403on the Vue 3 instance. ESLint clean apart from the repo-wide pre-existingn/no-unpublished-import.