Skip to content

fix(reporter): accept the IDP_* declaration keys in the configmap schema - #2544

Open
qnen wants to merge 1 commit into
mainfrom
fix/reporter-idp-schema
Open

qnen wants to merge 1 commit into
mainfrom
fix/reporter-idp-schema

Conversation

@qnen

@qnen qnen commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Pull Request Type

  • Reporter

Problema

O values.schema.json do reporter (4.x) restringe manager.configmap, worker.configmap e common.configmap à allowlist de config/schema-keys.txt (mais a família aberta DATASOURCE_*). IDP_DECLARATION_ENABLED e IDP_HOST, as envs que o declaration.WireFromEnv do lib-auth lê para publicar o manifesto de permissões, não estão na lista. Com elas em manager.configmap, o render falha:

- manager.configmap: Property name of "IDP_DECLARATION_ENABLED" does not match
- manager.configmap: Must validate at least one schema (anyOf)

É o que quebra hoje o render do reporter nos dev-st do PR do gitops lerian-internal-gitops#3458 (chart 4.3.13-alpha, mesmo schema).

O que muda

  • config/schema-keys.txt: + IDP_DECLARATION_ENABLED, IDP_HOST.
  • values.schema.json: as duas chaves nos três enums gerados (manager, worker, common compartilham a lista; fica igual ao que o gerador produz).
  • values.yaml: documenta as chaves em manager.configmap e onde vai o par de credenciais (secrets.IDP_M2M_*).

Nenhuma mudança de template: o ConfigMap do manager já faz range em manager.configmap, então as chaves chegam ao pod.

Compatibilidade

Aditivo: o schema só passa a aceitar duas chaves a mais. Release esperado: patch.

Não depende do PR do lerian-common (#2543). A adoção do helper lerian-common.idp.* (que também tira o par IDP_M2M_* do Secret do worker) vem num PR separado, em draft até o lerian-common 2.4.0 sair.

Teste local (helm v3.16.4)

Values Antes Depois
benedita dev-st do #3458 rc=1 (erro de schema acima) rc=0; ConfigMap do manager com IDP_DECLARATION_ENABLED/IDP_HOST; par no Secret
anacleto chaos dev-st do #3458 rc=1 rc=0; ConfigMap com as duas chaves
  • helm lint: 0 falhas.
  • python3 tests/test_crm_config.py: passa.

🤖 Generated with Claude Code

values.schema.json restricts every configmap to the allowlist in
config/schema-keys.txt (plus the open DATASOURCE_ family). Neither
IDP_DECLARATION_ENABLED nor IDP_HOST is on it, so setting them in
manager.configmap - the keys lib-auth's declaration.WireFromEnv reads
to publish the permission manifest - fails the render with
"manager.configmap: Property name of IDP_DECLARATION_ENABLED does not
match".

Add both keys to the allowlist and to the three generated enums
(manager, worker and common, which share the list), and document them
under manager.configmap. The manager ConfigMap already ranges over
manager.configmap, so the keys reach the pod with no template change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@qnen
qnen requested a review from a team October 16, 2026 20:13
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: c2d9e240-b2fc-4204-b436-88c9f626fa25
📥 Commits

Reviewing files that changed from the base of the PR and between e5abd5b and f45e038.

📒 Files selected for processing: 3
  • charts/reporter/config/schema-keys.txt
  • charts/reporter/values.schema.json
  • charts/reporter/values.yaml

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

📝 Walkthrough

The reporter chart now allows IDP_DECLARATION_ENABLED and IDP_HOST in its rendered configuration keys and configmap schemas. Its values file includes commented guidance for manager permission declaration settings. No configuration values were activated.

Changes: Reporter IDP configuration

Layer / File(s) Summary
Allowlist and document IDP settings
charts/reporter/config/schema-keys.txt, charts/reporter/values.schema.json, charts/reporter/values.yaml
The rendered-key list and manager, worker, and shared configmap schemas allowlist IDP_DECLARATION_ENABLED and IDP_HOST. The values file adds commented guidance for the manager’s Access Manager permission declaration, including the enable flag, required host and client credentials, and an example host.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to f45e0

This additive change lets operators set the IDP declaration keys in the reporter chart configuration without schema rejection. Nothing is activated by default, so the merge risk is minimal.

✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@lerian-studio-midaz-push-bot

Copy link
Copy Markdown
Contributor

Chart image references

Every image referenced by 1 chart(s) in this pull request exists in its registry.

chart verified verdict
reporter 11 all present
Every reference checked

reporter

  • ✅ busybox:latest
  • ✅ busybox:1.37
  • ✅ chrislusf/seaweedfs:3.93
  • ✅ curlimages/curl:8.7.1
  • ✅ bitnamisecure/mongodb:latest
  • ✅ valkey/valkey:8.1.3
  • ✅ ghcr.io/kedacore/keda-admission-webhooks:2.17.1
  • ✅ ghcr.io/kedacore/keda-metrics-apiserver:2.17.1
  • ✅ ghcr.io/kedacore/keda:2.17.1
  • ✅ ghcr.io/lerianstudio/reporter-manager:4.5.0
  • ✅ ghcr.io/lerianstudio/reporter-worker:4.5.0

🖼️ View full logs

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant