Skip to content

Fix a UI template update on BanyanDB leaving a disabled template disabled - #14133

Merged
wu-sheng merged 2 commits into
masterfrom
fix/banyandb-ui-template-reenable
Oct 14, 2026
Merged

wu-sheng merged 2 commits into
masterfrom
fix/banyandb-ui-template-reenable

Conversation

@wu-sheng

Copy link
Copy Markdown
Member

Fix a UI template update on BanyanDB leaving a disabled template disabled

  • Add a unit test to verify that the fix works. Covered by the ui-management e2e case (BanyanDB) rather than a unit test; see below.
  • Explain briefly why the bug exists and how to fix it.

DashboardSetting.toEntity() sets disabled to false, so an update stores the new configuration as enabled. ElasticSearch (forceUpdate of the whole document) and JDBC (an UPDATE of every column) write it that way. The BanyanDB DAO's changeTemplate applied a patch of only configuration and update_time, so after PUT /ui-management/templates a disabled template stayed disabled.

On ElasticSearch and JDBC, an update is the only way to bring a disabled template back, since addTemplate refuses an existing id. On BanyanDB the same call leaves it disabled, so a client needs a different call for each storage. Horizon UI hit this: reactivating a disabled layer template, or publishing a template over a removed one, did nothing on BanyanDB.

changeTemplate now writes the whole record, as addTemplate does. The partial applyConfiguration is no longer used and is removed.

The ui-management e2e case gains three steps after the disable:

  • update the disabled template;
  • get it, expecting the new configuration with disabled: false;
  • check the default list returns it again.

Run locally on BanyanDB, all 10 steps pass with this change. Against the master image without it (d9e895f560), the case fails at the get step.

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.
  • Update the CHANGES log.

…bled

DashboardSetting.toEntity() sets disabled to false, and the ElasticSearch and
JDBC DAOs write the whole record on an update, so an update enables the
template. The BanyanDB DAO applied a patch of only the configuration and the
update time, so a disabled template stayed disabled. On ElasticSearch and JDBC
an update is the only way to bring a disabled template back, since adding
refuses an existing id.

changeTemplate now writes every tag, as addTemplate does; the partial
applyConfiguration is no longer used and is removed. The ui-management e2e
case updates the template after disabling it, and checks that it is enabled
and listed again.
@wu-sheng
wu-sheng requested a balanced review from Copilot October 13, 2026 15:00
@wu-sheng wu-sheng added this to the 11.1.0 milestone Oct 13, 2026
@wu-sheng wu-sheng added bug Something isn't working and you are sure it's a bug! backend OAP backend related. labels Oct 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

3 open findings
What changed in this PR

Fixes BanyanDB UI template updates so updating a disabled template re-enables it (consistent with Elasticsearch/JDBC behavior), and extends the ui-management e2e case to cover the scenario.

Changes:

  • Update BanyanDB changeTemplate to write the full record (not a partial patch) and remove the unused partial-apply helper.
  • Extend the ui-management e2e scenario with update/get/list steps after disabling a template, plus new expected outputs.
  • Add a changelog entry documenting the bug and fix.
File Description
test/​e2e-v2/​cases/​ui-management/​ui-management-cases.yaml Adds e2e steps verifying “update re-enables disabled template” behavior
test/​e2e-v2/​cases/​ui-management/​expected/​template-reenabled.yml New expected output for re-enabled template after update
test/​e2e-v2/​cases/​ui-management/​expected/​template-list-one.yml New expected output for default list count after re-enable
oap-server/​.../​BanyanDBUITemplateManagementDAO.java Writes full record on update; removes partial configuration patch method
docs/​en/​changes/​changes.md Documents the BanyanDB template-update fix

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/e2e-v2/cases/ui-management/ui-management-cases.yaml
Comment thread docs/en/changes/changes.md
@wu-sheng wu-sheng closed this Oct 13, 2026
@wu-sheng wu-sheng reopened this Oct 13, 2026
wu-sheng added a commit to apache/skywalking-horizon-ui that referenced this pull request Oct 14, 2026
…hem again (#194)

A dashboard template stored on OAP can be written by anything, and one whose
content would break its pages used to render partly, or take down the sidebar
or every dashboard with it. Horizon now checks every stored template when it
reads it -- layer dashboards, overviews, alarm pages, translations, the 3D
map, the theme and the default time window -- and serves an invalid one to
nobody, leaving everything else as it was.

Invalid templates are reported only on the Dashboard setup pages: a red
count on the sidebar row, a banner listing each one with Show problems (the
stored JSON with every problem underlined, beside what is wrong), Download
and Disable, an INVALID chip and an Invalid filter in the pickers. An enabled
invalid template opens no editor and refuses every write until it is
disabled. Import runs the publish checks before staging a file and shows a
refused file's problems on the file itself.

Valid / invalid and enabled / disabled are separate. Every setup page lists
the templates it owns that are disabled on OAP, and Enable turns one back on
with the content it holds; an invalid one comes back invalid. Reactivate on
Layer dashboards does the same, and a deleted overview dashboard, alarm page
or translation can now be brought back. After a Disable or Enable, each page
refreshes everything its own publish refreshes.

OAP's update leaves a disabled record disabled on BanyanDB (fixed upstream in
apache/skywalking#14133), so Horizon writes a record it needs enabled with
update and then create, and waits until OAP reports it enabled.
@wu-sheng
wu-sheng merged commit 2a25e04 into master Oct 14, 2026
471 of 481 checks passed
@wu-sheng
wu-sheng deleted the fix/banyandb-ui-template-reenable branch October 14, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend OAP backend related. bug Something isn't working and you are sure it's a bug!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants