mirror of
https://github.com/expo/explore.git
synced 2026-11-15 17:32:23 -10:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58a9facf1c |
No files matched your search
@@ -16,34 +16,6 @@ Write "No visible change" if there is none.
|
||||
| --- | --- |
|
||||
| | |
|
||||
|
||||
## Code examples
|
||||
|
||||
<!--
|
||||
Required for any change to how Explore is used or what it writes: a CLI command or flag,
|
||||
config.yaml, a workflow template, a file format (a replay or flows file, report JSON), or a
|
||||
public type. Show it in use as a reader would write it: the command with its flags, the config
|
||||
or file it reads, and what it prints or writes, trimmed to the lines that matter. When existing
|
||||
usage changes, show it before and after.
|
||||
Write "No change to usage" if there is none.
|
||||
-->
|
||||
|
||||
```sh
|
||||
|
||||
```
|
||||
|
||||
## Try it
|
||||
|
||||
<!--
|
||||
Optional, but recommended: something a reviewer can open or run to see the change for themselves.
|
||||
- A Viewer change: the Viewer preview comment on this PR links a live build. Name the report,
|
||||
screen and steps to look at.
|
||||
- A capture or report change: a hosted report from a run of this branch (explore:binary,
|
||||
explore:session or capture with --upload), or an app pull request whose review ran this branch.
|
||||
- Otherwise: the commands that run it from a checkout of this branch, for example
|
||||
`npm ci && npm run build`, then `node dist/cli.js <command>`, with any app or file it needs.
|
||||
Write "Nothing to try" if there is nothing a reviewer could run.
|
||||
-->
|
||||
|
||||
## Testing
|
||||
|
||||
<!-- What you ran and what you checked by hand. -->
|
||||
+4
-4
@@ -153,10 +153,10 @@ Each new start logs the failed run's link and reason, for example `the hosted EA
|
||||
|
||||
1. `hostedRepackPeers` lists, in config order, the targets that repack the same app on EAS: one platform, EAS profile and bundle id. `capture:review`, `capture:review --compare` and `capture:baseline` pass them on.
|
||||
- A capture gets a `RepackShare` when it has two or more peers and `GITHUB_RUN_ID`, `GITHUB_RUN_ATTEMPT` and `GITHUB_REPOSITORY` are set. Its scope is the run attempt, its leader is the first peer, and its rank is its place among the peers.
|
||||
- A single target, a local review, `capture.repack: local`, and a native build this job made itself behave as before. The repack of a native build this job made carries no key, so it is never shared.
|
||||
2. The build to repack is the newest finished build with the fingerprint that Explore did not repack itself (`existingBuild`, from 20 builds), else the newest repack. On a project that reviews often, the 20 are all repacks (euxy's 50 most recent `explore` builds were), so jobs that start minutes apart can pick different builds; the key below names the native code, not the build, so they still share.
|
||||
- A single target, a local review, `capture.repack: local`, and a native build this job made itself behave as before. Nobody else's key can match a native build this job made.
|
||||
2. The build to repack is the newest finished build with the fingerprint that Explore did not repack itself (`existingBuild`, from 20 builds). If repacks carry their source's fingerprint, every job still picks the same build.
|
||||
3. Once the copy is staged, the capture takes a key (`hostedRepackShareKey`) from:
|
||||
- the run attempt, the platform and the native fingerprint;
|
||||
- the run attempt, the platform and the native build id;
|
||||
- the EAS profile and environment name;
|
||||
- a snapshot of the environment's variables: `eas env:list --format long` for the project and the account, which names each variable with its value (masked when sensitive or secret) and when it was last updated;
|
||||
- the Explore release;
|
||||
@@ -168,7 +168,7 @@ Each new start logs the failed run's link and reason, for example `the hosted EA
|
||||
6. When the repack it follows fails, is cancelled or loses the key, the capture looks for another with the same key for 60 s, staggered the same way, before it repacks itself. That catches the leader's retry, which starts at once (#176).
|
||||
7. It also repacks itself, with the retries above, when nothing appears in its wait, or when EAS fails to answer three times in a row. Looking stops while the budget still has 5 minutes for a repack of its own. A followed repack that does not finish within the budget fails the target. No capture waits on a job that cannot answer, and none waits past its budget.
|
||||
|
||||
Only a build whose marker is this capture's own key is used, and every input to the key but one is what this capture would itself have uploaded and built with. So two jobs share a repack only when their uploads, native fingerprint, profile, environment variables and Explore release are the same, in the same run attempt. The one input that is not this capture's own is the source build: a follower runs the leader's repack of the build the leader found, which has the same fingerprint as its own but may be another build of it. `existingBuild` already treats builds of one fingerprint as interchangeable; what a repack keeps from its source beyond the native code the fingerprint covers (its Info.plist, and the toolchain it was built with) can differ between such builds. The run attempt is in the scope, and a review's or a first attempt's repacks are never used by another run or attempt. That covers the baseline workflow, whose artifacts later reviews reuse, and "Re-run failed jobs" after an `EXPO_PUBLIC_*` value was fixed, which rebundles with the new value.
|
||||
Only a build whose marker is this capture's own key is used, and every input to the key is what this capture would itself have uploaded and built with. So two jobs share a repack only when their uploads, native build, profile, environment variables and Explore release are the same, in the same run attempt. The run attempt is in the scope, and a review's or a first attempt's repacks are never used by another run or attempt. That covers the baseline workflow, whose artifacts later reviews reuse, and "Re-run failed jobs" after an `EXPO_PUBLIC_*` value was fixed, which rebundles with the new value.
|
||||
|
||||
What the key does not protect against: every input to it is public or predictable, and the pull request's head code runs in the capture job with `EXPO_TOKEN` (`app.config.*` under `eas config` and `eas fingerprint:generate`, and the app's build code on EAS). Head code could therefore make a build whose message carries the base side's marker, and base captures of the same run attempt in other matrix jobs would install it. That is within the trust the capture already gives EAS: the same credentials could publish a simulator build with a reused fingerprint, which every capture already reuses by fingerprint (the `build` stage above), and head code in one job can already tamper with that job's own base side on the runner. The run attempt in the scope keeps such a build out of every other run, including the baseline. Requiring the build's `initiatingActor` to be this job's own credentials would not exclude head code, which runs with the same token. Explore cannot tell offline which actor EAS records for a workflow's repack build, so it does not check it.
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ Pointed to a build, the [quick start](#quick-start) maps every screen of it, wit
|
||||
- A simulator build. A device `.ipa`, an `.aab`, an unsigned APK, or an APK without native libraries for the emulator (x86_64 on EAS Simulator, `arm64-v8a` locally on Apple silicon; a universal APK has both) is rejected before a device starts.
|
||||
- Platform, bundle id, name, and version are read from the build; you pass nothing else.
|
||||
- A run stops after 15 minutes, 40 screens, or 150 actions (`--max-duration-minutes`, `--max-screens`, `--max-actions`).
|
||||
- Buttons that delete, pay, sign out, send, or leave the app are never tapped. Explore judges a control by its label and its identifier (`btn_delete`, `deleteAccount`), including one tapped by position. `--allow-destructive "Reset filters"` allows one by its exact label.
|
||||
- Buttons that delete, pay, sign out, send, or leave the app are never tapped. `--allow-destructive "Reset filters"` allows one by its exact label.
|
||||
- `--hints "…"` tells the model what to focus on or how to sign in ([details](#sign-in-and-other-app-state)).
|
||||
- On EAS Simulator the report is hosted, and the link lasts as long as its EAS Hosting deployment (see [report access](docs/private-review.md#hosted-previews)); `--no-upload` keeps it local. On a local simulator it opens in the local Viewer (`--no-open` or `--json` skips that; `view --dir <folder>` opens it later), and `--upload` hosts it, which needs an EAS login. `--json` prints the result for scripts.
|
||||
- For a link that stays the same from run to run, pass `--alias NAME` and set `EXPLORE_PREVIEW_TOKEN` to a fixed token of 32 characters from a–z and 2–7 (`LC_ALL=C tr -dc a-z2-7 </dev/urandom | head -c 32`).
|
||||
@@ -508,7 +508,7 @@ npx @expo/explore explore:binary ./my-app.app \
|
||||
--hints "Sign in as [email protected] with {{secret:APP_TEST_PASSWORD}}"
|
||||
```
|
||||
|
||||
The model only sees the reference, and Explore types the value. The value is redacted everywhere, and a screen that shows it gets no screenshot, so keep non-sensitive values like a test email as plain text. Explore finds the value in the screen's accessibility tree; a screen that draws it without exposing it there (in a canvas or an image) is not recognised. In CI, store the value as a repository secret instead.
|
||||
The model only sees the reference, and Explore types the value. The value is redacted everywhere, and a screen that shows it gets no screenshot, so keep non-sensitive values like a test email as plain text. In CI, store the value as a repository secret instead.
|
||||
|
||||
If the sign-in can't be typed (one-time codes, email links, Sign in with Apple or Google), sign in by hand on a session and run `explore:session`. Explore never taps Sign out.
|
||||
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@expo/explore",
|
||||
"version": "0.22.1",
|
||||
"version": "0.22.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@expo/explore",
|
||||
"version": "0.22.1",
|
||||
"version": "0.22.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@expo/repack-app": "0.10.1",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@expo/explore",
|
||||
"version": "0.22.1",
|
||||
"version": "0.22.0",
|
||||
"description": "Source-driven mobile app maps, deterministic CI capture, and visual reviews",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
|
||||
@@ -55,7 +55,7 @@ set -a && . ./.env.explore && set +a && npx @expo/explore explore:binary ./app.a
|
||||
--hints "Sign in with {{secret:APP_TEST_EMAIL}} and {{secret:APP_TEST_PASSWORD}}, then explore the signed-in app"
|
||||
```
|
||||
|
||||
The model only ever sees the reference; Explore types the value into the field. The value is redacted from the map, the report and errors, and a frame that shows it (the filled-in form, or a profile screen that displays the email) is kept without a screenshot. Explore finds the value in the accessibility tree, so a value drawn without an accessible label (in a canvas or an image) is not recognised. So make only what is sensitive a secret: a dedicated test email can go in the hints as plain text, and then the account screen keeps its picture. A reference to a variable that is not set fails before a session starts (`EXPLORATION_SECRET_MISSING`); provider keys, `EXPO_TOKEN` and CI variables cannot be referenced.
|
||||
The model only ever sees the reference; Explore types the value into the field. The value is redacted from the map, the report and errors, and a frame that shows it (the filled-in form, or a profile screen that displays the email) is kept without a screenshot. So make only what is sensitive a secret: a dedicated test email can go in the hints as plain text, and then the account screen keeps its picture. A reference to a variable that is not set fails before a session starts (`EXPLORATION_SECRET_MISSING`); provider keys, `EXPO_TOKEN` and CI variables cannot be referenced.
|
||||
|
||||
**When a sign-in cannot be typed** (a one-time code, an email link, Sign in with Apple or Google, a captcha): sign in by hand on a session and use `explore:session`. Sign out is never tapped, so the run stays signed in.
|
||||
|
||||
@@ -64,7 +64,7 @@ The model only ever sees the reference; Explore types the value into the field.
|
||||
- Onboarding: `--launch-url` to a screen past it, or hints such as "skip the tour with Skip".
|
||||
- Screens that need data: a test account that already has it, and hints naming where it is ("open the first project").
|
||||
- Permission prompts are denied. To explore what is behind one, allow it by hand on a session first, then `explore:session`.
|
||||
- Purchases, deletes, sends and sign out are blocked, judged by a control's label and its identifier, including a control tapped by position. `--allow-destructive "Label"` allows one control by label; a paywall needs an account that already has the entitlement.
|
||||
- Purchases, deletes, sends and sign out are blocked. `--allow-destructive "Label"` allows one control by label; a paywall needs an account that already has the entitlement.
|
||||
- A large app: raise the budgets (`--max-duration-minutes`, `--max-screens`, `--max-actions`; see [What happens](#what-happens)) and use the hints to say what to cover first.
|
||||
|
||||
## Already have a session? `explore:session`
|
||||
|
||||
+11
-30
@@ -69,8 +69,6 @@ export type BlackBoxExplorerResult = {
|
||||
const DESTRUCTIVE = /\b(delete|remove|erase|reset|wipe|clear all|sign ?out|log ?out|unsubscribe|cancel subscription|deactivate|close account|purchase|buy|subscribe|pay|checkout|send|post|publish|report|block|submit order|confirm order|place order)\b/i;
|
||||
// A bare "Map" is usually the app's own map tab or screen; only a named maps app or directions leave the app.
|
||||
const EXTERNAL = /\b(open in|safari|chrome|browser|app store|play store|share|mail|call|sms|(apple|google) maps|directions)\b/i;
|
||||
/** For the person running Explore, who sees blocked steps in flow and replay results; the model cannot pass it. */
|
||||
const ALLOW_HINT = "(Whoever runs Explore can allow a safe control with --allow-destructive and its exact label.)";
|
||||
const VOLATILE = /\d|[:%$€£]|\b(am|pm)\b/gi;
|
||||
const INTERACTIVE = new Set(["button", "link", "cell", "switch", "tab", "menuitem", "textfield", "securetextfield", "searchfield", "textview", "edittext", "slider", "checkbox", "radiobutton", "segmentedcontrol", "toggle"]);
|
||||
|
||||
@@ -187,20 +185,13 @@ function isInteractive(node: Record<string, unknown>): boolean {
|
||||
return traits.some(trait => /button|link|tab|adjustable/i.test(trait));
|
||||
}
|
||||
|
||||
const allowed = (label: string, allow: readonly string[]) => allow.some(item => item.toLowerCase() === label.toLowerCase());
|
||||
|
||||
export function riskOf(label: string, allow: readonly string[]): ActionRisk {
|
||||
if (allowed(label, allow)) return "safe";
|
||||
// Identifiers join their words (btn_delete, deleteAccount, sign-out), which \b does not split.
|
||||
const words = label.replace(/(\p{Ll}|\d)(\p{Lu})/gu, "$1 $2").replace(/[_.-]+/g, " ");
|
||||
if (DESTRUCTIVE.test(words)) return "destructive";
|
||||
if (EXTERNAL.test(words)) return "external";
|
||||
if (allow.some(allowed => allowed.toLowerCase() === label.toLowerCase())) return "safe";
|
||||
if (DESTRUCTIVE.test(label)) return "destructive";
|
||||
if (EXTERNAL.test(label)) return "external";
|
||||
return "safe";
|
||||
}
|
||||
|
||||
const RISK_ORDER: readonly ActionRisk[] = ["safe", "unknown", "external", "destructive"];
|
||||
const worstRisk = (...risks: ActionRisk[]): ActionRisk => risks.reduce((worst, risk) => RISK_ORDER.indexOf(risk) > RISK_ORDER.indexOf(worst) ? risk : worst, "safe");
|
||||
|
||||
/** Structure plus stable text, with values and numerals masked, so a clock tick or a counter does not create a new screen. */
|
||||
/**
|
||||
* A text field's label is whatever it shows: its placeholder while empty (Android sets `hintShowing`), then the typed text.
|
||||
@@ -669,11 +660,7 @@ export async function runBlackBoxExploration(options: BlackBoxExplorerOptions):
|
||||
if (input.frameId !== undefined) {
|
||||
const point = { action: "tap" as const, frameId: text(input.frameId, "frameId", 256), x: Number(input.x), y: Number(input.y) };
|
||||
const target = input.target !== undefined ? cleanLabel(text(input.target, "target", 80)) : "";
|
||||
// The control under the point is judged by its own label and identifier too, not only by the model's description of it.
|
||||
const under = nodeUnder(point), underLabel = str(under?.label);
|
||||
const risk = underLabel && allowed(underLabel, allow) ? "safe"
|
||||
: worstRisk(target ? riskOf(target, allow) : "unknown", ...[underLabel, str(under?.identifier)].flatMap(name => name ? [riskOf(name, allow)] : []));
|
||||
return { action: point, kind: "press", label: target || placeUnder(point) || `tap ${point.x.toFixed(2)},${point.y.toFixed(2)}`, risk };
|
||||
return { action: point, kind: "press", label: target || placeUnder(point) || `tap ${point.x.toFixed(2)},${point.y.toFixed(2)}`, risk: target ? riskOf(target, allow) : "unknown" };
|
||||
}
|
||||
if (!selector) throw failure("AGENT_ACTION_INVALID", "tap needs a label, an identifier, or frame coordinates.");
|
||||
return { action: { action: "tap", ...selector } as BlackBoxAction, kind: "press", label, risk };
|
||||
@@ -727,12 +714,13 @@ export async function runBlackBoxExploration(options: BlackBoxExplorerOptions):
|
||||
return { action: "tap", frameId: latest.frameId ?? "current", x: (bounds.x + bounds.width / 2) / extent.width, y: (bounds.y + bounds.height / 2) / extent.height };
|
||||
};
|
||||
|
||||
/** The smallest hittable control at a frame point in the latest tree, whether or not the map has recorded it. */
|
||||
const nodeUnder = (point: { x: number; y: number }): Record<string, unknown> | undefined => {
|
||||
/** A coordinate tap the model did not describe, on a node the map has no name for (an icon-font button in a header), is
|
||||
* named by what it is and where it sits: "icon button, top right" says more than the coordinates did. */
|
||||
const placeUnder = (point: { x: number; y: number }): string | undefined => {
|
||||
const extent = latest ? frameExtent(latest.nodes) : undefined;
|
||||
if (!extent) return undefined;
|
||||
const x = point.x * extent.width, y = point.y * extent.height;
|
||||
return latest!.nodes
|
||||
const under = latest!.nodes
|
||||
.filter(node => {
|
||||
const rect = node.rect as { x: number; y: number; width: number; height: number } | undefined;
|
||||
return !!rect && node.hittable === true && x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height
|
||||
@@ -742,12 +730,6 @@ export async function runBlackBoxExploration(options: BlackBoxExplorerOptions):
|
||||
const ra = a.rect as { width: number; height: number }, rb = b.rect as { width: number; height: number };
|
||||
return ra.width * ra.height - rb.width * rb.height;
|
||||
})[0];
|
||||
};
|
||||
|
||||
/** A coordinate tap the model did not describe, on a node the map has no name for (an icon-font button in a header), is
|
||||
* named by what it is and where it sits: "icon button, top right" says more than the coordinates did. */
|
||||
const placeUnder = (point: { x: number; y: number }): string | undefined => {
|
||||
const under = nodeUnder(point);
|
||||
if (!under) return undefined;
|
||||
const role = roleOf(under);
|
||||
const label = str(under.label) ?? "";
|
||||
@@ -823,8 +805,7 @@ export async function runBlackBoxExploration(options: BlackBoxExplorerOptions):
|
||||
: elementUnder(chosen.action, fromScreenId);
|
||||
const { action, kind } = chosen;
|
||||
const label = named ? named.label : chosen.label;
|
||||
// A control allowed by its label is allowed however it is targeted, even when its identifier reads as risky.
|
||||
const risk = named && allowed(named.label, allow) ? "safe" : named && chosen.risk !== "destructive" && chosen.risk !== "external" ? riskOf(named.label, allow) : chosen.risk;
|
||||
const risk = named && chosen.risk !== "destructive" && chosen.risk !== "external" ? riskOf(named.label, allow) : chosen.risk;
|
||||
const startedAt = timestamp();
|
||||
const attemptId = `att_${randomUUID().slice(0, 12)}`;
|
||||
const matched = map.frontier.find(item => item.status === "pending" && item.screenId === fromScreenId && item.actionKind === kind
|
||||
@@ -836,8 +817,8 @@ export async function runBlackBoxExploration(options: BlackBoxExplorerOptions):
|
||||
startedAt, completedAt: timestamp(), reason });
|
||||
await persist();
|
||||
return toolResult({ ok: false, blocked: true, reason: risk === "destructive"
|
||||
? `"${label}" looks destructive (delete/reset/sign out/purchase/send). Explore does not activate such controls. Choose another control. ${ALLOW_HINT}`
|
||||
: `"${label}" looks like it opens another app (browser/store/share/mail/maps). Explore does not activate such controls. Choose another control. ${ALLOW_HINT}` });
|
||||
? `"${label}" looks destructive (delete/reset/sign out/purchase/send). Explore does not activate such controls. Choose another control.`
|
||||
: `"${label}" looks like it opens another app (browser/store/share/mail/maps). Explore does not activate such controls. Choose another control.` });
|
||||
}
|
||||
// The map keeps the reference the model typed; only the device gets the value.
|
||||
const typed = action.action === "fill" || action.action === "type" ? { ...action, text: inputs.resolve(action.text) } : action;
|
||||
|
||||
+10
-17
@@ -119,9 +119,9 @@ const EXPLORE_REPACK_MESSAGE = /^expo-explore (?:ios|android) capture: route obs
|
||||
|
||||
/**
|
||||
* The finished build to repack from `eas build:list --fingerprint-hash`: the newest one Explore did not repack itself,
|
||||
* else the newest. A repack keeps its source build's native code and carries its fingerprint, so on a project that
|
||||
* reviews often every listed build is a repack, and this is the newest of them; jobs that look minutes apart can get
|
||||
* different ones. A shared repack is keyed by the fingerprint, not by this build (hostedRepackShareKey).
|
||||
* else the newest. A repack keeps its source build's native code, and may carry its fingerprint; preferring the build
|
||||
* it came from has every job of a run pick the same one, which a shared repack's key needs (RepackShare), instead of a
|
||||
* repack another job finished a minute earlier.
|
||||
*/
|
||||
export function existingBuild(stdout: string): EasBuildDescriptor | undefined {
|
||||
const value = parseJson(stdout, "eas build:list");
|
||||
@@ -712,18 +712,13 @@ export async function stagedProjectDigest(root: string): Promise<string> {
|
||||
|
||||
/**
|
||||
* The key a shared repack's build carries in its message: everything the repack is made from, so two jobs share one only
|
||||
* when each would have uploaded the same bytes onto the same native code, for the same profile, EAS environment (by name
|
||||
* and by a snapshot of its variables) and Explore release, in the same run attempt.
|
||||
*
|
||||
* The native code is named by its fingerprint, not by the build a job found to repack: the build lookup returns the
|
||||
* newest build with that fingerprint, which is often an earlier repack, and it moves as repacks finish. In
|
||||
* brentvatne/euxy#179 (review run 40042718931) a target that started late found the repack the others had just made,
|
||||
* so its key matched none; it waited 3 minutes for a repack it could not find, then made another.
|
||||
* when each would have uploaded the same bytes for the same native build, profile, EAS environment (by name and by a
|
||||
* snapshot of its variables) and Explore release, in the same run attempt.
|
||||
*/
|
||||
export function hostedRepackShareKey(input: { scope: string; platform: "ios" | "android"; fingerprint: string; easProfile: string;
|
||||
export function hostedRepackShareKey(input: { scope: string; platform: "ios" | "android"; nativeBuildId: string; easProfile: string;
|
||||
environment: string; environmentVariables: string; project: string }): string {
|
||||
return createHash("sha256").update(JSON.stringify({ contract: "expo-explore.repack-share.v3", explore: EXPLORE_VERSION, scope: input.scope,
|
||||
platform: input.platform, fingerprint: input.fingerprint, easProfile: input.easProfile, environment: input.environment,
|
||||
return createHash("sha256").update(JSON.stringify({ contract: "expo-explore.repack-share.v2", explore: EXPLORE_VERSION, scope: input.scope,
|
||||
platform: input.platform, nativeBuildId: input.nativeBuildId, easProfile: input.easProfile, environment: input.environment,
|
||||
environmentVariables: input.environmentVariables, project: input.project })).digest("hex").slice(0, 32);
|
||||
}
|
||||
|
||||
@@ -875,8 +870,6 @@ async function prepareHostedRepack(options: {
|
||||
easCommand: string;
|
||||
project: string;
|
||||
nativeBuildId: string;
|
||||
/** The native fingerprint of that build, which keys a shared repack (hostedRepackShareKey). */
|
||||
fingerprint: string;
|
||||
easProfile: string;
|
||||
repackProfile: RepackProfile;
|
||||
easEnvironment: NodeJS.ProcessEnv;
|
||||
@@ -937,7 +930,7 @@ async function prepareHostedRepack(options: {
|
||||
if (variables === undefined) options.say(`EAS did not list the ${environment} environment's variables; repacking here without sharing the repack`);
|
||||
else {
|
||||
// The digest is taken before the workflow file is written: the file's message carries the key made from it.
|
||||
const marker = hostedRepackShareMarker(hostedRepackShareKey({ scope: options.share.scope, platform, fingerprint: options.fingerprint,
|
||||
const marker = hostedRepackShareMarker(hostedRepackShareKey({ scope: options.share.scope, platform, nativeBuildId: options.nativeBuildId,
|
||||
easProfile: options.easProfile, environment, environmentVariables: variables, project: await stagedProjectDigest(staged) }));
|
||||
const shared = await options.timings.measure("repack-share-wait", () => sharedHostedRepack({ share: options.share!, marker, platform, say: options.say, clock,
|
||||
list: () => eas(["build:list", "--platform", platform, "--limit", String(SHARED_REPACK_LIST_LIMIT), "--json", "--non-interactive"], 2 * 60_000).stdout,
|
||||
@@ -1019,7 +1012,7 @@ export async function prepareExactSourceBuild(options: {
|
||||
if ((options.repack ?? "eas") === "eas") {
|
||||
if (!options.easProfile) throw new Error("The hosted repack needs the capture build profile name.");
|
||||
const hosted = await prepareHostedRepack({ platform, runner: options.runner, easCommand: options.easCommand, project: options.project,
|
||||
nativeBuildId: options.nativeBuildId, fingerprint: options.fingerprint, easProfile: options.easProfile, repackProfile: options.repackProfile,
|
||||
nativeBuildId: options.nativeBuildId, easProfile: options.easProfile, repackProfile: options.repackProfile,
|
||||
easEnvironment: options.easEnvironment, restrictedEnvironment: options.repackEnvironment, provider: providers[0]!,
|
||||
parameterKeys: captureObserverParameterKeys(options.routes), root, share: options.share, say: options.progress ?? (() => undefined),
|
||||
timings: options.timings ?? silentTimings, onBlocking: options.onBlocking,
|
||||
|
||||
+1
-1
@@ -608,7 +608,7 @@ async function executeCiMap(options: CiMapOptions, setStage: (stage: string) =>
|
||||
type BuiltApp = { fingerprint: string; nativeEasBuildId: string | null; easBuildId: string | null; app?: string; reused: boolean; version?: string; buildNumber?: string };
|
||||
// What a hosted repack waits with and reports through: one deadline from the moment the session starts beside it, for
|
||||
// the wait for another job's repack and every repack of its own. The repack is shared with this run's other matrix
|
||||
// jobs only when it repacks a build EAS already had: a native build this job made is its own, so its repack carries no key and is never shared.
|
||||
// jobs only when it repacks a build EAS already had: a native build this job made is its own, so nobody else's key matches it.
|
||||
const repackWaits = (shared: boolean) => ({ ...(shared ? { share: options.repackShare } : {}), progress: say, now: options.now, sleep: options.sleep, timings, onBlocking: options.onBlocking,
|
||||
signal: options.signal, deadline: (options.now ?? Date.now)() + HOSTED_REPACK_BUDGET_MS });
|
||||
// `repacking` tells the captures sharing this build that their sessions can start too (sharedBuild).
|
||||
|
||||
@@ -87,16 +87,14 @@ jobs:
|
||||
shell: bash
|
||||
# Launch recordings (capture.launch) are decoded with ffmpeg; GitHub's Ubuntu runners do not ship it. A package
|
||||
# mirror can stall without failing, so each apt-get call has network timeouts and a time limit, and a stalled
|
||||
# attempt is tried once more: the step fails in minutes rather than holding the job to its timeout. timeout runs
|
||||
# under sudo so its signal reaches apt-get itself, and -k kills an apt-get that does not exit on it: without -k,
|
||||
# timeout waits for the command however long it takes (brentvatne/euxy review run 40042718931 waited 7 minutes).
|
||||
# attempt is tried once more: the step fails in minutes rather than holding the job to its timeout.
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if ! command -v ffmpeg > /dev/null; then
|
||||
apt=(apt-get -qq -o Acquire::Retries=3 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 -o DPkg::Lock::Timeout=120)
|
||||
apt=(sudo apt-get -qq -o Acquire::Retries=3 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 -o DPkg::Lock::Timeout=120)
|
||||
for attempt in 1 2; do
|
||||
if sudo timeout -k 10 120 "${apt[@]}" update && sudo timeout -k 10 120 "${apt[@]}" install -y --no-install-recommends ffmpeg > /dev/null; then break; fi
|
||||
if timeout 120 "${apt[@]}" update && timeout 120 "${apt[@]}" install -y --no-install-recommends ffmpeg > /dev/null; then break; fi
|
||||
if [ "$attempt" = 2 ]; then echo '::error title=LAUNCH_DECODER_INSTALL_FAILED::apt-get could not install ffmpeg; rerun the job.'; exit 1; fi
|
||||
echo "::warning title=LAUNCH_DECODER_INSTALL_RETRY::apt-get did not install ffmpeg on attempt $attempt; trying again."
|
||||
done
|
||||
|
||||
@@ -124,16 +124,14 @@ jobs:
|
||||
shell: bash
|
||||
# Launch recordings (capture.launch) are decoded with ffmpeg; GitHub's Ubuntu runners do not ship it. A package
|
||||
# mirror can stall without failing, so each apt-get call has network timeouts and a time limit, and a stalled
|
||||
# attempt is tried once more: the step fails in minutes rather than holding the job to its timeout. timeout runs
|
||||
# under sudo so its signal reaches apt-get itself, and -k kills an apt-get that does not exit on it: without -k,
|
||||
# timeout waits for the command however long it takes (brentvatne/euxy review run 40042718931 waited 7 minutes).
|
||||
# attempt is tried once more: the step fails in minutes rather than holding the job to its timeout.
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if ! command -v ffmpeg > /dev/null; then
|
||||
apt=(apt-get -qq -o Acquire::Retries=3 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 -o DPkg::Lock::Timeout=120)
|
||||
apt=(sudo apt-get -qq -o Acquire::Retries=3 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 -o DPkg::Lock::Timeout=120)
|
||||
for attempt in 1 2; do
|
||||
if sudo timeout -k 10 120 "${apt[@]}" update && sudo timeout -k 10 120 "${apt[@]}" install -y --no-install-recommends ffmpeg > /dev/null; then break; fi
|
||||
if timeout 120 "${apt[@]}" update && timeout 120 "${apt[@]}" install -y --no-install-recommends ffmpeg > /dev/null; then break; fi
|
||||
if [ "$attempt" = 2 ]; then echo '::error title=LAUNCH_DECODER_INSTALL_FAILED::apt-get could not install ffmpeg; rerun the job.'; exit 1; fi
|
||||
echo "::warning title=LAUNCH_DECODER_INSTALL_RETRY::apt-get did not install ffmpeg on attempt $attempt; trying again."
|
||||
done
|
||||
|
||||
@@ -113,16 +113,14 @@ jobs:
|
||||
shell: bash
|
||||
# Launch recordings (capture.launch) are decoded with ffmpeg; GitHub's Ubuntu runners do not ship it. A package
|
||||
# mirror can stall without failing, so each apt-get call has network timeouts and a time limit, and a stalled
|
||||
# attempt is tried once more: the step fails in minutes rather than holding the job to its timeout. timeout runs
|
||||
# under sudo so its signal reaches apt-get itself, and -k kills an apt-get that does not exit on it: without -k,
|
||||
# timeout waits for the command however long it takes (brentvatne/euxy review run 40042718931 waited 7 minutes).
|
||||
# attempt is tried once more: the step fails in minutes rather than holding the job to its timeout.
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if ! command -v ffmpeg > /dev/null; then
|
||||
apt=(apt-get -qq -o Acquire::Retries=3 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 -o DPkg::Lock::Timeout=120)
|
||||
apt=(sudo apt-get -qq -o Acquire::Retries=3 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 -o DPkg::Lock::Timeout=120)
|
||||
for attempt in 1 2; do
|
||||
if sudo timeout -k 10 120 "${apt[@]}" update && sudo timeout -k 10 120 "${apt[@]}" install -y --no-install-recommends ffmpeg > /dev/null; then break; fi
|
||||
if timeout 120 "${apt[@]}" update && timeout 120 "${apt[@]}" install -y --no-install-recommends ffmpeg > /dev/null; then break; fi
|
||||
if [ "$attempt" = 2 ]; then echo '::error title=LAUNCH_DECODER_INSTALL_FAILED::apt-get could not install ffmpeg; rerun the job.'; exit 1; fi
|
||||
echo "::warning title=LAUNCH_DECODER_INSTALL_RETRY::apt-get did not install ffmpeg on attempt $attempt; trying again."
|
||||
done
|
||||
|
||||
@@ -1207,52 +1207,3 @@ test("a replay plan's {{secret:NAME}} inputs are read before any device starts a
|
||||
assert.equal(map.actionAttempts[0].action.input.value, "{{secret:APP_TEST_PASSWORD}}");
|
||||
assert.ok(!JSON.stringify(map).includes("hunter2-test"));
|
||||
});
|
||||
|
||||
test("risk words are found inside identifiers that join them", async () => {
|
||||
const { riskOf } = await tsImport("../../src/binary/explorer.ts", import.meta.url);
|
||||
for (const label of ["btn_delete", "deleteAccount", "sign-out", "logOutButton", "settings.reset"]) assert.equal(riskOf(label, []), "destructive", label);
|
||||
assert.equal(riskOf("openInSafari", []), "external");
|
||||
for (const label of ["postsTab", "settings_button", "Profile", "MapView"]) assert.equal(riskOf(label, []), "safe", label);
|
||||
assert.equal(riskOf("resetFilters", ["resetFilters"]), "safe", "an allowed identifier");
|
||||
});
|
||||
|
||||
/**
|
||||
* A screen whose only control is a hittable custom view the map does not record as a control (type Other, as many
|
||||
* custom pressables are): its risk is in its own label and identifier.
|
||||
*/
|
||||
function iconScreen(icon) {
|
||||
return [{ type: "Window", rect: { x: 0, y: 0, width: 400, height: 800 } }, { type: "StaticText", label: "Inbox" },
|
||||
{ type: "Other", hittable: true, rect: { x: 340, y: 40, width: 44, height: 44 }, ...icon }];
|
||||
}
|
||||
|
||||
test("a coordinate tap is judged by the control under the point, whatever the model calls it", async () => {
|
||||
for (const icon of [{ identifier: "btn_delete" }, { label: "Delete conversation" }]) {
|
||||
const { calls, acted, map } = await harness([["observe", { includeImage: true }], ["act", { action: "tap", frameId: "frame-0", x: 0.9, y: 0.075, target: "Profile" }], ["finish", { summary: "x" }]],
|
||||
{ observe: async includeImage => ({ nodes: iconScreen(icon), capturedAt: new Date().toISOString(), ...(includeImage ? { frameId: "frame-0", png: PNG, imageSha256: "d".repeat(64) } : {}) }) });
|
||||
assert.equal(acted.length, 0, JSON.stringify(icon));
|
||||
assert.equal(calls[1].result.blocked, true);
|
||||
assert.match(calls[1].result.reason, /looks destructive.*--allow-destructive/);
|
||||
assert.equal(map.actionAttempts.at(-1).risk, "destructive");
|
||||
}
|
||||
});
|
||||
|
||||
test("a coordinate tap on a control allowed by its label goes through, even when its identifier reads as risky", async () => {
|
||||
const { acted } = await harness([["observe", { includeImage: true }], ["act", { action: "tap", frameId: "frame-0", x: 0.9, y: 0.075 }], ["finish", { summary: "x" }]],
|
||||
{ allowDestructive: ["Reset filters"],
|
||||
observe: async includeImage => ({ nodes: iconScreen({ label: "Reset filters", identifier: "resetFilters" }), capturedAt: new Date().toISOString(), ...(includeImage ? { frameId: "frame-0", png: PNG, imageSha256: "d".repeat(64) } : {}) }) });
|
||||
assert.equal(acted.length, 1);
|
||||
});
|
||||
|
||||
test("a coordinate tap with no control under the point is still recorded as unknown, not refused", async () => {
|
||||
const { acted, map } = await harness([["observe", { includeImage: true }], ["act", { action: "tap", frameId: "frame-0", x: 0.5, y: 0.5 }], ["finish", { summary: "x" }]],
|
||||
{ observe: async includeImage => ({ nodes: iconScreen({ identifier: "btn_delete" }), capturedAt: new Date().toISOString(), ...(includeImage ? { frameId: "frame-0", png: PNG, imageSha256: "d".repeat(64) } : {}) }) });
|
||||
assert.equal(acted.length, 1);
|
||||
assert.equal(map.actionAttempts.at(-1).risk, "unknown");
|
||||
});
|
||||
|
||||
test("a tap by identifier on a control allowed by its label goes through", async () => {
|
||||
const screen = [{ type: "StaticText", label: "Filters" }, { type: "Button", label: "Reset filters", identifier: "resetFilters" }];
|
||||
const { acted } = await harness([["observe", { includeImage: true }], ["act", { action: "tap", identifier: "resetFilters" }], ["finish", { summary: "x" }]],
|
||||
{ allowDestructive: ["Reset filters"], observe: async includeImage => ({ nodes: screen, capturedAt: new Date().toISOString(), ...(includeImage ? { frameId: "frame-0", png: PNG, imageSha256: "e".repeat(64) } : {}) }) });
|
||||
assert.equal(acted.length, 1);
|
||||
});
|
||||
@@ -243,7 +243,7 @@ async function fixture(t, settings = {}) {
|
||||
if (listed === null) throw new Error('eas env:list exited with status 1: GraphQL request failed.');
|
||||
return { stdout: listed ?? 'Environment: preview\nNo variables found for this environment.\n', stderr: '' };
|
||||
}
|
||||
if (command === 'build:list') return json(settings.reuse ? [{ id: settings.reusable ?? 'native-build', ...buildMetadata }] : []);
|
||||
if (command === 'build:list') return json(settings.reuse ? [{ id: 'native-build', ...buildMetadata }] : []);
|
||||
if (command === 'build') return json([{ id: 'built-app', fingerprint: { hash: 'source-fingerprint' }, ...buildMetadata }]);
|
||||
if (command === 'env:pull') { writeFileSync(value(request, '--path'), '# Environment: preview\nEXPO_PUBLIC_ENDPOINT=sample\n'); return { stdout: '', stderr: '' }; }
|
||||
if (command === 'build:download') {
|
||||
@@ -2146,22 +2146,6 @@ test('two jobs of one run attempt that repack the same app share one hosted repa
|
||||
assert.ok(lines.some(line => /using EAS build repacked-app, the hosted repack of this commit another target of this run made/.test(line)), lines.join('\n'));
|
||||
});
|
||||
|
||||
test('a target that starts after the shared repack finished, and finds that repack as its build to repack, joins it', async t => {
|
||||
const eas = easBuilds();
|
||||
const leader = await fixture(t, { reuse: true, eas });
|
||||
await runCiMap({ ...leader.options, ...share('iphone') });
|
||||
eas.builds[0].status = 'FINISHED';
|
||||
// The newest build with the fingerprint is now the leader's repack (brentvatne/euxy#179, review run 40042718931): a
|
||||
// key made from the build each job found would differ, and this target would wait, then repack a repack itself.
|
||||
const { f, lines, run } = await follow(t, eas, { reusable: 'repacked-app' });
|
||||
const result = await run;
|
||||
assert.equal(runs(f), 0, 'the late target does not repack');
|
||||
assert.equal(shareLists(f), 1, 'its first look finds the finished repack');
|
||||
assert.deepEqual(downloaded(f), ['repacked-app']);
|
||||
assert.equal(result.easBuildId, 'repacked-app');
|
||||
assert.ok(lines.some(line => /using EAS build repacked-app, the hosted repack of this commit another target of this run made/.test(line)), lines.join('\n'));
|
||||
});
|
||||
|
||||
test("a target follows the leader's repack by its id while it runs, even once newer builds push it off the list", async t => {
|
||||
const message = await leaderMessage(t);
|
||||
const eas = easBuilds([{ id: 'leader-repack', status: 'IN_QUEUE', platform: 'IOS', message }]);
|
||||
|
||||
@@ -129,17 +129,13 @@ test('the staged digest changes with any file, mode or link, and the share key w
|
||||
await rm(join(root, 'entry.js')); await symlink('package.json', join(root, 'entry.js')); digests.push(await stagedProjectDigest(root));
|
||||
await mkdir(join(root, 'empty')); digests.push(await stagedProjectDigest(root));
|
||||
assert.equal(new Set(digests).size, digests.length);
|
||||
const input = { scope: 'acme/example#39506405687.1', platform: 'ios', fingerprint: 'ea9bf84e1a5b0900000ba7c1e6b1c7e272e1306f', easProfile: 'explore', environment: 'preview', environmentVariables: 'a'.repeat(64), project: digests[0] };
|
||||
const input = { scope: 'acme/example#39506405687.1', platform: 'ios', nativeBuildId: 'a81d5d80', easProfile: 'explore', environment: 'preview', environmentVariables: 'a'.repeat(64), project: digests[0] };
|
||||
const key = hostedRepackShareKey(input);
|
||||
assert.match(key, /^[0-9a-f]{32}$/);
|
||||
for (const [name, other] of Object.entries({ scope: 'acme/example#39506405687.2', platform: 'android', fingerprint: 'fc2446ef4e6d0000000000000000000000000000', easProfile: 'other', environment: 'production',
|
||||
for (const [name, other] of Object.entries({ scope: 'acme/example#39506405687.2', platform: 'android', nativeBuildId: 'b0000000', easProfile: 'other', environment: 'production',
|
||||
environmentVariables: 'b'.repeat(64), project: digests[1] })) {
|
||||
assert.notEqual(hostedRepackShareKey({ ...input, [name]: other }), key, name);
|
||||
}
|
||||
// Which build a job found to repack does not matter, only its native code: a target that starts after the others'
|
||||
// repack finished finds that repack as its newest build of the fingerprint (brentvatne/euxy#179), and must still
|
||||
// join it rather than make another.
|
||||
assert.equal(hostedRepackShareKey({ ...input, nativeBuildId: '7f6b592a' }), hostedRepackShareKey({ ...input, nativeBuildId: '2ebcfd8d' }));
|
||||
});
|
||||
|
||||
test("only a build whose message ends with this key, for this platform, is another job's repack", () => {
|
||||
|
||||
@@ -316,13 +316,9 @@
|
||||
.compare-stage.mode-flip .compare-frame-wrap,
|
||||
.sidebar-review-stage.mode-flip .compare-frame-wrap,
|
||||
.sidebar-review-stage.mode-split.landscape .compare-frame-wrap { display: flex; justify-content: center; }
|
||||
/* The width is spelled out, not left to aspect-ratio: WebKit sizes a flex item by its height + aspect-ratio box's
|
||||
available width rather than its ratio width, so Split's two sides stayed half the stage each and each frame sat at
|
||||
the left of its side, off centre under its name (seen on a folded iPhone Duo). */
|
||||
.compare-frame {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: calc(var(--compare-frame-height) * var(--compare-aspect));
|
||||
height: var(--compare-frame-height);
|
||||
aspect-ratio: var(--compare-aspect);
|
||||
overflow: hidden;
|
||||
|
||||
Reference in new issue
Block a user