Skip to content

refactor: rename the erag layer to chatbot - #240

Merged
mik-now merged 1 commit into
intel:release-3.1from
mik-now:mikolajn/refactor/layer-chatbot
Dec 2, 2026
Merged

mik-now merged 1 commit into
intel:release-3.1from
mik-now:mikolajn/refactor/layer-chatbot

Conversation

@mik-now

@mik-now mik-now commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Renames the erag layer to chatbot: the install target (install chatbot), config.chatbot.yaml, the layer in components/version/backup profile, the toolkit-manager.intel.com/layer label and the check ids (chatbot/configuration, chatbot/data_consistency, ...). Docs and tests follow.

Clean rename, no alias. Upgrades start from 3.1.0, the first release with the chatbot layer, so the keycloak-rename check (it only refused records older than 3.1.0) is removed. An erag install needs a fresh reinstall; docs/deployment/install-rag.md has the steps.

Companion PR: intel/toolkit-manager#201

Tests: pytest src/tests/unit/scripts (74 passed). Not run on a cluster yet.

@sys-aibot

sys-aibot commented Dec 1, 2026 •

Copy link
Copy Markdown

Claude finished @mik-now's task in 57s —— View job


Verdict: needs changes

Correctness

  1. deployment/upgrade_checks/keycloak_rename.yaml:13: the keycloak-rename gate no longer fires on the clusters it exists for. _recorded comes from _layer_records[upgrade_check_layer], and upgrade_check_layer is now chatbot. Every pre-3.1.0 cluster was recorded under erag (the PR body says those clusters keep their old erag-deployment-manifest record). So _recorded is '', and the check returns pass with the message "no record from before the Chatbot Toolkit rename".

    • Failure scenario: a 3.0.x cluster runs install chatbot. The gate passes, and the install creates an empty ChatbotToolkit realm next to EnterpriseRAG. That is exactly what docs/deployment/install-rag.md ("Upgrade from a release before the Chatbot Toolkit rename") says is refused.
    • The 3.0.x stack also stays in place under erag labels. The new chatbot layer then installs its own release names and namespaces on top of it.
    • Fix: also read the legacy record, for example _layer_records[upgrade_check_layer] | default(_layer_records.erag | default({})). Alternatively, refuse outright when an erag record exists. The block message should then say to tear down with the previous release.
      Fix this →
  2. src/tests/unit/scripts/test_keycloak_rename_check.py:221: the blocking test now uses a fixture that can't occur in practice. It feeds {"chatbot": {"version": "3.0.0", ...}}, but no release before 3.1.0 ever wrote a chatbot record. So the test passes while the real case (an erag record) slips through, as described in finding 1. Add a case with an erag record (rule 5: changed behavior needs a test).

  3. docs/deployment/install-rag.md:1259: the teardown command for the previous release is wrong. Step 1 says "Tear down with the previous release: ./es_auto_installer.sh teardown chatbot". The previous release has no chatbot target, so this command fails or does nothing. This line must stay teardown erag.

  4. deployment/backup_profile.yaml:91 and deployment/scripts/query_deployment_manifest.sh:8: objects still labelled layer: erag are now silently skipped.

    • The backup selector matches layer: chatbot or no layer label. Anything labelled erag on an existing cluster is left out of backups without any warning.
    • query_deployment_manifest.sh returns nothing for a cluster installed as erag.
    • If "no alias" is intended, the gate from finding 1 must stop such clusters before they reach these paths. Otherwise add erag to the backup matchLabels alternatives.

Integrity / readability

  1. deployment/roles/app_pre_install/tasks/version_change.yaml:9-26: half-renamed. Task names and lookups now say chatbot, but the facts are still erag_run_class, erag_record, erag_version_change, erag_pending_pre_snapshot and erag_pre_snapshot_reused. deployment/roles/app_post_install/tasks/data_consistency.yaml:15,37,71,105,107 consumes them under the same names. Rename them all (e.g. chatbot_*), or keep every name in the file as erag. Mixing the two is confusing.

  2. src/tests/e2e/lifecycle/test_uninstall.py:2120-2122 and scenarios.yaml:2030: leftover erag names in the uninstall test. The test is still called test_uninstall_erag, and its docstring still says "the erag application layer" next to teardown chatbot. Rename it to test_uninstall_chatbot and update the scenarios.yaml reference.

  3. Docs: no migration note for existing users. The PR body says existing envs need init chatbot, and that clusters installed as erag keep their old record and labels. No doc tells users this. Someone with env/<name>/config.erag.yaml who runs install chatbot won't know their config is no longer read. Add a short "Upgrading from the erag target" note in docs/deployment/install-rag.md, beside the existing rename section.

