@applitools/core 4.56.0 → 4.56.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.56.1](https://github.com/Applitools-Dev/sdk/compare/js/core@4.56.0...js/core@4.56.1) (2026-01-27)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * take branch and parent from scm integration and populate in field- fld-4074 ([#3492](https://github.com/Applitools-Dev/sdk/issues/3492)) ([0af3128](https://github.com/Applitools-Dev/sdk/commit/0af31283888c2896604656251df2455d39c93cbf))
9
+
3
10
  ## [4.56.0](https://github.com/Applitools-Dev/sdk/compare/js/core@4.55.0...js/core@4.56.0) (2026-01-21)
4
11
 
5
12
 
package/dist/open-eyes.js CHANGED
@@ -168,8 +168,8 @@ function makeOpenEyes({ type: defaultType = 'classic', clients, batch, removeDup
168
168
  }); // TODO solve the types issue
169
169
  /////// END FUNCTION BODY ///////////////////
170
170
  async function populateAutoScmInfo(batchId) {
171
- var _a, _b;
172
- var _c;
171
+ var _a, _b, _c, _d;
172
+ var _e;
173
173
  const branchName = await (0, extract_git_info_1.extractGitBranch)({ execOptions: { cwd }, logger });
174
174
  const { owner: repoOwner, name: repoName } = await (0, extract_git_info_1.extractGitRepo)({ execOptions: { cwd }, logger });
175
175
  const buildId = await (0, extract_git_info_1.extractBuildIdFromCI)();
@@ -185,8 +185,10 @@ function makeOpenEyes({ type: defaultType = 'classic', clients, batch, removeDup
185
185
  if (scmInfo) {
186
186
  (_a = settings.batch) !== null && _a !== void 0 ? _a : (settings.batch = {});
187
187
  settings.batch.id = isRealBatchId(settings.batch.id) ? settings.batch.id : batchId;
188
- (_b = (_c = settings.batch).buildId) !== null && _b !== void 0 ? _b : (_c.buildId = buildId);
189
- // Intentionally not auto populating branchName and parentBranchName. If there is scmInfo then Eyes already knows these values.
188
+ (_b = (_e = settings.batch).buildId) !== null && _b !== void 0 ? _b : (_e.buildId = buildId);
189
+ // Takes data if it was not set by env. This is the priority according to yotam from BE
190
+ (_c = settings.branchName) !== null && _c !== void 0 ? _c : (settings.branchName = scmInfo.scmSourceBranch || undefined);
191
+ (_d = settings.parentBranchName) !== null && _d !== void 0 ? _d : (settings.parentBranchName = scmInfo.scmTargetBranch || undefined);
190
192
  }
191
193
  }
192
194
  else {
@@ -150,6 +150,15 @@ exports.extractBranchingTimestamp = utils.general.cachify(async function ({ bran
150
150
  logger = logger.extend({ tags: [`extract-branching-timestamp-${utils.general.shortid()}`] });
151
151
  // Get the primary remote name (cached)
152
152
  const remoteName = await (0, exports.getPrimaryRemoteName)({ execOptions, logger });
153
+ const shallowCheckResult = await executeWithLog('git rev-parse --is-shallow-repository', {
154
+ execOptions,
155
+ logger,
156
+ });
157
+ const isShallow = shallowCheckResult.stdout.trim() === 'true';
158
+ if (isShallow) {
159
+ logger.log('extractBranchingTimestamp - Repository is a shallow clone, attempting to unshallow');
160
+ await executeFetchStrategy(isShallow, execOptions, logger);
161
+ }
153
162
  // Step 1: Try with remote refs first (fast path - uses already-fetched remote data)
154
163
  const command = `HASH=$(git merge-base ${branchName} ${parentBranchName}) && git show -q --format=%aI $HASH`;
155
164
  let result = await executeWithLog(command, { execOptions, logger });
@@ -190,14 +199,6 @@ exports.extractBranchingTimestamp = utils.general.cachify(async function ({ bran
190
199
  }
191
200
  }
192
201
  }
193
- // Step 4: Fallback to unshallow if still no result
194
- if (!result.stdout) {
195
- const command = `HASH=$(git merge-base ${branchName} ${parentBranchName}) && git show -q --format=%aI $HASH`;
196
- result = await executeWithLog(`git fetch ${remoteName} --unshallow --filter=tree:0 && ${command}`, {
197
- execOptions,
198
- logger,
199
- });
200
- }
201
202
  const timestamp = result.stdout.replace(/\s/g, '');
202
203
  if (isISODate(timestamp)) {
203
204
  logger.log('git branching timestamp successfully extracted', timestamp);
@@ -323,7 +324,7 @@ async function executeFetchStrategy(isShallow, execOptions, logger) {
323
324
  if (isShallow) {
324
325
  // Shallow clone needs full unshallow for initial topology discovery
325
326
  logger.log(`Shallow repository detected, unshallowing to enable topology discovery...`);
326
- await executeWithLog(`git fetch ${remoteName} --unshallow --filter=tree:0`, {
327
+ await executeWithLog(`git fetch ${remoteName} --unshallow --filter=blob:none`, {
327
328
  execOptions,
328
329
  logger,
329
330
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/core",
3
- "version": "4.56.0",
3
+ "version": "4.56.1",
4
4
  "homepage": "https://applitools.com",
5
5
  "bugs": {
6
6
  "url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -129,5 +129,13 @@
129
129
  },
130
130
  "publishConfig": {
131
131
  "access": "public"
132
+ },
133
+ "lavamoat": {
134
+ "allowScripts": {
135
+ "chromedriver": true,
136
+ "puppeteer": true,
137
+ "ws>bufferutil": false,
138
+ "ws>utf-8-validate": false
139
+ }
132
140
  }
133
141
  }