Skip to content

fix(publishing): rename one context variable on Design (#5437) - #5447

Merged
natechadwick-intsof merged 2 commits into
mainfrom
fix/issue-5437-context-variable-rename
Oct 9, 2026
Merged

natechadwick-intsof merged 2 commits into
mainfrom
fix/issue-5437-context-variable-rename

Conversation

@natechadwick-intsof

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

Copy link
Copy Markdown
Collaborator

Summary

Publishing Design can rename one context variable. PUT /sites/{siteId}/properties with renameName: true, name set to the stored name, and newName set to the new name keeps the stored value and leaves every other variable on that context in place. Blank, duplicate, and overlong names do not write. Cancel does not write. HTTP 400, 403, and 409 keep the old name. Combining renameName with updateValue returns HTTP 400 (CONTEXT_VARIABLE_RENAME_NOT_WITH_VALUE) and writes nothing.

A same trimmed name is not a duplicate and does not save. On a concrete PSSite the rename is in place, so the property id and value stay. This is slice 103 of parent #4531.

Fixes #5437

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

Test plan

  1. Open Publishing Design for a site that has at least two context variables on one context.
  2. Choose Rename on one variable, enter a new unique name of at most 50 characters, and save. The value stays. The other variables on that context stay. Reload and confirm the new name.
  3. Start a rename and choose Cancel. The old name stays and nothing is written.
  4. Try a blank name, a name longer than 50 characters, and a name that matches another variable on that context. None of those write.
  5. Confirm HTTP 400 (rename combined with a value change), 403, and 409 leave the old name on screen.
  6. Automated: sitemanage PSPublishingDesignRestServiceTest rename cases; WebUI Vitest contextVariableRename.test.ts, SiteDesignPanel.contextVariableRename.test.tsx, and the rename case in siteProperty.api.test.ts.
  7. H2 Playwright from modules/perc-qa-automation/frontend: npm run test:surface -- --path tests/publishing/designContextVariableRename.spec.js — 2 passed. console-clean=yes. server.log-clean=yes.

Checklist

  • Product documentation — updated product-docs/8.2/admin/publishing.md (section "Rename one context variable (Design)")
  • Unit / module tests — behavioral tests for rename validation, persistence, and the Design panel; sitemanage and WebUI standalone clean install green
  • WebUI + Playwright — modules/perc-qa-automation/frontend/tests/publishing/designContextVariableRename.spec.js (2 passed on H2 QA)
  • Build gates — sitemanage and WebUI standalone clean install; no final/sealed/signature change, so no reverse-dep install
  • Cross-platform — no new filesystem path construction

Pre-push local code review

# Erlang review — PR #5447

## Scope

- Persona: erlang 0.1.1
- Persona source: /home/nate/.local/share/mkd/agents/erlang
- Status: mkd-code-review 0.1.18, pack percussion, --gate advisory, --git-base origin/main
- PR: https://github.com/intersoftdatalabs-in/percussioncms/pull/5447
- Base: origin/main
- Head: 5ab6b91e835dc7ccbd0b1ae6abf1675ca5d88ee5
- Files analyzed: 12
- Reviewer: independent Erlang (did not author the PR)

## Independent reading

`renameContextVariable` renames one listed variable. A blank name, a blank new name, a blank context, or a name longer than 50 characters is HTTP 400 and does not save. A missing stored name, or a new name that matches a different variable on that context, is HTTP 409 and does not save. The same trimmed name does not save. `renameName` combined with `updateValue` is HTTP 400 and writes neither. A value sent with the rename is ignored. On `PSSite`, the same `PSSiteProperty` is removed, renamed, and put back so the property id and value stay. A variable with the same name on another context stays. The client omits `value`, does not PUT a blank, duplicate, or overlong name, and on 400, 403, or 409 leaves the old name. Cancel does not call the server. Vitest, the service tests (including property id and the other context), Playwright, and `product-docs/8.2/admin/publishing.md` are present. No filesystem path joins. No rule files.

`renameContextVariable` cognitive complexity is a suggestion at the ceiling. `associateContentList` is the following method; its body is not the rename. That complexity row is a suggestion, not a bug. The LLM stage failed open (Ollama CUDA out of memory). Neither blocks.

Recommendation: approve. May merge: yes.

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

## Summary

Machine analysis found **3** finding(s), **0** bug(s).

## Scope

- Base: origin/main
- Head: HEAD
- Files: 12 analyzed
- In-diff: 2 finding(s); preexisting: 0
- 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/PSPublishingDesignRestService.java:1146 (in-diff)
- Rule: `complexity.cognitive`
- Tool: `arborist-metrics`
- Description: Function `renameContextVariable` cognitive=15 (max 15), cyclomatic=16 (max 15)
- Suggestion: Extract helpers, reduce nesting, use guard clauses (see CODE_STANDARDS).
- Status: open

### Issue 2 -- Severity: suggestion

- File: projects/sitemanage/src/main/java/com/percussion/publishingdesign/impl/PSPublishingDesignRestService.java:1263 (in-diff)
- Rule: `complexity.cognitive`
- Tool: `arborist-metrics`
- Description: Function `associateContentList` cognitive=16 (max 15), cyclomatic=15 (max 15)
- Suggestion: Extract helpers, reduce nesting, use guard clauses (see CODE_STANDARDS).
- Status: open

### Issue 3 -- Severity: suggestion

- File: review
- Rule: `llm.error`
- Tool: `llm`
- Description: model `ollama-dev-coder` failed: http: status 500 Internal Server Error body {"error":{"message":"llama-server process has terminated: exit status 1: cudaMalloc failed: out of memory\nalloc_tensor_range: failed to allocate CUDA0 buffer of size 5064192000\nerror loading model: unable to allocate CUDA0 buffer","type":"api_error","param":null,"code":null}}

- Status: open

Build evidence

modules_built: projects/sitemanage, WebUI

downstream_checked: none (new DTO fields and getters only; no type made final or sealed and no public or protected signature change)

C1

cd projects/sitemanage
JAVA_HOME=/usr/lib/jvm/java-21-openjdk rtk mvn clean install
Tests run: 3852, Failures: 0, Errors: 0, Skipped: 125
BUILD SUCCESS
Finished 2026-10-08T23:34:39-04:00
cd WebUI
JAVA_HOME=/usr/lib/jvm/java-21-openjdk rtk mvn clean install
Java Tests run: 69, Failures: 0
Vitest: Test Files 752 passed, Tests 7288 passed
BUILD SUCCESS

C5 UI proof

python3 docker/scripts/perc-devctl.py qa-up
TEST_CMS_URL=http://127.0.0.1:9993
TEST_DB_TYPE=h2
TEST_PRODUCT=cms
ADMIN_USERNAME=Admin
python3 docker/scripts/perc-devctl.py qa-health
python3 docker/scripts/perc-devctl.py qa-deploy-war-jars --restart-jetty
python3 docker/scripts/perc-devctl.py qa-health

qa-health returned HTTP 200 and healthy after the in-cell Jetty restart (StopJetty/StartJetty). Server started 2026-10-09 03:35:53. The cell was not docker-restarted.

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/designContextVariableRename.spec.js
2 passed (chromium, 4.3s)
console-clean=yes
server.log-clean=yes (no ERROR or FATAL at or after 2026-10-09 03:36)

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-erlang.

Operators rename one publishing context variable from Design. The stored
value and the other variables on that context stay. Blank, duplicate, and
overlong names do not write, and cancel or HTTP 400/403/409 keeps the old name.

> 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 9, 2026
Record the pre-merge mkd-code-review of the context-variable rename.
In-diff findings are complexity suggestions. No blocking bugs.

> 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

LGTM. Independent Erlang review (persona erlang 0.1.1, mkd-code-review 0.1.18, pack percussion, gate advisory, base origin/main). Same-login APPROVE is rejected by GitHub, so this comment is the review. In-diff findings are complexity suggestions. Preexisting rows do not block. Ollama dev-coder failed open (CUDA out of memory). No blocking bugs. May merge: yes.

Report: docs/ai-generated/code-reviews/pr-5447-erlang.md

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

@natechadwick-intsof
natechadwick-intsof merged commit 7ec1b2d into main Oct 9, 2026
8 checks passed
@natechadwick-intsof
natechadwick-intsof deleted the fix/issue-5437-context-variable-rename branch October 9, 2026 03:59
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 103: PublishingShell rename one context variable

1 participant