Skip to content

[MOSIP-37808] Updated DB attributes of MOSIP .#135

Merged
ckm007 merged 4 commits into
mosip:developfrom
abhishek8shankar:MOSIP-37808
May 20, 2026
Merged

[MOSIP-37808] Updated DB attributes of MOSIP .#135
ckm007 merged 4 commits into
mosip:developfrom
abhishek8shankar:MOSIP-37808

Conversation

@abhishek8shankar

@abhishek8shankar abhishek8shankar commented May 18, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Per-database initialization now supports richer, explicit configuration (scripts dir, DB user/name, default DB) and per-database ENV_VERSION_FLAG for one service.
    • Chart now renders init jobs/config for enabled databases from a single unified template.
  • Improvements

    • DB setup uses a bandwidth-efficient Git sparse checkout.
    • Init container image includes build metadata, slimmer runtime deps, and exposes DB_SCRIPTS_DIR/DB_UNAME envs.

Review Change Stack

Signed-off-by: Abhi <abhishek.shankarcs@gmail.com>
@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 33f0130f-81d7-4f18-88fb-f140dfd97595

📥 Commits

Reviewing files that changed from the base of the PR and between 35efe7f and 922097b.

📒 Files selected for processing (2)
  • deploy/postgres-init-values.yaml
  • helm/postgres-init/values.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • helm/postgres-init/values.yaml

Walkthrough

Consolidates per-database Helm templates into parameterized env-configmap.yaml and job.yaml, extends per-database configuration fields in both deploy and Helm values, and updates the Dockerfile and postgres-init.sh to use sparse Git checkouts and new env vars.

Changes

Helm template consolidation and parameterized database initialization

