qualty 0.1.12 → 0.1.14

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.
@@ -272,6 +272,7 @@ async function downloadProjectAttachments({ apiUrl, token, orgId, projectId, spe
272
272
  const name = spec.original_filename || `${label}.bin`;
273
273
  const localPath = join(dir, name.replace(/[^a-zA-Z0-9._-]+/g, "_"));
274
274
  writeFileSync(localPath, buf);
275
+ labelToPath[String(fileId)] = localPath;
275
276
  labelToPath[label] = localPath;
276
277
  if (spec.label && spec.label !== label) labelToPath[spec.label] = localPath;
277
278
  }
@@ -1067,13 +1068,34 @@ export async function runLocalExecution({
1067
1068
  const context = await browser.newContext(contextOptions);
1068
1069
  const page = await context.newPage();
1069
1070
  const networkCollector = attachNetworkCollector(page);
1071
+ const attachmentSpecs = Array.isArray(claim.file_attachments) ? claim.file_attachments : [];
1070
1072
  const labelToPath = await downloadProjectAttachments({
1071
1073
  apiUrl,
1072
1074
  token,
1073
1075
  orgId,
1074
1076
  projectId: claim.project_id,
1075
- specs: claim.file_attachments,
1077
+ specs: attachmentSpecs,
1076
1078
  });
1079
+ const missingAttachmentLabels = attachmentSpecs
1080
+ .map((spec) => ({
1081
+ id: String(spec?.id || "").trim(),
1082
+ label: String(spec?.runner_key || spec?.label || "").trim(),
1083
+ rawLabel: String(spec?.label || "").trim(),
1084
+ }))
1085
+ .filter((it) => {
1086
+ if (it.id && labelToPath[it.id]) return false;
1087
+ if (it.label && labelToPath[it.label]) return false;
1088
+ if (it.rawLabel && labelToPath[it.rawLabel]) return false;
1089
+ return true;
1090
+ });
1091
+ if (missingAttachmentLabels.length > 0) {
1092
+ const listed = missingAttachmentLabels
1093
+ .map((it) => it.rawLabel || it.label || it.id || "<unknown>")
1094
+ .join(", ");
1095
+ throw new Error(
1096
+ `Attached file download failed for: ${listed}. Re-attach files in dashboard and retry local run.`
1097
+ );
1098
+ }
1077
1099
  const credentials = claim.credentials || null;
1078
1100
 
1079
1101
  const stepsJson = [];
package/bin/qualty.js CHANGED
@@ -9,8 +9,7 @@ import process from "node:process";
9
9
  import { runLocalCi } from "./local-runner.js";
10
10
 
11
11
  /** CLI backend URL is fixed by Qualty distribution. */
12
- // const DEFAULT_QUALTY_API_URL = "https://qualty-api-development.up.railway.app";
13
- const DEFAULT_QUALTY_API_URL = "http://localhost:8000";
12
+ const DEFAULT_QUALTY_API_URL = "https://qualty-api-development.up.railway.app";
14
13
 
15
14
  const QUALTY_CONFIG_DIR = join(homedir(), ".config", "qualty");
16
15
  const QUALTY_CONFIG_PATH = join(QUALTY_CONFIG_DIR, "config.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qualty",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "Qualty CLI for localhost and CI test runs",
5
5
  "bin": {
6
6
  "qualty": "bin/qualty.js"