mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-04 18:08:54 +00:00
Based on the later commits (after the earlier experimentation and reversions), the meaningful end state of the PR is: **Summary:** Improve E2E CI reliability, performance, and security by introducing robust build caching with safe fingerprinting and cache isolation, duration-based test sharding with graceful fallbacks, more reliable E2E impact detection and status handling, stronger cancellation/concurrency behavior, multiple iOS Detox stability fixes, and hardening GitHub Actions to avoid executing PR-authored code. Also includes CI fixes for iOS builds and a temporary Android E2E test skip for a known regression. --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Mattermost Build <build@mattermost.com>
49 lines
1.5 KiB
JavaScript
49 lines
1.5 KiB
JavaScript
'use strict';
|
|
|
|
/**
|
|
* Shared helpers for paths.json — used by the fingerprint action (via node -e)
|
|
* and by unit tests. Keep impact-filter glob conversion here so both sides agree.
|
|
*/
|
|
|
|
const path = require('path');
|
|
|
|
function loadPaths(pathsFile) {
|
|
// Dynamic path so the composite action can pass GITHUB_ACTION_PATH/paths.json.
|
|
// eslint-disable-next-line import/no-dynamic-require, global-require
|
|
return require(pathsFile || path.join(__dirname, 'paths.json'));
|
|
}
|
|
|
|
/** git ls-tree path → impact-filter glob (dir/ → dir/**). */
|
|
function fingerprintPathToGlob(entry) {
|
|
return entry.endsWith('/') ? `${entry}**` : entry;
|
|
}
|
|
|
|
function fingerprintPathsForPlatform(paths, platform) {
|
|
const extra = paths.fingerprintByPlatform[platform];
|
|
if (!extra) {
|
|
throw new Error(`Unknown platform: ${platform}`);
|
|
}
|
|
return [...paths.fingerprintShared, ...extra];
|
|
}
|
|
|
|
/** All globs the label manager should treat as E2E-impacting. */
|
|
function impactGlobs(paths) {
|
|
const fromFingerprint = new Set();
|
|
for (const entry of paths.fingerprintShared) {
|
|
fromFingerprint.add(fingerprintPathToGlob(entry));
|
|
}
|
|
for (const platformPaths of Object.values(paths.fingerprintByPlatform)) {
|
|
for (const entry of platformPaths) {
|
|
fromFingerprint.add(fingerprintPathToGlob(entry));
|
|
}
|
|
}
|
|
return [...fromFingerprint, ...paths.triggerExtra];
|
|
}
|
|
|
|
module.exports = {
|
|
loadPaths,
|
|
fingerprintPathToGlob,
|
|
fingerprintPathsForPlatform,
|
|
impactGlobs,
|
|
};
|