Layer / File(s) Summary
Helm template consolidation: from per-database to parameterized templates
helm/postgres-init/templates/env-configmap.yaml, helm/postgres-init/templates/job.yaml, helm/postgres-init/templates/*-env-configmap.yaml, helm/postgres-init/templates/*-job.yaml
New env-configmap.yaml and job.yaml iterate over .Values.databases to generate ConfigMaps and Jobs for each enabled database; many database-specific template blocks were removed.
Configuration schema extensions: per-database parameters
deploy/postgres-init-values.yaml, helm/postgres-init/values.yaml
Add scriptsDir, dbName, dbUser, and defaultDb defaults to database entries in both values files, introduce ENV_VERSION_FLAG for mosip_pms, update some branch values, and add new inji_* database entries.
Container image and initialization script improvements
postgres-init/Dockerfile, postgres-init/postgres-init.sh
Add build metadata labels and new env vars (DB_SCRIPTS_DIR, DB_UNAME), consolidate package installation, switch ADDCOPY, and refactor the init script to perform a sparse git clone/checkout and run deploy from db_scripts/$DB_SCRIPTS_DIR.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped through templates, tidy and spry,
Merged many files with a single try.
Sparse-checkout fetched just the scripts we need,
Now jobs and maps form from one seeded seed.
A carrot for reviewers — efficient and spry!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Updated DB attributes of MOSIP .' is vague and incomplete, using generic phrasing without clearly identifying the specific main change (e.g., which attributes, what the update accomplishes). Revise the title to be more specific and descriptive, such as 'Consolidate per-database initialization templates into generic configmap and job templates' or 'Refactor Helm templates for database initialization to support dynamic per-database configuration'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@helm/postgres-init/templates/env-configmap.yaml`:
- Around line 30-31: The template currently omits ENV_VERSION_FLAG when its
value is false because it uses a truthy check; change the conditional to check
for presence/definedness instead of truthiness so false is rendered (e.g.,
replace the truthy guard with a nil-check such as testing eq
$dbVal.ENV_VERSION_FLAG nil or using not eq nil) and keep the existing rendering
line ENV_VERSION_FLAG: {{ $dbVal.ENV_VERSION_FLAG | quote }} so the key is
emitted when explicitly set to false but still omitted when truly undefined.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0174c85e-44f3-4da0-8183-82d61efbce6a

📥 Commits

Reviewing files that changed from the base of the PR and between 682bbe2 and 1e6adf8.

📒 Files selected for processing (48)
  • deploy/postgres-init-values.yaml
  • helm/postgres-init/templates/audit-env-configmap.yaml
  • helm/postgres-init/templates/audit-job.yaml
  • helm/postgres-init/templates/credential-env-configmap.yaml
  • helm/postgres-init/templates/credential-job.yaml
  • helm/postgres-init/templates/digitalcard-env-configmap.yaml
  • helm/postgres-init/templates/digitalcard-job.yaml
  • helm/postgres-init/templates/env-configmap.yaml
  • helm/postgres-init/templates/esignet-env-configmap.yaml
  • helm/postgres-init/templates/esignet-job.yaml
  • helm/postgres-init/templates/hotlist-env-configmap.yaml
  • helm/postgres-init/templates/hotlist-job.yaml
  • helm/postgres-init/templates/ida-env-configmap.yaml
  • helm/postgres-init/templates/ida-job.yaml
  • helm/postgres-init/templates/idmap-env-configmap.yaml
  • helm/postgres-init/templates/idmap-job.yaml
  • helm/postgres-init/templates/idrepo-env-configmap.yaml
  • helm/postgres-init/templates/idrepo-job.yaml
  • helm/postgres-init/templates/inji-certify-env-configmap.yaml
  • helm/postgres-init/templates/inji-certify-job.yaml
  • helm/postgres-init/templates/inji-mimoto-env-configmap.yaml
  • helm/postgres-init/templates/inji-mimoto-job.yaml
  • helm/postgres-init/templates/inji-verify-env-configmap.yaml
  • helm/postgres-init/templates/inji-verify-job.yaml
  • helm/postgres-init/templates/job.yaml
  • helm/postgres-init/templates/kernel-env-configmap.yaml
  • helm/postgres-init/templates/kernel-job.yaml
  • helm/postgres-init/templates/keymgr-env-configmap.yaml
  • helm/postgres-init/templates/keymgr-job.yaml
  • helm/postgres-init/templates/master-env-configmap.yaml
  • helm/postgres-init/templates/master-job.yaml
  • helm/postgres-init/templates/mockidentitysystem-env-configmap.yaml
  • helm/postgres-init/templates/mockidentitysystem-job.yaml
  • helm/postgres-init/templates/otp-env-configmap.yaml
  • helm/postgres-init/templates/otp-job.yaml
  • helm/postgres-init/templates/pms-env-configmap.yaml
  • helm/postgres-init/templates/pms-job.yaml
  • helm/postgres-init/templates/prereg-env-configmap.yaml
  • helm/postgres-init/templates/prereg-job.yaml
  • helm/postgres-init/templates/regprc-env-configmap.yaml
  • helm/postgres-init/templates/regprc-job.yaml
  • helm/postgres-init/templates/resident-env-configmap.yaml
  • helm/postgres-init/templates/resident-job.yaml
  • helm/postgres-init/templates/toolkit-env-configmap.yaml
  • helm/postgres-init/templates/toolkit-job.yaml
  • helm/postgres-init/values.yaml
  • postgres-init/Dockerfile
  • postgres-init/postgres-init.sh
💤 Files with no reviewable changes (42)
  • helm/postgres-init/templates/prereg-env-configmap.yaml
  • helm/postgres-init/templates/digitalcard-env-configmap.yaml
  • helm/postgres-init/templates/inji-mimoto-env-configmap.yaml
  • helm/postgres-init/templates/hotlist-env-configmap.yaml
  • helm/postgres-init/templates/resident-env-configmap.yaml
  • helm/postgres-init/templates/idrepo-job.yaml
  • helm/postgres-init/templates/inji-certify-job.yaml
  • helm/postgres-init/templates/idmap-env-configmap.yaml
  • helm/postgres-init/templates/kernel-env-configmap.yaml
  • helm/postgres-init/templates/hotlist-job.yaml
  • helm/postgres-init/templates/esignet-job.yaml
  • helm/postgres-init/templates/mockidentitysystem-env-configmap.yaml
  • helm/postgres-init/templates/audit-env-configmap.yaml
  • helm/postgres-init/templates/idmap-job.yaml
  • helm/postgres-init/templates/keymgr-env-configmap.yaml
  • helm/postgres-init/templates/prereg-job.yaml
  • helm/postgres-init/templates/keymgr-job.yaml
  • helm/postgres-init/templates/pms-job.yaml
  • helm/postgres-init/templates/master-job.yaml
  • helm/postgres-init/templates/toolkit-env-configmap.yaml
  • helm/postgres-init/templates/toolkit-job.yaml
  • helm/postgres-init/templates/inji-mimoto-job.yaml
  • helm/postgres-init/templates/inji-verify-env-configmap.yaml
  • helm/postgres-init/templates/resident-job.yaml
  • helm/postgres-init/templates/regprc-job.yaml
  • helm/postgres-init/templates/ida-job.yaml
  • helm/postgres-init/templates/idrepo-env-configmap.yaml
  • helm/postgres-init/templates/master-env-configmap.yaml
  • helm/postgres-init/templates/regprc-env-configmap.yaml
  • helm/postgres-init/templates/inji-verify-job.yaml
  • helm/postgres-init/templates/credential-env-configmap.yaml
  • helm/postgres-init/templates/mockidentitysystem-job.yaml
  • helm/postgres-init/templates/esignet-env-configmap.yaml
  • helm/postgres-init/templates/otp-env-configmap.yaml
  • helm/postgres-init/templates/digitalcard-job.yaml
  • helm/postgres-init/templates/ida-env-configmap.yaml
  • helm/postgres-init/templates/otp-job.yaml
  • helm/postgres-init/templates/pms-env-configmap.yaml
  • helm/postgres-init/templates/audit-job.yaml
  • helm/postgres-init/templates/inji-certify-env-configmap.yaml
  • helm/postgres-init/templates/credential-job.yaml
  • helm/postgres-init/templates/kernel-job.yaml

Comment thread helm/postgres-init/templates/env-configmap.yaml

@ckm007 ckm007 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add comments in values of helm and install.

Signed-off-by: Abhi <abhishek.shankarcs@gmail.com>

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@helm/postgres-init/values.yaml`:
- Around line 35-37: The commented scaffold lines for readOnlyRootFilesystem,
runAsNonRoot, runAsUser and for requests are currently top-level; move them so
they are indented under their parent mapping keys (securityContext for
readOnlyRootFilesystem/runAsNonRoot/runAsUser and resources for requests) so
that if uncommented they become nested entries rather than new top-level
keys—adjust indentation to match the surrounding YAML block style for the
securityContext and resources entries (preserve the existing comment markers).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fb6df35c-b82d-4e46-be29-99777d8caab7

📥 Commits

Reviewing files that changed from the base of the PR and between 1e6adf8 and 35efe7f.

📒 Files selected for processing (2)
  • deploy/postgres-init-values.yaml
  • helm/postgres-init/values.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • deploy/postgres-init-values.yaml

Comment thread helm/postgres-init/values.yaml Outdated
Signed-off-by: Abhi <abhishek.shankarcs@gmail.com>
Signed-off-by: Abhi <abhishek.shankarcs@gmail.com>
@ckm007 ckm007 merged commit 21ade87 into mosip:develop May 20, 2026
7 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.

2 participants