@qoretechnologies/qlip 0.1.3-pr.30.gffaaa15 → 0.1.3-pr.31.g4b62f97

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
@@ -165,6 +165,15 @@ qlip prints a one-time warning when it detects a shallow clone. It
165
165
  never fails the upload over this — accuracy degrades, the run still
166
166
  succeeds.
167
167
 
168
+ ### Who triggered the build
169
+
170
+ On GitHub Actions qlip also sends the user who triggered the run
171
+ (`$GITHUB_ACTOR`, with `$GITHUB_ACTOR_ID` for a rename-proof avatar), so
172
+ the dashboard shows who pushed each build. Nothing to configure; set
173
+ `upload.triggeredByLogin` (and optionally `upload.triggeredById`) to
174
+ override it, for example from a CI system that isn't GitHub Actions.
175
+ Outside CI the field is simply omitted.
176
+
168
177
  ## Manual screenshots inside play
169
178
 
170
179
  Use the existing **"Logged In"** story as a real-world example:
package/dist/types.d.ts CHANGED
@@ -149,6 +149,19 @@ export interface QlipUploadOptions {
149
149
  * "View PR" link. See `design/UPLOAD.md`.
150
150
  */
151
151
  pullRequestUrl?: string;
152
+ /**
153
+ * GitHub login of the user who triggered the build — shown as the
154
+ * build's author in the dashboard. Auto-detected from `$GITHUB_ACTOR`
155
+ * when omitted. Undefined (not sent) outside GitHub Actions; a
156
+ * dashboard upload is attributed from the signed-in session instead.
157
+ */
158
+ triggeredByLogin?: string;
159
+ /**
160
+ * GitHub account id of that user (`$GITHUB_ACTOR_ID`). Stable across
161
+ * a login rename, so the server prefers it for the avatar. Only sent
162
+ * alongside `triggeredByLogin`.
163
+ */
164
+ triggeredById?: number;
152
165
  /** Skip upload entirely (handy for local-only runs). */
153
166
  disabled?: boolean;
154
167
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACh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M,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,KAAK,EAAE;QACL,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,cAAc,EAAE,MAAM,CAAC;QACvB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,aAAa,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,wDAAwD;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACtC"}
@@ -38,6 +38,29 @@ export declare const autodetectBaseBranch: () => string | undefined;
38
38
  * `qlip-server/design/UPLOAD.md`.
39
39
  */
40
40
  export declare const autodetectPullRequestUrl: () => string | undefined;
41
+ /** The GitHub user whose action produced the build. */
42
+ export interface IUploadTriggeredBy {
43
+ /** GitHub login (`$GITHUB_ACTOR`). */
44
+ login: string;
45
+ /**
46
+ * GitHub account id (`$GITHUB_ACTOR_ID`). Stable across a rename, so
47
+ * the server prefers it for the avatar; omitted on an older runner
48
+ * that doesn't set it.
49
+ */
50
+ id?: number;
51
+ }
52
+ /**
53
+ * Who triggered the CI run — the user the dashboard shows as the
54
+ * build's author. GitHub Actions sets `$GITHUB_ACTOR` (the login) and
55
+ * `$GITHUB_ACTOR_ID` (the numeric account id) on every run.
56
+ *
57
+ * Env-only by design: outside CI there is no GitHub identity to read
58
+ * (a git author is an email, not a login), and a dashboard upload is
59
+ * attributed server-side from the signed-in session. Returns undefined
60
+ * for local runs; the server stores it as nullable, so absence just
61
+ * means "author unknown". See `qlip-server/design/UPLOAD.md`.
62
+ */
63
+ export declare const autodetectTriggeredBy: () => IUploadTriggeredBy | undefined;
41
64
  /**
42
65
  * Commit SHAs from HEAD backward, nearest-first, capped at
43
66
  * MAX_ANCESTOR_COMMITS. The server walks this list to find the nearest
@@ -1 +1 @@
1
- {"version":3,"file":"autodetect.d.ts","sourceRoot":"","sources":["../../src/upload/autodetect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAqBH,eAAO,MAAM,gBAAgB,QAAO,MAAM,GAAG,SAW5C,CAAC;AAkCF,eAAO,MAAM,gBAAgB,QAAO,MAAM,GAAG,SAS5C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAO,MAAM,GAAG,SAGhD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB,QAAO,MAAM,GAAG,SAcpD,CAAC;AA0BF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,QAAO,MAAM,EAAE,GAAG,SAgBvD,CAAC"}
1
+ {"version":3,"file":"autodetect.d.ts","sourceRoot":"","sources":["../../src/upload/autodetect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAqBH,eAAO,MAAM,gBAAgB,QAAO,MAAM,GAAG,SAW5C,CAAC;AAkCF,eAAO,MAAM,gBAAgB,QAAO,MAAM,GAAG,SAS5C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAO,MAAM,GAAG,SAGhD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB,QAAO,MAAM,GAAG,SAcpD,CAAC;AAEF,uDAAuD;AACvD,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,QAAO,kBAAkB,GAAG,SAM7D,CAAC;AA0BF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,QAAO,MAAM,EAAE,GAAG,SAgBvD,CAAC"}
@@ -127,6 +127,25 @@ export const autodetectPullRequestUrl = () => {
127
127
  const base = serverUrl.replace(/\/+$/, '');
128
128
  return `${base}/${repo}/pull/${prNumber}`;
129
129
  };
130
+ /**
131
+ * Who triggered the CI run — the user the dashboard shows as the
132
+ * build's author. GitHub Actions sets `$GITHUB_ACTOR` (the login) and
133
+ * `$GITHUB_ACTOR_ID` (the numeric account id) on every run.
134
+ *
135
+ * Env-only by design: outside CI there is no GitHub identity to read
136
+ * (a git author is an email, not a login), and a dashboard upload is
137
+ * attributed server-side from the signed-in session. Returns undefined
138
+ * for local runs; the server stores it as nullable, so absence just
139
+ * means "author unknown". See `qlip-server/design/UPLOAD.md`.
140
+ */
141
+ export const autodetectTriggeredBy = () => {
142
+ const login = process.env['GITHUB_ACTOR']?.trim();
143
+ if (!login || login.length === 0)
144
+ return undefined;
145
+ const rawId = process.env['GITHUB_ACTOR_ID']?.trim();
146
+ const id = rawId && /^\d+$/.test(rawId) ? Number(rawId) : undefined;
147
+ return id !== undefined ? { login, id } : { login };
148
+ };
130
149
  let shallowWarningEmitted = false;
131
150
  /**
132
151
  * A shallow clone (CI default for `actions/checkout`) only has the tip
@@ -1 +1 @@
1
- {"version":3,"file":"finalize.d.ts","sourceRoot":"","sources":["../../src/upload/finalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAoBxE;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM;CAI5B;AA6BD,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED,eAAO,MAAM,aAAa,GACxB,MAAM,qBAAqB,KAC1B,OAAO,CAAC,IAAI,CA6Gd,CAAC"}
1
+ {"version":3,"file":"finalize.d.ts","sourceRoot":"","sources":["../../src/upload/finalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAqBxE;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM;CAI5B;AA6BD,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED,eAAO,MAAM,aAAa,GACxB,MAAM,qBAAqB,KAC1B,OAAO,CAAC,IAAI,CA2Hd,CAAC"}
@@ -17,7 +17,7 @@
17
17
  * dedupes — if both paths fire in the same run, only the first
18
18
  * actually does the work.
19
19
  */
20
- import { autodetectAncestorCommits, autodetectBaseBranch, autodetectBranch, autodetectCommit, autodetectPullRequestUrl, } from './autodetect.js';
20
+ import { autodetectAncestorCommits, autodetectBaseBranch, autodetectBranch, autodetectCommit, autodetectPullRequestUrl, autodetectTriggeredBy, } from './autodetect.js';
21
21
  import { buildCaptureReport, describeBaselineCollisions, describeCollisions, describeMissingCaptures, describePartialBuild, writeCaptureReport, } from './capture-report.js';
22
22
  import { mergeManifestFragments } from './manifest.js';
23
23
  import { QlipUploadError, uploadBuild, resolveServerUrl } from './upload.js';
@@ -118,6 +118,15 @@ export const finalizeBuild = async (opts) => {
118
118
  const baseBranch = opts.upload.baseBranch ?? autodetectBaseBranch();
119
119
  const ancestorCommits = opts.upload.ancestorCommits ?? autodetectAncestorCommits();
120
120
  const pullRequestUrl = opts.upload.pullRequestUrl ?? autodetectPullRequestUrl();
121
+ // An explicit login wins outright (with whatever id came with it);
122
+ // otherwise both come from the CI env together.
123
+ const detectedTriggeredBy = opts.upload.triggeredByLogin === undefined
124
+ ? autodetectTriggeredBy()
125
+ : undefined;
126
+ const triggeredByLogin = opts.upload.triggeredByLogin ?? detectedTriggeredBy?.login;
127
+ const triggeredById = opts.upload.triggeredByLogin !== undefined
128
+ ? opts.upload.triggeredById
129
+ : detectedTriggeredBy?.id;
121
130
  const resolved = {
122
131
  ...opts.upload,
123
132
  ...(branch !== undefined ? { branch } : {}),
@@ -125,6 +134,8 @@ export const finalizeBuild = async (opts) => {
125
134
  ...(baseBranch !== undefined ? { baseBranch } : {}),
126
135
  ...(ancestorCommits !== undefined ? { ancestorCommits } : {}),
127
136
  ...(pullRequestUrl !== undefined ? { pullRequestUrl } : {}),
137
+ ...(triggeredByLogin !== undefined ? { triggeredByLogin } : {}),
138
+ ...(triggeredById !== undefined ? { triggeredById } : {}),
128
139
  };
129
140
  try {
130
141
  const result = await uploadBuild({
@@ -1 +1 @@
1
- {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/upload/upload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAgB,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGnE,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAC1B,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kEAAkE;IA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AC,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,OAAO,EAAE,iBAAiB,CAAC;IAC3B,oDAAoD;IACpD,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,iFAAiF;IACjF,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,sCAAsC,CAAC;AAOtE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAC,KAC5C,MAAsE,CAAC;AAE1E,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;gBAG3B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,YAAuB;CAUjC;AA6JD,eAAO,MAAM,WAAW,GACtB,OAAO,eAAe,KACrB,OAAO,CAAC,gBAAgB,CAkG1B,CAAC"}
@@ -125,6 +125,12 @@ const uploadBuildLegacy = async (fetchImpl, baseUrl, buildDir, options, manifest
125
125
  if (options.pullRequestUrl !== undefined) {
126
126
  form.append('pullRequestUrl', options.pullRequestUrl);
127
127
  }
128
+ if (options.triggeredByLogin !== undefined) {
129
+ form.append('triggeredByLogin', options.triggeredByLogin);
130
+ }
131
+ if (options.triggeredById !== undefined) {
132
+ form.append('triggeredById', String(options.triggeredById));
133
+ }
128
134
  const response = await fetchImpl(`${baseUrl}/api/builds/upload`, {
129
135
  method: 'POST',
130
136
  body: form,
@@ -165,6 +171,12 @@ export const uploadBuild = async (input) => {
165
171
  ...(options.pullRequestUrl !== undefined
166
172
  ? { pullRequestUrl: options.pullRequestUrl }
167
173
  : {}),
174
+ ...(options.triggeredByLogin !== undefined
175
+ ? { triggeredByLogin: options.triggeredByLogin }
176
+ : {}),
177
+ ...(options.triggeredById !== undefined
178
+ ? { triggeredById: options.triggeredById }
179
+ : {}),
168
180
  }),
169
181
  });
170
182
  // 404 ⇒ server predates the v2 routes; fall back to legacy multipart.
@@ -15,7 +15,7 @@
15
15
  * `qlip-server/design/UPLOAD.md`.
16
16
  */
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.autodetectAncestorCommits = exports.autodetectPullRequestUrl = exports.autodetectBaseBranch = exports.autodetectCommit = exports.autodetectBranch = void 0;
18
+ exports.autodetectAncestorCommits = exports.autodetectTriggeredBy = exports.autodetectPullRequestUrl = exports.autodetectBaseBranch = exports.autodetectCommit = exports.autodetectBranch = void 0;
19
19
  const node_child_process_1 = require("node:child_process");
20
20
  const node_fs_1 = require("node:fs");
21
21
  /** Server-side cap on the ancestry list (`qlip-server/design/UPLOAD.md`). */
@@ -134,6 +134,26 @@ const autodetectPullRequestUrl = () => {
134
134
  return `${base}/${repo}/pull/${prNumber}`;
135
135
  };
136
136
  exports.autodetectPullRequestUrl = autodetectPullRequestUrl;
137
+ /**
138
+ * Who triggered the CI run — the user the dashboard shows as the
139
+ * build's author. GitHub Actions sets `$GITHUB_ACTOR` (the login) and
140
+ * `$GITHUB_ACTOR_ID` (the numeric account id) on every run.
141
+ *
142
+ * Env-only by design: outside CI there is no GitHub identity to read
143
+ * (a git author is an email, not a login), and a dashboard upload is
144
+ * attributed server-side from the signed-in session. Returns undefined
145
+ * for local runs; the server stores it as nullable, so absence just
146
+ * means "author unknown". See `qlip-server/design/UPLOAD.md`.
147
+ */
148
+ const autodetectTriggeredBy = () => {
149
+ const login = process.env['GITHUB_ACTOR']?.trim();
150
+ if (!login || login.length === 0)
151
+ return undefined;
152
+ const rawId = process.env['GITHUB_ACTOR_ID']?.trim();
153
+ const id = rawId && /^\d+$/.test(rawId) ? Number(rawId) : undefined;
154
+ return id !== undefined ? { login, id } : { login };
155
+ };
156
+ exports.autodetectTriggeredBy = autodetectTriggeredBy;
137
157
  let shallowWarningEmitted = false;
138
158
  /**
139
159
  * A shallow clone (CI default for `actions/checkout`) only has the tip
@@ -122,6 +122,15 @@ const finalizeBuild = async (opts) => {
122
122
  const baseBranch = opts.upload.baseBranch ?? (0, autodetect_js_1.autodetectBaseBranch)();
123
123
  const ancestorCommits = opts.upload.ancestorCommits ?? (0, autodetect_js_1.autodetectAncestorCommits)();
124
124
  const pullRequestUrl = opts.upload.pullRequestUrl ?? (0, autodetect_js_1.autodetectPullRequestUrl)();
125
+ // An explicit login wins outright (with whatever id came with it);
126
+ // otherwise both come from the CI env together.
127
+ const detectedTriggeredBy = opts.upload.triggeredByLogin === undefined
128
+ ? (0, autodetect_js_1.autodetectTriggeredBy)()
129
+ : undefined;
130
+ const triggeredByLogin = opts.upload.triggeredByLogin ?? detectedTriggeredBy?.login;
131
+ const triggeredById = opts.upload.triggeredByLogin !== undefined
132
+ ? opts.upload.triggeredById
133
+ : detectedTriggeredBy?.id;
125
134
  const resolved = {
126
135
  ...opts.upload,
127
136
  ...(branch !== undefined ? { branch } : {}),
@@ -129,6 +138,8 @@ const finalizeBuild = async (opts) => {
129
138
  ...(baseBranch !== undefined ? { baseBranch } : {}),
130
139
  ...(ancestorCommits !== undefined ? { ancestorCommits } : {}),
131
140
  ...(pullRequestUrl !== undefined ? { pullRequestUrl } : {}),
141
+ ...(triggeredByLogin !== undefined ? { triggeredByLogin } : {}),
142
+ ...(triggeredById !== undefined ? { triggeredById } : {}),
132
143
  };
133
144
  try {
134
145
  const result = await (0, upload_js_1.uploadBuild)({
@@ -133,6 +133,12 @@ const uploadBuildLegacy = async (fetchImpl, baseUrl, buildDir, options, manifest
133
133
  if (options.pullRequestUrl !== undefined) {
134
134
  form.append('pullRequestUrl', options.pullRequestUrl);
135
135
  }
136
+ if (options.triggeredByLogin !== undefined) {
137
+ form.append('triggeredByLogin', options.triggeredByLogin);
138
+ }
139
+ if (options.triggeredById !== undefined) {
140
+ form.append('triggeredById', String(options.triggeredById));
141
+ }
136
142
  const response = await fetchImpl(`${baseUrl}/api/builds/upload`, {
137
143
  method: 'POST',
138
144
  body: form,
@@ -173,6 +179,12 @@ const uploadBuild = async (input) => {
173
179
  ...(options.pullRequestUrl !== undefined
174
180
  ? { pullRequestUrl: options.pullRequestUrl }
175
181
  : {}),
182
+ ...(options.triggeredByLogin !== undefined
183
+ ? { triggeredByLogin: options.triggeredByLogin }
184
+ : {}),
185
+ ...(options.triggeredById !== undefined
186
+ ? { triggeredById: options.triggeredById }
187
+ : {}),
176
188
  }),
177
189
  });
178
190
  // 404 ⇒ server predates the v2 routes; fall back to legacy multipart.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qoretechnologies/qlip",
3
- "version": "0.1.3-pr.30.gffaaa15",
3
+ "version": "0.1.3-pr.31.g4b62f97",
4
4
  "description": "Storybook screenshot capture for the Vitest addon",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",