flakiness 0.230.0 → 0.232.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
@@ -23,7 +23,7 @@ npx flakiness <command>
23
23
  flakiness auth login
24
24
 
25
25
  # Show current logged-in user
26
- flakiness auth whoami
26
+ flakiness auth status
27
27
 
28
28
  # Logout from current session
29
29
  flakiness auth logout
package/lib/cli/cli.js CHANGED
@@ -1030,7 +1030,7 @@ import path7 from "path";
1030
1030
  // ../package.json
1031
1031
  var package_default = {
1032
1032
  name: "@flakiness/monorepo",
1033
- version: "0.230.0",
1033
+ version: "0.232.0",
1034
1034
  type: "module",
1035
1035
  private: true,
1036
1036
  scripts: {
@@ -1449,9 +1449,9 @@ async function cmdAuthLogout() {
1449
1449
  await UserSession.remove();
1450
1450
  }
1451
1451
 
1452
- // src/cli/cmd-auth-whoami.ts
1452
+ // src/cli/cmd-auth-status.ts
1453
1453
  import { styleText as styleText2 } from "node:util";
1454
- async function cmdAuthWhoami() {
1454
+ async function cmdAuthStatus() {
1455
1455
  const session = await UserSession.load();
1456
1456
  if (!session || !await printLoggedInUser(session)) {
1457
1457
  console.log('Not logged in. Run "flakiness auth login" first.');
@@ -1825,6 +1825,7 @@ import fs4 from "fs";
1825
1825
  import ora from "ora";
1826
1826
  import path4 from "path";
1827
1827
  var RUN_DIR_PREFIX = `run-`;
1828
+ var DOWNLOADS_DIR = `.fk-pending-downloads`;
1828
1829
  async function cmdDownload(options) {
1829
1830
  const { api } = await authenticate({
1830
1831
  endpoint: options.endpoint,
@@ -1858,6 +1859,8 @@ async function cmdDownload(options) {
1858
1859
  console.log(`Found ${downloadedRuns.length} locally downloaded reports`);
1859
1860
  const toBeDownloaded = Ranges.subtract(runIds, Ranges.fromList(downloadedRuns));
1860
1861
  console.log(`Downloading ${Ranges.cardinality(toBeDownloaded)} reports`);
1862
+ await fs4.promises.rm(DOWNLOADS_DIR, { recursive: true, force: true });
1863
+ await fs4.promises.mkdir(DOWNLOADS_DIR, { recursive: true });
1861
1864
  const it = Ranges.iterate(toBeDownloaded);
1862
1865
  const downloaders = [];
1863
1866
  const spinner = ora("Downloading reports:").start();
@@ -1874,11 +1877,12 @@ async function cmdDownload(options) {
1874
1877
  }
1875
1878
  await Promise.all(downloaders);
1876
1879
  spinner.stop();
1880
+ await fs4.promises.rm(DOWNLOADS_DIR, { recursive: true, force: true });
1877
1881
  }
1878
1882
  async function downloadRun(api, project, runId) {
1879
- const runDir = RUN_DIR_PREFIX + runId;
1880
- if (fs4.existsSync(runDir)) {
1881
- console.log(`Directory ${runDir} already exists!`);
1883
+ const finalDir = RUN_DIR_PREFIX + runId;
1884
+ if (fs4.existsSync(finalDir)) {
1885
+ console.log(`Directory ${finalDir} already exists!`);
1882
1886
  return;
1883
1887
  }
1884
1888
  const urls = await api.run.downloadURLs.GET({
@@ -1886,15 +1890,16 @@ async function downloadRun(api, project, runId) {
1886
1890
  projectSlug: project.projectSlug,
1887
1891
  runId
1888
1892
  });
1889
- const attachmentsDir = path4.join(runDir, "attachments");
1890
- await fs4.promises.mkdir(runDir, { recursive: true });
1893
+ const tmpDir = path4.join(DOWNLOADS_DIR, RUN_DIR_PREFIX + runId);
1894
+ const attachmentsDir = path4.join(tmpDir, "attachments");
1895
+ await fs4.promises.mkdir(tmpDir, { recursive: true });
1891
1896
  if (urls.attachmentURLs.length)
1892
1897
  await fs4.promises.mkdir(attachmentsDir, { recursive: true });
1893
1898
  const response = await fetch(urls.reportURL);
1894
1899
  if (!response.ok)
1895
1900
  throw new Error(`HTTP error ${response.status} for report URL: ${urls.reportURL}`);
1896
1901
  const reportContent = await response.text();
1897
- await fs4.promises.writeFile(path4.join(runDir, "report.json"), reportContent);
1902
+ await fs4.promises.writeFile(path4.join(tmpDir, "report.json"), reportContent);
1898
1903
  const attachmentDownloader = async () => {
1899
1904
  while (urls.attachmentURLs.length) {
1900
1905
  const url = urls.attachmentURLs.pop();
@@ -1910,6 +1915,7 @@ async function downloadRun(api, project, runId) {
1910
1915
  for (let i = 0; i < 4; ++i)
1911
1916
  workerPromises.push(attachmentDownloader());
1912
1917
  await Promise.all(workerPromises);
1918
+ await fs4.promises.rename(tmpDir, finalDir);
1913
1919
  }
1914
1920
 
1915
1921
  // ../node_modules/.pnpm/xxhash-wasm@1.1.0/node_modules/xxhash-wasm/esm/xxhash-wasm.js
@@ -2247,7 +2253,7 @@ async function cmdUpload(relativePaths, options) {
2247
2253
  }
2248
2254
  const reportDir = stat.isDirectory() ? fullPath : path6.dirname(fullPath);
2249
2255
  const { report, attachments, missingAttachments } = await readReport(reportDir);
2250
- if (missingAttachments.length)
2256
+ if (missingAttachments.length && !options.progress)
2251
2257
  warn(`Missing ${missingAttachments.length} attachments`);
2252
2258
  if (options.flakinessProject)
2253
2259
  report.flakinessProject = options.flakinessProject;
@@ -2357,8 +2363,8 @@ auth.command("login").description("Login to the Flakiness.io service").addOption
2357
2363
  auth.command("logout").description("Logout from current session").action(async () => runCommand(async () => {
2358
2364
  await cmdAuthLogout();
2359
2365
  }));
2360
- auth.command("whoami").description("Show current logged in user information").action(async () => runCommand(async () => {
2361
- await cmdAuthWhoami();
2366
+ auth.command("status").alias("whoami").description("Show current logged in user information").action(async () => runCommand(async () => {
2367
+ await cmdAuthStatus();
2362
2368
  }));
2363
2369
  var skills = program.command("skills").description("Manage agent skills");
2364
2370
  var optAgent = new Option("--agent <agent>", "Target agent").choices(AGENTS).makeOptionMandatory();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flakiness",
3
- "version": "0.230.0",
3
+ "version": "0.232.0",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "flakiness": "./lib/cli/cli.js"
@@ -23,8 +23,8 @@
23
23
  "@types/debug": "^4.1.12",
24
24
  "@types/express": "^4.17.20",
25
25
  "gray-matter": "^4.0.3",
26
- "@flakiness/server": "0.230.0",
27
- "@flakiness/shared": "0.230.0"
26
+ "@flakiness/shared": "0.232.0",
27
+ "@flakiness/server": "0.232.0"
28
28
  },
29
29
  "dependencies": {
30
30
  "@flakiness/flakiness-report": "^0.29.0",