Skip to content

Add mobile settings - #92

Merged
yasserfaraazkhan merged 4 commits into
masterfrom
add_mobile_settings
Jul 25, 2026
Merged

Add mobile settings#92
yasserfaraazkhan merged 4 commits into
masterfrom
add_mobile_settings

Conversation

@yasserfaraazkhan

Copy link
Copy Markdown
Contributor

Summary:

  • Mobile E2E moves from 3 shared sites to 5 platform-isolated sites: android-site-1/2, ios-site-1/2, site-3.
  • Workflow inputs switch to ANDROID_SITE_1/2_URL, IOS_SITE_1/2_URL, SITE_3_URL.
  • Mobile CMT builds a 5-server topology per server version in CMT_MATRIX.
  • CMT version auto-resolution now caps at 2 ESR lines + latest 3 minors + current RC.
  • Cancel sibling goroutines if one mobile CMT platform fails; keep newest versions when CMTServerVersions override is capped.
NONE

…est override versions

- gofmt server/config.go struct alignment
- pass cancellable context through createSingleCMTInstance / createMobileCMTInstances
  so sibling goroutines stop provisioning when any platform fails
- cap explicit CMTServerVersions override by keeping the newest (tail) entries
  instead of the oldest (head), since the matrix is normally sorted ascending

Tests: go vet ./..., go build ./..., go test -race ./... pass.
Downstream workflow contract checks (e2e-detox-pr.yml inputs and
compatibility-matrix-testing.yml CMT_MATRIX schema) remain to be verified
against the actual workflow files before merge.
@mm-cloud-bot mm-cloud-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Jul 25, 2026
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

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: 39d2711c-c5e0-47b7-894c-19d6d9aeb903

📥 Commits

Reviewing files that changed from the base of the PR and between 3ddd565 and 43b8fe8.

📒 Files selected for processing (4)
  • server/e2e_tests.go
  • server/e2e_tests_test.go
  • server/push_events.go
  • server/workflow_run.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • server/e2e_tests_test.go
  • server/push_events.go
  • server/workflow_run.go

📝 Walkthrough

Walkthrough

Mobile E2E orchestration now provisions five platform-specific instances and dispatches explicit URLs. CMT version selection uses semver-aware ESR capping, while mobile CMT provisioning and matrix output represent each platform separately.

Changes

Mobile E2E and CMT changes

Layer / File(s) Summary
Five-instance mobile topology and dispatch
server/e2e_tests.go, server/push_events.go, server/e2e_tests_test.go, server/e2e_dryrun_test.go
Mobile platforms, installation settings, workflow inputs, push dispatch, instance metadata, and related tests now use Android, iOS, and site-three instances.
CMT version selection and capping
server/e2e_tests.go, server/workflow_run.go, server/config.go, config/config-matterwick.default.json, server/workflow_run_test.go, server/e2e_dryrun_test.go
CMT fallback versions, semver ordering, ESR selection, version caps, RC handling, and validation expectations are updated.
Per-version mobile CMT provisioning and matrix output
server/workflow_run.go, server/e2e_dryrun_test.go
Mobile CMT creation now provisions five instances per version, rolls back partial sets, and emits separate platform URL fields with latest handling.

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

Sequence Diagram(s)

sequenceDiagram
  participant E2ERequestHandler
  participant createCloudInstallation
  participant MobileInstances
  participant dispatchMobileE2EWorkflow
  E2ERequestHandler->>createCloudInstallation: create mobile installation
  E2ERequestHandler->>MobileInstances: provision five canonical platforms
  MobileInstances->>dispatchMobileE2EWorkflow: provide five platform URLs
  dispatchMobileE2EWorkflow->>dispatchMobileE2EWorkflow: validate and map workflow inputs
Loading

Possibly related PRs

  • mattermost/matterwick#90: Introduces the config-driven CMT settings extended by this PR’s fallback and provisioning changes.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the change, but it is too vague to clearly describe the main update. Use a more specific title that mentions the mobile E2E and CMT topology changes, such as adding platform-isolated mobile settings.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly matches the mobile E2E and CMT changes in the pull request.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add_mobile_settings

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

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

🧹 Nitpick comments (2)
server/e2e_tests_test.go (1)

649-650: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert against mobileE2EPlatforms rather than restating the list.

The inline predicate hard-codes the same five identifiers the table already provides, so this subtest passes no matter what production code does and will silently drift if the canonical list changes.

♻️ Proposed refactor
-			isMobile := tt.platform == "android-site-1" || tt.platform == "android-site-2" ||
-				tt.platform == "ios-site-1" || tt.platform == "ios-site-2" || tt.platform == "site-3"
+			isMobile := slices.Contains(mobileE2EPlatforms, tt.platform)
🤖 Prompt for 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.

