Skip to content

feat: add instance domain model and static config - #511

Merged
volodymyr-chekyrta merged 1 commit into
openedx:developfrom
raccoongang:infra/01-instance-model
Oct 21, 2026
Merged

volodymyr-chekyrta merged 1 commit into
openedx:developfrom
raccoongang:infra/01-instance-model

Conversation

@IvanStepanok

Copy link
Copy Markdown
Contributor

Description

Android port of openedx-app-ios#672, the first PR of the multi-instance stack. It adds the Instance model and parses it from the INSTANCES block of the bundled config. Nothing reads it yet: no selection, no networking, no UI.

What's in this PR

Core model (core/instance/Instance.kt, InstancesConfig.kt)

  • Instance: identity (stable KEY, NAME, localized INSTANCE_NAME), auth (API_HOST_URL, OAUTH_CLIENT_ID, SSO URLs), theming (accent color, light/dark palette overrides, logo, header image, corner style), PLATFORM_NAME, and the entry as configured, so later PRs can read its overrides of app-level keys.
  • InstancesConfig: the parsed catalog, looked up by key.
  • Required fields are NAME, API_HOST_URL (must be an absolute URL) and OAUTH_CLIENT_ID; a malformed entry is dropped. KEY falls back to a slug of NAME, the display name falls back to English and then NAME, PLATFORM_NAME defaults to the display name, and blank strings count as unset.

Schema

  • Same keys as iOS, UPPER_SNAKE_CASE. Palette field names inside THEME.LIGHT / THEME.DARK (accent_color, ...) are left lowercase: they are the theme engine's contract.
  • Both SSO_FINISHED_URL and SSO_URL_SUCCESSFUL_LOGIN are accepted for the SSO completion URL. The iOS model reads the first while its remote mapping produces the second; reading both keeps either config working.

Static config

  • default_config/dev/config.yaml gets a complete example INSTANCES entry, matching the existing app-level localhost values so the dev build behaves the same.

Tests

  • InstancesConfigTest (11 cases) on a shared fixture (bundled_instances.json, the iOS dev catalog plus a malformed entry): every field, required-field enforcement, slug fallback, localized names, defaults, fallback merging, blank values, and identity by key rather than catalog position.

Out of scope

  • Instance selection.
  • Remote catalog fetch.

Testing

  • ./gradlew detektAll testProdDebugUnitTest :app:assembleProdDebug

Note

This is the 1st pull request of the multi-instance stack (11 PRs, one per iOS PR). Please review and merge in order.

Introduces Instance and InstancesConfig: what one Open edX platform is and how it is
parsed from the INSTANCES block of the bundled config. Nothing reads it yet.

Required fields are NAME, API_HOST_URL and OAUTH_CLIENT_ID; a malformed entry is dropped.
KEY falls back to a slug of NAME, INSTANCE_NAME is localized with an English fallback,
and PLATFORM_NAME defaults to the display name. The schema matches iOS (#672).
@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Oct 19, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @IvanStepanok!

This repository is currently maintained by @openedx/openedx-mobile-maintainers.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@IvanStepanok

Copy link
Copy Markdown
Contributor Author

@openedx/openedx-mobile-maintainers this one and #512 are approved and ready to merge. I only have triage access here, so could one of you merge them? Please merge #511 first, then #512. #512 stays conflict-free after #511 is squashed.

The rest of the stack waits: #513 is back in review after a fix, and #514–#517 build on it.

@volodymyr-chekyrta
volodymyr-chekyrta merged commit 59478d6 into openedx:develop Oct 21, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Contributions Oct 21, 2026
@volodymyr-chekyrta
volodymyr-chekyrta deleted the infra/01-instance-model branch October 21, 2026 17:22
@IvanStepanok IvanStepanok mentioned this pull request Oct 27, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants