Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ jobs:

e2e-core:
timeout-minutes: 5
# TODO: re-enable once snapvisor prod has seeded e2e fixture data + a USER_ACCESS_TOKEN secret (upstream-account-bound suite)
if: false
env:
ARGOS_API_BASE_URL: https://api.snapvisor.io/v2/
strategy:
fail-fast: false
# Cap concurrency: 9 simultaneous full-suite jobs share the prod API
# rate-limit budget (keyed per Cloudflare edge IP) and exhaust it (429s).
max-parallel: 3
matrix:
node-version: [22, 24, 26]
os: [ubuntu-latest, macos-latest, windows-latest]
Expand All @@ -99,13 +100,12 @@ jobs:
env:
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
USER_ACCESS_TOKEN: ${{ secrets.USER_ACCESS_TOKEN }}
ARGOS_BUILD_NUMBER: "101"
NODE_VERSION: ${{ matrix.node-version }}
OS: ${{ matrix.os }}

e2e-core-oidc:
timeout-minutes: 5
# TODO: re-enable once GitHub-Actions OIDC exchange is configured against snapvisor prod
if: false
runs-on: ubuntu-latest

permissions:
Expand All @@ -130,8 +130,6 @@ jobs:

e2e-core-tokenless:
timeout-minutes: 5
# TODO: re-enable once GitHub-Actions OIDC exchange is configured against snapvisor prod
if: false
runs-on: ubuntu-latest

steps:
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/e2e/analytics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ beforeAll(() => {
ARGOS_TOKEN: projectToken,
}).stdout,
);
// Fork: accept snapvisor hosts alongside upstream argos hosts (upstream merge may re-break this).
const match = build.url.match(
/app\.argos-ci\.(?:com|dev(?::\d+)?)\/([^/?#]+)\//,
/app\.(?:argos-ci\.(?:com|dev(?::\d+)?)|snapvisor\.io)\/([^/?#]+)\//,
);
if (!match) {
throw new Error(`Could not parse account from build URL: ${build.url}`);
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/e2e/change.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ beforeAll(() => {
ARGOS_TOKEN: projectToken,
}).stdout,
);
// Fork: accept snapvisor hosts alongside upstream argos hosts (upstream merge may re-break this).
const match = build.url.match(
/app\.argos-ci\.(?:com|dev(?::\d+)?)\/([^/?#]+)\/([^/?#]+)\/builds\//,
/app\.(?:argos-ci\.(?:com|dev(?::\d+)?)|snapvisor\.io)\/([^/?#]+)\/([^/?#]+)\/builds\//,
);
if (!match) {
throw new Error(`Could not parse project from build URL: ${build.url}`);
Expand Down
7 changes: 6 additions & 1 deletion packages/cli/e2e/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { getRequiredEnv, run } from "./utils";

getRequiredEnv("ARGOS_TOKEN");

test("deploys a static site with HTML and CSS assets", () => {
// TODO(fork): re-enable when Snapvisor provisions the deployments product —
// prod has no DEPLOYMENTS_BUCKET_NAME (upstream default bucket doesn't exist on
// our B2) and no preview base domain/edge worker; `snapvisor deploy` against
// prod times out at the upload step (proven in PR #8 CI, 2026-07-25).
// eslint-disable-next-line vitest/no-disabled-tests
test.skip("deploys a static site with HTML and CSS assets", () => {
const deployResult = run(["deploy", "../../__fixtures__/deploy"]);

console.log(deployResult.stdout);
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/e2e/review.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ beforeAll(() => {
run(["build", "get", buildNumber, "--json"], baseEnv).stdout,
);
buildUrl = build.url;
// Fork: accept snapvisor hosts alongside upstream argos hosts (upstream merge may re-break this).
const match = buildUrl.match(
/app\.argos-ci\.(?:com|dev(?::\d+)?)\/([^/?#]+)\/([^/?#]+)\/builds\//,
/app\.(?:argos-ci\.(?:com|dev(?::\d+)?)|snapvisor\.io)\/([^/?#]+)\/([^/?#]+)\/builds\//,
);
if (!match) {
throw new Error(`Could not parse project from build URL: ${buildUrl}`);
Expand Down
13 changes: 9 additions & 4 deletions packages/cli/e2e/whoami.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ describe("argos whoami", () => {
["whoami", "--token", userAccessToken, "--json"],
baseEnv,
);
const user = JSON.parse(output.stdout);
expect(user.id).toBeDefined();
expect(user.slug).toBeDefined();
// The /me payload is { user: { id, name, email }, accounts: [{ slug, ... }] }
// (api-client `Me` schema): the user id lives under `user`, and slug is an
// account-level field. Assert against that real shape.
const me = JSON.parse(output.stdout);
expect(me.user.id).toBeDefined();
expect(me.accounts[0]?.slug).toBeDefined();
});

test("prints human-readable user data", () => {
const output = run(["whoami", "--token", userAccessToken], baseEnv);
// `formatMe` prints identity + the account slugs on an "Accounts:" line
// (there is no per-user slug — slug is account-scoped).
expect(output.stdout).toContain("Logged in to Snapvisor as");
expect(output.stdout).toContain("Slug:");
expect(output.stdout).toContain("Accounts:");
});
});
12 changes: 12 additions & 0 deletions packages/cli/src/lib/build-reference.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ describe("parseBuildReference", () => {
});
});

it("parses a snapvisor production build URL", () => {
expect(
parseBuildReference(
"https://app.snapvisor.io/devino/snapvisor-js-e2e/builds/101",
),
).toEqual({
owner: "devino",
project: "snapvisor-js-e2e",
buildNumber: 101,
});
});

it("parses a build URL with a trailing path, query, or hash", () => {
expect(
parseBuildReference(
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/lib/build-reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ export type BuildReference = {
// Anything after the build number — extra path segments (e.g. a diff id), a
// query string, or a hash — is ignored, so deep links like
// `.../builds/5014/347549006` resolve to build 5014.
// Fork: accept snapvisor hosts alongside upstream argos hosts (upstream merge may re-break this).
const BUILD_URL_REGEXP =
/^https:\/\/app\.argos-ci\.(?:com|dev(?::\d+)?)\/(?<owner>[^/?#]+)\/(?<project>[^/?#]+)\/builds\/(?<buildNumber>\d+)(?:[/?#]|$)/;
/^https:\/\/app\.(?:argos-ci\.(?:com|dev(?::\d+)?)|snapvisor\.io)\/(?<owner>[^/?#]+)\/(?<project>[^/?#]+)\/builds\/(?<buildNumber>\d+)(?:[/?#]|$)/;

/**
* Parse a build reference, accepting either a bare build number (`"1234"`) or a
Expand Down
Loading