In `@server/e2e_tests_test.go` around lines 649 - 650, Replace the inline platform
comparisons in the subtest’s isMobile calculation with an assertion against the
canonical mobileE2EPlatforms collection. Reuse mobileE2EPlatforms so the test
validates membership from the shared list and stays synchronized when it
changes.
server/e2e_tests.go (1)

599-611: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Mobile site URLs are plumbed positionally instead of by Platform. Every mobile dispatch and matrix path assumes instances arrive in exactly mobileE2EPlatforms order and that the two package-level slices stay the same length; nothing asserts either invariant, so a future reordering or list change swaps Android/iOS URLs silently. A single platform-keyed helper that resolves the five URLs from []*E2EInstance would fix all four sites.

  • server/e2e_tests.go#L599-L611: build a Platform → URL map and pair mobileE2EPlatforms[i] with mobileE2EWorkflowInputKeys[i], erroring on a missing platform.
  • server/e2e_tests.go#L1379-L1401: replace the five positional URL parameters with the ordered instance slice (or a struct) and derive the input keys from mobileE2EWorkflowInputKeys.
  • server/push_events.go#L298-L320: stop indexing instances[0]..instances[4]; resolve URLs through the same platform-keyed helper so the guard and the dispatch cannot diverge.
  • server/workflow_run.go#L579-L587: within each version block, pick each URL by the instance's Platform rather than by offset+N.
🤖 Prompt for 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.

In `@server/e2e_tests.go` around lines 599 - 611, Replace positional mobile
instance URL handling with one platform-keyed helper that maps each instance’s
Platform to its URL, validates the mobileE2EPlatforms and
mobileE2EWorkflowInputKeys pairing, and errors when a required platform is
missing. In server/e2e_tests.go lines 599-611, use the helper for workflow
inputs; in server/e2e_tests.go lines 1379-1401, pass the ordered instance slice
or equivalent and derive keys through the helper; in server/push_events.go lines
298-320, use the helper for both validation and dispatch instead of
instances[0]..instances[4]; in server/workflow_run.go lines 579-587, select URLs
by each instance’s Platform rather than offset-based indexing.
🤖 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.

Nitpick comments:
In `@server/e2e_tests_test.go`:
- Around line 649-650: Replace the inline platform comparisons in the subtest’s
isMobile calculation with an assertion against the canonical mobileE2EPlatforms
collection. Reuse mobileE2EPlatforms so the test validates membership from the
shared list and stays synchronized when it changes.

In `@server/e2e_tests.go`:
- Around line 599-611: Replace positional mobile instance URL handling with one
platform-keyed helper that maps each instance’s Platform to its URL, validates
the mobileE2EPlatforms and mobileE2EWorkflowInputKeys pairing, and errors when a
required platform is missing. In server/e2e_tests.go lines 599-611, use the
helper for workflow inputs; in server/e2e_tests.go lines 1379-1401, pass the
ordered instance slice or equivalent and derive keys through the helper; in
server/push_events.go lines 298-320, use the helper for both validation and
dispatch instead of instances[0]..instances[4]; in server/workflow_run.go lines
579-587, select URLs by each instance’s Platform rather than offset-based
indexing.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cc178ee3-6cce-4ca4-a838-9a8d0373ecf4

📥 Commits

Reviewing files that changed from the base of the PR and between ed70dd7 and 3ddd565.

📒 Files selected for processing (8)
  • config/config-matterwick.default.json
  • server/config.go
  • server/e2e_dryrun_test.go
  • server/e2e_tests.go
  • server/e2e_tests_test.go
  • server/push_events.go
  • server/workflow_run.go
  • server/workflow_run_test.go

- Add buildMobileURLInputs helper that validates canonical platforms and pairs
  them with workflow input keys so callers cannot drift from slice order.
- Use the helper in triggerMobileE2EWorkflow, dispatchMobileE2EWorkflow,
  triggerMobileE2EWorkflowForPushEvent, and buildMobileCMTMatrixJSON.
- Replace dispatchMobileE2EWorkflow's five positional URL params with the
  ordered instance slice.
- In e2e_tests_test.go, assert mobile membership via slices.Contains against
  mobileE2EPlatforms instead of restating the list.

Tests: gofmt, go vet, go build, go test -race pass.

@saturninoabril saturninoabril 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.

Thanks @yasserfaraazkhan, lgtm.

@yasserfaraazkhan
yasserfaraazkhan merged commit 5a91975 into master Jul 25, 2026
3 checks passed
@yasserfaraazkhan
yasserfaraazkhan deleted the add_mobile_settings branch July 25, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note-none Denotes a PR that doesn't merit a release note.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants