slnodejs 6.1.344 → 6.1.361

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.
Files changed (27) hide show
  1. package/browser-agent/dist/browser-agent-all.js +181 -17
  2. package/browser-agent/dist/browser-agent-all.min.js +3 -3
  3. package/browser-agent/package.json +1 -1
  4. package/package.json +1 -1
  5. package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js +2 -1
  6. package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js.map +1 -1
  7. package/tsOutputs/build-scanner/instrumentation/process-pool/contracts.d.ts +1 -0
  8. package/tsOutputs/build-scanner/instrumentation/process-pool/contracts.js +2 -1
  9. package/tsOutputs/build-scanner/instrumentation/process-pool/contracts.js.map +1 -1
  10. package/tsOutputs/build-scanner/instrumentation/process-pool/process-pool.js +21 -11
  11. package/tsOutputs/build-scanner/instrumentation/process-pool/process-pool.js.map +1 -1
  12. package/tsOutputs/build-scanner/instrumentation/process-pool/stop-by-condition-transform-stream.js +37 -0
  13. package/tsOutputs/build-scanner/instrumentation/process-pool/stop-by-condition-transform-stream.js.map +1 -0
  14. package/tsOutputs/common/agent-events/agent-events-conracts.d.ts +2 -0
  15. package/tsOutputs/common/agent-events/agent-events-conracts.js.map +1 -1
  16. package/tsOutputs/common/agent-events/agent-instance-info-builder.d.ts +0 -2
  17. package/tsOutputs/common/agent-events/agent-instance-info-builder.js +143 -3
  18. package/tsOutputs/common/agent-events/agent-instance-info-builder.js.map +1 -1
  19. package/tsOutputs/common/agent-events/machine-info-builder.js +4 -0
  20. package/tsOutputs/common/agent-events/machine-info-builder.js.map +1 -1
  21. package/tsOutputs/common/constants/sl-env-vars.js +2 -2
  22. package/tsOutputs/common/constants/sl-env-vars.js.map +1 -1
  23. package/tsOutputs/common/footprints-process-v6/buffer-size-helper.d.ts +2 -1
  24. package/tsOutputs/common/footprints-process-v6/buffer-size-helper.js +3 -2
  25. package/tsOutputs/common/footprints-process-v6/buffer-size-helper.js.map +1 -1
  26. package/tsOutputs/test-listener/agent-loader.js +28 -0
  27. package/tsOutputs/test-listener/agent-loader.js.map +1 -1
@@ -33850,7 +33850,7 @@ module.exports={
33850
33850
  "_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
33851
33851
  "_shasum": "da37cebd31e79a1367e941b592ed1fbebd58abbb",
33852
33852
  "_spec": "elliptic@^6.5.3",
33853
- "_where": "/var/lib/jenkins/workspace/.OnPremise.Agent.JavaScript_main/browser-agent/node_modules/browserify-sign",
33853
+ "_where": "/var/lib/jenkins/workspace/.OnPremise.Agent.JavaScript_main@4/browser-agent/node_modules/browserify-sign",
33854
33854
  "author": {
33855
33855
  "name": "Fedor Indutny",
33856
33856
  "email": "fedor@indutny.com"
@@ -53937,7 +53937,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
53937
53937
  "use strict";
53938
53938
  Object.defineProperty(exports, "__esModule", { value: true });
53939
53939
  exports.SL_AGENT_TYPE = exports.SL_AGENT_VERSION = void 0;
53940
- exports.SL_AGENT_VERSION = '6.1.344';
53940
+ exports.SL_AGENT_VERSION = '6.1.361';
53941
53941
  exports.SL_AGENT_TYPE = 'browser';
53942
53942
  });
53943
53943
 