@mik-now
mik-now force-pushed the mikolajn/refactor/layer-chatbot branch from 1e9ca30 to 9712635 Compare December 1, 2026 19:02
@sys-aibot

sys-aibot commented Dec 1, 2026 •

Copy link
Copy Markdown

Claude finished @mik-now's task in 59s —— View job


Verdict: needs changes

The new commit fixes most of the previous round. former_names: [erag] hands the refusal of pre-rename clusters to Toolkit Manager. The erag_* facts are now chatbot_*, test_uninstall_chatbot is renamed, the teardown command is back to teardown erag, and there is a migration note. What's left:

Correctness / minimal code

  1. deployment/upgrade_checks/keycloak_rename.yaml:13: no real cluster can reach the blocking branch any more.

    • _recorded reads _layer_records[upgrade_check_layer], which is now chatbot.
    • Every release before 3.1.0 wrote an erag record. Per deployment/components.yaml:24-25, Toolkit Manager now refuses those clusters itself (former-name).
    • No chatbot record with a version below 3.1.0.dev0 can exist, so this check always returns pass. That is code for a case that can't happen (rule 1).
    • Two ways to fix it:
      • Drop the check and its tests, and point deployment/version.yaml:5 and the docs at former-name.
      • Or keep it on purpose as a second gate and make it read _layer_records.erag too, so it guards something real.
    • Which one is right depends on whether rebranding: rename the erag layer to chatbot toolkit-manager#201 runs layer checks for a cluster that former-name already refused. I can't check that from this repo.
      Fix this →
  2. src/tests/unit/scripts/test_keycloak_rename_check.py:305: the blocking test still uses a record that can't occur. It passes {"chatbot": {"version": "3.0.0", ...}}, but no release before 3.1.0 ever wrote a chatbot record. The test passes without covering a real path. It goes away with finding 1, either by deleting the check or by switching the fixture to an erag record.

  3. deployment/version.yaml:5: the comment now credits the wrong check. It says keycloak_rename.yaml refuses an upgrade from a release before 3.1.0. On a real cluster that refusal now comes from Toolkit Manager's former-name check. Update the comment along with finding 1.

Docs

  1. docs/deployment/install-rag.md:1335-1338: the migration steps run init chatbot after the user's config is already in place.
    • Step 1 of the same doc says init "Seeds env/<name>/config.chatbot.yaml from the flavour's defaults". If it overwrites an existing file, the user's moved config and the keys they just renamed are lost.
    • Running init chatbot first and the mv last works whatever init does with an existing file.
    • The prose also says to move the env and then rename keys in config.chatbot.yaml, but the code block comes after that sentence. Putting the commands before the key-rename instruction would read in the order they run.

@mik-now
mik-now force-pushed the mikolajn/refactor/layer-chatbot branch from 9712635 to 3e872b5 Compare December 2, 2026 02:11
@sys-aibot

sys-aibot commented Dec 2, 2026 •

Copy link
Copy Markdown

Claude finished @mik-now's task in 46s —— View job


Verdict: needs changes

This push brings back the original single commit, and several fixes from the last round are gone. deployment/components.yaml has no former_names: [erag]. The rename-section teardown command says chatbot again. There is no migration note. The version_change.yaml / data_consistency.yaml facts and test_uninstall_chatbot are fully renamed, so those earlier findings stay fixed.

