Skip to content

Add merged configs for devportal and AIW distributions#2799

Merged
Piumal1999 merged 7 commits into
wso2:mainfrom
Piumal1999:unify-config-dist
Jul 23, 2026
Merged

Add merged configs for devportal and AIW distributions#2799
Piumal1999 merged 7 commits into
wso2:mainfrom
Piumal1999:unify-config-dist

Conversation

@Piumal1999

@Piumal1999 Piumal1999 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Purpose

Fix #2730

Summary

Unified configuration model

  • Every component lives under its own root table — [developer_portal.*], [platform_api.*], [ai_workspace.*] — so their keys never collide in one file.
  • Each component's config loader (Platform API, AI Workspace BFF) now narrows to its own subtree before interpolating {{ env }} / {{ file }} tokens, so a shared multi-component file never forces one service to resolve another component's tokens (which would fail closed).

Unified distribution packaging (make dist)

  • Each distribution zip now ships one config.toml carrying every bundled component's section; the same file is mounted into every container and each service reads only its own table.
  • The merged config-template.toml documents all bundled components, with any optional component (e.g. Developer Portal) appended at the bottom.

AI Workspace: optional Developer Portal (and vise-versa)

  • Developer Portal ships in the AI Workspace docker-compose.yaml behind an opt-in developer-portal Compose profile, sharing the single Platform API (no second instance).
  • Off by default; enabled with docker compose --profile with-developer-portal up -d plus a documented config/secret step. (docker compose --profile with-ai-workspace up -d for devportal)
  • If the user want to run the optional component, they have to copy the related configs and set the related env variables.

Related doc

https://docs.google.com/document/d/1ymKUVmLAdXkNVIi3ynRGMXJySUWnmc2glmtZru9KJ9A/edit?tab=t.0

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Platform API and AI Workspace now interpolate only their own configuration sections. Distribution builds produce unified TOML files, and optional Developer Portal or AI Workspace services use shared configuration through Compose profiles.

Changes

Unified configuration and optional services

Layer / File(s) Summary
Component-scoped configuration loading
platform-api/config/config.go, platform-api/config/config_test.go, portals/ai-workspace/bff/internal/config/*, platform-api/config/config-template.toml
Configuration interpolation is limited to the component subtree, with tests covering foreign sections and updated encryption-key setup guidance.
Unified distribution configuration packaging
portals/ai-workspace/Makefile, portals/developer-portal/Makefile
Distribution targets merge component TOML files, append optional template sections, and pin companion image versions.
Optional Compose service integration
portals/ai-workspace/docker-compose.yaml, portals/developer-portal/docker-compose.yaml
Optional services are profile-gated, share configuration and credentials, depend on Platform API health, expose healthchecks and ports, and use persistent storage where required.
Unified configuration documentation and setup
portals/ai-workspace/distribution/README.md, portals/developer-portal/distribution/README.md, portals/developer-portal/scripts/setup.sh
Documentation and setup comments describe unified configuration files, optional profiles, component sections, ports, and credential fields.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Compose
  participant PlatformAPI
  participant OptionalComponent
  Compose->>PlatformAPI: Start shared Platform API
  PlatformAPI-->>Compose: Healthcheck succeeds
  Compose->>OptionalComponent: Start enabled profile service
  OptionalComponent->>PlatformAPI: Use shared configuration and API
Loading

Possibly related PRs

Suggested reviewers: renuka-fernando, krishanx92, virajsalaka, malinthaprasan, pubudu538

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Several changes extend beyond #2730, including Developer Portal distribution updates, optional compose profiles, and loader/interpolation scoping fixes. Split the ancillary config and compose changes into separate PRs or link additional issues that explicitly cover them.
Description check ⚠️ Warning The description covers purpose and summary, but it omits most required template sections like goals, approach, tests, security, and environment. Add the missing template sections or mark N/A where applicable, including goals, approach, user stories, documentation, tests, security checks, samples, related PRs, and test environment.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR fulfills #2730 by merging distribution configs into a single config.toml for AI Workspace and related packaging changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title is concise and matches the main change: merged configs for DevPortal and AI Workspace distributions.
✨ 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.

Comment thread portals/ai-workspace/docker-compose.yaml Outdated

@Thushani-Jayasekera Thushani-Jayasekera left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@portals/ai-workspace/Makefile`:
- Around line 185-189: Guard the DEVPORTAL_VERSION assignment in
portals/ai-workspace/Makefile lines 185-189 by verifying
../developer-portal/VERSION exists and is non-empty before applying sed,
otherwise use 0.0.0. Apply the same guarded fallback to the corresponding
version assignment in portals/developer-portal/Makefile lines 139-145 for
../ai-workspace/VERSION.

In `@portals/developer-portal/distribution/README.md`:
- Line 120: Update the JWT configuration documentation in the table to use the
actual platform API fields public_key_file and private_key_file instead of
public_key and private_key, preserving the existing keypair description and
setup.sh default reference.

In `@portals/developer-portal/docker-compose.yaml`:
- Around line 58-63: Update the comment immediately above the ai-workspace
service to identify AI Workspace rather than Developer Portal, while preserving
the existing --profile with-ai-workspace usage.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b83512cd-ad74-4bd9-beae-98349ede0034

📥 Commits

Reviewing files that changed from the base of the PR and between 2aa77be and f21ec2d.

📒 Files selected for processing (12)
  • platform-api/config/config-template.toml
  • platform-api/config/config.go
  • platform-api/config/config_test.go
  • portals/ai-workspace/Makefile
  • portals/ai-workspace/bff/internal/config/config_test.go
  • portals/ai-workspace/bff/internal/config/settings.go
  • portals/ai-workspace/distribution/README.md
  • portals/ai-workspace/docker-compose.yaml
  • portals/developer-portal/Makefile
  • portals/developer-portal/distribution/README.md
  • portals/developer-portal/docker-compose.yaml
  • portals/developer-portal/scripts/setup.sh

Comment thread portals/ai-workspace/Makefile
Comment thread portals/developer-portal/distribution/README.md
Comment thread portals/developer-portal/docker-compose.yaml
@Piumal1999
Piumal1999 merged commit 571e7f2 into wso2:main Jul 23, 2026
13 of 24 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.

[Task]: Merge two config,toml files in the dist to a single toml file

3 participants