@@ -54287,13 +54287,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
54287
54287
  })(function (require, exports) {
54288
54288
  "use strict";
54289
54289
  Object.defineProperty(exports, "__esModule", { value: true });
54290
- exports.relativePathRegex = exports.EVENTS = exports.EVENT_TYPES = exports.CONTEXT = exports.SL_EVENTS_BRIDGE = exports.SL_TEST_NAME = exports.SL_SESSION_ID = exports.SL_CONTEXT_KEY = exports.SL_BAGGAGE_HEADER = void 0;
54290
+ exports.relativePathRegex = exports.EVENTS = exports.EVENT_TYPES = exports.SL_SESSION_CONTEXT = exports.CONTEXT = exports.SL_EVENTS_BRIDGE = exports.SL_TEST_NAME = exports.SL_SESSION_ID = exports.SL_CONTEXT_KEY = exports.SL_BAGGAGE_HEADER = void 0;
54291
54291
  exports.SL_BAGGAGE_HEADER = 'baggage';
54292
54292
  exports.SL_CONTEXT_KEY = 'sl-context';
54293
54293
  exports.SL_SESSION_ID = 'x-sl-test-session-id';
54294
54294
  exports.SL_TEST_NAME = 'x-sl-test-name';
54295
54295
  exports.SL_EVENTS_BRIDGE = 'sl-events-bridge';
54296
54296
  exports.CONTEXT = 'context';
54297
+ exports.SL_SESSION_CONTEXT = 'sl-session-ctx';
54297
54298
  exports.EVENT_TYPES = {
54298
54299
  SET: 'set',
54299
54300
  ACK: 'ack',
@@ -54328,7 +54329,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
54328
54329
  })(function (require, exports) {
54329
54330
  "use strict";
54330
54331
  Object.defineProperty(exports, "__esModule", { value: true });
54331
- exports.registerEvents = void 0;
54332
+ exports.checkExistingContext = exports.registerEvents = void 0;
54332
54333
  const SlConst = require("./const");
54333
54334
  const api = require("@opentelemetry/api");
54334
54335
  const cockpit_notifier_1 = require("../../../common/agent-events/cockpit-notifier");
@@ -54347,8 +54348,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
54347
54348
  }
54348
54349
  addEventListener(SlConst.EVENTS.SET_BAGGAGE, ({ detail }) => {
54349
54350
  var _a, _b;
54350
- const sessionId = detail === null || detail === void 0 ? void 0 : detail[SlConst.SL_SESSION_ID];
54351
- const testName = detail === null || detail === void 0 ? void 0 : detail[SlConst.SL_TEST_NAME];
54351
+ if (!detail)
54352
+ return;
54353
+ const sessionId = detail[SlConst.SL_SESSION_ID];
54354
+ const testName = detail[SlConst.SL_TEST_NAME];
54352
54355
  if (!(sessionId === null || sessionId === void 0 ? void 0 : sessionId.length) || !(testName === null || testName === void 0 ? void 0 : testName.length))
54353
54356
  return;
54354
54357
  if (withOpenTelemetry) {
@@ -54364,6 +54367,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
54364
54367
  });
54365
54368
  addEventListener(SlConst.EVENTS.SET_CONTEXT, ({ detail }) => {
54366
54369
  var _a;
54370
+ if (!detail)
54371
+ return;
54372
+ detail.persist = detail.persist !== false;
54373
+ if (detail.persist) {
54374
+ sessionStorage.setItem(SlConst.SL_SESSION_CONTEXT, JSON.stringify(detail));
54375
+ }
54367
54376
  dispatchEvent(new CustomEvent(SlConst.EVENTS.SET_BAGGAGE, {
54368
54377
  detail: Object.assign({}, ((_a = detail[SlConst.SL_BAGGAGE_HEADER]) !== null && _a !== void 0 ? _a : {})),
54369
54378
  }));
@@ -54393,6 +54402,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
54393
54402
  });
54394
54403
  window.$Sealights.eventsBridge.loaded = true;
54395
54404
  logger.info(`Events Bridge integration loaded. All events registered successfully. OpenTelemetry status: ${withOpenTelemetry}`);
54405
+ checkExistingContext(logger);
54396
54406
  }
54397
54407
  catch (error) {
54398
54408
  logger.error(`An error occurred while registering OpenTelemetry integration events.`, error);
@@ -54401,6 +54411,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
54401
54411
  }
54402
54412
  };
54403
54413
  exports.registerEvents = registerEvents;
54414
+ function checkExistingContext(logger) {
54415
+ const existingContext = (sessionStorage.getItem(SlConst.SL_SESSION_CONTEXT));
54416
+ if (existingContext === null || existingContext === void 0 ? void 0 : existingContext.length) {
54417
+ const parsedContext = JSON.parse(existingContext);
54418
+ logger.info(`Found existing context in session storage. Dispatching event with data: ${existingContext}`);
54419
+ const storedContextEvent = new CustomEvent(SlConst.EVENTS.SET_CONTEXT, {
54420
+ detail: parsedContext,
54421
+ });
54422
+ dispatchEvent(storedContextEvent);
54423
+ }
54424
+ }
54425
+ exports.checkExistingContext = checkExistingContext;
54404
54426
  });
54405
54427
 
