mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-04 18:08:54 +00:00
* MM-71189 Preserve feature flags in Detox config patches Co-authored-by: mattermost-code <matty-code@mattermost.com> * Guard getFeatureFlags against empty config responses Return an error instead of treating a missing config body as an empty flag set, so a dropped GET does not patch only the requested flags. Co-authored-by: mattermost-code <matty-code@mattermost.com> * Retrigger CI after Detox iOS and iPad E2E flakes Co-authored-by: mattermost-code <matty-code@mattermost.com> * test(e2e): apply one declared server baseline at provisioning Provisioning drives each test server to one declared baseline: the config keys E2E needs and the full FeatureFlags map, written read-modify-write so no flag is reset. Env-pinned keys are reported, not patched, and leftover E2E policies, remote clusters and property fields are removed. Provisioning also disables stray plugins once. * test(e2e): assert the server baseline instead of patching config in specs These specs patched server-wide settings (CRT, archived channels, auto-replies, ...) and restored them while other shards depended on them. They now assert the provisioned baseline instead. * test(e2e): split CI servers into pool and mutation roles; remove the locks Each platform's server A becomes a read-only pool for 27 shards (and iPad and Maestro); server B (and on iOS part of SITE_3) runs one serial mutation shard with the specs in detox/e2e/server_mutation_specs.json. The classification, server and SITE_3 locks go. - split-tests.js places mutation specs by the manifest and packs the pool by duration; a spec that needs B never falls back to the shared SITE_3. - A pool request guard, an ESLint rule and a manifest checker keep server-wide writes off the pool. Mutation shards re-apply the baseline before each spec file. - Mutating tests move to their own spec files; ABAC specs use channel-scoped permission policies; MFA and Terms of Service run on the mutation server. - Pool shards no longer disable provisioned plugins, so the Agents specs run. * fix(e2e): fail a spec when the baseline cannot be applied locally * fix(e2e): keep transport retries for feature-flag and baseline reads Restore the retry in getFeatureFlags, which apiEnableFeatureFlags calls directly, and retry the baseline assertion's GET requests on transport failures. * test(e2e): cover retries of dropped config and baseline reads * test(e2e): apply one declared server baseline at provisioning Provisioning drives each test server to one declared baseline: the config keys E2E needs and the full FeatureFlags map, written read-modify-write so no flag is reset. Env-pinned keys are reported, not patched, and leftover E2E policies, remote clusters and property fields are removed. Provisioning also disables stray plugins once. * test(e2e): assert the server baseline instead of patching config in specs These specs patched server-wide settings (CRT, archived channels, auto-replies, ...) and restored them while other shards depended on them. They now assert the provisioned baseline instead. * fix(e2e): fail a spec when the baseline cannot be applied locally * fix(e2e): keep transport retries for feature-flag and baseline reads Restore the retry in getFeatureFlags, which apiEnableFeatureFlags calls directly, and retry the baseline assertion's GET requests on transport failures. * test(e2e): cover retries of dropped config and baseline reads * E2E: stop burn-on-read spec turning other feature flags off Its partial FeatureFlags patch reset every other flag on the shared server, which turned ChannelAttributes off under channel_attributes on another shard. Enable only the missing flags, as redacted_files and upload_permission do, and do the same for the dialog spec. Also tap the attach button the app actually renders in MM-T339_1. * E2E: route flag-off spec to B on iOS; tap the real attach button in the max-size spec * test(e2e): apply one declared server baseline at provisioning Provisioning drives each test server to one declared baseline: the config keys E2E needs and the full FeatureFlags map, written read-modify-write so no flag is reset. Env-pinned keys are reported, not patched, and leftover E2E policies, remote clusters and property fields are removed. Provisioning also disables stray plugins once. * test(e2e): assert the server baseline instead of patching config in specs These specs patched server-wide settings (CRT, archived channels, auto-replies, ...) and restored them while other shards depended on them. They now assert the provisioned baseline instead. * fix(e2e): fail a spec when the baseline cannot be applied locally * fix(e2e): keep transport retries for feature-flag and baseline reads Restore the retry in getFeatureFlags, which apiEnableFeatureFlags calls directly, and retry the baseline assertion's GET requests on transport failures. * test(e2e): cover retries of dropped config and baseline reads * E2E: stop burn-on-read spec turning other feature flags off Its partial FeatureFlags patch reset every other flag on the shared server, which turned ChannelAttributes off under channel_attributes on another shard. Enable only the missing flags, as redacted_files and upload_permission do, and do the same for the dialog spec. Also tap the attach button the app actually renders in MM-T339_1. * E2E: wait for the results service before retrying a shard upload upload-artifact does not retry network errors (ENOTFOUND, ETIMEDOUT), and the retry fired ~30 ms after the first failure, inside the same DNS outage. A shard whose specs all passed was then reported as "spec did not run". Each retry now waits (bounded, 120 s) for the results host to answer, with a second retry. * E2E: run the specs a killed iOS Jest never started; record why it died When Jest is killed between spec files (exit code = null) it writes no report, and the specs after that point never run. Run only those once in a fresh Jest and merge the results; specs that ran keep their own result, so a spec that crashes Jest stays red. Also sample memory and collect jetsam/crash reports so the next kill names its cause. * E2E: keep the demo plugin off the shared servers; 32 shards The demo plugin posts into every team on every server event and inside every config save, and on our servers each of those posts fails. Only the two dialog specs use it, so install it only on mutation server B, disable it everywhere else (failing provisioning if it stays on), and route both dialog specs to B. Drop the DialogOnlyMode setting, which v0.12.1 does not have. Raise Detox shards 28 -> 32. * E2E: give the demo plugin a settings entry on the servers that install it Demo plugin v0.12.1's ConfigurationWillBeSaved hands the whole config back when it has no settings entry, and that round trip resets settings it does not know, or that are false, to their defaults. With DialogOnlyMode gone from the baseline, fresh B servers had no entry, so ChannelAttributesRequired=true and EnableMobileUpload=false were reverted inside the save. An empty entry keeps the hook out of the save. --------- Co-authored-by: mattermost-code <matty-code@mattermost.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: yasserfaraazkhan <yasser.khan@mattermost.com>
105 lines
3.6 KiB
YAML
105 lines
3.6 KiB
YAML
name: ci
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- 'release*'
|
|
pull_request:
|
|
|
|
permissions:
|
|
pull-requests: write
|
|
|
|
env:
|
|
NODE_VERSION: 24.15.0
|
|
TERM: xterm
|
|
|
|
jobs:
|
|
lint-typecheck:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: ci/checkout-repo
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
- name: ci/prepare-node-deps
|
|
uses: ./.github/actions/prepare-node-deps
|
|
- name: ci/check-styles
|
|
shell: bash
|
|
run: |
|
|
echo "::group::check-styles"
|
|
npm run check
|
|
echo "::endgroup::"
|
|
- name: ci/check-i18n
|
|
shell: bash
|
|
run: |
|
|
echo "::group::check-i18n"
|
|
./scripts/precommit/i18n.sh
|
|
echo "::endgroup::"
|
|
|
|
detox-lint-typecheck:
|
|
# The detox/ package has its own tsconfig and is not covered by the root
|
|
# check above. A TypeScript error in a detox test file makes its whole suite
|
|
# fail to run, so the E2E shard exits non-zero and drops its JUnit, silently
|
|
# reducing the reported test count. Type-check detox on every PR so the error
|
|
# surfaces here instead.
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: ci/checkout-repo
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
- name: ci/prepare-node-deps
|
|
uses: ./.github/actions/prepare-node-deps
|
|
- name: ci/detox-install
|
|
shell: bash
|
|
# prepare-node-deps only installs the top-level node_modules; the detox
|
|
# package has its own, needed for its type-check.
|
|
run: cd detox && npm ci
|
|
- name: ci/detox-typecheck
|
|
shell: bash
|
|
run: |
|
|
echo "::group::detox-typecheck"
|
|
cd detox && npm run tsc
|
|
echo "::endgroup::"
|
|
# Server roles: specs that change server-wide state must be in the mutation manifest, and
|
|
# the shard split and pool guard must keep them off the shared pool servers.
|
|
- name: ci/detox-check-server-mutation-manifest
|
|
shell: bash
|
|
run: node detox/utils/check-server-mutation-manifest.js
|
|
- name: ci/detox-split-tests-unit
|
|
shell: bash
|
|
run: |
|
|
echo "::group::detox-split-tests-unit"
|
|
npx jest --rootDir . --config '{"testEnvironment":"node"}' .github/actions/generate-specs/split-tests.test.js
|
|
echo "::endgroup::"
|
|
- name: ci/detox-unit
|
|
shell: bash
|
|
run: |
|
|
echo "::group::detox-unit"
|
|
cd detox && npm run test:unit
|
|
echo "::endgroup::"
|
|
# Also validated by the E2E workflow, but that one is label-gated, so a header
|
|
# contract break could sit unreported until someone asked for an E2E run. This
|
|
# job is unconditional and finishes in about a minute.
|
|
- name: ci/detox-validate-flow-headers
|
|
shell: bash
|
|
run: |
|
|
echo "::group::detox-validate-flow-headers"
|
|
bash detox/maestro/scripts/validate-flow-headers.sh
|
|
echo "::endgroup::"
|
|
|
|
test:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: ci/checkout-repo
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
- name: ci/prepare-node-deps
|
|
uses: ./.github/actions/prepare-node-deps
|
|
- name: ci/run-tests
|
|
# main and PRs run test:coverage via the test-coverage action below;
|
|
# release branches just need a plain test pass.
|
|
if: startsWith(github.ref_name, 'release')
|
|
shell: bash
|
|
run: npm run test:ci
|
|
- name: ci/test-coverage
|
|
if: github.event_name == 'pull_request' || github.ref_name == 'main'
|
|
uses: ./.github/actions/test-coverage
|
|
with:
|
|
run_id: ${{ github.run_id }}
|