Correctness

  1. deployment/upgrade_checks/keycloak_rename.yaml:13: clusters from before the rename get through the gate.

    • _recorded reads _layer_records[upgrade_check_layer], which is now chatbot. Every release before 3.1.0 recorded under erag, so _recorded is '' and the check returns pass.
    • Nothing else refuses these clusters: components.yaml:116-119 declares chatbot with no former_names.
    • Failure scenario: a 3.0.x cluster runs install chatbot. The gate passes, and the install creates an empty ChatbotToolkit realm next to EnterpriseRAG. The chatbot releases also go on top of the 3.0.x stack, which is still labelled erag. docs/deployment/install-rag.md says this upgrade is refused.
    • Fix: restore former_names: [erag] in components.yaml so Toolkit Manager refuses these clusters, as in the previous revision. Or make _recorded fall back to _layer_records.erag.
      Fix this →
  2. src/tests/unit/scripts/test_keycloak_rename_check.py:296: the blocking test uses a record that never exists in practice. It feeds {"chatbot": {"version": "3.0.0", ...}}, but no release before 3.1.0 wrote a chatbot record. The test passes while the real case, an erag record, gets through (finding 1). Add a parametrized case with an erag record that expects blocking. Changed behavior needs a test (rule 5).

  3. docs/deployment/install-rag.md:1330 (diff line), step 1 of "Upgrade from a release before the Chatbot Toolkit rename": the teardown command is wrong. It says to tear down with the previous release using ./es_auto_installer.sh teardown chatbot. The previous release has no chatbot target, so this command fails. It must stay teardown erag.

  4. deployment/backup_profile.yaml:91 and deployment/scripts/query_deployment_manifest.sh:8: objects labelled layer: erag are now silently left out.

    • The backup selector matches layer: chatbot or no layer label, so erag-labelled objects on an existing cluster are skipped without a warning.
    • The manifest query returns nothing for a cluster installed as erag.
    • "No alias" works only if finding 1 stops these clusters before they reach these paths. Fix finding 1 and leave these as they are, or add erag to the backup selector.

Docs

  1. docs/deployment/install-rag.md: nothing tells existing users how to move from the erag target. The PR body says existing envs need init chatbot, but no doc says so. Someone with env/<name>/config.erag.yaml who runs install chatbot won't know the file is no longer read. Step 2 of the rename section also points at config.chatbot.yaml, which these users don't have yet.

    • Add a short note next to the rename section. Its order: init chatbot first, then move the old config.erag.yaml over the seeded file, then rename the keys.
    • In that order, init can't overwrite the user's moved config.
  2. deployment/version.yaml:5: this comment depends on finding 1. It says keycloak_rename.yaml refuses an upgrade from a release before 3.1.0. If the refusal moves to Toolkit Manager's former_names, update the comment to match.

@mik-now
mik-now force-pushed the mikolajn/refactor/layer-chatbot branch from 3e872b5 to f8bf98b Compare December 2, 2026 06:45
@sys-aibot

sys-aibot commented Dec 2, 2026 •

Copy link
Copy Markdown

Claude finished @mik-now's task in 37s —— View job


Verdict: needs changes

This revision fixes the docs from last round. Step 1 of the rename section says teardown erag again. Step 2 is now the migration note: run init chatbot first, move the settings over, then clean up config.erag.yaml and .solutions.yaml. The chatbot_* facts and test_uninstall_chatbot are still fully renamed. Nothing on a real cluster refuses a pre-rename install yet.

Correctness

  1. deployment/upgrade_checks/keycloak_rename.yaml:13: the gate never blocks a real cluster, and nothing else does either.

    • _recorded reads _layer_records[upgrade_check_layer], which is now chatbot.
    • Every release before 3.1.0 recorded under erag, so _recorded is '' and the check returns pass.
    • deployment/components.yaml:116-119 declares chatbot with no former_names: [erag], so Toolkit Manager doesn't refuse these clusters either.
    • The docs (install-rag.md:1338) no longer say the installer refuses. But the user is the only safeguard now: skip step 1 and nothing stops them.
    • Failure scenario: a 3.0.x cluster runs install chatbot without tearing down first. The install creates an empty ChatbotToolkit realm next to EnterpriseRAG. It also puts the chatbot releases on top of the 3.0.x stack, which is still labelled erag.
    • Fix: restore former_names: [erag], or make _recorded fall back to _layer_records.erag. If you restore former_names, the check has no case left it can block. Delete it and its tests (rule 1).
      Fix this →
  2. src/tests/unit/scripts/test_keycloak_rename_check.py:69: the blocking test uses a record that can't exist. It feeds {"chatbot": {"version": "3.0.0", ...}}, but no release before 3.1.0 ever wrote a chatbot record. The test passes even though the real case, an erag record, gets through (finding 1). Add a case with an erag record that expects blocking, or drop the test along with the check.

  3. deployment/upgrade_checks/keycloak_rename.yaml:18: the resolve text now says "tear chatbot down with the release that installed it". That release has no chatbot target. If you keep the check, the text must name erag (as install-rag.md:1340 does).

  4. deployment/backup_profile.yaml:91 and deployment/scripts/query_deployment_manifest.sh:8: objects labelled layer: erag are skipped without a warning. The backup selector now matches only layer: chatbot or no layer label. The manifest query returns nothing for an erag install. That's fine only if finding 1 stops such clusters before they reach these paths. Fix finding 1, or add erag to the backup selector.