54406
54428
  },{"../../../common/agent-events/cockpit-notifier":461,"./const":423,"@opentelemetry/api":18}],425:[function(require,module,exports){
@@ -56834,12 +56856,149 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
56834
56856
  exports.AgentInstanceInfoBuilder = void 0;
56835
56857
  const sensitive_data_filter_1 = require("./sensitive-data-filter");
56836
56858
  const SEALIGHTS_ENV_VAR_PREFIX = 'SL_';
56859
+ const CI_ENV_VARS = new Set([
56860
+ 'build_number',
56861
+ 'build_id',
56862
+ 'build_url',
56863
+ 'node_name',
56864
+ 'job_name',
56865
+ 'build_tag',
56866
+ 'jenkins_url',
56867
+ 'workspace',
56868
+ 'git_commit',
56869
+ 'git_url',
56870
+ 'git_branch',
56871
+ 'circle_branch',
56872
+ 'circle_build_num',
56873
+ 'circle_build_url',
56874
+ 'circle_job',
56875
+ 'circle_node_index',
56876
+ 'circle_node_total',
56877
+ 'circle_pr_number',
56878
+ 'circle_pr_reponame',
56879
+ 'circle_previous_build_num',
56880
+ 'circle_project_reponame',
56881
+ 'circle_pull_request',
56882
+ 'circle_repository_url',
56883
+ 'circle_sha1',
56884
+ 'circle_tag',
56885
+ 'circle_workflow_id',
56886
+ 'circle_workflow_job_id',
56887
+ 'circle_workflow_workspace_id',
56888
+ 'circle_working_directory',
56889
+ 'teamcity_version',
56890
+ 'teamcity_project_name',
56891
+ 'teamcity_buildconf_name',
56892
+ 'build_is_personal',
56893
+ 'ci_builds_dir',
56894
+ 'ci_commit_author',
56895
+ 'ci_commit_before_sha',
56896
+ 'ci_commit_branch',
56897
+ 'ci_commit_description',
56898
+ 'ci_commit_message',
56899
+ 'ci_commit_ref_name',
56900
+ 'ci_commit_ref_slug',
56901
+ 'ci_commit_sha',
56902
+ 'ci_commit_short_sha',
56903
+ 'ci_commit_tag',
56904
+ 'ci_commit_timestamp',
56905
+ 'ci_commit_title',
56906
+ 'ci_concurrent_id',
56907
+ 'ci_concurrent_project_id',
56908
+ 'ci_config_path',
56909
+ 'ci_default_branch',
56910
+ 'ci_dependency_proxy_server',
56911
+ 'ci_disposable_environment',
56912
+ 'ci_environment_name',
56913
+ 'ci_environment_slug',
56914
+ 'ci_environment_url',
56915
+ 'ci_environment_action',
56916
+ 'ci_environment_tier',
56917
+ 'ci_job_id',
56918
+ 'ci_job_image',
56919
+ 'ci_job_name',
56920
+ 'ci_job_stage',
56921
+ 'ci_job_url',
56922
+ 'ci_job_started_at',
56923
+ 'ci_kubernetes_active',
56924
+ 'ci_node_index',
56925
+ 'ci_node_total',
56926
+ 'ci_pipeline_url',
56927
+ 'ci_project_dir',
56928
+ 'ci_project_name',
56929
+ 'ci_project_namespace',
56930
+ 'ci_project_path_slug',
56931
+ 'ci_project_path',
56932
+ 'ci_project_repository_languages',
56933
+ 'ci_project_root_namespace',
56934
+ 'ci_project_title',
56935
+ 'ci_project_description',
56936
+ 'ci_project_url',
56937
+ 'ci_registry_image',
56938
+ 'ci_repository_url',
56939
+ 'ci_server_host',
56940
+ 'ci_server_name',
56941
+ 'ci_server_url',
56942
+ 'ci_server_version_major',
56943
+ 'ci_server_version_minor',
56944
+ 'ci_server_version_patch',
56945
+ 'ci_server_version',
56946
+ 'gitlab_ci',
56947
+ 'ci_merge_request_approved',
56948
+ 'ci_merge_request_assignees',
56949
+ 'ci_merge_request_id',
56950
+ 'ci_merge_request_iid',
56951
+ 'ci_merge_request_labels',
56952
+ 'ci_merge_request_milestone',
56953
+ 'ci_merge_request_project_id',
56954
+ 'ci_merge_request_project_path',
56955
+ 'ci_merge_request_project_url',
56956
+ 'ci_merge_request_ref_path',
56957
+ 'ci_merge_request_source_branch_name',
56958
+ 'ci_merge_request_source_branch_sha',
56959
+ 'ci_merge_request_source_project_id',
56960
+ 'ci_merge_request_source_project_path',
56961
+ 'ci_merge_request_source_project_url',
56962
+ 'ci_merge_request_target_branch_name',
56963
+ 'ci_merge_request_target_branch_sha',
56964
+ 'ci_merge_request_title',
56965
+ 'ci_merge_request_event_type',
56966
+ 'ci_merge_request_diff_id',
56967
+ 'ci_merge_request_diff_base_sha',
56968
+ 'ci_external_pull_request_iid',
56969
+ 'ci_external_pull_request_source_repository',
56970
+ 'ci_external_pull_request_target_repository',
56971
+ 'ci_external_pull_request_source_branch_name',
56972
+ 'ci_external_pull_request_source_branch_sha',
56973
+ 'ci_external_pull_request_target_branch_name',
56974
+ 'ci_external_pull_request_target_branch_sha',
56975
+ 'github_action',
56976
+ 'github_action_path',
56977
+ 'github_action_repository',
56978
+ 'github_base_ref',
56979
+ 'github_env',
56980
+ 'github_head_ref',
56981
+ 'github_job',
56982
+ 'github_path',
56983
+ 'github_ref',
56984
+ 'github_ref_name',
56985
+ 'github_ref_type',
56986
+ 'github_repository',
56987
+ 'github_repository_owner',
56988
+ 'github_sha',
56989
+ 'github_step_summary',
56990
+ 'github_workflow',
56991
+ 'github_workspace',
56992
+ 'runner_arch',
56993
+ 'runner_name',
56994
+ 'runner_os',
56995
+ 'runner_temp',
56996
+ 'runner_tool_cache'
56997
+ ]);
56837
56998
  class AgentInstanceInfoBuilder {
56838
56999
  constructor(agentEventsController) {
56839
57000
  this.sendsPing = true;
56840
57001
  this.agentConfig = agentEventsController.agentConfig;
56841
- this.agentId = agentEventsController.agentInstanceData.agentId;
56842
- this.agentType = agentEventsController.agentInstanceData.agentType;
56843
57002
  this.tags = agentEventsController.resolveTags();
56844
57003
  this.tools = agentEventsController.tools;
56845
57004
  this.logger = agentEventsController.logger;
@@ -56879,7 +57038,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
56879
57038
  extractSealightsEnvVars() {
56880
57039
  const slEnvVars = {};
56881
57040
  Object.keys(process.env).forEach(key => {
56882
- if (key.indexOf(SEALIGHTS_ENV_VAR_PREFIX) === 0 || key === 'NODE_OPTIONS') {
57041
+ if (key.indexOf(SEALIGHTS_ENV_VAR_PREFIX) === 0 || key === 'NODE_OPTIONS' || key === 'PATH' || CI_ENV_VARS.has(key.toLowerCase())) {
56883
57042
  slEnvVars[key] = (0, sensitive_data_filter_1.isSensitive)(key, process.env[key], this.logger) ?
56884
57043
  AgentInstanceInfoBuilder.SECRET_VALUE_PLACEHOLDER : process.env[key];
56885
57044
  }
@@ -57129,7 +57288,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
57129
57288
  if (v !== undefined) module.exports = v;
57130
57289
  }
57131
57290
  else if (typeof define === "function" && define.amd) {
57132
- define(["require", "exports", "os", "../system-date"], factory);
57291
+ define(["require", "exports", "os", "../system-date", "../footprints-process-v6/buffer-size-helper"], factory);
57133
57292
  }
57134
57293
  })(function (require, exports) {
57135
57294
  "use strict";
@@ -57137,6 +57296,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
57137
57296
  exports.MachineInfoBuilder = void 0;
57138
57297
  const os = require("os");
57139
57298
  const system_date_1 = require("../system-date");
57299
+ const buffer_size_helper_1 = require("../footprints-process-v6/buffer-size-helper");
57140
57300
  class MachineInfoBuilder {
57141
57301
  constructor() {
57142
57302
  this.info = {};
@@ -57144,6 +57304,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
57144
57304
  fillData() {
57145
57305
  const currentDate = (0, system_date_1.getSystemDate)();
57146
57306
  this.info.machineName = os.hostname();
57307
+ const cpus = os.cpus();
57308
+ this.info.cpu = cpus.map(cpu => `${cpu.model} (${cpu.speed} MHz`).join(', ');
57309
+ this.info.totalMemory = `${os.totalmem() / buffer_size_helper_1.BufferSizeHelper.BYTES_IN_GB} Gb`;
57147
57310
  this.info.arch = os.arch();
57148
57311
  this.info.os = os.platform();
57149
57312
  this.info.localDateTime = currentDate.toString();
@@ -57169,7 +57332,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
57169
57332
  });
57170
57333
 
57171
57334
  }).call(this)}).call(this,require('_process'))
57172
- },{"../system-date":505,"_process":335,"os":310}],464:[function(require,module,exports){
57335
+ },{"../footprints-process-v6/buffer-size-helper":485,"../system-date":505,"_process":335,"os":310}],464:[function(require,module,exports){
57173
57336
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
57174
57337
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
57175
57338
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -58016,13 +58179,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
58016
58179
  if (v !== undefined) module.exports = v;
58017
58180
  }
58018
58181
  else if (typeof define === "function" && define.amd) {
58019
- define(["require", "exports", "../utils/env-var-parsing"], factory);
58182
+ define(["require", "exports", "../footprints-process-v6/buffer-size-helper", "../utils/env-var-parsing"], factory);
58020
58183
  }
58021
58184
  })(function (require, exports) {
58022
58185
  "use strict";
58023
58186
  var _a;
58024
58187
  Object.defineProperty(exports, "__esModule", { value: true });
58025
58188
  exports.SlEnvVars = void 0;
58189
+ const buffer_size_helper_1 = require("../footprints-process-v6/buffer-size-helper");
58026
58190
  const env_var_parsing_1 = require("../utils/env-var-parsing");
58027
58191
  class SlEnvVars {
58028
58192
  static getHttpTimeout() {
@@ -58130,10 +58294,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
58130
58294
  static minifyInstrumentedOutput() { return env_var_parsing_1.EnvVarParsing.parseBoolean(SlEnvVars.CIA.MINIFY_INSTRUMENTED_OUTPUT); }
58131
58295
  static inProcessInstrumentation() { return env_var_parsing_1.EnvVarParsing.parseBoolean(SlEnvVars.CIA.IN_PROCESS_INSTRUMENTATION); }
58132
58296
  static getMaxBuffer() {
58133
- const oneMB = 1024 * 1024;
58134
58297
  const bufferInBytes = env_var_parsing_1.EnvVarParsing.parseNumber(SlEnvVars.CIA.MAX_BUFFER);
58135
58298
  if (bufferInBytes !== null) {
58136
- return bufferInBytes * oneMB;
58299
+ return bufferInBytes * buffer_size_helper_1.BufferSizeHelper.BYTES_IN_MB;
58137
58300
  }
58138
58301
  return bufferInBytes;
58139
58302
  }
@@ -58151,7 +58314,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
58151
58314
  });
58152
58315
 
58153
58316
  }).call(this)}).call(this,require('_process'))
