Skip to content

fix(publish): delete an edition from PublishingShell Design (#5083) - #5100

Merged
natechadwick-intsof merged 5 commits into
mainfrom
fix/issue-5083-delete-edition
Oct 3, 2026
Merged

natechadwick-intsof merged 5 commits into
mainfrom
fix/issue-5083-delete-edition

Conversation

@natechadwick-intsof

@natechadwick-intsof natechadwick-intsof commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

PublishingShell Design can delete an idle edition after an explicit confirm. The existing DELETE …/sitemanage/publishingdesign/editions/{editionId} path now requires Admin or Designer (HTTP 403), rejects a blank id (HTTP 400), and refuses an edition that has a running publish job (HTTP 409, Edition is in use). Success closes the editor and removes the row from the open site's edition list. Cancel does not call the server.

Parent tracker: #4531 (slice 63). Out of scope: copy edition, create edition, stopping a running job, delivery-server delete, JSF deletes, and #1371 UAT.

Fixes #5083

Operator: Grok: night-issue-prs (model grok-4.7)

Test plan

  1. H2 QA: Publish → Design → Editions. Create an edition, open it, click Delete, confirm Delete this design object? This cannot be undone. The row disappears.
  2. Repeat and dismiss the confirm dialog. The edition stays on the list and no DELETE is sent.
  3. Stub or provoke HTTP 400, 403, and 409. The message stays in the editor alert and the list row remains.
  4. Unit: PSPublishingDesignRestServiceTest delete cases and PSPublishingRuntimeSupportTest.runningJobId_*; Vitest EditionEditor.delete, DesignSection.deleteEdition, mapEditionDeleteError.

Checklist

  • Product documentation — updated product-docs/8.2/admin/publishing.md (### Delete a publish edition (Design))
  • Unit / module tests — behavioral tests for delete 400/403/404/409 and the confirm/error UI; changed modules green under standalone clean install
  • WebUI + Playwright — modules/perc-qa-automation/frontend/tests/publishing/designEditionDelete.spec.js (3 passed on H2 QA)
  • Build gates — standalone clean install for WebUI, projects/sitemanage, and modules/perc-qa-automation (no skipTests). Rest was reinstalled only to realign the local SNAPSHOT with main; this branch does not change rest sources.
  • Cross-platform — no new filesystem path construction

Build evidence

modules_built: WebUI, projects/sitemanage, modules/perc-qa-automation

  • cd WebUI && rtk mvn clean install — BUILD SUCCESS. Vitest: Test Files 613 passed, Tests 5596 passed. Surefire Tests run: 69, Failures: 0.
  • cd projects/sitemanage && JAVA_HOME=/usr/lib/jvm/java-21-openjdk bash ../../mvnw clean install — BUILD SUCCESS. Tests run: 3236, Failures: 0, Errors: 0, Skipped: 125.
  • cd modules/perc-qa-automation && JAVA_HOME=/usr/lib/jvm/java-21-openjdk bash ../../mvnw clean install — BUILD SUCCESS (npm ci). Surefire: No tests to run (Playwright is the C5 surface run).
  • cd rest && JAVA_HOME=/usr/lib/jvm/java-21-openjdk bash ../mvnw clean install — BUILD SUCCESS. Local m2 realignment only; rest sources are unchanged on this branch.

downstream_checked: none. runningJobId is additive. No type was made final or sealed. No public method signature changed. No extends PSPublishingDesignRestService or extends PSPublishingRuntimeSupport subclasses.

UI proof (C5)

  • python3 docker/scripts/perc-devctl.py qa-up --skip-image-build — RESULT:OK. TEST_CMS_URL=http://127.0.0.1:9993 QA_CMS_HOST_PORT=9993 QA_CONTAINER=perc-matrix-cms-h2. Admin password taken from qa-up stdout (not recorded here).
  • python3 docker/scripts/perc-devctl.py qa-health — RESULT:OK HEALTH:healthy HTTP:200.
  • Copied sitemanage-8.2.0-SNAPSHOT.jar and rest-8.2.0-SNAPSHOT.jar into perc-matrix-cms-h2:/opt/Percussion/jetty/base/webapps/Rhythmyx/WEB-INF/lib/. python3 docker/scripts/perc-devctl.py qa-deploy-webui — RESULT:OK.
  • In-cell /opt/Percussion/jetty/StopJetty.sh then detached StartJetty.sh (not docker restart). Truncated server.log. qa-health again — RESULT:OK HEALTH:healthy.
  • cd modules/perc-qa-automation/frontend && TEST_CMS_URL=http://127.0.0.1:9993 ADMIN_USERNAME=Admin TEST_DB_TYPE=h2 TEST_PRODUCT=cms rtk npm run test:surface -- --path tests/publishing/designEditionDelete.spec.js — 3 passed (4.5s).
  • console-clean=yes (spec asserts no pageerror / console error; HTTP 400/403/409 status text ignored).
  • server.log-clean=yes (no new ERROR/FATAL lines in the test window).

Pre-push local code review

Erlang review — PR #5100

Scope

Independent re-review after 1428cb3d (finished job no longer blocks edition delete). I did not author the change. runningJobId returns 0 when IPSPublisherJobStatus.State.isTerminal(), the same predicate as PSPublishingJob.isFinished(). getEditionJobId is unchanged, so the runtime list can still show a completed job. getPublishingJobStatus throws IllegalStateException for an unknown id, and that path is idle. Any other status-lookup failure stays in use. Tests cover a completed job, a cancelled job, an active WORKING job, an unknown id, a failed lookup, and delete through PSPublishingRuntimeSupport (completed deletes, working is HTTP 409).

Nit, non-blocking: the runningJobId comment says "null is idle". A null edition guid is idle. A null status or null state still returns the job id (treated as in use). The code is the safer behavior.

CLI stdout (mkd-code-review analyze --format markdown)

Summary

Machine analysis found 1 finding(s), 0 bug(s).

Scope

  • Base: origin/main
  • Head: HEAD
  • Files: 13 analyzed
  • In-diff: 0 finding(s); preexisting: 1
  • Persona: erlang 0.1.1
  • Persona source: /home/nate/.local/share/mkd/agents/erlang

Recommendation

approve

Gate

  • Blocking bugs: 0
  • May commit/push: yes

Issues

Issue 1 -- Severity: suggestion

  • File: projects/sitemanage/src/main/java/com/percussion/publishingdesign/impl/PSPublishingRuntimeSupport.java:91 (preexisting)
  • Rule: complexity.cognitive
  • Tool: arborist-metrics
  • Description: Function listRuntimeEditions cognitive=23 (max 15), cyclomatic=12 (max 15)
  • Suggestion: Extract helpers, reduce nesting, use guard clauses (see CODE_STANDARDS).
  • Status: open

Erlang findings (strict gate)

No blocking bugs. The first-pass bug (a finished job still in m_jobs returned HTTP 409 for up to REAP_TIME) is fixed on this head.

Nit: PSPublishingRuntimeSupport.runningJobId javadoc "null is idle" does not match a null job status, which stays in use.

Preexisting suggestion: listRuntimeEditions cognitive complexity. Not introduced by this diff. Does not block.

Recommendation

approve

Gate

  • Blocking bugs: 0
  • May commit/push: yes

Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs-erlang.

Confirm delete of an idle edition and refuse a running job with HTTP 409. Show 400, 403, and 409 in the editor. Slice of #4531.

Fixes #5083

> Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs.
> Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs.
@natechadwick-intsof natechadwick-intsof added operator:grok Changes authored by Grok operator:night-issue-prs night-issue-prs workflow model:grok-4.7 Session model grok-4.7 labels Oct 3, 2026
Request changes: a finished publish job still blocks edition delete for up to an hour.

> Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs-erlang.
@natechadwick-intsof

Copy link
Copy Markdown
Collaborator Author

Independent Erlang review of 3511651dfc (report commit a8c3596754). Request changes. Do not merge.

Bug: PSPublishingDesignRestService.rejectEditionInUse (PSPublishingDesignRestService.java:1393) returns HTTP 409 when runningJobId is > 0. PSPublishingRuntimeSupport.runningJobId (PSPublishingRuntimeSupport.java:145) returns getEditionJobId and does not check isFinished().

PSRxPublisherService.getEditionJobId keeps the latest job id in m_jobs, including finished jobs, until REAP_TIME (one hour after end time). startPublishingJob only treats !job.isFinished() as running. After a publish completes, delete of that idle edition stays 409 "Edition is in use" for up to an hour. The runtime list uses the same id to show status (including Completed); delete must not treat jobId > 0 as still running.

Fix: 409 only when that job exists and !isFinished(). Add a behavioral test where a finished job is still in the map and delete is allowed. Do not change getEditionJobId itself.

Machine mkd-code-review (advisory) reported 0 in-diff bugs and one preexisting complexity suggestion on listRuntimeEditions. That suggestion does not block. The finished-job 409 does.

Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs-erlang.

getEditionJobId keeps completed jobs until reap, so delete returned 409
for up to an hour after a publish finished. runningJobId now treats a
terminal status as idle and still blocks a job that is actually running.

> Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs-erlang-fix.
Finished publish jobs no longer block edition delete. No blocking bugs.

> Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs-erlang.

@natechadwick-intsof natechadwick-intsof left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent re-review of 1428cb3d. LGTM. GitHub rejected a same-login APPROVE (Review Can not approve your own pull request).

runningJobId treats a terminal job status as idle (State.isTerminal(), same predicate as PSPublishingJob.isFinished()). getEditionJobId is unchanged. An unknown job id is idle. Any other status-lookup failure stays in use. Tests cover completed, cancelled, working, unknown, and lookup failure, and delete through the runtime support.

Nit, non-blocking: the javadoc line "null is idle" matches a null edition guid, not a null job status (that path stays in use).

Machine mkd-code-review on this head: 13 files, 0 in-diff bugs, 1 preexisting listRuntimeEditions complexity suggestion. That suggestion does not block.

Report commit: 4cc87bd7.

Co-Authored by Grok Build 1.0.46 using grok-4.7 with agent night-issue-prs-erlang.

@natechadwick-intsof
natechadwick-intsof merged commit 2a470be into main Oct 3, 2026
6 checks passed
@natechadwick-intsof
natechadwick-intsof deleted the fix/issue-5083-delete-edition branch October 3, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

model:grok-4.7 Session model grok-4.7 operator:grok Changes authored by Grok operator:night-issue-prs night-issue-prs workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

issue 4531 slice 63: PublishingShell delete an edition

1 participant