Comments

  1. deployment/version.yaml:5-6 and deployment/upgrade_checks/keycloak_rename.yaml:4-8: the comments say this check refuses an upgrade from before 3.1.0. After this rename it refuses nothing. Update the comments to match whichever fix you pick for finding 1.

@mik-now
mik-now force-pushed the mikolajn/refactor/layer-chatbot branch from f8bf98b to 3055a85 Compare December 2, 2026 06:50
@sys-aibot

sys-aibot commented Dec 2, 2026 •

Copy link
Copy Markdown

Claude finished @mik-now's task in 46s —— View job


Verdict: needs changes

This revision deletes keycloak_rename.yaml and its test, and rewrites the comments and docs to match (version.yaml:5-6, install-rag.md rename section, backup-and-restore.md). Nothing references the deleted check any more. That closes earlier findings 2, 3 and 5. One gap from the last rounds is still open, and the deletion makes it wider.

Correctness

  1. deployment/components.yaml:117-120: nothing refuses an install over a cluster from before the rename.

    • The check that was meant to refuse it is gone.
    • The chatbot layer still declares no former_names: [erag]. Toolkit Manager therefore has no way to tell that the erag-deployment-manifest record on the cluster belongs to this layer.
    • The docs now say only that such an install "needs a fresh reinstall" (install-rag.md:1358, backup-and-restore.md:1256). The user's own discipline is the only safeguard.
    • Failure scenario: on a 3.0.x cluster, a user skips step 1 (teardown with the previous release). They do step 2 (init chatbot, drop erag from .solutions.yaml) and run install chatbot. Nothing stops the run:
      • It creates an empty ChatbotToolkit realm next to EnterpriseRAG.
      • The chatbot releases go on top of the 3.0.x stack, which is still labelled erag.
      • The old stack can't be reached by teardown chatbot or by backup (see finding 2). The new release's teardown can't remove it either.
    • Fix: restore former_names: [erag] on the chatbot layer. An earlier revision of this PR had it, so rebranding: rename the erag layer to chatbot toolkit-manager#201 supports it. Then Toolkit Manager refuses these clusters, and deleting the in-layer check is the right call (rule 1).
    • Once that's back, the docs can say the installer refuses such an upgrade again, citing Toolkit Manager's former-name check.
      Fix this →
  2. deployment/backup_profile.yaml:91 and deployment/scripts/query_deployment_manifest.sh:8: objects labelled layer: erag are skipped without a warning.

    • The backup selector matches only layer: chatbot or no layer label.
    • The manifest query returns nothing for an erag install.
    • Both are fine once finding 1 is fixed, because such clusters never get this far. Without that fix, they're reachable by the failure scenario above.

Hard rename, no compatibility for existing envs or clusters: init/install
target, config.chatbot.yaml, components/version/backup profile layer, the
toolkit-manager.intel.com/layer label, check ids, facts and tests. Upgrades
start from 3.1.0, so the keycloak-rename gate for older records goes; an erag
install needs a fresh reinstall (docs/deployment/install-rag.md).

Signed-off-by: Nowicki, Mikolaj <mikolaj.nowicki@intel.com>
@mik-now
mik-now merged commit f32cdca into intel:release-3.1 Dec 2, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants