flakiness 0.287.0 → 0.289.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -37,14 +37,17 @@ Upload Flakiness report files to the service:
37
37
  # Upload with access token
38
38
  flakiness upload ./flakiness-report/report.json --access-token <token>
39
39
 
40
- # Upload via GitHub OIDC (no token needed if report contains flakinessProject)
40
+ # Upload via CI OIDC (no token needed if report contains flakinessProject)
41
41
  flakiness upload ./flakiness-report/report.json
42
42
 
43
43
  # Upload with custom endpoint
44
44
  flakiness upload ./report.json --endpoint https://custom.flakiness.io
45
45
  ```
46
46
 
47
- The CLI supports **GitHub OIDC** authentication: when running in GitHub Actions with `id-token: write` permission and the report contains a `flakinessProject` field, the CLI automatically authenticates without an access token. Reporters set `flakinessProject` automatically.
47
+ The CLI authenticates without an access token when CI can mint an OIDC token for it and the report contains a `flakinessProject` field. Reporters set `flakinessProject` automatically. Two providers are supported:
48
+
49
+ - **GitHub Actions** — grant the job `id-token: write` permission.
50
+ - **GitLab CI/CD** (gitlab.com only) — declare a `FLAKINESS_ID_TOKEN` entry under `id_tokens:` in `.gitlab-ci.yml`, with `aud` set to your `org/project`.
48
51
 
49
52
  **Options:**
50
53
  - `-t, --access-token <token>` — Read-write access token (env: `FLAKINESS_ACCESS_TOKEN`)
@@ -93,6 +96,7 @@ flakiness show ./path/to/report
93
96
  |----------|-------------|
94
97
  | `FLAKINESS_ACCESS_TOKEN` | Read-write access token for authentication |
95
98
  | `FLAKINESS_PROJECT` | Flakiness.io project in `org/project` format (for OIDC uploads) |
99
+ | `FLAKINESS_ID_TOKEN` | GitLab CI/CD ID token, set by an `id_tokens:` entry in `.gitlab-ci.yml` |
96
100
  | `FLAKINESS_ENDPOINT` | Custom service endpoint URL |
97
101
 
98
102
  ## License
package/lib/cli/cli.js CHANGED
@@ -1034,7 +1034,7 @@ import path7 from "path";
1034
1034
  // ../package.json
1035
1035
  var package_default = {
1036
1036
  name: "@flakiness/monorepo",
1037
- version: "0.287.0",
1037
+ version: "0.289.0",
1038
1038
  type: "module",
1039
1039
  private: true,
1040
1040
  scripts: {
@@ -1060,7 +1060,7 @@ var package_default = {
1060
1060
  kubik: "^0.24.0",
1061
1061
  "smee-client": "^5.0.0",
1062
1062
  tsx: "^4.23.1",
1063
- typescript: "^5.9.3"
1063
+ typescript: "^7.0.2"
1064
1064
  }
1065
1065
  };
1066
1066
 
@@ -1376,7 +1376,7 @@ var UserSession = class _UserSession {
1376
1376
  import { styleText } from "node:util";
1377
1377
 
1378
1378
  // src/authenticate.ts
1379
- import { GithubOIDC } from "@flakiness/sdk";
1379
+ import { GitlabOIDC, initializeOIDCFromEnv } from "@flakiness/sdk";
1380
1380
  async function authenticate(options) {
1381
1381
  if (options.accessToken) {
1382
1382
  return {
@@ -1395,19 +1395,19 @@ async function authenticate(options) {
1395
1395
  endpoint: session.endpoint()
1396
1396
  };
1397
1397
  }
1398
- const githubOIDC = GithubOIDC.initializeFromEnv();
1399
- if (githubOIDC) {
1398
+ const oidc = initializeOIDCFromEnv();
1399
+ if (oidc) {
1400
1400
  if (!options.flakinessProject)
1401
- throw new Error("GitHub OIDC requires --project to be specified");
1402
- const token = await githubOIDC.createFlakinessAccessToken(options.flakinessProject);
1401
+ throw new Error(`${oidc.name} OIDC requires --project to be specified`);
1402
+ const token = await oidc.createFlakinessAccessToken(options.flakinessProject);
1403
1403
  return {
1404
1404
  api: createServerAPI(options.endpoint, { auth: token }),
1405
- method: "GitHub OIDC",
1405
+ method: oidc instanceof GitlabOIDC ? "GitLab OIDC" : "GitHub OIDC",
1406
1406
  accessToken: token,
1407
1407
  endpoint: options.endpoint
1408
1408
  };
1409
1409
  }
1410
- throw new Error('No authentication found. Use --access-token, run "flakiness auth login", or run in GitHub Actions with OIDC enabled.');
1410
+ throw new Error('No authentication found. Use --access-token, run "flakiness auth login", or run in CI with OIDC enabled.');
1411
1411
  }
1412
1412
 
1413
1413
  // src/cli/cmd-access.ts
@@ -1796,13 +1796,12 @@ async function cmdConvert(junitPath, options) {
1796
1796
  if (options.commitId) {
1797
1797
  commitId = options.commitId;
1798
1798
  } else {
1799
- try {
1800
- const worktree = GitWorktree.create(process.cwd());
1801
- commitId = worktree.headCommitId();
1802
- } catch (e2) {
1799
+ const result = GitWorktree.initialize(process.cwd());
1800
+ if (!result.ok) {
1803
1801
  console.error("Failed to get git commit info. Please provide --commit-id option.");
1804
1802
  process.exit(1);
1805
1803
  }
1804
+ commitId = result.commitId;
1806
1805
  }
1807
1806
  const { report, attachments } = await parseJUnit(xmlContents, {
1808
1807
  commitId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flakiness",
3
- "version": "0.287.0",
3
+ "version": "0.289.0",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "flakiness": "./lib/cli/cli.js"
@@ -19,16 +19,16 @@
19
19
  "author": "Degu Labs, Inc",
20
20
  "license": "MIT",
21
21
  "devDependencies": {
22
- "@playwright/test": "^1.61.1",
22
+ "@playwright/test": "^1.62.0",
23
23
  "@types/debug": "^4.1.13",
24
24
  "@types/express": "^4.17.25",
25
25
  "gray-matter": "^4.0.3",
26
- "@flakiness/server": "0.287.0",
27
- "@flakiness/shared": "0.287.0"
26
+ "@flakiness/shared": "0.289.0",
27
+ "@flakiness/server": "0.289.0"
28
28
  },
29
29
  "dependencies": {
30
30
  "@flakiness/flakiness-report": "^0.36.0",
31
- "@flakiness/sdk": "^2.7.0",
31
+ "@flakiness/sdk": "^3.6.0",
32
32
  "@rgrove/parse-xml": "^4.2.2",
33
33
  "commander": "^14.0.3",
34
34
  "debug": "^4.4.3",