Commit Graph
372 Commits
Author SHA1 Message Date
mattermost-code 43a85732c0 Automated cherry pick of #38060 (#38069)
Automatic Merge
2026-08-21 11:36:44 +03:00
b083070d91 ci: bump test-system-io-summary action for missed-spec status (#37804) (#38075)
* ci: bump test-system-io-summary action for missed-spec status

Placeholder bump pending merge of mattermost-test-system-io summary fix.



* ci: re-pin test-system-io-summary to main e2d5032

Replace the pre-merge placeholder SHA with the latest
mattermost-test-system-io main commit, which includes the
squash-merged missed-spec summary fix from #96.



---------




(cherry picked from commit 020e9dabdd)

Co-authored-by: sabril <5334504+saturninoabril@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: saturnino <saturnino@mattermost.com>
2026-08-21 04:56:30 +00:00
Eva SarafianouandCursor a70e8751d4 Gate ci-report and ci-artifacts on relevant-changed to fix skipped-job failures (#37777)
server-ci.yml always triggers now, but ci-report and ci-artifacts were
missed when #37557 gated the other jobs on needs.go.outputs.relevant-changed.
On PRs that don't touch server code, build-mattermost-server and the test
jobs are skipped, so ci-artifacts fails trying to download a
server-dist-artifact that was never uploaded, and ci-report fails trying
to validate test logs that don't exist. Skip both cleanly instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 16:33:57 +00:00
Eva SarafianouandCursor 6b90bb3063 Make server-ci.yml always trigger so required checks never get stuck pending (#37557)
* Make server-ci.yml always trigger so required checks never get stuck pending

Required status checks (e.g. "Server CI Complete") never get reported for a
commit whose workflow run was skipped by the top-level `paths` filter, which
leaves them stuck "Pending" forever and blocks merging PRs that don't touch
server code. Move the path filtering into a job-level `if:` gated on a new
`relevant-changed` output instead, so the workflow always runs and always
reports a status.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Fail ci-complete explicitly when the go job doesn't succeed

Previously ci-complete ran unconditionally (if: always()) and its step just
echoed a success message, so if the go job failed (e.g. the new
relevant-changed detection step erroring out), all downstream jobs would be
silently skipped due to unset outputs, yet ci-complete would still report
"Server CI Complete" as green. Add go to needs and explicitly fail the step
when needs.go.result != 'success', while keeping the existing always()/FIPS
skip-tolerance behavior so the check still always gets reported.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 11:24:06 +03:00
sabril 4cd57370ac ci: remove testcontainers teardown step from playwright e2e workflow (#37697) 2026-07-28 09:20:49 +00:00
sabrilandMattermost Build a8c2307bee E2E/Playwright: Add testcontainers to playwright-lib (#37570)
* add testcontainers to playwright-lib

* include retry mechanism for transient failures

* - Introduced a new command `testcontainers:up` in package.json to run Playwright tests with Testcontainers.
- Created a standalone Playwright configuration file `playwright.testcontainers-up.config.ts` for managing Testcontainers.
- Added a no-op test `testcontainers_up.spec.ts` to ensure the Testcontainers stack is up during the test run.
- Implemented a global setup script `testcontainers_up_global_setup.ts` to start and stop the Testcontainers stack.
- Updated dependencies in package.json, including adding `chalk` for logging.

* fix package-lock

* fix tsc and restore waiting for all migrations to complete

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2026-07-28 10:06:36 +02:00
sabrilandMattermost Build c77efb5ab3 ci: update actions/test-system-io to latest with upload retries (#37612)
* ci: update actions/test-system-io to latest with upload retries

* chore: update test system io actions

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2026-07-28 06:03:31 +00:00
Eva SarafianouandCursor 8828e5a258 fix(docs-preview): set commit status via gh api for correct target_url (#37664)
* docs: mark scale partial pages as unlisted with proper titles

These MDX files are content partials imported into the scale-to-*-users
pages, mirroring the :orphan:/:nosearch: Sphinx pages they were migrated
from. Without frontmatter, Docusaurus rendered them as full standalone
pages with an ugly slug-derived title, breadcrumbs, and pagination.
unlisted: true keeps their routes alive (needed by the PDF book builder
and legacy redirects) while hiding them from the sidebar, breadcrumbs,
pagination, and search indexing.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(docs-preview): set commit status via gh api for correct target_url

The shared mattermost/actions/delivery/update-commit-status action accepts
a target_url input but ignores it, hardcoding the Actions run URL instead.
This made the docs-preview PR check's Details link point at the workflow
run rather than the S3-hosted preview site.

Switch docs-preview-template.yml and docs-preview-fork.yml to call the
GitHub Statuses API directly via `gh api repos/.../statuses/{sha}`, matching
the pattern in e2e-tests-playwright.yml, so the success status's target_url
points at the actual preview URL.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 10:28:39 +03:00
Eva SarafianouandCursor 5fbb2a32d6 docs: vendor and stage Mattermost Agents docs for Docusaurus build (#37627)
* docs: vendor and stage Mattermost Agents docs for Docusaurus build

The migration plan externalized Agents links, but the Docusaurus sidebar
generator already declares an `agents` TOP_LEVEL category and stub pages
link to `/agents/docs/*` paths with no content behind them. Vendor the
mattermost-plugin-agents docs/ folder as a submodule and stage it into
main/agents/docs/ at build time (mirroring how Sphinx handles the same
submodule via conf.py excludes), so the Agents sidebar category and
internal links resolve to real, versioned content instead of dead ends.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: strip leading license comment before MDX-staging Agents docs

Three feature pages (channel_summaries.md, custom_prompts.md,
managing_agents.md) lead with a raw <!-- Copyright ... --> HTML comment
before the # Title line, which broke both title extraction (regex only
matched a title at the very start of the file) and the Docusaurus build
(MDX doesn't parse bare HTML comments the way Markdown does, so it failed
to compile with "Unexpected character '!'"). Strip the license comment
before further processing instead of trying to convert it.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: fail loudly on missing Agents submodule, fix usage comment path

- A missing/uninitialized vendor/mattermost-plugin-agents submodule
  previously logged a warning and returned a successful zero-count
  result, letting CI/prestart/prebuild continue with an empty (or, on a
  reused workspace, stale) Agents section instead of failing. Now it
  clears any previously staged output first, then throws so the build
  fails clearly when the submodule isn't present.
- Fixed the usage comment referencing the nonexistent docs-site/scripts
  path instead of the actual docs/site/scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: checkout submodules in docs-ci.yaml build check

This is the third docs-building workflow (alongside docs-cd.yml and
docs-preview-template.yml) that runs npm run build on docs/site, and it
was missed when submodules: true was added to the other two — its
"Build docs site" step failed on this PR because
vendor/mattermost-plugin-agents wasn't checked out, which
stage-agents-docs.mjs now correctly treats as a hard failure.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: inline Agents content instead of a separate top-level LHS section

Sphinx never gives Agents its own top-level nav entry: it `.. include::`s
admin_guide.md/user_guide.md directly into the existing curated pages
(administration-guide/configure/agents-admin-guide.rst and
end-user-guide/agents.rst), and only nests a handful of files
(providers, aws_bedrock_setup, sovereign_ai, usage_tips) as small hidden-
toctree children of those same two pages. load-testing.md,
upgrading_to_2.0.md, and all of features/*.md are never referenced in any
Sphinx toctree at all.

The previous vendoring approach staged all 12 files as a brand-new,
disconnected top-level "Agents" category, so reaching the actual guide
meant leaving the curated page, opening an unrelated top-level section,
and drilling into "Docs" — the opposite of what Sphinx does today.

This reproduces Sphinx's structure instead:
- stage-agents-docs.mjs now categorizes the 12 vendored files: admin_guide/
  user_guide are staged twice — once as a normal (but `unlisted: true`)
  doc for direct-link parity with Sphinx's orphan pages, and once as a
  Docusaurus Markdown partial (leading underscore, auto-excluded from
  routing/sidebars) for inline import. providers/aws_bedrock_setup/
  sovereign_ai/usage_tips are staged as normal listed docs. Everything
  else is staged unlisted, matching Sphinx never surfacing them in nav.
- Added generic relative-markdown-link rewriting (mirroring the existing
  image-path rewriting) so cross-links between vendored files
  (`../admin_guide.md#anchor`, `features/channel_summaries.md`, etc.)
  resolve correctly regardless of nesting depth or where the linking
  content ends up rendered.
- agents-admin-guide.mdx and end-user-guide/agents.mdx now `import` and
  render the partials inline instead of linking out, and no longer link
  to a separate "Docs" section.
- gen-documentation-sidebar.mjs: removed the standalone `agents`
  TOP_LEVEL category. Added `{doc: '<full id>'}` support to
  buildAdminConfigureItem for cross-directory group items, and a new
  ADMIN_CONFIGURE_GROUPS.agents group nesting providers/aws_bedrock_setup/
  sovereign_ai under agents-admin-guide. Added a standalone
  promoteDocToCategory helper (End User Guide has no full manual-grouping
  override) to nest usage_tips under end-user-guide/agents.
- Documented both patterns (cross-directory group items, Markdown-partial
  inlining) in docs/site/README.md's "Manual grouping overrides" section.

Validated: stage-agents-docs.mjs + gen-documentation-sidebar.mjs both run
clean with zero warnings; a scoped @mdx-js/mdx compile check across all
16 affected files (2 curated pages + 12 staged docs + 2 partials) passes
with zero failures. Full `docusaurus build` still needs the OpenAPI
prebuild's Go toolchain, unavailable in this sandbox — already covered by
docs-ci.yaml in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(agents): self-host the plugin-v2 upgrade guide link

Now that mattermost-plugin-agents/docs is vendored and staged into
/agents/docs/*, point the two "how to upgrade to Agents v2" references
(v11 changelog, important upgrade notes) at our own
/agents/docs/upgrading_to_2.0 page instead of an external GitHub blob
link — the same self-hosting fix already applied to the old dangling
sample-file links.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(agents): tighten stage-agents-docs.mjs header comment

Same explanation, fewer words — trims the file-level comment from ~45
to ~33 lines without dropping the rationale (why staging instead of a
direct submodule checkout, and how the three-way listed/unlisted/
inline-partial split reproduces Sphinx's nav).

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 16:56:13 +03:00
Nuno Simões 5afa3b8cbf ci: run yamllint on ubuntu-24.04 (#37641) 2026-07-23 17:38:06 +02:00
Eva SarafianouandCursor 24a5dd2859 ci: consolidate docs-preview checks into one status with preview URL (#37524)
* ci: consolidate docs-preview checks into one status with preview URL

Drop the same-repo status-update jobs that cluttered the PR checks list,
and post a single docs-preview commit status whose Details link opens the
preview environment.

Co-authored-by: Cursor <cursoragent@cursor.com>

* remove comment

* Remove duplicate failure status update in docs-preview-fork workflow

The deploy job already posts a failure commit status via the shared
template, making the separate update-failure-status job redundant.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 13:51:32 +03:00
Jesse Hallam 14b4e8ee55 Disable Codecov PR comments (#37391) 2026-07-16 10:57:41 -03:00
Eva SarafianouandCursor 2d8a5f94ba Stop posting docs preview PR comments; link preview from status check (#37491)
Docs preview cleanup and build workflows no longer post PR comments.
The build workflows now surface the preview URL via the commit status's
target_url instead, so the status check links directly to the preview.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 14:29:28 +03:00
6b4b77723c Update config change checker script and workflow (#37226)
* Update config change checker script and workflow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Update check_config_changes_ci.py

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2026-07-14 13:04:40 +03:00
sabril bd0d8866d6 Remove deprecated Playwright/Cypress v1 dispatch (#37413)
* Remove deprecated Playwright/Cypress v1 e2e CI dispatch

Deletes the legacy in-job execution templates and their calculate-results
actions, and unconditionally routes both wrappers to the v2 (Test System IO)
templates. Test suites and local-dev tooling are untouched.

* remove v2 references

* remove aws dependencies in e2e tests, remove deprecated workflows
2026-07-14 10:55:18 +08:00
Eva SarafianouandCursor 33eb5b1a28 ci: add docs PR preview workflows (#37440)
* ci: add docs PR preview workflows (P10)

Adds preview builds for PRs touching docs/** or api/**, deployed to the
existing mattermost-docs-preview-pulls S3 bucket under a repo-scoped
mattermost/pr-<N>/ prefix so they don't collide with mattermost/docs's
own previews of the same bucket. Fork PRs are handled via a manual
workflow_dispatch since they can't access secrets; previews are cleaned
up automatically on PR close for both same-repo and fork PRs.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: use PR author for docs preview TRIGGERING_ACTOR

pull_request.head.user.login is the owner of the head repo/branch, not
the PR author -- for same-repo PRs (head repo == base repo) this
resolves to the org name instead of the contributor who opened the PR.
pull_request.user.login is always the actual PR author.

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: reword docs preview PR comment

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: harden docs preview workflows

- docs-preview-fork: add explicit permissions (statuses/pull-requests
  write, contents read) instead of relying on default token scope.
- docs-preview-template: validate PR_NUMBER is digits-only and quote
  the S3 destination before use in the upload step, guarding against
  script injection via the fork dispatch's free-text input.
- docs-preview-template: add a per-PR concurrency group so an older,
  slower build can't overwrite a newer upload.
- docs-preview/docs-preview-fork: replace secrets: inherit with an
  explicit secrets mapping, and declare the secrets contract on the
  reusable template, so only the two AWS preview credentials are
  passed instead of every repo/org secret.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: align docs preview build/permissions with docs-ci, drop 3rd-party comment action

- docs-preview-template: add Set up Go (api/server/go.mod), matching
  docs-ci -- make -C api build shells out to `go run .` for code
  sample extraction and needs a pinned toolchain, not whatever happens
  to be preinstalled on the runner.
- docs-preview-template: drop the explicit "Build OpenAPI spec" step;
  npm run build's prebuild lifecycle script already runs
  make -C api build, so it was running twice.
- docs-preview-template: replace peter-evans/create-or-update-comment
  with plain `gh pr comment`, dropping a third-party action pin;
  behavior is unchanged (posts a new comment every run).
- docs-preview: add explicit permissions (contents: read,
  pull-requests: write) so the reusable workflow's requested
  pull-requests: write isn't silently downgraded by a restrictive
  default token policy.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: use gh pr comment in docs-preview-cleanup, drop 3rd-party action

Same swap already made in docs-preview-template.yml -- gh is
preinstalled on the runner, so this drops another third-party action
pin. Also quotes the S3 URI via env vars for consistency with the
template's upload step.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: replace pull_request_target with pull_request in docs-preview-cleanup

zizmor flags pull_request_target as a dangerous trigger by default.
Switch to plain pull_request, guarded to skip fork PRs (which don't
get secrets on this event) -- fork preview cleanup will be handled by
a separate scheduled sweep instead. Also fixes a stray '=' character
that had crept into the file.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 15:54:27 +03:00
Jesse Hallam 10555f155c Converge generated-file CI checks on a single make generated target (#37451)
* Converge generated-file CI checks on a single make generated target

The server-ci.yml workflow had many separate "run a make target, then fail
on any git diff" jobs, but make generated only covered a few of them, so the
target and CI drifted apart.

Expand make generated to regenerate every committed asset, adding
gen-serialized, migrations-extract, build-templates, mmctl-docs, and
modules-tidy, and collapse the per-asset check jobs into a single
check-generated job.

Split the backport migration guard into its own check-backport-migrations
job and make target, renaming the script to match.

* git status --porcelain

* simplify permissions block given defaults
2026-07-13 10:49:33 +02:00
Amy BlaisandMattermost Build 4e428ef393 Fix docs automation workflow (#37401)
* Fix docs automation workflow

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2026-07-13 10:12:57 +03:00
Jesse Hallam be7cc0ba3e Bucket server test-timing cache by date to cut cache churn (#37425) 2026-07-10 11:46:49 -04:00
Jesse Hallam fcdda55454 Move e2e npm registry cache out of the node-cache- namespace (#37427)
The e2e npm registry cache keyed on node-cache-<os>-<arch>-npm-e2e-,
sharing the node-cache- prefix that actions/setup-node generates
automatically for its built-in npm cache (node-cache-<os>-<arch>-npm-).
Because the arch segment differs only by case (setup-node uses Node's
process.arch 'x64'; this action uses runner.arch 'X64') and GitHub matches
restore-key prefixes case-insensitively, the two buckets share a common
prefix. A future broad restore-key such as node-cache-<os>-<arch>-npm-
could then cross-restore one bucket's ~/.npm into the other.

Rename the key to e2e-npm-registry-<os>-<arch>-, giving it a distinct
namespace that is not a prefix of node-cache- in either direction and
matches the repo's content-descriptive e2e cache keys (e2e-cypress-deps-,
e2e-playwright-deps-, e2e-platform-pkgs-). Existing entries orphan and
age out; the daily warm job repopulates under the new key on next run.
2026-07-10 09:54:35 +02:00
Eva SarafianouandCursor 1b27d5d7e2 ci: add docs CD workflow (#37421)
* ci: add docs CD workflow (P9)

Builds the Docusaurus site and deploys to S3 on every push to master
touching docs/** or api/**, then invalidates CloudFront. Splits the S3
sync into two passes so content-hashed build assets get long-lived
immutable caching while unhashed HTML stays no-cache for near-instant
propagation.

Co-authored-by: Cursor <cursoragent@cursor.com>

* ci: remove workflow_dispatch trigger from docs-cd

Deploys should only happen via push to master, not manual trigger.

Co-authored-by: Cursor <cursoragent@cursor.com>

* ci: typecheck before building docs in CD

docusaurus build strips TypeScript types via babel without validating
them, so a type error could still deploy. docs-ci.yaml typechecks the
same commit, but as an uncoupled parallel workflow it doesn't gate CD —
this catches it if CI fails or a required check is bypassed on master.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 15:03:28 +00:00
Eva SarafianouandCursor dd69d06dc6 Migrate docs site: Docusaurus config, Algolia, OpenAPI pipeline, and CI (#37402)
* Align Docusaurus config for monorepo, wire Algolia DocSearch (P6)

Fixes projectName/editUrl/path references left over from the docs-unified
repo split, adds trailingSlash for predictable CloudFront 404 handling, and
wires an Algolia search block into themeConfig that's only included when
credentials are present (Docusaurus's schema rejects an empty appId/apiKey,
so this keeps builds green with or without them). Also fixes the
sidebar/redirect generator scripts, which still pointed at the pre-rename
docs/ directory instead of main/, and adds docs/Makefile,
.env.local.example, and an updated README for local dev.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Wire OpenAPI generation to api/v4/source and add docs-ci.yaml (P7)

Replaces build-openapi.mjs's custom YAML-merge implementation with a thin
wrapper around the canonical `make -C api build` target, keeping only the
MDX sanitization step (quote/autolink fixes) that docusaurus-plugin-openapi-docs
needs. Adds a "prebuild" npm script so `npm run build` regenerates the spec
automatically, and ignores the generated api/v4/html artifacts (narrow form,
since ssr_template.hbs and static/favicon.ico under that path are committed).

Also adds docs-ci.yaml as a path-scoped PR/master build+typecheck gate for
the docs site, replacing the legacy `docs` repo's Sphinx-based ci.yml now
that docs live in this monorepo.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Rename OpenAPI prebuild script for clarity

"prebuild" is an npm lifecycle hook name (auto-runs before "npm run build"),
not a descriptive name, so `npm run prebuild` didn't signal it's specifically
about OpenAPI generation. Split it into "build:openapi" (the actual script,
runnable directly and self-explanatory) with "prebuild" now just delegating
to it, preserving the automatic pre-build trigger.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Regenerate sidebars automatically before dev/build (P7 fixup)

documentation.generated.json and developers.generated.json are gitignored
and nothing produced them on a fresh checkout, so both `npm start` and
`npm run build` failed with MODULE_NOT_FOUND outside a working tree that
happened to have stale copies lying around. Wire the sidebar generators
into `prestart`/`prebuild` so they're always regenerated first.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Remove docs/site/.env.local.example

There's a single Algolia DocSearch app for docs.mattermost.com; credentials
aren't distributed to individual developers, so a per-dev .env.local
workflow doesn't apply. Credentials are only ever injected in CI/CD via
repository variables. Local builds/dev server run fine without them (the
Algolia block in docusaurus.config.ts is conditional).

Co-authored-by: Cursor <cursoragent@cursor.com>

* Wire OpenAPI doc generation into prestart/prebuild, drop unused Makefile

docusaurus-plugin-openapi-docs requires a separate `docusaurus gen-api-docs`
CLI step to populate docs/api/reference/ (gitignored) — nothing was
invoking it, so a fresh checkout's npm start/build failed the same way the
sidebar JSONs did. Split build:openapi into build:openapi:spec (slow, runs
make -C api build) and build:openapi:docs (fast, generates MDX from the
existing spec), and wire prestart to reuse an existing spec instead of
rebuilding it every dev-server start.

Also drops docs/Makefile: four of its five targets were pure passthroughs
to npm scripts, unreferenced by CI or anything else, and there's no
repo-wide `make -C <dir>` convention to fit into.

Note: a duplicate-doc-id build failure (operationId `status` in the
Playbooks OpenAPI spec colliding with the main API's `status` tag) is
being fixed separately in mattermost-plugin-playbooks.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Fix stale docs/ reference in sidebar generator's error message

The existence check still hardcoded "docs/" in its error text after SRC
was repointed to main/. Use the SRC constant in the message so it can't
drift out of sync with the actual path again.

Co-authored-by: Cursor <cursoragent@cursor.com>

* remove code comment

* Drop unused artifact upload from docs-ci.yaml

Nothing consumes it: P9's docs-cd.yml will rebuild independently on push
to master rather than downloading it via workflow_run (avoids workflow_run
trigger footguns for an infrequent, cheap-enough rebuild), and P10's
preview build always needs its own independent build anyway (bakes a
per-PR BASE_URL). This was carried over from the old docs repo's ci.yml
out of habit; that repo's own PR-time uploads had the same unused-artifact
issue (only cd.yml's post-merge run ever consumed it).

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 12:32:39 +03:00
sabril 49891e2f15 Bump Playwright v2 CI workers from 10 to 15 (#37414) 2026-07-09 13:51:00 +08:00
Jesse Hallam c3726ccb6b chore(ci): warm node and npm caches daily; make CI jobs restore read-only (#37393)
* chore(ci): warm node and npm caches daily; make CI jobs restore read-only

Add daily scheduled workflows on master that warm two independent caches,
each in its own workflow mirroring its consumers:

- webapp-ci-cache-warm.yml warms the webapp node_modules cache
  (keyed on webapp/package-lock.json)
- e2e-ci-cache-warm.yml warms the E2E ~/.npm registry cache
  (keyed on the cypress/playwright/api lockfiles)

Webapp CI and the E2E/api CI jobs now restore these caches read-only instead
of writing them, so the daily jobs keep the caches warm. The E2E ~/.npm
restore is factored into a reusable restore-e2e-npm-cache composite action,
and webapp-setup gains a read-only mode for the node_modules cache.

* chore(ci): guard cache-warm workflows with a concurrency group

* chore(ci): drop unused node-cache-dependency-path output

* chore(ci): reuse webapp-setup for node_modules in e2e-tests-check
2026-07-08 16:38:11 +00:00
Amy Blais ac44b55530 Fix milestone lookup piping jq output through gh api --jq (#37381)
Automatic Merge
2026-07-08 08:50:45 +02:00
Jesse Hallam c820db7284 ci: auto-build missing buildenv images for in-flight Go version bumps (#37286) 2026-07-02 10:09:29 -03:00
Amy BlaisandClaude Sonnet 4.6 236e39b9fc Update docs-impact-review prompt (#37224)
* Update docs-impact-review workflow with improved configuration

- Include PR head SHA in concurrency group to avoid cancelling concurrent runs on different commits
- Move permissions to workflow level
- Remove Docs/Not Needed label skip condition from job if clause
- Upgrade model to claude-sonnet-4-20250514 with increased max-turns (30→50)
- Add Bash(ls*) to allowedTools
- Add bug-fix pattern to no-docs-needed list
- Refine security fix rule to skip docs unless externally observable contract change
- Guard label addition behind !analysisFailed check

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Revert structural changes from #37084, keep prompt improvements

Reverts the concurrency group SHA addition, permissions restructure,
model/max-turns/tool changes, and label guard from #37084 as they are
not needed.

Keeps only the meaningful prompt changes:
- Remove Docs/Not Needed label skip from job if condition
- Add bug-fix pattern to no-docs-needed list
- Refine security fix rule to skip docs unless externally observable contract change

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Restore Docs/Not Needed label skip condition

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Update docs-impact-review workflow

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 11:08:27 +03:00
Jesse Hallam a54b4b0a4f ci: make setup-go-work a Makefile prereq, remove explicit CI steps (#37268) 2026-06-30 16:04:03 +02:00
Amy Blais 97cf1a4f42 Update docs-needed workflow (#37294)
Automatic Merge
2026-06-30 12:05:18 +02:00
sabril d85da5ce2c E2E/Playwright: Upgrade Playwright to 1.61 and its deps (#37277)
* chore: upgrade playwright to 1.61 and its deps

* fix failed tests

* address comments

* use assignTeamsToPolicy helper method
2026-06-30 04:38:05 +00:00
7fbbf0beef Add CI check to prevent renumbering or renaming existing DB migrations (#37099)
* Add CI check to prevent renumbering or renaming existing DB migrations

Backporting or rebasing a PR can accidentally change the sequence number
or description of a migration that already shipped on master, which
corrupts the upgrade path for existing installations (see MM-68848).

This adds a migration_check tool that compares the working tree's
migration files against the base branch and fails when an existing
migration's version or name differs. Brand new migrations are ignored.
It is wired into the existing "Check migration files" CI job via a new
`make check-migration-changes` target.

Co-authored-by: mattermost-code <matty-code@mattermost.com>

* Apply go fix strings.SplitSeq in migration_check

Co-authored-by: mattermost-code <matty-code@mattermost.com>

* Retrigger CI after transient Enterprise npm failure

Co-authored-by: mattermost-code <matty-code@mattermost.com>

* Use github.ref_name as migration check base ref fallback on push

Co-authored-by: mattermost-code <matty-code@mattermost.com>

* Flag shipped migrations missing from branch by version and name

Add reverse comparison so deletions and simultaneous renumber+rename are
caught, per CodeRabbit review feedback.

Co-authored-by: mattermost-code <matty-code@mattermost.com>

* Address PR feedback: 0 answered, 2 resolved, 0 declined

* Address PR feedback: 2 answered, 1 resolved, 1 declined

* Fix migration check direction and scope to release branches

Address isacikgoz review feedback:
- Reverse the comparison so it flags migration files the branch HAS that
  the base branch (origin/master) does NOT, instead of flagging base
  migrations missing from the branch. A backport branch is an older subset
  of master, so the old direction reported every newer master migration as
  an error.
- Include the up/down kind in the comparison key so a one-sided rename of
  only the .up or .down file is no longer masked by its surviving partner.
- Restrict the CI step to PRs targeting release-* branches, where the head
  is expected to be a subset of master; on master-targeted PRs new
  migrations are normal and would otherwise be flagged as stray.

* Scope migration check to PR-added Postgres migrations

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: mattermost-code <matty-code@mattermost.com>
2026-06-29 12:23:08 -04:00
Amy BlaisandMattermost Build 891b59d459 Server: Create product documentation automation (#36282)
* Create docs process automation

Create an automation for the process of opening docs PRs for dev PRs with the "Docs/Neded" label. This same automation will be applied to mobile/desktop repos.

Associated PR in the docs repo: mattermost/docs#8844.

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

* Update docs-needed.yml

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2026-06-29 11:56:32 +03:00
Jesse Hallam 2d05d06371 ci: replace volatile e2e-platform-pkgs cache with shared webapp-setup (#37182)
* ci: replace volatile e2e-platform-pkgs cache with shared webapp-setup

* ci: replace volatile e2e-platform-pkgs cache in cypress template v2

* ci: tighten prep-deps comments

* fix: typo in webapp-setup comment
2026-06-25 14:31:37 -03:00
Eva SarafianouandCursor 7ed01d749e Skip docs impact review when Docs/Not Needed label is present (#37109)
* Skip docs impact review when Docs/Not Needed label is present

Add a gate job that checks for the Docs/Not Needed label before running
the Claude analysis, so maintainers can opt out without the workflow
re-adding Docs/Needed on subsequent CI runs.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Simplify docs/not-needed gate using contains() expression

Replace the dedicated check-docs-not-needed job with a contains() check
on github.event.pull_request.labels in the docs-impact-review job's if:
condition. This avoids spinning up a separate runner and an extra API
call to achieve the same opt-out behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 12:59:59 +03:00
Eva SarafianouandCursor 2f47a0dafb Update docs impact review workflow to Claude Sonnet 4.6 (#37071)
Claude Sonnet 4 was retired; use the supported claude-sonnet-4-6 model.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 10:43:52 +00:00
Maria A NunezandCursor Agent a08d806a48 Fix flaky-test Mattermost table for colspan section rows (#36993)
* Fix flaky table conversion for colspan section rows

The mikepenz flaky_summary HTML contains per-suite section-header rows
(<td colspan="2"><strong>...</strong></td>) that markdown tables cannot
represent. The sed pipeline only matched bare <td>/<th> with text-only
content, so those rows leaked raw HTML and broke the rendered table in
Mattermost.

Replace the sed/awk conversion with an inline python3 HTML parser that keeps
only rows matching the header column count (dropping the section-header
rows), unescapes HTML entities, escapes in-cell pipes, and emits a flat
markdown table.

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* Collapse whitespace in flaky table cells

str.strip() only trims leading/trailing whitespace, so an embedded newline
(including one decoded from an entity like &#10;) would remain and break the
single-line markdown table row. Collapse all internal whitespace to single
spaces when rendering each cell.

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-06-11 10:20:27 -04:00
Nuno Simões fb77dec493 Configure Dependabot cooldown for GitHub Actions updates (#36887) 2026-06-10 14:09:29 +02:00
Alejandro García Montoro 2e3c0ff278 MM-69175: Fix broken CI steps (#36989)
* Fix broken migration/codegen CI self-checks

The git status self-checks in server-ci.yml became silent no-ops once
these jobs moved into the build container (#33679): the resolved shell
is sh, where the bash-only [[ ]] errors out, and git rejects the
checkout with "dubious ownership". Switch to POSIX [ ], mark the
workspace safe so git status runs, and print the diff on failure across
all affected checks.

* Regenerate stale migrations.list

The broken check-migrations step let an outdated migrations.list ship.
Regenerate it with make migrations-extract to add migration 000193.

* make mocks

* make gen-serialized

* make mmctl-docs
2026-06-10 13:54:10 +02:00
Nuno Simões 7ecd62ddc1 ci: invoke post-server-ci workflows via workflow_call from Server CI (#36880) 2026-06-10 11:54:21 +02:00
Harrison Healey f3836530b7 MM-69003 Mostly share ESLint config between web app and E2E tests (#36767)
* Switch Cypress to use shared ESLint config

* Run --fix in Cypress

* Manually fix remaining lint issues in Cypress

* Switch Playwright to use shared ESLint config

* Run --fix in Playwright

* Manually fix remaining lint issues in Playwright

* Install and cache web app deps during Cypress CI builds

This also caches the types and client package. That isn't needed currently
since it uses prepackaged versions of those, but I imagine we might change
that at some point.

* Run e2e-tests-check when ESLint plugin is updated

* Change E2E test GHA caching to cache all of web app node_modules

* Fix mismatch between cache save and restore

* Try bumping cache keys

* Copy step to install dependencies to server.run_cypress.sh

I don't know how this must've worked before, but if this fixes the issue,
it seems like neither Cypress nor Playwright actually use the cached
depenendencies.

* Try disabling caching entirely for Cypress tests

* Try bypassing makefile?

* Try also manually building dependencies in run_specs.sh

I don't know why this appears to duplicate run_cypress.sh and
run_playwright.sh, both of which are called run_test.sh which
might not be used any more as best I can tell.

* Try installing the web app dependencies in yet another place

* Disable the extra steps in server.prepare.sh specifically for Cypress

* Revert changes to update cache key and disable web app depenedency cache on Cypress builds
2026-06-09 20:50:58 +00:00
Amy BlaisandMattermost Build 7ad8f71bf5 Automate schema migration release notes process (#36760)
* Create migration-automation.yml

* Create migration_automation.py

* Update migration-automation.yml

* Update migration_automation.py

* Update migration-automation.yml

* Update migration_automation.py

* Update migration-automation.yml

* Update migration_automation.py

* Update migration-automation.yml

* Update migration_automation.py

* Update migration-automation.yml

* Update migration_automation.py

* Update migration-automation.yml

* Update migration-automation.yml

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2026-06-09 12:41:42 +03:00
Maria A NunezandCursor Agent b7dda3435c Move flaky test report from PR comment to Mattermost channel (#36965)
* Move flaky test report from PR comment to Mattermost channel

Replace the github-script step that posted the flaky test summary as a PR
comment with a step that posts the summary to a Mattermost channel via a new
Mattermost incoming webhook (WEBHOOK_URL_FLAKY_TEST_MM). The HTML <table>
summary is converted to a Markdown table, with content pipes escaped and HTML
entities decoded. The existing custom flaky-test hub webhook is left untouched.

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* Hoist github.server_url into SERVER_URL env var

Keep all GitHub Actions context expressions in the step's env block for
consistency, and build PR_URL purely from shell variables.

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-06-08 15:16:46 -04:00
Nuno Simões 56015e8b87 ci: use variables in shell for workflows (#36904) 2026-06-04 19:52:53 +02:00
Nuno Simões 4245b69744 Pass explicit secrets to reusable server CI workflows (#36896) 2026-06-04 19:42:32 +02:00
Nuno Simões 3af36e0a49 ci: scope GitHub Actions workflows (#36890)
* Scope GitHub Actions workflow and job permissions

* Fix workflow permissions gaps from least-privilege scoping
2026-06-04 19:40:30 +02:00
Nuno Simões 563e1a951d ci: standardize checkout action inputs across workflows (#36876)
* ci: standardize checkout action inputs across workflows

* ci: checkout in claude pipeline use default
2026-06-04 09:01:22 +02:00
edgarbellot 42f021581f Tighten CI workflows (#36778) 2026-05-28 18:21:13 +02:00
Jesse Hallam 462f34ac6c Generate default_roles_permissions.js from a live server snapshot (#36698)
* Generate default_roles_permissions.js from a live server snapshot

Replace the hand-maintained default_roles_permissions.js with a
generated file. The generator (scripts/default_permissions_generator/)
boots a real app.NewServer() against a temporary database created by
storetest.MakeSqlSettings, lets all schema and app-level migrations run
naturally, then snapshots the resulting Roles table into the JS file.

This eliminates the drift risk of the previous hand-maintained map:
new migrations are picked up automatically because the same server
initialization path is used here as in production.

The CI job gets a postgres service and sets IS_CI=true so the generator
uses the same host-switching logic as the rest of the test suite.
Locally, make start-docker provides the postgres instance.

* Address CodeRabbit feedback: pin checkout SHA, add permissions, add .PHONY entries
2026-05-25 15:03:11 -03:00
Jesse Hallam b60ba8b6b4 chore(ci): allow build-server-image to build and push from release branches (#36716) 2026-05-22 14:15:23 -04:00
Jesse Hallam 834a86b5e3 MM-68248: Support OpenSearch v3 (#36617)
* Remove build-opensearch-image.yml -- the published image is unused

* MM-68248: Support OpenSearch v3

* MM-68248: Add CI job to test OpenSearch v2 backwards compatibility

* MM-68248: Handle missing indexes gracefully before reindex

OpenSearch v3 rejects _update_by_query and _delete_by_query with no index
argument (405), and returns index_not_found_exception (404) when querying
an exact index name that hasn't been created yet. Both arise before any
reindex has run, since indexes are created on first document write.

Return nil/empty instead of an error from all affected operations, and add
test coverage for each in the no-indexes state.

* MM-68248: Fix copy-paste operation names in DeleteFilesBatch

* MM-68248: Add i18n string for delete_files_batch error

* Revert "MM-68248: Add i18n string for delete_files_batch error"

This reverts commit e885678088.

* Revert "MM-68248: Fix copy-paste operation names in DeleteFilesBatch"

This reverts commit 4b7caacf59.

* Revert "MM-68248: Handle missing indexes gracefully before reindex"

This reverts commit 2d2d522f86.
2026-05-22 15:37:50 +00:00