58154
- },{"../utils/env-var-parsing":506,"_process":335}],475:[function(require,module,exports){
58317
+ },{"../footprints-process-v6/buffer-size-helper":485,"../utils/env-var-parsing":506,"_process":335}],475:[function(require,module,exports){
58155
58318
  (function (factory) {
58156
58319
  if (typeof module === "object" && typeof module.exports === "object") {
58157
58320
  var v = factory(require, exports);
@@ -59170,7 +59333,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
59170
59333
  (this.testNamesCount * BufferSizeHelper.FOUR_BYTES + this.testNamesLengthSum) +
59171
59334
  (this.hitCount * BufferSizeHelper.APPROX_HIT_SIZE) +
59172
59335
  (this.indicesCount * BufferSizeHelper.EIGHT_BYTES);
59173
- return sizeInBytes / BufferSizeHelper.MB;
59336
+ return sizeInBytes / BufferSizeHelper.BYTES_IN_MB;
59174
59337
  }
59175
59338
  incrementSizeCounters(testName, methodIndicesSize, branchIndicesSize) {
59176
59339
  this.hitCount++;
@@ -59185,7 +59348,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
59185
59348
  BufferSizeHelper.FOUR_BYTES = 4;
59186
59349
  BufferSizeHelper.EIGHT_BYTES = 8;
59187
59350
  BufferSizeHelper.APPROX_HIT_SIZE = 128;
59188
- BufferSizeHelper.MB = 1024 * 1024;
59351
+ BufferSizeHelper.BYTES_IN_MB = 1024 * 1024;
59352
+ BufferSizeHelper.BYTES_IN_GB = 1024 * 1024 * 1024;
59189
59353
  });
59190
59354
 
59191
59355
  },{}],486:[function(require,module,exports){