@applitools/eyes-browser 1.6.23 → 1.6.25
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 +98 -0
- package/dist/index.js +1384 -308
- package/package.json +3 -3
- package/types/input/CheckSettings.d.ts +3 -1
- package/types/input/ExactMatchSettings.d.ts +28 -21
package/dist/index.js
CHANGED
|
@@ -13738,6 +13738,134 @@ var require_BatchInfo = __commonJS({
|
|
|
13738
13738
|
}
|
|
13739
13739
|
});
|
|
13740
13740
|
|
|
13741
|
+
// ../eyes/dist/input/ExactMatchSettings.js
|
|
13742
|
+
var require_ExactMatchSettings = __commonJS({
|
|
13743
|
+
"../eyes/dist/input/ExactMatchSettings.js"(exports) {
|
|
13744
|
+
"use strict";
|
|
13745
|
+
init_global();
|
|
13746
|
+
init_process();
|
|
13747
|
+
init_setImmediate();
|
|
13748
|
+
init_buffer();
|
|
13749
|
+
init_setInterval();
|
|
13750
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
13751
|
+
if (k2 === void 0)
|
|
13752
|
+
k2 = k;
|
|
13753
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13754
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13755
|
+
desc = { enumerable: true, get: function() {
|
|
13756
|
+
return m[k];
|
|
13757
|
+
} };
|
|
13758
|
+
}
|
|
13759
|
+
Object.defineProperty(o, k2, desc);
|
|
13760
|
+
} : function(o, m, k, k2) {
|
|
13761
|
+
if (k2 === void 0)
|
|
13762
|
+
k2 = k;
|
|
13763
|
+
o[k2] = m[k];
|
|
13764
|
+
});
|
|
13765
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
13766
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
13767
|
+
} : function(o, v) {
|
|
13768
|
+
o["default"] = v;
|
|
13769
|
+
});
|
|
13770
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
13771
|
+
if (mod && mod.__esModule)
|
|
13772
|
+
return mod;
|
|
13773
|
+
var result = {};
|
|
13774
|
+
if (mod != null) {
|
|
13775
|
+
for (var k in mod)
|
|
13776
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
13777
|
+
__createBinding(result, mod, k);
|
|
13778
|
+
}
|
|
13779
|
+
__setModuleDefault(result, mod);
|
|
13780
|
+
return result;
|
|
13781
|
+
};
|
|
13782
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13783
|
+
exports.ExactMatchSettingsData = exports.validateExactMatchSettings = void 0;
|
|
13784
|
+
var utils2 = __importStar(require_browser3());
|
|
13785
|
+
function validateExactMatchSettings(exact) {
|
|
13786
|
+
utils2.guard.isInteger(exact.minDiffIntensity, { name: "minDiffIntensity", strict: false });
|
|
13787
|
+
utils2.guard.isInteger(exact.minDiffWidth, { name: "minDiffWidth", strict: false });
|
|
13788
|
+
utils2.guard.isInteger(exact.minDiffHeight, { name: "minDiffHeight", strict: false });
|
|
13789
|
+
utils2.guard.isNumber(exact.matchThreshold, { name: "matchThreshold", strict: false });
|
|
13790
|
+
}
|
|
13791
|
+
exports.validateExactMatchSettings = validateExactMatchSettings;
|
|
13792
|
+
var ExactMatchSettingsData = class {
|
|
13793
|
+
constructor(settings) {
|
|
13794
|
+
this._settings = {};
|
|
13795
|
+
this.minDiffIntensity = settings.minDiffIntensity;
|
|
13796
|
+
this.minDiffWidth = settings.minDiffWidth;
|
|
13797
|
+
this.minDiffHeight = settings.minDiffHeight;
|
|
13798
|
+
this.matchThreshold = settings.matchThreshold;
|
|
13799
|
+
}
|
|
13800
|
+
get minDiffIntensity() {
|
|
13801
|
+
return this._settings.minDiffIntensity;
|
|
13802
|
+
}
|
|
13803
|
+
set minDiffIntensity(minDiffIntensity) {
|
|
13804
|
+
validateExactMatchSettings({ minDiffIntensity });
|
|
13805
|
+
this._settings.minDiffIntensity = minDiffIntensity;
|
|
13806
|
+
}
|
|
13807
|
+
getMinDiffIntensity() {
|
|
13808
|
+
return this.minDiffIntensity;
|
|
13809
|
+
}
|
|
13810
|
+
setMinDiffIntensity(value) {
|
|
13811
|
+
this.minDiffIntensity = value;
|
|
13812
|
+
}
|
|
13813
|
+
get minDiffWidth() {
|
|
13814
|
+
return this._settings.minDiffWidth;
|
|
13815
|
+
}
|
|
13816
|
+
set minDiffWidth(minDiffWidth) {
|
|
13817
|
+
validateExactMatchSettings({ minDiffWidth });
|
|
13818
|
+
this._settings.minDiffWidth = minDiffWidth;
|
|
13819
|
+
}
|
|
13820
|
+
getMinDiffWidth() {
|
|
13821
|
+
return this.minDiffWidth;
|
|
13822
|
+
}
|
|
13823
|
+
setMinDiffWidth(value) {
|
|
13824
|
+
this.minDiffWidth = value;
|
|
13825
|
+
}
|
|
13826
|
+
get minDiffHeight() {
|
|
13827
|
+
return this._settings.minDiffHeight;
|
|
13828
|
+
}
|
|
13829
|
+
set minDiffHeight(minDiffHeight) {
|
|
13830
|
+
validateExactMatchSettings({ minDiffHeight });
|
|
13831
|
+
this._settings.minDiffHeight = minDiffHeight;
|
|
13832
|
+
}
|
|
13833
|
+
getMinDiffHeight() {
|
|
13834
|
+
return this.minDiffHeight;
|
|
13835
|
+
}
|
|
13836
|
+
setMinDiffHeight(value) {
|
|
13837
|
+
this.minDiffHeight = value;
|
|
13838
|
+
}
|
|
13839
|
+
get matchThreshold() {
|
|
13840
|
+
return this._settings.matchThreshold;
|
|
13841
|
+
}
|
|
13842
|
+
set matchThreshold(matchThreshold) {
|
|
13843
|
+
validateExactMatchSettings({ matchThreshold });
|
|
13844
|
+
this._settings.matchThreshold = matchThreshold;
|
|
13845
|
+
}
|
|
13846
|
+
getMatchThreshold() {
|
|
13847
|
+
return this.matchThreshold;
|
|
13848
|
+
}
|
|
13849
|
+
setMatchThreshold(value) {
|
|
13850
|
+
this.matchThreshold = value;
|
|
13851
|
+
}
|
|
13852
|
+
/** @internal */
|
|
13853
|
+
toObject() {
|
|
13854
|
+
return this._settings;
|
|
13855
|
+
}
|
|
13856
|
+
/** @internal */
|
|
13857
|
+
toJSON() {
|
|
13858
|
+
return utils2.general.toJSON(this._settings);
|
|
13859
|
+
}
|
|
13860
|
+
/** @internal */
|
|
13861
|
+
toString() {
|
|
13862
|
+
return utils2.general.toString(this);
|
|
13863
|
+
}
|
|
13864
|
+
};
|
|
13865
|
+
exports.ExactMatchSettingsData = ExactMatchSettingsData;
|
|
13866
|
+
}
|
|
13867
|
+
});
|
|
13868
|
+
|
|
13741
13869
|
// ../eyes/dist/input/CheckSettings.js
|
|
13742
13870
|
var require_CheckSettings = __commonJS({
|
|
13743
13871
|
"../eyes/dist/input/CheckSettings.js"(exports) {
|
|
@@ -13783,6 +13911,7 @@ var require_CheckSettings = __commonJS({
|
|
|
13783
13911
|
exports.Target = exports.TargetAutomation = exports.TargetImage = exports.CheckSettingsAutomationFluent = exports.CheckSettingsImageFluent = exports.CheckSettingsBaseFluent = void 0;
|
|
13784
13912
|
var AccessibilityRegionType_1 = require_AccessibilityRegionType();
|
|
13785
13913
|
var MatchLevel_1 = require_MatchLevel();
|
|
13914
|
+
var ExactMatchSettings_1 = require_ExactMatchSettings();
|
|
13786
13915
|
var utils2 = __importStar(require_browser3());
|
|
13787
13916
|
var CheckSettingsBaseFluent = class {
|
|
13788
13917
|
constructor(settings, parent) {
|
|
@@ -13966,8 +14095,12 @@ var require_CheckSettings = __commonJS({
|
|
|
13966
14095
|
this._settings.matchLevel = MatchLevel_1.MatchLevelEnum.Layout;
|
|
13967
14096
|
return this;
|
|
13968
14097
|
}
|
|
13969
|
-
exact() {
|
|
14098
|
+
exact(exact) {
|
|
14099
|
+
if (exact)
|
|
14100
|
+
(0, ExactMatchSettings_1.validateExactMatchSettings)(exact);
|
|
13970
14101
|
this._settings.matchLevel = MatchLevel_1.MatchLevelEnum.Exact;
|
|
14102
|
+
if (exact)
|
|
14103
|
+
this._settings.exact = exact;
|
|
13971
14104
|
return this;
|
|
13972
14105
|
}
|
|
13973
14106
|
strict() {
|
|
@@ -14138,12 +14271,16 @@ var require_CheckSettings = __commonJS({
|
|
|
14138
14271
|
/** @internal */
|
|
14139
14272
|
toJSON() {
|
|
14140
14273
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
14274
|
+
if (this._settings.exact && this._settings.matchLevel === MatchLevel_1.MatchLevelEnum.Exact) {
|
|
14275
|
+
(0, ExactMatchSettings_1.validateExactMatchSettings)(this._settings.exact);
|
|
14276
|
+
}
|
|
14141
14277
|
return {
|
|
14142
14278
|
target: this._target,
|
|
14143
14279
|
settings: utils2.general.removeUndefinedProps({
|
|
14144
14280
|
name: this._settings.name,
|
|
14145
14281
|
region: this._settings.region ? this.toCoreRegion(this._settings.region) : this._settings.region,
|
|
14146
14282
|
matchLevel: this._settings.matchLevel,
|
|
14283
|
+
exact: this._settings.exact,
|
|
14147
14284
|
useDom: this._settings.useDom,
|
|
14148
14285
|
sendDom: this._settings.sendDom,
|
|
14149
14286
|
enablePatterns: this._settings.enablePatterns,
|
|
@@ -14349,6 +14486,9 @@ var require_CheckSettings = __commonJS({
|
|
|
14349
14486
|
/** @internal */
|
|
14350
14487
|
toJSON() {
|
|
14351
14488
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
14489
|
+
if (this._settings.exact && this._settings.matchLevel === MatchLevel_1.MatchLevelEnum.Exact) {
|
|
14490
|
+
(0, ExactMatchSettings_1.validateExactMatchSettings)(this._settings.exact);
|
|
14491
|
+
}
|
|
14352
14492
|
return {
|
|
14353
14493
|
target: this._settings.page,
|
|
14354
14494
|
settings: utils2.general.removeUndefinedProps({
|
|
@@ -14359,6 +14499,7 @@ var require_CheckSettings = __commonJS({
|
|
|
14359
14499
|
scrollRootElement: this._settings.scrollRootElement,
|
|
14360
14500
|
fully: this._settings.fully,
|
|
14361
14501
|
matchLevel: this._settings.matchLevel,
|
|
14502
|
+
exact: this._settings.exact,
|
|
14362
14503
|
useDom: this._settings.useDom,
|
|
14363
14504
|
sendDom: this._settings.sendDom,
|
|
14364
14505
|
enablePatterns: this._settings.enablePatterns,
|
|
@@ -14609,127 +14750,6 @@ var require_ProxySettings = __commonJS({
|
|
|
14609
14750
|
}
|
|
14610
14751
|
});
|
|
14611
14752
|
|
|
14612
|
-
// ../eyes/dist/input/ExactMatchSettings.js
|
|
14613
|
-
var require_ExactMatchSettings = __commonJS({
|
|
14614
|
-
"../eyes/dist/input/ExactMatchSettings.js"(exports) {
|
|
14615
|
-
"use strict";
|
|
14616
|
-
init_global();
|
|
14617
|
-
init_process();
|
|
14618
|
-
init_setImmediate();
|
|
14619
|
-
init_buffer();
|
|
14620
|
-
init_setInterval();
|
|
14621
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
14622
|
-
if (k2 === void 0)
|
|
14623
|
-
k2 = k;
|
|
14624
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14625
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14626
|
-
desc = { enumerable: true, get: function() {
|
|
14627
|
-
return m[k];
|
|
14628
|
-
} };
|
|
14629
|
-
}
|
|
14630
|
-
Object.defineProperty(o, k2, desc);
|
|
14631
|
-
} : function(o, m, k, k2) {
|
|
14632
|
-
if (k2 === void 0)
|
|
14633
|
-
k2 = k;
|
|
14634
|
-
o[k2] = m[k];
|
|
14635
|
-
});
|
|
14636
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
14637
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14638
|
-
} : function(o, v) {
|
|
14639
|
-
o["default"] = v;
|
|
14640
|
-
});
|
|
14641
|
-
var __importStar = exports && exports.__importStar || function(mod) {
|
|
14642
|
-
if (mod && mod.__esModule)
|
|
14643
|
-
return mod;
|
|
14644
|
-
var result = {};
|
|
14645
|
-
if (mod != null) {
|
|
14646
|
-
for (var k in mod)
|
|
14647
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
14648
|
-
__createBinding(result, mod, k);
|
|
14649
|
-
}
|
|
14650
|
-
__setModuleDefault(result, mod);
|
|
14651
|
-
return result;
|
|
14652
|
-
};
|
|
14653
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14654
|
-
exports.ExactMatchSettingsData = void 0;
|
|
14655
|
-
var utils2 = __importStar(require_browser3());
|
|
14656
|
-
var ExactMatchSettingsData = class {
|
|
14657
|
-
constructor(settings) {
|
|
14658
|
-
this._settings = {};
|
|
14659
|
-
this.minDiffIntensity = settings.minDiffIntensity;
|
|
14660
|
-
this.minDiffWidth = settings.minDiffWidth;
|
|
14661
|
-
this.minDiffHeight = settings.minDiffHeight;
|
|
14662
|
-
this.matchThreshold = settings.matchThreshold;
|
|
14663
|
-
}
|
|
14664
|
-
get minDiffIntensity() {
|
|
14665
|
-
return this._settings.minDiffIntensity;
|
|
14666
|
-
}
|
|
14667
|
-
set minDiffIntensity(minDiffIntensity) {
|
|
14668
|
-
utils2.guard.isNumber(minDiffIntensity, { name: "minDiffIntensity", strict: false });
|
|
14669
|
-
this._settings.minDiffIntensity = minDiffIntensity;
|
|
14670
|
-
}
|
|
14671
|
-
getMinDiffIntensity() {
|
|
14672
|
-
return this.minDiffIntensity;
|
|
14673
|
-
}
|
|
14674
|
-
setMinDiffIntensity(value) {
|
|
14675
|
-
this.minDiffIntensity = value;
|
|
14676
|
-
}
|
|
14677
|
-
get minDiffWidth() {
|
|
14678
|
-
return this._settings.minDiffWidth;
|
|
14679
|
-
}
|
|
14680
|
-
set minDiffWidth(minDiffWidth) {
|
|
14681
|
-
utils2.guard.isNumber(minDiffWidth, { name: "minDiffWidth", strict: false });
|
|
14682
|
-
this._settings.minDiffWidth = minDiffWidth;
|
|
14683
|
-
}
|
|
14684
|
-
getMinDiffWidth() {
|
|
14685
|
-
return this.minDiffWidth;
|
|
14686
|
-
}
|
|
14687
|
-
setMinDiffWidth(value) {
|
|
14688
|
-
this.minDiffWidth = value;
|
|
14689
|
-
}
|
|
14690
|
-
get minDiffHeight() {
|
|
14691
|
-
return this._settings.minDiffHeight;
|
|
14692
|
-
}
|
|
14693
|
-
set minDiffHeight(minDiffHeight) {
|
|
14694
|
-
utils2.guard.isNumber(minDiffHeight, { name: "minDiffHeight", strict: false });
|
|
14695
|
-
this._settings.minDiffHeight = minDiffHeight;
|
|
14696
|
-
}
|
|
14697
|
-
getMinDiffHeight() {
|
|
14698
|
-
return this.minDiffHeight;
|
|
14699
|
-
}
|
|
14700
|
-
setMinDiffHeight(value) {
|
|
14701
|
-
this.minDiffHeight = value;
|
|
14702
|
-
}
|
|
14703
|
-
get matchThreshold() {
|
|
14704
|
-
return this._settings.matchThreshold;
|
|
14705
|
-
}
|
|
14706
|
-
set matchThreshold(matchThreshold) {
|
|
14707
|
-
utils2.guard.isNumber(matchThreshold, { name: "matchThreshold", strict: false });
|
|
14708
|
-
this._settings.matchThreshold = matchThreshold;
|
|
14709
|
-
}
|
|
14710
|
-
getMatchThreshold() {
|
|
14711
|
-
return this.matchThreshold;
|
|
14712
|
-
}
|
|
14713
|
-
setMatchThreshold(value) {
|
|
14714
|
-
this.matchThreshold = value;
|
|
14715
|
-
}
|
|
14716
|
-
/** @internal */
|
|
14717
|
-
toObject() {
|
|
14718
|
-
return this._settings;
|
|
14719
|
-
}
|
|
14720
|
-
/** @internal */
|
|
14721
|
-
toJSON() {
|
|
14722
|
-
return utils2.general.toJSON(this._settings);
|
|
14723
|
-
}
|
|
14724
|
-
/** @internal */
|
|
14725
|
-
toString() {
|
|
14726
|
-
return utils2.general.toString(this);
|
|
14727
|
-
}
|
|
14728
|
-
};
|
|
14729
|
-
exports.ExactMatchSettingsData = ExactMatchSettingsData;
|
|
14730
|
-
}
|
|
14731
|
-
});
|
|
14732
|
-
|
|
14733
14753
|
// ../eyes/dist/input/FloatingMatchSettings.js
|
|
14734
14754
|
var require_FloatingMatchSettings = __commonJS({
|
|
14735
14755
|
"../eyes/dist/input/FloatingMatchSettings.js"(exports) {
|
|
@@ -14966,6 +14986,8 @@ var require_ImageMatchSettings = __commonJS({
|
|
|
14966
14986
|
return this._settings.exact;
|
|
14967
14987
|
}
|
|
14968
14988
|
set exact(exact) {
|
|
14989
|
+
if (exact)
|
|
14990
|
+
(0, ExactMatchSettings_1.validateExactMatchSettings)(exact);
|
|
14969
14991
|
this._settings.exact = exact;
|
|
14970
14992
|
}
|
|
14971
14993
|
getExact() {
|
|
@@ -15246,6 +15268,7 @@ var require_Configuration = __commonJS({
|
|
|
15246
15268
|
var BatchInfo_1 = require_BatchInfo();
|
|
15247
15269
|
var PropertyData_1 = require_PropertyData();
|
|
15248
15270
|
var ImageMatchSettings_1 = require_ImageMatchSettings();
|
|
15271
|
+
var ExactMatchSettings_1 = require_ExactMatchSettings();
|
|
15249
15272
|
var utils2 = __importStar(require_browser3());
|
|
15250
15273
|
var ConfigurationData = class {
|
|
15251
15274
|
_isElementReference(value) {
|
|
@@ -15651,6 +15674,8 @@ var require_Configuration = __commonJS({
|
|
|
15651
15674
|
}
|
|
15652
15675
|
set defaultMatchSettings(defaultMatchSettings) {
|
|
15653
15676
|
utils2.guard.notNull(defaultMatchSettings, { name: "defaultMatchSettings" });
|
|
15677
|
+
if (defaultMatchSettings.exact)
|
|
15678
|
+
(0, ExactMatchSettings_1.validateExactMatchSettings)(defaultMatchSettings.exact);
|
|
15654
15679
|
this._config.defaultMatchSettings = defaultMatchSettings;
|
|
15655
15680
|
}
|
|
15656
15681
|
getDefaultMatchSettings() {
|
|
@@ -16395,7 +16420,10 @@ var require_Configuration = __commonJS({
|
|
|
16395
16420
|
}
|
|
16396
16421
|
/** @internal */
|
|
16397
16422
|
toJSON() {
|
|
16398
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
16423
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
16424
|
+
if (((_a = this.defaultMatchSettings) === null || _a === void 0 ? void 0 : _a.exact) && this.defaultMatchSettings.matchLevel === MatchLevel_1.MatchLevelEnum.Exact) {
|
|
16425
|
+
(0, ExactMatchSettings_1.validateExactMatchSettings)(this.defaultMatchSettings.exact);
|
|
16426
|
+
}
|
|
16399
16427
|
return utils2.general.toJSON({
|
|
16400
16428
|
open: utils2.general.removeUndefinedProps({
|
|
16401
16429
|
eyesServerUrl: this.serverUrl,
|
|
@@ -16439,7 +16467,7 @@ var require_Configuration = __commonJS({
|
|
|
16439
16467
|
bypassCSP: this.bypassCSP
|
|
16440
16468
|
}),
|
|
16441
16469
|
screenshot: utils2.general.removeUndefinedProps({
|
|
16442
|
-
fully: (
|
|
16470
|
+
fully: (_b = this.fully) !== null && _b !== void 0 ? _b : this.forceFullPageScreenshot,
|
|
16443
16471
|
scrollRootElement: this.scrollRootElement,
|
|
16444
16472
|
stitchMode: this.stitchMode,
|
|
16445
16473
|
hideScrollbars: this.hideScrollbars,
|
|
@@ -16452,13 +16480,13 @@ var require_Configuration = __commonJS({
|
|
|
16452
16480
|
rotation: this.rotation,
|
|
16453
16481
|
scaleRatio: this.scaleRatio
|
|
16454
16482
|
}),
|
|
16455
|
-
debugImages: ((
|
|
16483
|
+
debugImages: ((_c = this.debugScreenshots) === null || _c === void 0 ? void 0 : _c.save) && utils2.types.has(this.debugScreenshots, "path") ? this.debugScreenshots : void 0,
|
|
16456
16484
|
captureStatusBar: this.captureStatusBar,
|
|
16457
16485
|
mobileOptions: this.mobileOptions
|
|
16458
16486
|
}),
|
|
16459
16487
|
check: utils2.general.removeUndefinedProps({
|
|
16460
16488
|
httpVersion: this.httpVersion,
|
|
16461
|
-
environments: (
|
|
16489
|
+
environments: (_d = this.browsersInfo) === null || _d === void 0 ? void 0 : _d.map((browserInfo) => {
|
|
16462
16490
|
if (utils2.types.has(browserInfo, "iosDeviceInfo") && utils2.types.has(browserInfo.iosDeviceInfo, "iosVersion")) {
|
|
16463
16491
|
const { iosVersion, ...iosDeviceInfo } = browserInfo.iosDeviceInfo;
|
|
16464
16492
|
return { iosDeviceInfo: { ...iosDeviceInfo, version: iosVersion } };
|
|
@@ -16466,26 +16494,27 @@ var require_Configuration = __commonJS({
|
|
|
16466
16494
|
return browserInfo;
|
|
16467
16495
|
}),
|
|
16468
16496
|
ufgOptions: this.visualGridOptions,
|
|
16469
|
-
layoutBreakpoints: utils2.types.isDefined(this.layoutBreakpoints) ? utils2.types.has(this.layoutBreakpoints, "breakpoints") ? this.layoutBreakpoints : { breakpoints: (
|
|
16497
|
+
layoutBreakpoints: utils2.types.isDefined(this.layoutBreakpoints) ? utils2.types.has(this.layoutBreakpoints, "breakpoints") ? this.layoutBreakpoints : { breakpoints: (_e = this.layoutBreakpoints) !== null && _e !== void 0 ? _e : false } : void 0,
|
|
16470
16498
|
disableBrowserFetching: this.disableBrowserFetching,
|
|
16471
16499
|
autProxy: this.autProxy,
|
|
16472
16500
|
sendDom: this.sendDom,
|
|
16473
16501
|
matchTimeout: this.matchTimeout,
|
|
16474
|
-
matchLevel: (
|
|
16475
|
-
|
|
16476
|
-
|
|
16477
|
-
|
|
16478
|
-
|
|
16502
|
+
matchLevel: (_f = this.defaultMatchSettings) === null || _f === void 0 ? void 0 : _f.matchLevel,
|
|
16503
|
+
exact: (_g = this.defaultMatchSettings) === null || _g === void 0 ? void 0 : _g.exact,
|
|
16504
|
+
ignoreCaret: (_h = this.defaultMatchSettings) === null || _h === void 0 ? void 0 : _h.ignoreCaret,
|
|
16505
|
+
ignoreDisplacements: (_j = this.defaultMatchSettings) === null || _j === void 0 ? void 0 : _j.ignoreDisplacements,
|
|
16506
|
+
enablePatterns: (_k = this.defaultMatchSettings) === null || _k === void 0 ? void 0 : _k.enablePatterns,
|
|
16507
|
+
accessibilitySettings: ((_l = this.defaultMatchSettings) === null || _l === void 0 ? void 0 : _l.accessibilitySettings) && {
|
|
16479
16508
|
level: this.defaultMatchSettings.accessibilitySettings.level,
|
|
16480
16509
|
version: this.defaultMatchSettings.accessibilitySettings.guidelinesVersion
|
|
16481
16510
|
},
|
|
16482
|
-
useDom: (
|
|
16483
|
-
ignoreRegions: (
|
|
16484
|
-
contentRegions: (
|
|
16485
|
-
layoutRegions: (
|
|
16486
|
-
strictRegions: (
|
|
16487
|
-
floatingRegions: (
|
|
16488
|
-
accessibilityRegions: (
|
|
16511
|
+
useDom: (_m = this.defaultMatchSettings) === null || _m === void 0 ? void 0 : _m.useDom,
|
|
16512
|
+
ignoreRegions: (_o = this.defaultMatchSettings) === null || _o === void 0 ? void 0 : _o.ignoreRegions,
|
|
16513
|
+
contentRegions: (_p = this.defaultMatchSettings) === null || _p === void 0 ? void 0 : _p.contentRegions,
|
|
16514
|
+
layoutRegions: (_q = this.defaultMatchSettings) === null || _q === void 0 ? void 0 : _q.layoutRegions,
|
|
16515
|
+
strictRegions: (_r = this.defaultMatchSettings) === null || _r === void 0 ? void 0 : _r.strictRegions,
|
|
16516
|
+
floatingRegions: (_s = this.defaultMatchSettings) === null || _s === void 0 ? void 0 : _s.floatingRegions,
|
|
16517
|
+
accessibilityRegions: (_t = this.defaultMatchSettings) === null || _t === void 0 ? void 0 : _t.accessibilityRegions,
|
|
16489
16518
|
skipRootHtmlResource: this.skipRootHtmlResource
|
|
16490
16519
|
}),
|
|
16491
16520
|
close: utils2.general.removeUndefinedProps({
|
|
@@ -18936,6 +18965,71 @@ var require_formatter = __commonJS({
|
|
|
18936
18965
|
}
|
|
18937
18966
|
});
|
|
18938
18967
|
|
|
18968
|
+
// ../logger/dist/log-buffer.js
|
|
18969
|
+
var require_log_buffer = __commonJS({
|
|
18970
|
+
"../logger/dist/log-buffer.js"(exports) {
|
|
18971
|
+
"use strict";
|
|
18972
|
+
init_global();
|
|
18973
|
+
init_process();
|
|
18974
|
+
init_setImmediate();
|
|
18975
|
+
init_buffer();
|
|
18976
|
+
init_setInterval();
|
|
18977
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18978
|
+
exports.__resetLogBufferForTests = exports.isLogBufferActive = exports.disableLogBuffer = exports.onLogBufferFull = exports.consumeLogBuffer = exports.appendToLogBuffer = void 0;
|
|
18979
|
+
var LOG_BUFFER_MAX_ENTRIES = 5e4;
|
|
18980
|
+
var LOG_BUFFER_MAX_CHARS = 8e6;
|
|
18981
|
+
var logBuffer = [];
|
|
18982
|
+
var logBufferChars = 0;
|
|
18983
|
+
var onFull;
|
|
18984
|
+
var ANSI_REGEX = /\x1b\[[0-9;]*m/g;
|
|
18985
|
+
function appendToLogBuffer(line) {
|
|
18986
|
+
if (!logBuffer)
|
|
18987
|
+
return;
|
|
18988
|
+
logBuffer.push(line);
|
|
18989
|
+
logBufferChars += line.length;
|
|
18990
|
+
if (logBuffer.length > LOG_BUFFER_MAX_ENTRIES || logBufferChars > LOG_BUFFER_MAX_CHARS) {
|
|
18991
|
+
if (onFull)
|
|
18992
|
+
onFull();
|
|
18993
|
+
else {
|
|
18994
|
+
const dropped = logBuffer.shift();
|
|
18995
|
+
if (dropped)
|
|
18996
|
+
logBufferChars -= dropped.length;
|
|
18997
|
+
}
|
|
18998
|
+
}
|
|
18999
|
+
}
|
|
19000
|
+
exports.appendToLogBuffer = appendToLogBuffer;
|
|
19001
|
+
function consumeLogBuffer() {
|
|
19002
|
+
if (!logBuffer)
|
|
19003
|
+
return "";
|
|
19004
|
+
const text = logBuffer.length ? logBuffer.join("\n") + "\n" : "";
|
|
19005
|
+
logBuffer = [];
|
|
19006
|
+
logBufferChars = 0;
|
|
19007
|
+
return text.replace(ANSI_REGEX, "");
|
|
19008
|
+
}
|
|
19009
|
+
exports.consumeLogBuffer = consumeLogBuffer;
|
|
19010
|
+
function onLogBufferFull(cb) {
|
|
19011
|
+
onFull = cb;
|
|
19012
|
+
}
|
|
19013
|
+
exports.onLogBufferFull = onLogBufferFull;
|
|
19014
|
+
function disableLogBuffer() {
|
|
19015
|
+
logBuffer = void 0;
|
|
19016
|
+
logBufferChars = 0;
|
|
19017
|
+
onFull = void 0;
|
|
19018
|
+
}
|
|
19019
|
+
exports.disableLogBuffer = disableLogBuffer;
|
|
19020
|
+
function isLogBufferActive() {
|
|
19021
|
+
return logBuffer !== void 0;
|
|
19022
|
+
}
|
|
19023
|
+
exports.isLogBufferActive = isLogBufferActive;
|
|
19024
|
+
function __resetLogBufferForTests() {
|
|
19025
|
+
logBuffer = [];
|
|
19026
|
+
logBufferChars = 0;
|
|
19027
|
+
onFull = void 0;
|
|
19028
|
+
}
|
|
19029
|
+
exports.__resetLogBufferForTests = __resetLogBufferForTests;
|
|
19030
|
+
}
|
|
19031
|
+
});
|
|
19032
|
+
|
|
18939
19033
|
// ../logger/dist/handler-console.js
|
|
18940
19034
|
var require_handler_console = __commonJS({
|
|
18941
19035
|
"../logger/dist/handler-console.js"(exports) {
|
|
@@ -19515,50 +19609,58 @@ var require_printer = __commonJS({
|
|
|
19515
19609
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19516
19610
|
exports.makePrinter = void 0;
|
|
19517
19611
|
var log_level_1 = require_log_level();
|
|
19612
|
+
var log_buffer_1 = require_log_buffer();
|
|
19518
19613
|
function makePrinter({ handler, level = log_level_1.LogLevel.silent, format, masks, maskLog }) {
|
|
19519
19614
|
var _a;
|
|
19520
19615
|
const formatter = (_a = format === null || format === void 0 ? void 0 : format.formatter) !== null && _a !== void 0 ? _a : (chunks, options) => ({ chunks, options, isRaw: true });
|
|
19521
19616
|
return { debug, log, info: log, warn, error, fatal, verbose: log };
|
|
19617
|
+
function emit(threshold, levelName, messages) {
|
|
19618
|
+
const gated = level < threshold;
|
|
19619
|
+
if (gated && !(0, log_buffer_1.isLogBufferActive)())
|
|
19620
|
+
return void 0;
|
|
19621
|
+
const line = formatter(messages, { ...format, level: levelName, masks, maskLog });
|
|
19622
|
+
if ((0, log_buffer_1.isLogBufferActive)() && typeof line === "string")
|
|
19623
|
+
(0, log_buffer_1.appendToLogBuffer)(line);
|
|
19624
|
+
return gated ? void 0 : line;
|
|
19625
|
+
}
|
|
19522
19626
|
function debug(...messages) {
|
|
19523
|
-
|
|
19524
|
-
|
|
19525
|
-
|
|
19526
|
-
handler.log(formatter(messages, options));
|
|
19627
|
+
const line = emit(log_level_1.LogLevel.debug, "debug", messages);
|
|
19628
|
+
if (line !== void 0)
|
|
19629
|
+
handler.log(line);
|
|
19527
19630
|
}
|
|
19528
19631
|
function log(...messages) {
|
|
19529
|
-
|
|
19530
|
-
|
|
19531
|
-
|
|
19532
|
-
handler.log(formatter(messages, options));
|
|
19632
|
+
const line = emit(log_level_1.LogLevel.info, "info", messages);
|
|
19633
|
+
if (line !== void 0)
|
|
19634
|
+
handler.log(line);
|
|
19533
19635
|
}
|
|
19534
19636
|
function warn(...messages) {
|
|
19535
|
-
|
|
19637
|
+
const line = emit(log_level_1.LogLevel.warn, "warn", messages);
|
|
19638
|
+
if (line === void 0)
|
|
19536
19639
|
return;
|
|
19537
|
-
const options = { ...format, level: "warn", masks, maskLog };
|
|
19538
19640
|
if (handler.warn)
|
|
19539
|
-
handler.warn(
|
|
19641
|
+
handler.warn(line);
|
|
19540
19642
|
else
|
|
19541
|
-
handler.log(
|
|
19643
|
+
handler.log(line);
|
|
19542
19644
|
}
|
|
19543
19645
|
function error(...messages) {
|
|
19544
|
-
|
|
19646
|
+
const line = emit(log_level_1.LogLevel.error, "error", messages);
|
|
19647
|
+
if (line === void 0)
|
|
19545
19648
|
return;
|
|
19546
|
-
const options = { ...format, level: "error", masks, maskLog };
|
|
19547
19649
|
if (handler.error)
|
|
19548
|
-
handler.error(
|
|
19650
|
+
handler.error(line);
|
|
19549
19651
|
else
|
|
19550
|
-
handler.log(
|
|
19652
|
+
handler.log(line);
|
|
19551
19653
|
}
|
|
19552
19654
|
function fatal(...messages) {
|
|
19553
|
-
|
|
19655
|
+
const line = emit(log_level_1.LogLevel.fatal, "fatal", messages);
|
|
19656
|
+
if (line === void 0)
|
|
19554
19657
|
return;
|
|
19555
|
-
const options = { ...format, level: "fatal", masks, maskLog };
|
|
19556
19658
|
if (handler.fatal)
|
|
19557
|
-
handler.fatal(
|
|
19659
|
+
handler.fatal(line);
|
|
19558
19660
|
else if (handler.error)
|
|
19559
|
-
handler.error(
|
|
19661
|
+
handler.error(line);
|
|
19560
19662
|
else
|
|
19561
|
-
handler.log(
|
|
19663
|
+
handler.log(line);
|
|
19562
19664
|
}
|
|
19563
19665
|
}
|
|
19564
19666
|
exports.makePrinter = makePrinter;
|
|
@@ -19834,6 +19936,7 @@ var require_browser6 = __commonJS({
|
|
|
19834
19936
|
};
|
|
19835
19937
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19836
19938
|
__exportStar(require_formatter(), exports);
|
|
19939
|
+
__exportStar(require_log_buffer(), exports);
|
|
19837
19940
|
__exportStar(require_handler_console(), exports);
|
|
19838
19941
|
__exportStar(require_handler_debug(), exports);
|
|
19839
19942
|
__exportStar(require_logger(), exports);
|
|
@@ -30103,6 +30206,7 @@ var require_requests = __commonJS({
|
|
|
30103
30206
|
ignoreCaret: settings.ignoreCaret,
|
|
30104
30207
|
enablePatterns: settings.enablePatterns,
|
|
30105
30208
|
matchLevel: (_a = settings.matchLevel) !== null && _a !== void 0 ? _a : "Strict",
|
|
30209
|
+
exact: settings.matchLevel === "Exact" ? settings.exact : void 0,
|
|
30106
30210
|
useDom: (_b = settings.useDom) !== null && _b !== void 0 ? _b : false,
|
|
30107
30211
|
densityMetrics: settings.densityMetrics
|
|
30108
30212
|
},
|
|
@@ -74571,6 +74675,108 @@ var require_delete_test = __commonJS({
|
|
|
74571
74675
|
}
|
|
74572
74676
|
});
|
|
74573
74677
|
|
|
74678
|
+
// ../core-base/dist/server/sdk-log-upload.js
|
|
74679
|
+
var require_sdk_log_upload = __commonJS({
|
|
74680
|
+
"../core-base/dist/server/sdk-log-upload.js"(exports) {
|
|
74681
|
+
"use strict";
|
|
74682
|
+
init_global();
|
|
74683
|
+
init_process();
|
|
74684
|
+
init_setImmediate();
|
|
74685
|
+
init_buffer();
|
|
74686
|
+
init_setInterval();
|
|
74687
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74688
|
+
exports.makeSdkLogUpload = void 0;
|
|
74689
|
+
var req_1 = (init_dist(), __toCommonJS(dist_exports));
|
|
74690
|
+
function makeSdkLogUpload({ url, proxy, httpVersion }) {
|
|
74691
|
+
let created = false;
|
|
74692
|
+
let stopped = false;
|
|
74693
|
+
let chain = Promise.resolve();
|
|
74694
|
+
async function append(text) {
|
|
74695
|
+
if (stopped || !text)
|
|
74696
|
+
return;
|
|
74697
|
+
try {
|
|
74698
|
+
if (!created) {
|
|
74699
|
+
const res2 = await (0, req_1.req)(url, {
|
|
74700
|
+
method: "PUT",
|
|
74701
|
+
headers: { "x-ms-blob-type": "AppendBlob", "Content-Length": "0" },
|
|
74702
|
+
proxy,
|
|
74703
|
+
httpVersion
|
|
74704
|
+
});
|
|
74705
|
+
if (!res2.ok && res2.status !== 409)
|
|
74706
|
+
throw new Error(`create blob failed (${res2.status})`);
|
|
74707
|
+
created = true;
|
|
74708
|
+
}
|
|
74709
|
+
const res = await (0, req_1.req)(withQuery(url, "comp=appendblock"), { method: "PUT", body: text, proxy, httpVersion });
|
|
74710
|
+
if (!res.ok)
|
|
74711
|
+
throw new Error(`appendblock failed (${res.status})`);
|
|
74712
|
+
} catch {
|
|
74713
|
+
stopped = true;
|
|
74714
|
+
}
|
|
74715
|
+
}
|
|
74716
|
+
return (text) => chain = chain.then(() => append(text));
|
|
74717
|
+
}
|
|
74718
|
+
exports.makeSdkLogUpload = makeSdkLogUpload;
|
|
74719
|
+
var withQuery = (url, q) => url + (url.includes("?") ? "&" : "?") + q;
|
|
74720
|
+
}
|
|
74721
|
+
});
|
|
74722
|
+
|
|
74723
|
+
// ../core-base/dist/sdk-log-streaming.js
|
|
74724
|
+
var require_sdk_log_streaming = __commonJS({
|
|
74725
|
+
"../core-base/dist/sdk-log-streaming.js"(exports) {
|
|
74726
|
+
"use strict";
|
|
74727
|
+
init_global();
|
|
74728
|
+
init_process();
|
|
74729
|
+
init_setImmediate();
|
|
74730
|
+
init_buffer();
|
|
74731
|
+
init_setInterval();
|
|
74732
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74733
|
+
exports.decideSdkLogStreaming = void 0;
|
|
74734
|
+
var logger_1 = require_browser6();
|
|
74735
|
+
var sdk_log_upload_1 = require_sdk_log_upload();
|
|
74736
|
+
var SDK_LOG_RUN_ID = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
74737
|
+
var SDK_LOG_PLACEHOLDER = "__sdk_logs_batch_id__";
|
|
74738
|
+
var sdkLogDecided = false;
|
|
74739
|
+
var sdkLogDrain;
|
|
74740
|
+
function decideSdkLogStreaming(account) {
|
|
74741
|
+
var _a, _b;
|
|
74742
|
+
if (!sdkLogDecided) {
|
|
74743
|
+
sdkLogDecided = true;
|
|
74744
|
+
const disabled = !!process.env.APPLITOOLS_DISABLE_BACKEND_LOGS;
|
|
74745
|
+
if (!account.collectSdkLogs || !account.sdkLogsUploadUrl || disabled) {
|
|
74746
|
+
(0, logger_1.disableLogBuffer)();
|
|
74747
|
+
} else {
|
|
74748
|
+
const url = account.sdkLogsUploadUrl.split(SDK_LOG_PLACEHOLDER).join(encodeURIComponent(SDK_LOG_RUN_ID));
|
|
74749
|
+
const upload = (0, sdk_log_upload_1.makeSdkLogUpload)({
|
|
74750
|
+
url,
|
|
74751
|
+
proxy: account.eyesServer.proxy,
|
|
74752
|
+
httpVersion: account.eyesServer.httpVersion
|
|
74753
|
+
});
|
|
74754
|
+
sdkLogDrain = () => {
|
|
74755
|
+
const text = (0, logger_1.consumeLogBuffer)();
|
|
74756
|
+
if (text)
|
|
74757
|
+
void upload(text);
|
|
74758
|
+
};
|
|
74759
|
+
(0, logger_1.onLogBufferFull)(sdkLogDrain);
|
|
74760
|
+
const timer = setIntervalBrowser(() => sdkLogDrain === null || sdkLogDrain === void 0 ? void 0 : sdkLogDrain(), 5e3);
|
|
74761
|
+
(_b = (_a = timer).unref) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
74762
|
+
installSdkLogShutdownHooks();
|
|
74763
|
+
}
|
|
74764
|
+
}
|
|
74765
|
+
}
|
|
74766
|
+
exports.decideSdkLogStreaming = decideSdkLogStreaming;
|
|
74767
|
+
var shutdownHooksInstalled = false;
|
|
74768
|
+
function installSdkLogShutdownHooks() {
|
|
74769
|
+
if (shutdownHooksInstalled)
|
|
74770
|
+
return;
|
|
74771
|
+
shutdownHooksInstalled = true;
|
|
74772
|
+
const shutdown = () => sdkLogDrain === null || sdkLogDrain === void 0 ? void 0 : sdkLogDrain();
|
|
74773
|
+
process.on("beforeExit", shutdown);
|
|
74774
|
+
process.on("SIGINT", shutdown);
|
|
74775
|
+
process.on("SIGTERM", shutdown);
|
|
74776
|
+
}
|
|
74777
|
+
}
|
|
74778
|
+
});
|
|
74779
|
+
|
|
74574
74780
|
// ../core-base/dist/get-account-info.js
|
|
74575
74781
|
var require_get_account_info = __commonJS({
|
|
74576
74782
|
"../core-base/dist/get-account-info.js"(exports) {
|
|
@@ -74614,6 +74820,7 @@ var require_get_account_info = __commonJS({
|
|
|
74614
74820
|
};
|
|
74615
74821
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74616
74822
|
exports.makeGetAccountInfo = void 0;
|
|
74823
|
+
var sdk_log_streaming_1 = require_sdk_log_streaming();
|
|
74617
74824
|
var utils2 = __importStar(require_browser3());
|
|
74618
74825
|
function makeGetAccountInfo({ requests, agentId: defaultAgentId, logger: mainLogger }) {
|
|
74619
74826
|
return async function getAccountInfo({ settings, logger = mainLogger }) {
|
|
@@ -74622,11 +74829,13 @@ var require_get_account_info = __commonJS({
|
|
|
74622
74829
|
settings.agentId = `${defaultAgentId} ${settings.agentId ? `[${settings.agentId}]` : ""}`.trim();
|
|
74623
74830
|
logger.log('Command "getAccountInfo" is called with settings', settings);
|
|
74624
74831
|
const account = await requests.getAccountInfo({ settings, logger });
|
|
74625
|
-
|
|
74832
|
+
const result = {
|
|
74626
74833
|
...account,
|
|
74627
74834
|
eyesServer: { ...account.eyesServer, agentId: settings.agentId },
|
|
74628
74835
|
ufgServer: { ...account.ufgServer, agentId: settings.agentId }
|
|
74629
74836
|
};
|
|
74837
|
+
(0, sdk_log_streaming_1.decideSdkLogStreaming)(result);
|
|
74838
|
+
return result;
|
|
74630
74839
|
};
|
|
74631
74840
|
}
|
|
74632
74841
|
exports.makeGetAccountInfo = makeGetAccountInfo;
|
|
@@ -75052,6 +75261,7 @@ var require_dist2 = __commonJS({
|
|
|
75052
75261
|
__exportStar(require_core(), exports);
|
|
75053
75262
|
__exportStar(require_eyes(), exports);
|
|
75054
75263
|
__exportStar(require_requests(), exports);
|
|
75264
|
+
__exportStar(require_sdk_log_upload(), exports);
|
|
75055
75265
|
__exportStar(require_core_error(), exports);
|
|
75056
75266
|
__exportStar(require_missingApiKeyError(), exports);
|
|
75057
75267
|
__exportStar(require_test_error(), exports);
|
|
@@ -82746,7 +82956,7 @@ ${l2}`}`, { bundledCss: u2, unfetchedResources: a2 };
|
|
|
82746
82956
|
return m3 && (k2.shadowRoot = m3), k2;
|
|
82747
82957
|
}
|
|
82748
82958
|
}(t3);
|
|
82749
|
-
f2(l2.doCaptureDoc), d2(l2.waitForImages), await Promise.all(m2), f2(l2.waitForImages), T2.version = "1.4.0", T2.scriptVersion = "11.8.
|
|
82959
|
+
f2(l2.doCaptureDoc), d2(l2.waitForImages), await Promise.all(m2), f2(l2.waitForImages), T2.version = "1.4.0", T2.scriptVersion = "11.8.3";
|
|
82750
82960
|
const N2 = p2.length ? `${p2.join("\n")}
|
|
82751
82961
|
` : "", P2 = h2.size ? `${Array.from(h2).join("\n")}
|
|
82752
82962
|
` : "", A2 = JSON.stringify({ separator: w2, cssStartToken: y2, cssEndToken: y2, iframeStartToken: `"${g2}`, iframeEndToken: `${g2}"` });
|
|
@@ -89732,7 +89942,7 @@ var require_captureDomPollForIE = __commonJS({
|
|
|
89732
89942
|
case 24:
|
|
89733
89943
|
return L2 = e4.sent, A2(E2.prefetchCss), j2 = U0({ parseCss: D0, CSSImportRule, getCssFromCache: L2, absolutizeUrl: j0, unfetchedToken: _2 }), k2 = z0({ getCssFromCache: L2, absolutizeUrl: j0 }), C2 = V0({ extractCssFromNode: k2, getBundledCssFromCssText: j2, unfetchedToken: _2 }), S2(E2.doCaptureDoc), M2 = H2(i3), A2(E2.doCaptureDoc), S2(E2.waitForImages), e4.next = 35, Promise.all(O2);
|
|
89734
89944
|
case 35:
|
|
89735
|
-
return A2(E2.waitForImages), M2.version = "1.4.0", M2.scriptVersion = "11.8.
|
|
89945
|
+
return A2(E2.waitForImages), M2.version = "1.4.0", M2.scriptVersion = "11.8.3", N2 = T2.length ? T2.join("\n") + "\n" : "", U2 = x2.size ? Array.from(x2).join("\n") + "\n" : "", D2 = JSON.stringify({ separator: P2, cssStartToken: _2, cssEndToken: _2, iframeStartToken: '"' + R2, iframeEndToken: R2 + '"' }), A2(E2.total), B2 = JSON.stringify(M2), z2 = D2 + "\n" + U2 + P2 + "\n" + N2 + P2 + "\n" + ("string" == typeof B2 ? B2 : H0(M2)) + F2(), console.log("[captureFrame]", JSON.stringify(E2)), e4.abrupt("return", z2);
|
|
89736
89946
|
case 46:
|
|
89737
89947
|
case "end":
|
|
89738
89948
|
return e4.stop();
|
|
@@ -104738,7 +104948,7 @@ creating temp style for access.`), r2 = Qh(e3);
|
|
|
104738
104948
|
function M2(e3) {
|
|
104739
104949
|
return r3.defaultView && r3.defaultView.frameElement && r3.defaultView.frameElement.getAttribute(e3);
|
|
104740
104950
|
}
|
|
104741
|
-
}(n3).then((e3) => (m2.log("processPage end"), e3.scriptVersion = "4.17.
|
|
104951
|
+
}(n3).then((e3) => (m2.log("processPage end"), e3.scriptVersion = "4.17.5", e3));
|
|
104742
104952
|
}, n2[S], "domSnapshotResult");
|
|
104743
104953
|
return function(e3) {
|
|
104744
104954
|
try {
|
|
@@ -127916,6 +128126,7 @@ var require_check3 = __commonJS({
|
|
|
127916
128126
|
var to_base_check_settings_1 = require_to_base_check_settings();
|
|
127917
128127
|
var to_old_infra_environment_1 = require_to_old_infra_environment();
|
|
127918
128128
|
function makeCheck({ eyes: eyes2, target: defaultTarget, environments: defaultEnvironments = [], spec: spec2, signal, logger: mainLogger }) {
|
|
128129
|
+
const oldInfraRetryDisabled = /* @__PURE__ */ new WeakSet();
|
|
127919
128130
|
return async function check({ target = defaultTarget, settings = {}, logger = mainLogger } = {}) {
|
|
127920
128131
|
var _a;
|
|
127921
128132
|
logger = logger.extend(mainLogger);
|
|
@@ -128064,18 +128275,21 @@ var require_check3 = __commonJS({
|
|
|
128064
128275
|
settings: baseSettings,
|
|
128065
128276
|
logger: environmentLogger
|
|
128066
128277
|
});
|
|
128067
|
-
if (!checkResult.asExpected && baseEyes.test.shouldRetryWithOldInfra) {
|
|
128278
|
+
if (!checkResult.asExpected && baseEyes.test.shouldRetryWithOldInfra && !oldInfraRetryDisabled.has(baseEyes)) {
|
|
128068
128279
|
const oldInfraEnvironment = (0, to_old_infra_environment_1.toOldInfraEnvironment)(environment);
|
|
128069
128280
|
if (oldInfraEnvironment) {
|
|
128070
128281
|
try {
|
|
128071
128282
|
const { target: target3, settings: settings2 } = await renderForCheck(oldInfraEnvironment);
|
|
128072
128283
|
settings2.oldInfraRetry = true;
|
|
128073
|
-
await baseEyes.check({
|
|
128284
|
+
const retryResult = await baseEyes.check({
|
|
128074
128285
|
target: { ...target3, isTransformed: true },
|
|
128075
128286
|
settings: settings2,
|
|
128076
128287
|
logger: environmentLogger
|
|
128077
128288
|
});
|
|
128289
|
+
if (!retryResult.asExpected)
|
|
128290
|
+
oldInfraRetryDisabled.add(baseEyes);
|
|
128078
128291
|
} catch (error) {
|
|
128292
|
+
oldInfraRetryDisabled.add(baseEyes);
|
|
128079
128293
|
environmentLogger.warn("Old-infra retry failed; keeping the primary check result", error);
|
|
128080
128294
|
}
|
|
128081
128295
|
}
|
|
@@ -129507,6 +129721,292 @@ var require_get_eyes_results = __commonJS({
|
|
|
129507
129721
|
}
|
|
129508
129722
|
});
|
|
129509
129723
|
|
|
129724
|
+
// ../../node_modules/shell-quote/quote.js
|
|
129725
|
+
var require_quote = __commonJS({
|
|
129726
|
+
"../../node_modules/shell-quote/quote.js"(exports, module) {
|
|
129727
|
+
"use strict";
|
|
129728
|
+
init_global();
|
|
129729
|
+
init_process();
|
|
129730
|
+
init_setImmediate();
|
|
129731
|
+
init_buffer();
|
|
129732
|
+
init_setInterval();
|
|
129733
|
+
var OPS = [
|
|
129734
|
+
"||",
|
|
129735
|
+
"&&",
|
|
129736
|
+
";;",
|
|
129737
|
+
"|&",
|
|
129738
|
+
"<(",
|
|
129739
|
+
"<<<",
|
|
129740
|
+
">>",
|
|
129741
|
+
">&",
|
|
129742
|
+
"<&",
|
|
129743
|
+
"&",
|
|
129744
|
+
";",
|
|
129745
|
+
"(",
|
|
129746
|
+
")",
|
|
129747
|
+
"|",
|
|
129748
|
+
"<",
|
|
129749
|
+
">"
|
|
129750
|
+
];
|
|
129751
|
+
var LINE_TERMINATORS = /[\n\r\u2028\u2029]/;
|
|
129752
|
+
var GLOB_SHELL_SPECIAL = /[\s#!"$&'():;<=>@\\^`|]/g;
|
|
129753
|
+
module.exports = function quote(xs) {
|
|
129754
|
+
return xs.map(function(s) {
|
|
129755
|
+
if (s === "") {
|
|
129756
|
+
return "''";
|
|
129757
|
+
}
|
|
129758
|
+
if (s && typeof s === "object") {
|
|
129759
|
+
if (s.op === "glob") {
|
|
129760
|
+
if (typeof s.pattern !== "string") {
|
|
129761
|
+
throw new TypeError("glob token requires a string `pattern`");
|
|
129762
|
+
}
|
|
129763
|
+
if (LINE_TERMINATORS.test(s.pattern)) {
|
|
129764
|
+
throw new TypeError("glob `pattern` must not contain line terminators");
|
|
129765
|
+
}
|
|
129766
|
+
return s.pattern.replace(GLOB_SHELL_SPECIAL, "\\$&");
|
|
129767
|
+
}
|
|
129768
|
+
if (typeof s.op === "string") {
|
|
129769
|
+
if (OPS.indexOf(s.op) < 0) {
|
|
129770
|
+
throw new TypeError("invalid `op` value: " + JSON.stringify(s.op));
|
|
129771
|
+
}
|
|
129772
|
+
return s.op.replace(/[\s\S]/g, "\\$&");
|
|
129773
|
+
}
|
|
129774
|
+
if (typeof s.comment === "string") {
|
|
129775
|
+
if (LINE_TERMINATORS.test(s.comment)) {
|
|
129776
|
+
throw new TypeError("`comment` must not contain line terminators");
|
|
129777
|
+
}
|
|
129778
|
+
return "#" + s.comment;
|
|
129779
|
+
}
|
|
129780
|
+
throw new TypeError("unrecognized object token shape");
|
|
129781
|
+
}
|
|
129782
|
+
if (/["\s\\]/.test(s) && !/'/.test(s)) {
|
|
129783
|
+
return "'" + s.replace(/(['])/g, "\\$1") + "'";
|
|
129784
|
+
}
|
|
129785
|
+
if (/["'\s]/.test(s)) {
|
|
129786
|
+
return '"' + s.replace(/(["\\$`!])/g, "\\$1") + '"';
|
|
129787
|
+
}
|
|
129788
|
+
return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, "$1\\$2");
|
|
129789
|
+
}).join(" ");
|
|
129790
|
+
};
|
|
129791
|
+
}
|
|
129792
|
+
});
|
|
129793
|
+
|
|
129794
|
+
// ../../node_modules/shell-quote/parse.js
|
|
129795
|
+
var require_parse2 = __commonJS({
|
|
129796
|
+
"../../node_modules/shell-quote/parse.js"(exports, module) {
|
|
129797
|
+
"use strict";
|
|
129798
|
+
init_global();
|
|
129799
|
+
init_process();
|
|
129800
|
+
init_setImmediate();
|
|
129801
|
+
init_buffer();
|
|
129802
|
+
init_setInterval();
|
|
129803
|
+
var CONTROL = "(?:" + [
|
|
129804
|
+
"\\|\\|",
|
|
129805
|
+
"\\&\\&",
|
|
129806
|
+
";;",
|
|
129807
|
+
"\\|\\&",
|
|
129808
|
+
"\\<\\(",
|
|
129809
|
+
"\\<\\<\\<",
|
|
129810
|
+
">>",
|
|
129811
|
+
">\\&",
|
|
129812
|
+
"<\\&",
|
|
129813
|
+
"[&;()|<>]"
|
|
129814
|
+
].join("|") + ")";
|
|
129815
|
+
var controlRE = new RegExp("^" + CONTROL + "$");
|
|
129816
|
+
var META = "|&;()<> \\t";
|
|
129817
|
+
var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"';
|
|
129818
|
+
var DOUBLE_QUOTE = "'((\\\\'|[^'])*?)'";
|
|
129819
|
+
var hash = /^#$/;
|
|
129820
|
+
var SQ = "'";
|
|
129821
|
+
var DQ = '"';
|
|
129822
|
+
var DS = "$";
|
|
129823
|
+
var TOKEN = "";
|
|
129824
|
+
var mult = 4294967296;
|
|
129825
|
+
for (i = 0; i < 4; i++) {
|
|
129826
|
+
TOKEN += (mult * Math.random()).toString(16);
|
|
129827
|
+
}
|
|
129828
|
+
var i;
|
|
129829
|
+
var startsWithToken = new RegExp("^" + TOKEN);
|
|
129830
|
+
function matchAll(s, r) {
|
|
129831
|
+
var origIndex = r.lastIndex;
|
|
129832
|
+
var matches = [];
|
|
129833
|
+
var matchObj;
|
|
129834
|
+
while (matchObj = r.exec(s)) {
|
|
129835
|
+
matches.push(matchObj);
|
|
129836
|
+
if (r.lastIndex === matchObj.index) {
|
|
129837
|
+
r.lastIndex += 1;
|
|
129838
|
+
}
|
|
129839
|
+
}
|
|
129840
|
+
r.lastIndex = origIndex;
|
|
129841
|
+
return matches;
|
|
129842
|
+
}
|
|
129843
|
+
function getVar(env, pre, key) {
|
|
129844
|
+
var r = typeof env === "function" ? env(key) : env[key];
|
|
129845
|
+
if (typeof r === "undefined" && key != "") {
|
|
129846
|
+
r = "";
|
|
129847
|
+
} else if (typeof r === "undefined") {
|
|
129848
|
+
r = "$";
|
|
129849
|
+
}
|
|
129850
|
+
if (typeof r === "object") {
|
|
129851
|
+
return pre + TOKEN + JSON.stringify(r) + TOKEN;
|
|
129852
|
+
}
|
|
129853
|
+
return pre + r;
|
|
129854
|
+
}
|
|
129855
|
+
function parseInternal(string, env, opts) {
|
|
129856
|
+
if (!opts) {
|
|
129857
|
+
opts = {};
|
|
129858
|
+
}
|
|
129859
|
+
var BS = opts.escape || "\\";
|
|
129860
|
+
var BAREWORD = "(\\" + BS + `['"` + META + `]|[^\\s'"` + META + "])+";
|
|
129861
|
+
var chunker = new RegExp([
|
|
129862
|
+
"(" + CONTROL + ")",
|
|
129863
|
+
// control chars
|
|
129864
|
+
"(" + BAREWORD + "|" + SINGLE_QUOTE + "|" + DOUBLE_QUOTE + ")+"
|
|
129865
|
+
].join("|"), "g");
|
|
129866
|
+
var matches = matchAll(string, chunker);
|
|
129867
|
+
if (matches.length === 0) {
|
|
129868
|
+
return [];
|
|
129869
|
+
}
|
|
129870
|
+
if (!env) {
|
|
129871
|
+
env = {};
|
|
129872
|
+
}
|
|
129873
|
+
var commented = false;
|
|
129874
|
+
return matches.map(function(match) {
|
|
129875
|
+
var s = match[0];
|
|
129876
|
+
if (!s || commented) {
|
|
129877
|
+
return void 0;
|
|
129878
|
+
}
|
|
129879
|
+
if (controlRE.test(s)) {
|
|
129880
|
+
return { op: s };
|
|
129881
|
+
}
|
|
129882
|
+
var quote = false;
|
|
129883
|
+
var esc = false;
|
|
129884
|
+
var out = "";
|
|
129885
|
+
var isGlob = false;
|
|
129886
|
+
var i2;
|
|
129887
|
+
function parseEnvVar() {
|
|
129888
|
+
i2 += 1;
|
|
129889
|
+
var varend;
|
|
129890
|
+
var varname;
|
|
129891
|
+
var char = s.charAt(i2);
|
|
129892
|
+
if (char === "{") {
|
|
129893
|
+
i2 += 1;
|
|
129894
|
+
if (s.charAt(i2) === "}") {
|
|
129895
|
+
throw new Error("Bad substitution: " + s.slice(i2 - 2, i2 + 1));
|
|
129896
|
+
}
|
|
129897
|
+
varend = s.indexOf("}", i2);
|
|
129898
|
+
if (varend < 0) {
|
|
129899
|
+
throw new Error("Bad substitution: " + s.slice(i2));
|
|
129900
|
+
}
|
|
129901
|
+
varname = s.slice(i2, varend);
|
|
129902
|
+
i2 = varend;
|
|
129903
|
+
} else if (/[*@#?$!_-]/.test(char)) {
|
|
129904
|
+
varname = char;
|
|
129905
|
+
i2 += 1;
|
|
129906
|
+
} else {
|
|
129907
|
+
var slicedFromI = s.slice(i2);
|
|
129908
|
+
varend = slicedFromI.match(/[^\w\d_]/);
|
|
129909
|
+
if (!varend) {
|
|
129910
|
+
varname = slicedFromI;
|
|
129911
|
+
i2 = s.length;
|
|
129912
|
+
} else {
|
|
129913
|
+
varname = slicedFromI.slice(0, varend.index);
|
|
129914
|
+
i2 += varend.index - 1;
|
|
129915
|
+
}
|
|
129916
|
+
}
|
|
129917
|
+
return getVar(env, "", varname);
|
|
129918
|
+
}
|
|
129919
|
+
for (i2 = 0; i2 < s.length; i2++) {
|
|
129920
|
+
var c = s.charAt(i2);
|
|
129921
|
+
isGlob = isGlob || !quote && (c === "*" || c === "?");
|
|
129922
|
+
if (esc) {
|
|
129923
|
+
out += c;
|
|
129924
|
+
esc = false;
|
|
129925
|
+
} else if (quote) {
|
|
129926
|
+
if (c === quote) {
|
|
129927
|
+
quote = false;
|
|
129928
|
+
} else if (quote == SQ) {
|
|
129929
|
+
out += c;
|
|
129930
|
+
} else {
|
|
129931
|
+
if (c === BS) {
|
|
129932
|
+
i2 += 1;
|
|
129933
|
+
c = s.charAt(i2);
|
|
129934
|
+
if (c === DQ || c === BS || c === DS) {
|
|
129935
|
+
out += c;
|
|
129936
|
+
} else {
|
|
129937
|
+
out += BS + c;
|
|
129938
|
+
}
|
|
129939
|
+
} else if (c === DS) {
|
|
129940
|
+
out += parseEnvVar();
|
|
129941
|
+
} else {
|
|
129942
|
+
out += c;
|
|
129943
|
+
}
|
|
129944
|
+
}
|
|
129945
|
+
} else if (c === DQ || c === SQ) {
|
|
129946
|
+
quote = c;
|
|
129947
|
+
} else if (controlRE.test(c)) {
|
|
129948
|
+
return { op: s };
|
|
129949
|
+
} else if (hash.test(c)) {
|
|
129950
|
+
commented = true;
|
|
129951
|
+
var commentObj = { comment: string.slice(match.index + i2 + 1) };
|
|
129952
|
+
if (out.length) {
|
|
129953
|
+
return [out, commentObj];
|
|
129954
|
+
}
|
|
129955
|
+
return [commentObj];
|
|
129956
|
+
} else if (c === BS) {
|
|
129957
|
+
esc = true;
|
|
129958
|
+
} else if (c === DS) {
|
|
129959
|
+
out += parseEnvVar();
|
|
129960
|
+
} else {
|
|
129961
|
+
out += c;
|
|
129962
|
+
}
|
|
129963
|
+
}
|
|
129964
|
+
if (isGlob) {
|
|
129965
|
+
return { op: "glob", pattern: out };
|
|
129966
|
+
}
|
|
129967
|
+
return out;
|
|
129968
|
+
}).reduce(function(prev, arg) {
|
|
129969
|
+
return typeof arg === "undefined" ? prev : prev.concat(arg);
|
|
129970
|
+
}, []);
|
|
129971
|
+
}
|
|
129972
|
+
module.exports = function parse(s, env, opts) {
|
|
129973
|
+
var mapped = parseInternal(s, env, opts);
|
|
129974
|
+
if (typeof env !== "function") {
|
|
129975
|
+
return mapped;
|
|
129976
|
+
}
|
|
129977
|
+
return mapped.reduce(function(acc, s2) {
|
|
129978
|
+
if (typeof s2 === "object") {
|
|
129979
|
+
return acc.concat(s2);
|
|
129980
|
+
}
|
|
129981
|
+
var xs = s2.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g"));
|
|
129982
|
+
if (xs.length === 1) {
|
|
129983
|
+
return acc.concat(xs[0]);
|
|
129984
|
+
}
|
|
129985
|
+
return acc.concat(xs.filter(Boolean).map(function(x) {
|
|
129986
|
+
if (startsWithToken.test(x)) {
|
|
129987
|
+
return JSON.parse(x.split(TOKEN)[1]);
|
|
129988
|
+
}
|
|
129989
|
+
return x;
|
|
129990
|
+
}));
|
|
129991
|
+
}, []);
|
|
129992
|
+
};
|
|
129993
|
+
}
|
|
129994
|
+
});
|
|
129995
|
+
|
|
129996
|
+
// ../../node_modules/shell-quote/index.js
|
|
129997
|
+
var require_shell_quote = __commonJS({
|
|
129998
|
+
"../../node_modules/shell-quote/index.js"(exports) {
|
|
129999
|
+
"use strict";
|
|
130000
|
+
init_global();
|
|
130001
|
+
init_process();
|
|
130002
|
+
init_setImmediate();
|
|
130003
|
+
init_buffer();
|
|
130004
|
+
init_setInterval();
|
|
130005
|
+
exports.quote = require_quote();
|
|
130006
|
+
exports.parse = require_parse2();
|
|
130007
|
+
}
|
|
130008
|
+
});
|
|
130009
|
+
|
|
129510
130010
|
// ../core/dist/utils/extract-git-info.js
|
|
129511
130011
|
var require_extract_git_info = __commonJS({
|
|
129512
130012
|
"../core/dist/utils/extract-git-info.js"(exports) {
|
|
@@ -129552,10 +130052,11 @@ var require_extract_git_info = __commonJS({
|
|
|
129552
130052
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
129553
130053
|
};
|
|
129554
130054
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
129555
|
-
exports.extractBranchLookupFallbackList = exports.isISODate = exports.extractBranchingTimestamp = exports.extractBuildIdFromCI = exports.extractCIBranchName = exports.extractGitRepo = exports.extractGitBranch = exports.extractLatestCommitInfo = exports.getPrimaryRemoteName = exports.cacheKey = void 0;
|
|
130055
|
+
exports.extractBranchLookupFallbackList = exports.getBranchAncestryByLocalBranches = exports.getBranchAncestryByCommits = exports.isISODate = exports.extractBranchingTimestamp = exports.extractBuildIdFromCI = exports.extractCIBranchName = exports.extractGitRepo = exports.extractGitBranch = exports.extractLatestCommitInfo = exports.extractDefaultBranch = exports.checkGitEnvironment = exports.resolveBranchToLocalRef = exports.getPrimaryRemoteName = exports.cacheKey = void 0;
|
|
129556
130056
|
var utils2 = __importStar(require_browser3());
|
|
129557
130057
|
var fs_1 = __importDefault((init_fs(), __toCommonJS(fs_exports)));
|
|
129558
130058
|
var path_1 = __importDefault(require_path_browserify());
|
|
130059
|
+
var shell_quote_1 = require_shell_quote();
|
|
129559
130060
|
var logger_1 = require_browser6();
|
|
129560
130061
|
var isDebugMode = () => process.env.RUNNER_DEBUG === "1";
|
|
129561
130062
|
exports.cacheKey = "default";
|
|
@@ -129575,14 +130076,229 @@ var require_extract_git_info = __commonJS({
|
|
|
129575
130076
|
cwd: (_a = args[0].execOptions) === null || _a === void 0 ? void 0 : _a.cwd
|
|
129576
130077
|
};
|
|
129577
130078
|
});
|
|
129578
|
-
|
|
129579
|
-
|
|
130079
|
+
async function resolveBranchToLocalRef({ branchName, remoteName, execOptions, logger = (0, logger_1.makeLogger)() }) {
|
|
130080
|
+
const [local, tracking] = await Promise.all([
|
|
130081
|
+
executeWithLog((0, shell_quote_1.quote)(["git", "rev-parse", "--verify", "--quiet", `refs/heads/${branchName}`]), {
|
|
130082
|
+
execOptions,
|
|
130083
|
+
logger
|
|
130084
|
+
}),
|
|
130085
|
+
executeWithLog((0, shell_quote_1.quote)(["git", "rev-parse", "--verify", "--quiet", `refs/remotes/${remoteName}/${branchName}`]), {
|
|
130086
|
+
execOptions,
|
|
130087
|
+
logger
|
|
130088
|
+
})
|
|
130089
|
+
]);
|
|
130090
|
+
if (local.code === 0 && local.stdout.trim()) {
|
|
130091
|
+
return branchName;
|
|
130092
|
+
}
|
|
130093
|
+
if (tracking.code === 0 && tracking.stdout.trim()) {
|
|
130094
|
+
const create = await executeWithLog((0, shell_quote_1.quote)(["git", "branch", branchName, `${remoteName}/${branchName}`]), {
|
|
130095
|
+
execOptions,
|
|
130096
|
+
logger
|
|
130097
|
+
});
|
|
130098
|
+
if (create.code === 0) {
|
|
130099
|
+
logger.log(`resolveBranchToLocalRef: created local ref refs/heads/${branchName} from ${remoteName}/${branchName}`);
|
|
130100
|
+
return branchName;
|
|
130101
|
+
}
|
|
130102
|
+
const recheck = await executeWithLog((0, shell_quote_1.quote)(["git", "rev-parse", "--verify", "--quiet", `refs/heads/${branchName}`]), {
|
|
130103
|
+
execOptions,
|
|
130104
|
+
logger
|
|
130105
|
+
});
|
|
130106
|
+
if (recheck.code === 0 && recheck.stdout.trim())
|
|
130107
|
+
return branchName;
|
|
130108
|
+
}
|
|
130109
|
+
const env = await (0, exports.checkGitEnvironment)({ execOptions, logger });
|
|
130110
|
+
if (env.remoteAccessible) {
|
|
130111
|
+
const lsR = await executeWithLog((0, shell_quote_1.quote)(["git", "ls-remote", "--heads", remoteName, branchName]), {
|
|
130112
|
+
execOptions,
|
|
130113
|
+
logger
|
|
130114
|
+
});
|
|
130115
|
+
if (lsR.code === 0 && lsR.stdout.trim()) {
|
|
130116
|
+
const fetched = await executeWithLog((0, shell_quote_1.quote)(["git", "fetch", remoteName, `${branchName}:${branchName}`, "--filter=tree:0"]), { execOptions, logger });
|
|
130117
|
+
if (fetched.code === 0) {
|
|
130118
|
+
logger.log(`resolveBranchToLocalRef: fetched ${branchName} from ${remoteName} into refs/heads/${branchName}`);
|
|
130119
|
+
return branchName;
|
|
130120
|
+
}
|
|
130121
|
+
}
|
|
130122
|
+
}
|
|
130123
|
+
return void 0;
|
|
130124
|
+
}
|
|
130125
|
+
exports.resolveBranchToLocalRef = resolveBranchToLocalRef;
|
|
130126
|
+
exports.checkGitEnvironment = utils2.general.cachify(async function({ execOptions, logger = (0, logger_1.makeLogger)() }) {
|
|
130127
|
+
var _a, _b, _c, _d, _e, _f;
|
|
130128
|
+
let gitInstalled = false;
|
|
130129
|
+
let insideRepo = false;
|
|
130130
|
+
let remoteAccessible = false;
|
|
130131
|
+
let remoteName;
|
|
130132
|
+
const reasons = [];
|
|
130133
|
+
const finalize = (extraReason) => {
|
|
130134
|
+
if (extraReason)
|
|
130135
|
+
reasons.push(extraReason);
|
|
130136
|
+
const result = {
|
|
130137
|
+
gitInstalled,
|
|
130138
|
+
insideRepo,
|
|
130139
|
+
remoteAccessible,
|
|
130140
|
+
ok: gitInstalled && insideRepo,
|
|
130141
|
+
reason: reasons.length ? reasons.join("; ") : "ok",
|
|
130142
|
+
remoteName
|
|
130143
|
+
};
|
|
130144
|
+
try {
|
|
130145
|
+
logGitEnvironmentBanner(logger, result);
|
|
130146
|
+
} catch {
|
|
130147
|
+
}
|
|
130148
|
+
return result;
|
|
130149
|
+
};
|
|
129580
130150
|
try {
|
|
129581
|
-
|
|
129582
|
-
|
|
130151
|
+
try {
|
|
130152
|
+
const versionResult = await executeWithLog("git --version", { execOptions, logger });
|
|
130153
|
+
if (versionResult.code !== 0) {
|
|
130154
|
+
return finalize(`git binary: ${((_a = versionResult.stderr) === null || _a === void 0 ? void 0 : _a.trim()) || `exit ${versionResult.code} (command not found?)`}`);
|
|
130155
|
+
}
|
|
130156
|
+
gitInstalled = true;
|
|
130157
|
+
const repoResult = await executeWithLog("git rev-parse --is-inside-work-tree", { execOptions, logger });
|
|
130158
|
+
if (repoResult.code !== 0 || repoResult.stdout.trim() !== "true") {
|
|
130159
|
+
return finalize(`repo: ${((_b = repoResult.stderr) === null || _b === void 0 ? void 0 : _b.trim()) || "not inside a git work tree"}`);
|
|
130160
|
+
}
|
|
130161
|
+
insideRepo = true;
|
|
130162
|
+
const remotesResult = await executeWithLog("git remote", { execOptions, logger });
|
|
130163
|
+
const remotesText = remotesResult.stdout.trim();
|
|
130164
|
+
if (remotesResult.code !== 0 || !remotesText) {
|
|
130165
|
+
return finalize(`remote: ${((_c = remotesResult.stderr) === null || _c === void 0 ? void 0 : _c.trim()) || "no remote configured"}`);
|
|
130166
|
+
}
|
|
130167
|
+
const remotes = remotesText.split(/\s+/).filter(Boolean);
|
|
130168
|
+
remoteName = remotes.includes("origin") ? "origin" : remotes[0];
|
|
130169
|
+
const probe = await executeWithLog((0, shell_quote_1.quote)(["git", "ls-remote", remoteName, "HEAD"]), { execOptions, logger });
|
|
130170
|
+
if (probe.code !== 0) {
|
|
130171
|
+
return finalize(`remote: ${((_d = probe.stderr) === null || _d === void 0 ? void 0 : _d.trim()) || `ls-remote exit ${probe.code}`}`);
|
|
130172
|
+
}
|
|
130173
|
+
remoteAccessible = true;
|
|
130174
|
+
return finalize();
|
|
130175
|
+
} catch (err) {
|
|
130176
|
+
return finalize(`probe threw: ${(_e = err === null || err === void 0 ? void 0 : err.message) !== null && _e !== void 0 ? _e : err}`);
|
|
130177
|
+
}
|
|
130178
|
+
} catch (catastrophic) {
|
|
130179
|
+
return {
|
|
130180
|
+
gitInstalled: false,
|
|
130181
|
+
insideRepo: false,
|
|
130182
|
+
remoteAccessible: false,
|
|
130183
|
+
ok: false,
|
|
130184
|
+
reason: `checkGitEnvironment catastrophic failure: ${(_f = catastrophic === null || catastrophic === void 0 ? void 0 : catastrophic.message) !== null && _f !== void 0 ? _f : catastrophic}`,
|
|
130185
|
+
remoteName: void 0
|
|
130186
|
+
};
|
|
130187
|
+
}
|
|
130188
|
+
}, (args) => {
|
|
130189
|
+
var _a, _b;
|
|
130190
|
+
return { cwd: (_b = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.execOptions) === null || _b === void 0 ? void 0 : _b.cwd };
|
|
130191
|
+
});
|
|
130192
|
+
function logGitEnvironmentBanner(logger, r) {
|
|
130193
|
+
const sep = "============================================================";
|
|
130194
|
+
const allGood = r.gitInstalled && r.insideRepo && r.remoteAccessible;
|
|
130195
|
+
logger.log(sep);
|
|
130196
|
+
if (allGood) {
|
|
130197
|
+
logger.log("APPLITOOLS GIT ENVIRONMENT CHECK \u2713 all ok");
|
|
130198
|
+
} else if (!r.gitInstalled) {
|
|
130199
|
+
logger.log("APPLITOOLS GIT ENVIRONMENT CHECK \u2717 GIT NOT INSTALLED");
|
|
130200
|
+
} else if (!r.insideRepo) {
|
|
130201
|
+
logger.log("APPLITOOLS GIT ENVIRONMENT CHECK \u2717 NOT IN A GIT REPOSITORY");
|
|
130202
|
+
} else if (!r.remoteAccessible) {
|
|
130203
|
+
logger.log("APPLITOOLS GIT ENVIRONMENT CHECK \u2717 REMOTE NOT ACCESSIBLE");
|
|
130204
|
+
}
|
|
130205
|
+
logger.log(` git binary: ${r.gitInstalled ? "\u2713 installed" : "\u2717 NOT FOUND"}`);
|
|
130206
|
+
if (r.gitInstalled) {
|
|
130207
|
+
logger.log(` repo: ${r.insideRepo ? "\u2713 inside work tree" : "\u2717 NOT INSIDE A WORK TREE"}`);
|
|
130208
|
+
}
|
|
130209
|
+
if (r.gitInstalled && r.insideRepo) {
|
|
130210
|
+
const remoteLine = r.remoteAccessible ? `\u2713 accessible (${r.remoteName})` : r.remoteName ? `\u2717 NOT ACCESSIBLE (${r.remoteName})` : "\u2717 NONE CONFIGURED";
|
|
130211
|
+
logger.log(` remote: ${remoteLine}`);
|
|
130212
|
+
}
|
|
130213
|
+
if (!allGood) {
|
|
130214
|
+
logger.log(` reason: ${r.reason}`);
|
|
130215
|
+
if (!r.gitInstalled) {
|
|
130216
|
+
logger.log(" \u2192 All git-based SCM features will be SKIPPED.");
|
|
130217
|
+
logger.log(" \u2192 Install git or add it to PATH to enable branch detection and baseline inheritance.");
|
|
130218
|
+
} else if (!r.insideRepo) {
|
|
130219
|
+
logger.log(" \u2192 All git-based SCM features will be SKIPPED.");
|
|
130220
|
+
logger.log(" \u2192 Run this from inside a git working tree to enable branch detection.");
|
|
130221
|
+
} else if (!r.remoteAccessible) {
|
|
130222
|
+
logger.log(" \u2192 All remote-dependent fallbacks will be SKIPPED.");
|
|
130223
|
+
logger.log(" \u2192 Branch lookup may be incomplete. Verify network / credentials / remote config.");
|
|
130224
|
+
}
|
|
130225
|
+
}
|
|
130226
|
+
logger.log(sep);
|
|
130227
|
+
}
|
|
130228
|
+
exports.extractDefaultBranch = utils2.general.cachify(async function({ execOptions, logger = (0, logger_1.makeLogger)() }) {
|
|
130229
|
+
var _a;
|
|
130230
|
+
logger = logger.extend({ tags: [`extract-default-branch-${utils2.general.shortid()}`] });
|
|
130231
|
+
const envOverride = (_a = process.env.APPLITOOLS_DEFAULT_BRANCH) === null || _a === void 0 ? void 0 : _a.trim();
|
|
130232
|
+
if (envOverride) {
|
|
130233
|
+
logger.log(`extractDefaultBranch: using APPLITOOLS_DEFAULT_BRANCH="${envOverride}"`);
|
|
130234
|
+
return envOverride;
|
|
130235
|
+
}
|
|
130236
|
+
const env = await (0, exports.checkGitEnvironment)({ execOptions, logger });
|
|
130237
|
+
if (!env.ok) {
|
|
130238
|
+
logger.log("extractDefaultBranch: git environment not ok, falling back to 'main'");
|
|
130239
|
+
return "main";
|
|
130240
|
+
}
|
|
130241
|
+
const remoteName = await (0, exports.getPrimaryRemoteName)({ execOptions, logger });
|
|
130242
|
+
try {
|
|
130243
|
+
const r = await executeWithLog((0, shell_quote_1.quote)(["git", "symbolic-ref", "--short", `refs/remotes/${remoteName}/HEAD`]), {
|
|
129583
130244
|
execOptions,
|
|
129584
130245
|
logger
|
|
129585
130246
|
});
|
|
130247
|
+
if (!r.stderr && r.stdout.trim()) {
|
|
130248
|
+
const out = r.stdout.trim();
|
|
130249
|
+
const normalized = out.replace(new RegExp(`^${remoteName}/`), "");
|
|
130250
|
+
if (normalized) {
|
|
130251
|
+
logger.log(`extractDefaultBranch: resolved via symbolic-ref -> "${normalized}"`);
|
|
130252
|
+
return normalized;
|
|
130253
|
+
}
|
|
130254
|
+
}
|
|
130255
|
+
} catch (err) {
|
|
130256
|
+
if (isDebugMode())
|
|
130257
|
+
logger.log("extractDefaultBranch: symbolic-ref step failed, continuing", err);
|
|
130258
|
+
}
|
|
130259
|
+
try {
|
|
130260
|
+
const r = await executeWithLog((0, shell_quote_1.quote)(["git", "ls-remote", "--symref", remoteName, "HEAD"]), { execOptions, logger });
|
|
130261
|
+
if (!r.stderr && r.stdout) {
|
|
130262
|
+
const match = r.stdout.match(/^ref:\s+refs\/heads\/([^\s]+)\s+HEAD/m);
|
|
130263
|
+
if (match && match[1]) {
|
|
130264
|
+
logger.log(`extractDefaultBranch: resolved via ls-remote --symref -> "${match[1]}"`);
|
|
130265
|
+
return match[1];
|
|
130266
|
+
}
|
|
130267
|
+
}
|
|
130268
|
+
} catch (err) {
|
|
130269
|
+
if (isDebugMode())
|
|
130270
|
+
logger.log("extractDefaultBranch: ls-remote --symref step failed, continuing", err);
|
|
130271
|
+
}
|
|
130272
|
+
try {
|
|
130273
|
+
const r = await executeWithLog("git config --get init.defaultBranch", { execOptions, logger });
|
|
130274
|
+
if (!r.stderr && r.stdout.trim()) {
|
|
130275
|
+
logger.log(`extractDefaultBranch: resolved via init.defaultBranch -> "${r.stdout.trim()}"`);
|
|
130276
|
+
return r.stdout.trim();
|
|
130277
|
+
}
|
|
130278
|
+
} catch (err) {
|
|
130279
|
+
if (isDebugMode())
|
|
130280
|
+
logger.log("extractDefaultBranch: init.defaultBranch step failed, continuing", err);
|
|
130281
|
+
}
|
|
130282
|
+
logger.log('extractDefaultBranch: falling back to literal "main"');
|
|
130283
|
+
return "main";
|
|
130284
|
+
}, (args) => {
|
|
130285
|
+
var _a, _b;
|
|
130286
|
+
return { cwd: (_b = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.execOptions) === null || _b === void 0 ? void 0 : _b.cwd };
|
|
130287
|
+
});
|
|
130288
|
+
exports.extractLatestCommitInfo = utils2.general.cachify(async function({ execOptions, logger = (0, logger_1.makeLogger)() }) {
|
|
130289
|
+
const env = await (0, exports.checkGitEnvironment)({ execOptions, logger });
|
|
130290
|
+
if (!env.ok) {
|
|
130291
|
+
logger.log("extractLatestCommitInfo: git environment not ok, skipping");
|
|
130292
|
+
return void 0;
|
|
130293
|
+
}
|
|
130294
|
+
let result;
|
|
130295
|
+
try {
|
|
130296
|
+
const githubPullRequestLastCommitSha = await extractGithubPullRequestLastCommitSha();
|
|
130297
|
+
const logArgs = ["git", "log"];
|
|
130298
|
+
if (githubPullRequestLastCommitSha)
|
|
130299
|
+
logArgs.push(githubPullRequestLastCommitSha);
|
|
130300
|
+
logArgs.push("-1", "--format=%aI %H");
|
|
130301
|
+
result = await executeWithLog((0, shell_quote_1.quote)(logArgs), { execOptions, logger });
|
|
129586
130302
|
if (result.stderr) {
|
|
129587
130303
|
logger.log(`Error during extracting commit information from git`, result.stderr);
|
|
129588
130304
|
} else {
|
|
@@ -129600,7 +130316,7 @@ var require_extract_git_info = __commonJS({
|
|
|
129600
130316
|
var _a, _b, _c;
|
|
129601
130317
|
if (((_a = process.env.GITHUB_EVENT_NAME) === null || _a === void 0 ? void 0 : _a.startsWith("pull_request")) && process.env.GITHUB_EVENT_PATH) {
|
|
129602
130318
|
const remoteName = await (0, exports.getPrimaryRemoteName)({ execOptions, logger });
|
|
129603
|
-
await executeWithLog(
|
|
130319
|
+
await executeWithLog((0, shell_quote_1.quote)(["git", "fetch", remoteName, "--depth=2"]), { execOptions, logger });
|
|
129604
130320
|
const event = await fs_1.default.promises.readFile(process.env.GITHUB_EVENT_PATH, "utf-8").then(JSON.parse);
|
|
129605
130321
|
return (_c = (_b = event === null || event === void 0 ? void 0 : event.pull_request) === null || _b === void 0 ? void 0 : _b.head) === null || _c === void 0 ? void 0 : _c.sha;
|
|
129606
130322
|
}
|
|
@@ -129612,6 +130328,11 @@ var require_extract_git_info = __commonJS({
|
|
|
129612
130328
|
logger.log(`Extracted branch name from CI environment: "${ciBranch}"`);
|
|
129613
130329
|
return ciBranch;
|
|
129614
130330
|
}
|
|
130331
|
+
const env = await (0, exports.checkGitEnvironment)({ execOptions, logger });
|
|
130332
|
+
if (!env.ok) {
|
|
130333
|
+
logger.log("extractGitBranch: git environment not ok, no branch name available");
|
|
130334
|
+
return void 0;
|
|
130335
|
+
}
|
|
129615
130336
|
const result = await executeWithLog("git branch --show-current", { execOptions, logger });
|
|
129616
130337
|
if (result.stderr) {
|
|
129617
130338
|
logger.log(`Error during extracting current branch from git`, result.stderr);
|
|
@@ -129628,10 +130349,15 @@ var require_extract_git_info = __commonJS({
|
|
|
129628
130349
|
return { cwd: (_b = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.execOptions) === null || _b === void 0 ? void 0 : _b.cwd, ignoreGitBranching: (_c = args[0]) === null || _c === void 0 ? void 0 : _c.ignoreGitBranching };
|
|
129629
130350
|
});
|
|
129630
130351
|
exports.extractGitRepo = utils2.general.cachify(async function({ execOptions, logger = (0, logger_1.makeLogger)() }) {
|
|
130352
|
+
const env = await (0, exports.checkGitEnvironment)({ execOptions, logger });
|
|
130353
|
+
if (!env.ok) {
|
|
130354
|
+
logger.log("extractGitRepo: git environment not ok, returning empty repo info");
|
|
130355
|
+
return {};
|
|
130356
|
+
}
|
|
129631
130357
|
const remotes = await extractRemotes();
|
|
129632
130358
|
logger.log(`Extracted remotes from git: ${remotes}`);
|
|
129633
130359
|
const remote = remotes.includes("origin") ? "origin" : remotes[0];
|
|
129634
|
-
const result = await executeWithLog(
|
|
130360
|
+
const result = await executeWithLog((0, shell_quote_1.quote)(["git", "remote", "get-url", remote]), { execOptions, logger });
|
|
129635
130361
|
if (result.stderr) {
|
|
129636
130362
|
logger.log(`Error during extracting remote url from git`, result.stderr);
|
|
129637
130363
|
return {};
|
|
@@ -129675,51 +130401,82 @@ var require_extract_git_info = __commonJS({
|
|
|
129675
130401
|
}
|
|
129676
130402
|
exports.extractBuildIdFromCI = extractBuildIdFromCI;
|
|
129677
130403
|
exports.extractBranchingTimestamp = utils2.general.cachify(async function({ branchName, parentBranchName, execOptions, logger = (0, logger_1.makeLogger)() }) {
|
|
129678
|
-
var _a;
|
|
129679
130404
|
logger = logger.extend({ tags: [`extract-branching-timestamp-${utils2.general.shortid()}`] });
|
|
129680
|
-
|
|
129681
|
-
|
|
129682
|
-
|
|
129683
|
-
|
|
129684
|
-
|
|
129685
|
-
|
|
129686
|
-
|
|
129687
|
-
|
|
129688
|
-
|
|
129689
|
-
|
|
129690
|
-
|
|
129691
|
-
|
|
129692
|
-
|
|
129693
|
-
|
|
129694
|
-
|
|
129695
|
-
|
|
129696
|
-
|
|
129697
|
-
|
|
129698
|
-
|
|
129699
|
-
|
|
129700
|
-
|
|
129701
|
-
|
|
129702
|
-
const normalizedBranchName = missingBranch.replace(new RegExp(`^${remoteName}/`), "");
|
|
129703
|
-
if (!remoteBranches.has(normalizedBranchName)) {
|
|
129704
|
-
logger.log(`Branch ${missingBranch} not found on remote, skipping fetch`);
|
|
129705
|
-
return void 0;
|
|
129706
|
-
}
|
|
129707
|
-
logger.log(`Fetching missing branch ${missingBranch} from remote`);
|
|
129708
|
-
const command2 = `HASH=$(git merge-base ${branchName} ${parentBranchName}) && git show -q --format=%aI $HASH`;
|
|
129709
|
-
result = await executeWithLog(`git fetch ${remoteName} ${normalizedBranchName}:${normalizedBranchName} --filter=tree:0 && ${command2}`, {
|
|
129710
|
-
execOptions,
|
|
129711
|
-
logger
|
|
129712
|
-
});
|
|
129713
|
-
}
|
|
130405
|
+
try {
|
|
130406
|
+
const env = await (0, exports.checkGitEnvironment)({ execOptions, logger });
|
|
130407
|
+
if (!env.ok) {
|
|
130408
|
+
logger.log("extractBranchingTimestamp: git environment not ok, skipping");
|
|
130409
|
+
return void 0;
|
|
130410
|
+
}
|
|
130411
|
+
const remoteName = await (0, exports.getPrimaryRemoteName)({ execOptions, logger });
|
|
130412
|
+
const shallowCheckResult = await executeWithLog("git rev-parse --is-shallow-repository", {
|
|
130413
|
+
execOptions,
|
|
130414
|
+
logger
|
|
130415
|
+
});
|
|
130416
|
+
const isShallow = shallowCheckResult.stdout.trim() === "true";
|
|
130417
|
+
if (isShallow) {
|
|
130418
|
+
logger.log("extractBranchingTimestamp - Repository is a shallow clone, attempting to unshallow");
|
|
130419
|
+
await executeFetchStrategy(isShallow, execOptions, logger);
|
|
130420
|
+
}
|
|
130421
|
+
async function getMergeBase(ref1, ref2) {
|
|
130422
|
+
const { stdout, stderr } = await executeWithLog((0, shell_quote_1.quote)(["git", "merge-base", ref1, ref2]), { execOptions, logger });
|
|
130423
|
+
if (stderr) {
|
|
130424
|
+
if (isDebugMode())
|
|
130425
|
+
logger.log(`getMergeBase failed for ${ref1} and ${ref2}: ${stderr}`);
|
|
130426
|
+
return null;
|
|
129714
130427
|
}
|
|
130428
|
+
return stdout.trim();
|
|
129715
130429
|
}
|
|
129716
|
-
|
|
129717
|
-
|
|
129718
|
-
|
|
129719
|
-
|
|
129720
|
-
|
|
129721
|
-
|
|
129722
|
-
|
|
130430
|
+
async function getTimestampForHash(hash) {
|
|
130431
|
+
if (!hash)
|
|
130432
|
+
return void 0;
|
|
130433
|
+
const { stdout, stderr } = await executeWithLog((0, shell_quote_1.quote)(["git", "show", "-s", "--format=%aI", hash]), {
|
|
130434
|
+
execOptions,
|
|
130435
|
+
logger
|
|
130436
|
+
});
|
|
130437
|
+
const timestamp2 = stdout.trim();
|
|
130438
|
+
if (stderr || !isISODate(timestamp2)) {
|
|
130439
|
+
logger.log(`Error extracting timestamp for hash ${hash}: stderr: ${stderr}, stdout: ${stdout}`);
|
|
130440
|
+
return void 0;
|
|
130441
|
+
}
|
|
130442
|
+
return timestamp2;
|
|
130443
|
+
}
|
|
130444
|
+
let mergeBaseHash = null;
|
|
130445
|
+
mergeBaseHash = await getMergeBase(`${remoteName}/${branchName}`, `${remoteName}/${parentBranchName}`);
|
|
130446
|
+
if (!mergeBaseHash) {
|
|
130447
|
+
mergeBaseHash = await getMergeBase(branchName, parentBranchName);
|
|
130448
|
+
}
|
|
130449
|
+
if (!mergeBaseHash) {
|
|
130450
|
+
const remoteBranches = await getAllRemoteBranches({ execOptions, logger });
|
|
130451
|
+
if (!remoteBranches.has(parentBranchName)) {
|
|
130452
|
+
logger.log(`Parent branch ${parentBranchName} not found on remote, cannot determine branching point.`);
|
|
130453
|
+
return void 0;
|
|
130454
|
+
}
|
|
130455
|
+
const branchesToFetch = [parentBranchName];
|
|
130456
|
+
if (branchName !== parentBranchName && remoteBranches.has(branchName)) {
|
|
130457
|
+
branchesToFetch.push(branchName);
|
|
130458
|
+
}
|
|
130459
|
+
logger.log(`Fetching missing branches [${branchesToFetch.join(", ")}] from remote and retrying merge-base`);
|
|
130460
|
+
for (const branch of branchesToFetch) {
|
|
130461
|
+
await executeWithLog((0, shell_quote_1.quote)(["git", "fetch", remoteName, `${branch}:${branch}`, "--filter=tree:0"]), {
|
|
130462
|
+
execOptions,
|
|
130463
|
+
logger
|
|
130464
|
+
});
|
|
130465
|
+
}
|
|
130466
|
+
mergeBaseHash = await getMergeBase(branchName, parentBranchName);
|
|
130467
|
+
}
|
|
130468
|
+
if (!mergeBaseHash) {
|
|
130469
|
+
logger.log(`Could not find a merge-base for ${branchName} and ${parentBranchName}.`);
|
|
130470
|
+
return void 0;
|
|
130471
|
+
}
|
|
130472
|
+
const timestamp = await getTimestampForHash(mergeBaseHash);
|
|
130473
|
+
if (timestamp) {
|
|
130474
|
+
logger.log(`git branching timestamp for parent '${parentBranchName}' successfully extracted: ${timestamp}`);
|
|
130475
|
+
return timestamp;
|
|
130476
|
+
}
|
|
130477
|
+
} catch (err) {
|
|
130478
|
+
logger.log("extractBranchingTimestamp: unexpected error, returning undefined", err);
|
|
130479
|
+
return void 0;
|
|
129723
130480
|
}
|
|
129724
130481
|
}, (args) => {
|
|
129725
130482
|
var _a;
|
|
@@ -129744,6 +130501,47 @@ var require_extract_git_info = __commonJS({
|
|
|
129744
130501
|
return /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\+\d{2}:\d{2})?/.test(str);
|
|
129745
130502
|
}
|
|
129746
130503
|
exports.isISODate = isISODate;
|
|
130504
|
+
var GIT_PREDICATE_MAX_ATTEMPTS = 3;
|
|
130505
|
+
function classifyGitPredicate(result) {
|
|
130506
|
+
const code = result.code;
|
|
130507
|
+
const hasStderr = Boolean(result.stderr && result.stderr.trim());
|
|
130508
|
+
if (code === 0 && !hasStderr)
|
|
130509
|
+
return true;
|
|
130510
|
+
if (code === 1 && !hasStderr)
|
|
130511
|
+
return false;
|
|
130512
|
+
return "error";
|
|
130513
|
+
}
|
|
130514
|
+
async function runGitPredicateWithRetry(command, { execOptions, logger }) {
|
|
130515
|
+
let outcome = "error";
|
|
130516
|
+
for (let attempt = 0; attempt < GIT_PREDICATE_MAX_ATTEMPTS; attempt++) {
|
|
130517
|
+
const result = await executeWithLog(command, { execOptions, logger });
|
|
130518
|
+
outcome = classifyGitPredicate(result);
|
|
130519
|
+
if (outcome !== "error")
|
|
130520
|
+
return outcome;
|
|
130521
|
+
if (attempt < GIT_PREDICATE_MAX_ATTEMPTS - 1) {
|
|
130522
|
+
await gitRetryBackoff(attempt, command, logger);
|
|
130523
|
+
}
|
|
130524
|
+
}
|
|
130525
|
+
return outcome;
|
|
130526
|
+
}
|
|
130527
|
+
async function gitRetryBackoff(attempt, command, logger) {
|
|
130528
|
+
const backoff = 50 * 2 ** attempt + Math.floor(Math.random() * 10);
|
|
130529
|
+
if (isDebugMode()) {
|
|
130530
|
+
logger.log(`git transient error (attempt ${attempt + 1}), retrying in ${backoff}ms: ${command}`);
|
|
130531
|
+
}
|
|
130532
|
+
await new Promise((resolve) => setTimeout(resolve, backoff));
|
|
130533
|
+
}
|
|
130534
|
+
async function runGitContainsWithRetry(command, { execOptions, logger }) {
|
|
130535
|
+
for (let attempt = 0; attempt < GIT_PREDICATE_MAX_ATTEMPTS; attempt++) {
|
|
130536
|
+
const result = await executeWithLog(command, { execOptions, logger });
|
|
130537
|
+
if (!(result.stderr && result.stderr.trim()))
|
|
130538
|
+
return result.stdout;
|
|
130539
|
+
if (attempt < GIT_PREDICATE_MAX_ATTEMPTS - 1) {
|
|
130540
|
+
await gitRetryBackoff(attempt, command, logger);
|
|
130541
|
+
}
|
|
130542
|
+
}
|
|
130543
|
+
return "";
|
|
130544
|
+
}
|
|
129747
130545
|
async function parallelWithLimit(items, concurrency, fn) {
|
|
129748
130546
|
const results = [];
|
|
129749
130547
|
for (let i = 0; i < items.length; i += concurrency) {
|
|
@@ -129753,6 +130551,262 @@ var require_extract_git_info = __commonJS({
|
|
|
129753
130551
|
}
|
|
129754
130552
|
return results;
|
|
129755
130553
|
}
|
|
130554
|
+
async function getBranchAncestryByCommits({ gitBranchName, defaultBranch, execOptions, logger = (0, logger_1.makeLogger)() }) {
|
|
130555
|
+
logger = logger.extend({ tags: [`get-branch-ancestry-by-commits-${utils2.general.shortid()}`] });
|
|
130556
|
+
if (isDebugMode()) {
|
|
130557
|
+
logger.log(`[byCommits] Start: gitBranchName=${gitBranchName}, defaultBranch=${defaultBranch}`);
|
|
130558
|
+
}
|
|
130559
|
+
const env = await (0, exports.checkGitEnvironment)({ execOptions, logger });
|
|
130560
|
+
if (!env.ok) {
|
|
130561
|
+
logger.log("[byCommits] git environment not ok, returning []");
|
|
130562
|
+
return [];
|
|
130563
|
+
}
|
|
130564
|
+
try {
|
|
130565
|
+
let mergeBaseResult = await executeWithLog((0, shell_quote_1.quote)(["git", "merge-base", gitBranchName, defaultBranch]), {
|
|
130566
|
+
execOptions,
|
|
130567
|
+
logger
|
|
130568
|
+
});
|
|
130569
|
+
if (mergeBaseResult.stderr || !mergeBaseResult.stdout.trim()) {
|
|
130570
|
+
const remoteName2 = await (0, exports.getPrimaryRemoteName)({ execOptions, logger });
|
|
130571
|
+
const resolved = await resolveBranchToLocalRef({ branchName: defaultBranch, remoteName: remoteName2, execOptions, logger });
|
|
130572
|
+
if (resolved) {
|
|
130573
|
+
mergeBaseResult = await executeWithLog((0, shell_quote_1.quote)(["git", "merge-base", gitBranchName, defaultBranch]), {
|
|
130574
|
+
execOptions,
|
|
130575
|
+
logger
|
|
130576
|
+
});
|
|
130577
|
+
}
|
|
130578
|
+
if (mergeBaseResult.stderr || !mergeBaseResult.stdout.trim()) {
|
|
130579
|
+
logger.log(`[byCommits] \u2717 merge-base ${gitBranchName} ${defaultBranch} failed (stderr="${mergeBaseResult.stderr}"), returning []`);
|
|
130580
|
+
return [];
|
|
130581
|
+
}
|
|
130582
|
+
}
|
|
130583
|
+
const mergeBase = mergeBaseResult.stdout.trim();
|
|
130584
|
+
if (isDebugMode())
|
|
130585
|
+
logger.log(`[byCommits] Merge-base resolved: ${mergeBase}`);
|
|
130586
|
+
const logResult = await executeWithLog((0, shell_quote_1.quote)(["git", "log", "--format=%H", `${mergeBase}..${gitBranchName}`]), {
|
|
130587
|
+
execOptions,
|
|
130588
|
+
logger
|
|
130589
|
+
});
|
|
130590
|
+
if (logResult.stderr) {
|
|
130591
|
+
logger.log(`[byCommits] \u2717 git log ${mergeBase}..${gitBranchName} failed (stderr="${logResult.stderr}"), returning []`);
|
|
130592
|
+
return [];
|
|
130593
|
+
}
|
|
130594
|
+
const commits = logResult.stdout.trim().split("\n").filter(Boolean);
|
|
130595
|
+
if (isDebugMode())
|
|
130596
|
+
logger.log(`[byCommits] Walking ${commits.length} commit(s) in window ${mergeBase}..${gitBranchName}`);
|
|
130597
|
+
const candidates = /* @__PURE__ */ new Set([defaultBranch, gitBranchName]);
|
|
130598
|
+
const containResults = await parallelWithLimit(commits, 10, async (hash) => {
|
|
130599
|
+
const r = await runGitContainsWithRetry((0, shell_quote_1.quote)(["git", "branch", "-a", "--contains", hash, "--format=%(refname:short)"]), { execOptions, logger });
|
|
130600
|
+
return r.split("\n").map((line) => line.trim()).filter((b) => b && b !== "HEAD");
|
|
130601
|
+
});
|
|
130602
|
+
if (isDebugMode()) {
|
|
130603
|
+
logger.log(`[byCommits] Branches containing commits in ${mergeBase}..${gitBranchName}:`, containResults);
|
|
130604
|
+
}
|
|
130605
|
+
for (const list of containResults)
|
|
130606
|
+
for (const b of list)
|
|
130607
|
+
candidates.add(b);
|
|
130608
|
+
const atMergeBase = await runGitContainsWithRetry((0, shell_quote_1.quote)(["git", "branch", "-a", "--contains", mergeBase, "--format=%(refname:short)"]), { execOptions, logger });
|
|
130609
|
+
for (const b of atMergeBase.split("\n").map((l) => l.trim()).filter((b2) => b2 && b2 !== "HEAD")) {
|
|
130610
|
+
candidates.add(b);
|
|
130611
|
+
}
|
|
130612
|
+
if (isDebugMode()) {
|
|
130613
|
+
logger.log(`[byCommits] Unioned candidates before descendant filter (${candidates.size}): ${Array.from(candidates).join(", ")}`);
|
|
130614
|
+
}
|
|
130615
|
+
const remoteName = await (0, exports.getPrimaryRemoteName)({ execOptions, logger });
|
|
130616
|
+
let droppedSelf = 0;
|
|
130617
|
+
let droppedDescendants = 0;
|
|
130618
|
+
let droppedCousins = 0;
|
|
130619
|
+
const finalCandidates = await parallelWithLimit(Array.from(candidates), 10, async (branch) => {
|
|
130620
|
+
const normalizedBranch = branch.replace(new RegExp(`^${remoteName}/`), "");
|
|
130621
|
+
if (normalizedBranch === gitBranchName) {
|
|
130622
|
+
droppedSelf++;
|
|
130623
|
+
return null;
|
|
130624
|
+
}
|
|
130625
|
+
if (normalizedBranch === defaultBranch) {
|
|
130626
|
+
if (isDebugMode())
|
|
130627
|
+
logger.log(`[byCommits] KEEP base (default branch): ${normalizedBranch}`);
|
|
130628
|
+
return normalizedBranch;
|
|
130629
|
+
}
|
|
130630
|
+
const isDescendant = await runGitPredicateWithRetry((0, shell_quote_1.quote)(["git", "merge-base", "--is-ancestor", gitBranchName, branch]), { execOptions, logger });
|
|
130631
|
+
if (isDescendant === true) {
|
|
130632
|
+
droppedDescendants++;
|
|
130633
|
+
if (isDebugMode())
|
|
130634
|
+
logger.log(`[byCommits] DROP descendant: ${normalizedBranch}`);
|
|
130635
|
+
return null;
|
|
130636
|
+
}
|
|
130637
|
+
const mbAllResult = await runGitContainsWithRetry((0, shell_quote_1.quote)(["git", "merge-base", "--all", gitBranchName, branch]), {
|
|
130638
|
+
execOptions,
|
|
130639
|
+
logger
|
|
130640
|
+
});
|
|
130641
|
+
const mbCs = mbAllResult.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
130642
|
+
if (mbCs.length === 0) {
|
|
130643
|
+
if (isDebugMode())
|
|
130644
|
+
logger.log(`[byCommits] KEEP (no merge-base resolved, conservative): ${normalizedBranch}`);
|
|
130645
|
+
return normalizedBranch;
|
|
130646
|
+
}
|
|
130647
|
+
let anyStrictlyAboveFloor = false;
|
|
130648
|
+
for (const mbC of mbCs) {
|
|
130649
|
+
if (mbC === mergeBase)
|
|
130650
|
+
continue;
|
|
130651
|
+
const floorIsAncestorOfMbC = await runGitPredicateWithRetry((0, shell_quote_1.quote)(["git", "merge-base", "--is-ancestor", mergeBase, mbC]), { execOptions, logger });
|
|
130652
|
+
if (floorIsAncestorOfMbC === true || floorIsAncestorOfMbC === "error") {
|
|
130653
|
+
anyStrictlyAboveFloor = true;
|
|
130654
|
+
break;
|
|
130655
|
+
}
|
|
130656
|
+
}
|
|
130657
|
+
if (!anyStrictlyAboveFloor) {
|
|
130658
|
+
droppedCousins++;
|
|
130659
|
+
if (isDebugMode())
|
|
130660
|
+
logger.log(`[byCommits] DROP cousin (shares only the floor): ${normalizedBranch}`);
|
|
130661
|
+
return null;
|
|
130662
|
+
}
|
|
130663
|
+
if (isDebugMode())
|
|
130664
|
+
logger.log(`[byCommits] KEEP lineage point: ${normalizedBranch}`);
|
|
130665
|
+
return normalizedBranch;
|
|
130666
|
+
});
|
|
130667
|
+
const finalCleanBranches = finalCandidates.filter((b) => b !== null);
|
|
130668
|
+
const result = Array.from(new Set(finalCleanBranches)).sort();
|
|
130669
|
+
if (isDebugMode()) {
|
|
130670
|
+
logger.log(`[byCommits] Done. dropped(self=${droppedSelf}, descendants=${droppedDescendants}, cousins=${droppedCousins}) \u2192 ${result.length} lineage point(s): ${result.join(", ")}`);
|
|
130671
|
+
}
|
|
130672
|
+
return result;
|
|
130673
|
+
} catch (err) {
|
|
130674
|
+
logger.log("[byCommits] \u2717 ERROR", err);
|
|
130675
|
+
return [];
|
|
130676
|
+
}
|
|
130677
|
+
}
|
|
130678
|
+
exports.getBranchAncestryByCommits = getBranchAncestryByCommits;
|
|
130679
|
+
async function getBranchAncestryByLocalBranches({ gitBranchName, defaultBranch, execOptions, logger = (0, logger_1.makeLogger)() }) {
|
|
130680
|
+
logger = logger.extend({ tags: [`get-branch-ancestry-by-local-branches-${utils2.general.shortid()}`] });
|
|
130681
|
+
if (isDebugMode()) {
|
|
130682
|
+
logger.log(`[byLocalBranches] Start: gitBranchName=${gitBranchName}, defaultBranch=${defaultBranch}`);
|
|
130683
|
+
}
|
|
130684
|
+
const env = await (0, exports.checkGitEnvironment)({ execOptions, logger });
|
|
130685
|
+
if (!env.ok) {
|
|
130686
|
+
logger.log("[byLocalBranches] git environment not ok, returning []");
|
|
130687
|
+
return [];
|
|
130688
|
+
}
|
|
130689
|
+
let droppedNoMb = 0;
|
|
130690
|
+
let droppedRule1 = 0;
|
|
130691
|
+
let droppedRule2 = 0;
|
|
130692
|
+
let pinned = 0;
|
|
130693
|
+
try {
|
|
130694
|
+
let mergeBaseResult = await executeWithLog((0, shell_quote_1.quote)(["git", "merge-base", gitBranchName, defaultBranch]), {
|
|
130695
|
+
execOptions,
|
|
130696
|
+
logger
|
|
130697
|
+
});
|
|
130698
|
+
if (mergeBaseResult.stderr || !mergeBaseResult.stdout.trim()) {
|
|
130699
|
+
const remoteName2 = await (0, exports.getPrimaryRemoteName)({ execOptions, logger });
|
|
130700
|
+
const resolved = await resolveBranchToLocalRef({ branchName: defaultBranch, remoteName: remoteName2, execOptions, logger });
|
|
130701
|
+
if (resolved) {
|
|
130702
|
+
mergeBaseResult = await executeWithLog((0, shell_quote_1.quote)(["git", "merge-base", gitBranchName, defaultBranch]), {
|
|
130703
|
+
execOptions,
|
|
130704
|
+
logger
|
|
130705
|
+
});
|
|
130706
|
+
}
|
|
130707
|
+
if (mergeBaseResult.stderr || !mergeBaseResult.stdout.trim()) {
|
|
130708
|
+
logger.log(`[byLocalBranches] \u2717 merge-base ${gitBranchName} ${defaultBranch} failed (stderr="${mergeBaseResult.stderr}"), returning []`);
|
|
130709
|
+
return [];
|
|
130710
|
+
}
|
|
130711
|
+
}
|
|
130712
|
+
const mergeBase = mergeBaseResult.stdout.trim();
|
|
130713
|
+
if (isDebugMode())
|
|
130714
|
+
logger.log(`[byLocalBranches] Primary merge-base: ${mergeBase}`);
|
|
130715
|
+
const remoteName = await (0, exports.getPrimaryRemoteName)({ execOptions, logger });
|
|
130716
|
+
const refsResult = await executeWithLog((0, shell_quote_1.quote)(["git", "for-each-ref", "--format=%(refname:short)", "refs/heads/", `refs/remotes/${remoteName}/`]), { execOptions, logger });
|
|
130717
|
+
if (refsResult.stderr) {
|
|
130718
|
+
logger.log(`[byLocalBranches] \u2717 for-each-ref failed (stderr="${refsResult.stderr}"), returning []`);
|
|
130719
|
+
return [];
|
|
130720
|
+
}
|
|
130721
|
+
const candidateBranches = /* @__PURE__ */ new Map();
|
|
130722
|
+
candidateBranches.set(defaultBranch, defaultBranch);
|
|
130723
|
+
candidateBranches.set(gitBranchName, gitBranchName);
|
|
130724
|
+
for (const raw of refsResult.stdout.split("\n")) {
|
|
130725
|
+
const trimmed = raw.trim();
|
|
130726
|
+
if (!trimmed)
|
|
130727
|
+
continue;
|
|
130728
|
+
const normalized = trimmed.replace(new RegExp(`^${remoteName}/`), "");
|
|
130729
|
+
if (!normalized || normalized === "HEAD")
|
|
130730
|
+
continue;
|
|
130731
|
+
if (!candidateBranches.has(normalized)) {
|
|
130732
|
+
candidateBranches.set(normalized, trimmed);
|
|
130733
|
+
}
|
|
130734
|
+
}
|
|
130735
|
+
if (isDebugMode()) {
|
|
130736
|
+
logger.log(`[byLocalBranches] Enumerated ${candidateBranches.size} candidate(s): ${Array.from(candidateBranches.keys()).join(", ")}`);
|
|
130737
|
+
}
|
|
130738
|
+
const results = await parallelWithLimit(Array.from(candidateBranches.entries()), 10, async ([branch, refToUse]) => {
|
|
130739
|
+
if (branch === defaultBranch || branch === gitBranchName) {
|
|
130740
|
+
pinned++;
|
|
130741
|
+
if (isDebugMode())
|
|
130742
|
+
logger.log(`[byLocalBranches] KEEP pinned: ${branch}`);
|
|
130743
|
+
return branch;
|
|
130744
|
+
}
|
|
130745
|
+
const branchMbR = await runGitContainsWithRetry((0, shell_quote_1.quote)(["git", "merge-base", "--all", refToUse, gitBranchName]), {
|
|
130746
|
+
execOptions,
|
|
130747
|
+
logger
|
|
130748
|
+
});
|
|
130749
|
+
const branchMbs = branchMbR.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
130750
|
+
if (branchMbs.length === 0) {
|
|
130751
|
+
droppedNoMb++;
|
|
130752
|
+
if (isDebugMode()) {
|
|
130753
|
+
logger.log(`[byLocalBranches] DROP no-merge-base: ${branch}`);
|
|
130754
|
+
}
|
|
130755
|
+
return null;
|
|
130756
|
+
}
|
|
130757
|
+
let anyStrictlyAboveFloor = false;
|
|
130758
|
+
for (const branchMb2 of branchMbs) {
|
|
130759
|
+
if (branchMb2 === mergeBase)
|
|
130760
|
+
continue;
|
|
130761
|
+
const r1 = await runGitPredicateWithRetry((0, shell_quote_1.quote)(["git", "merge-base", "--is-ancestor", mergeBase, branchMb2]), {
|
|
130762
|
+
execOptions,
|
|
130763
|
+
logger
|
|
130764
|
+
});
|
|
130765
|
+
if (r1 === true || r1 === "error") {
|
|
130766
|
+
anyStrictlyAboveFloor = true;
|
|
130767
|
+
break;
|
|
130768
|
+
}
|
|
130769
|
+
}
|
|
130770
|
+
if (!anyStrictlyAboveFloor) {
|
|
130771
|
+
droppedRule1++;
|
|
130772
|
+
if (isDebugMode()) {
|
|
130773
|
+
logger.log(`[byLocalBranches] DROP Rule 1 (cousin \u2014 shares only the floor ${mergeBase}): ${branch} \u2014 bases=${branchMbs.join(",")}`);
|
|
130774
|
+
}
|
|
130775
|
+
return null;
|
|
130776
|
+
}
|
|
130777
|
+
const branchMb = branchMbs[0];
|
|
130778
|
+
const r2 = await runGitPredicateWithRetry((0, shell_quote_1.quote)(["git", "merge-base", "--is-ancestor", gitBranchName, refToUse]), {
|
|
130779
|
+
execOptions,
|
|
130780
|
+
logger
|
|
130781
|
+
});
|
|
130782
|
+
if (r2 === true) {
|
|
130783
|
+
droppedRule2++;
|
|
130784
|
+
if (isDebugMode()) {
|
|
130785
|
+
logger.log(`[byLocalBranches] DROP Rule 2 (descendant): ${branch} \u2014 ${gitBranchName} is its ancestor`);
|
|
130786
|
+
}
|
|
130787
|
+
return null;
|
|
130788
|
+
}
|
|
130789
|
+
if (r2 === "error") {
|
|
130790
|
+
droppedRule2++;
|
|
130791
|
+
if (isDebugMode())
|
|
130792
|
+
logger.log(`[byLocalBranches] DROP Rule 2 (transient error): ${branch}`);
|
|
130793
|
+
return null;
|
|
130794
|
+
}
|
|
130795
|
+
if (isDebugMode())
|
|
130796
|
+
logger.log(`[byLocalBranches] KEEP ancestor: ${branch} (mb=${branchMb})`);
|
|
130797
|
+
return branch;
|
|
130798
|
+
});
|
|
130799
|
+
const result = Array.from(new Set(results.filter((b) => b !== null))).sort();
|
|
130800
|
+
if (isDebugMode()) {
|
|
130801
|
+
logger.log(`[byLocalBranches] Done. pinned=${pinned}, dropped(no-mb=${droppedNoMb}, rule1=${droppedRule1}, rule2=${droppedRule2}) \u2192 ${result.length} ancestor(s): ${result.join(", ")}`);
|
|
130802
|
+
}
|
|
130803
|
+
return result;
|
|
130804
|
+
} catch (err) {
|
|
130805
|
+
logger.log("[byLocalBranches] \u2717 ERROR", err);
|
|
130806
|
+
return [];
|
|
130807
|
+
}
|
|
130808
|
+
}
|
|
130809
|
+
exports.getBranchAncestryByLocalBranches = getBranchAncestryByLocalBranches;
|
|
129756
130810
|
var getAllRemoteBranches = utils2.general.cachify(
|
|
129757
130811
|
async function({ execOptions, logger }) {
|
|
129758
130812
|
var _a;
|
|
@@ -129760,10 +130814,15 @@ var require_extract_git_info = __commonJS({
|
|
|
129760
130814
|
logger.log("[getAllRemoteBranches] Starting git ls-remote to fetch all remote branches...");
|
|
129761
130815
|
logger.log("[getAllRemoteBranches] execOptions.cwd:", (execOptions === null || execOptions === void 0 ? void 0 : execOptions.cwd) || "undefined");
|
|
129762
130816
|
}
|
|
130817
|
+
const env = await (0, exports.checkGitEnvironment)({ execOptions, logger });
|
|
130818
|
+
if (!env.remoteAccessible) {
|
|
130819
|
+
logger.log("[getAllRemoteBranches] Skipping ls-remote (remote not accessible), returning empty set");
|
|
130820
|
+
return /* @__PURE__ */ new Set();
|
|
130821
|
+
}
|
|
129763
130822
|
try {
|
|
129764
130823
|
const remoteName = await (0, exports.getPrimaryRemoteName)({ execOptions, logger });
|
|
129765
130824
|
const startTime = Date.now();
|
|
129766
|
-
const result = await executeWithLog(
|
|
130825
|
+
const result = await executeWithLog((0, shell_quote_1.quote)(["git", "ls-remote", "--heads", remoteName]), {
|
|
129767
130826
|
execOptions,
|
|
129768
130827
|
logger
|
|
129769
130828
|
});
|
|
@@ -129812,7 +130871,7 @@ var require_extract_git_info = __commonJS({
|
|
|
129812
130871
|
return /* @__PURE__ */ new Set();
|
|
129813
130872
|
}
|
|
129814
130873
|
},
|
|
129815
|
-
//
|
|
130874
|
+
// Cache by cwd only, not by logger instance.
|
|
129816
130875
|
(args) => {
|
|
129817
130876
|
var _a;
|
|
129818
130877
|
return { cwd: (_a = args[0].execOptions) === null || _a === void 0 ? void 0 : _a.cwd };
|
|
@@ -129820,17 +130879,22 @@ var require_extract_git_info = __commonJS({
|
|
|
129820
130879
|
5 * 60 * 1e3
|
|
129821
130880
|
);
|
|
129822
130881
|
async function executeFetchStrategy(isShallow, execOptions, logger) {
|
|
130882
|
+
const env = await (0, exports.checkGitEnvironment)({ execOptions, logger });
|
|
130883
|
+
if (!env.remoteAccessible) {
|
|
130884
|
+
logger.log("executeFetchStrategy: skipping fetch (remote not accessible)");
|
|
130885
|
+
return;
|
|
130886
|
+
}
|
|
129823
130887
|
const remoteName = await (0, exports.getPrimaryRemoteName)({ execOptions, logger });
|
|
129824
130888
|
if (isShallow) {
|
|
129825
130889
|
logger.log(`Shallow repository detected, unshallowing to enable topology discovery...`);
|
|
129826
|
-
await executeWithLog(
|
|
130890
|
+
await executeWithLog((0, shell_quote_1.quote)(["git", "fetch", remoteName, "--unshallow", "--filter=blob:none"]), {
|
|
129827
130891
|
execOptions,
|
|
129828
130892
|
logger
|
|
129829
130893
|
});
|
|
129830
130894
|
logger.log(`Repository unshallowed successfully`);
|
|
129831
130895
|
} else {
|
|
129832
130896
|
logger.log(`Non-shallow clone detected, fetching all remote branches for topology discovery...`);
|
|
129833
|
-
await executeWithLog(
|
|
130897
|
+
await executeWithLog((0, shell_quote_1.quote)(["git", "fetch", remoteName, "--filter=tree:0"]), {
|
|
129834
130898
|
execOptions,
|
|
129835
130899
|
logger
|
|
129836
130900
|
});
|
|
@@ -129838,9 +130902,14 @@ var require_extract_git_info = __commonJS({
|
|
|
129838
130902
|
}
|
|
129839
130903
|
}
|
|
129840
130904
|
async function ensureRemoteBranchesAvailable(branchName, isShallow, execOptions, logger) {
|
|
130905
|
+
const env = await (0, exports.checkGitEnvironment)({ execOptions, logger });
|
|
130906
|
+
if (!env.remoteAccessible) {
|
|
130907
|
+
logger.log("ensureRemoteBranchesAvailable: skipping (remote not accessible)");
|
|
130908
|
+
return;
|
|
130909
|
+
}
|
|
129841
130910
|
try {
|
|
129842
130911
|
const remoteName = await (0, exports.getPrimaryRemoteName)({ execOptions, logger });
|
|
129843
|
-
const symbolicResult = await executeWithLog(
|
|
130912
|
+
const symbolicResult = await executeWithLog((0, shell_quote_1.quote)(["git", "rev-parse", "--abbrev-ref", `${branchName}@{upstream}`]), {
|
|
129844
130913
|
execOptions,
|
|
129845
130914
|
logger
|
|
129846
130915
|
});
|
|
@@ -129849,12 +130918,14 @@ var require_extract_git_info = __commonJS({
|
|
|
129849
130918
|
return;
|
|
129850
130919
|
}
|
|
129851
130920
|
logger.log(`Detected remote branch scenario, fetching ancestor branches...`);
|
|
129852
|
-
await executeWithLog(
|
|
129853
|
-
execOptions,
|
|
129854
|
-
logger
|
|
129855
|
-
});
|
|
130921
|
+
await executeWithLog((0, shell_quote_1.quote)(["git", "config", `remote.${remoteName}.fetch`, `+refs/heads/*:refs/remotes/${remoteName}/*`]), { execOptions, logger });
|
|
129856
130922
|
await executeFetchStrategy(isShallow, execOptions, logger);
|
|
129857
130923
|
logger.log(`Remote branches fetched successfully for complete ancestor check`);
|
|
130924
|
+
try {
|
|
130925
|
+
await executeWithLog((0, shell_quote_1.quote)(["git", "remote", "set-head", remoteName, "-a"]), { execOptions, logger });
|
|
130926
|
+
} catch (err) {
|
|
130927
|
+
logger.log("ensureRemoteBranchesAvailable: remote set-head -a failed (continuing)", err);
|
|
130928
|
+
}
|
|
129858
130929
|
} catch (err) {
|
|
129859
130930
|
logger.log("Note: Could not determine if branch is remote, continuing with topology discovery", err);
|
|
129860
130931
|
}
|
|
@@ -129862,46 +130933,60 @@ var require_extract_git_info = __commonJS({
|
|
|
129862
130933
|
exports.extractBranchLookupFallbackList = utils2.general.cachify(async function({ gitBranchName, execOptions, logger = (0, logger_1.makeLogger)(), enableShallowClone = true }) {
|
|
129863
130934
|
const functionStartTime = Date.now();
|
|
129864
130935
|
logger = logger.extend({ tags: [`extract-branch-fallback-list-${utils2.general.shortid()}`] });
|
|
129865
|
-
|
|
130936
|
+
if (isDebugMode())
|
|
130937
|
+
logger.log(`[PERF] extractBranchLookupFallbackList started for branch: ${gitBranchName}`);
|
|
130938
|
+
const env = await (0, exports.checkGitEnvironment)({ execOptions, logger });
|
|
130939
|
+
if (!env.ok) {
|
|
130940
|
+
logger.log("extractBranchLookupFallbackList: git environment not ok, skipping");
|
|
130941
|
+
return void 0;
|
|
130942
|
+
}
|
|
129866
130943
|
try {
|
|
129867
130944
|
const shallowCheckStartTime = Date.now();
|
|
129868
130945
|
const shallowCheckResult = await executeWithLog("git rev-parse --is-shallow-repository", {
|
|
129869
130946
|
execOptions,
|
|
129870
130947
|
logger
|
|
129871
130948
|
});
|
|
129872
|
-
|
|
130949
|
+
if (isDebugMode())
|
|
130950
|
+
logger.log(`[PERF] Shallow check took ${Date.now() - shallowCheckStartTime}ms`);
|
|
129873
130951
|
const isShallow = shallowCheckResult.stdout.trim() === "true";
|
|
129874
130952
|
if (!enableShallowClone && isShallow) {
|
|
129875
|
-
logger.log("Shallow clone detected and
|
|
130953
|
+
logger.log("Shallow clone detected and enableShallowClone=false, skipping branch lookup");
|
|
129876
130954
|
return void 0;
|
|
129877
130955
|
}
|
|
129878
130956
|
const ensureRemoteStartTime = Date.now();
|
|
129879
130957
|
await ensureRemoteBranchesAvailable(gitBranchName, isShallow, execOptions, logger);
|
|
129880
|
-
|
|
129881
|
-
|
|
129882
|
-
logger.log(`Discovering ancestor branches using git topology for ${gitBranchName}...`);
|
|
130958
|
+
if (isDebugMode())
|
|
130959
|
+
logger.log(`[PERF] ensureRemoteBranchesAvailable took ${Date.now() - ensureRemoteStartTime}ms`);
|
|
129883
130960
|
const remoteName = await (0, exports.getPrimaryRemoteName)({ execOptions, logger });
|
|
129884
|
-
const
|
|
129885
|
-
|
|
129886
|
-
|
|
129887
|
-
|
|
129888
|
-
|
|
129889
|
-
|
|
129890
|
-
|
|
129891
|
-
|
|
129892
|
-
|
|
129893
|
-
|
|
129894
|
-
|
|
129895
|
-
|
|
129896
|
-
|
|
129897
|
-
|
|
130961
|
+
const defaultBranch = await (0, exports.extractDefaultBranch)({ execOptions, logger });
|
|
130962
|
+
logger.log(`Default branch detected: ${defaultBranch}`);
|
|
130963
|
+
const resolvedDefaultBranch = await resolveBranchToLocalRef({
|
|
130964
|
+
branchName: defaultBranch,
|
|
130965
|
+
remoteName,
|
|
130966
|
+
execOptions,
|
|
130967
|
+
logger
|
|
130968
|
+
});
|
|
130969
|
+
if (!resolvedDefaultBranch) {
|
|
130970
|
+
logger.log(`extractBranchLookupFallbackList: default branch "${defaultBranch}" not resolvable locally or on remote, skipping ancestry`);
|
|
130971
|
+
return void 0;
|
|
130972
|
+
}
|
|
130973
|
+
const ancestryStrategy = (process.env.APPLITOOLS_BRANCH_ANCESTRY_STRATEGY || "commits").trim().toLowerCase();
|
|
130974
|
+
const ancestryDriver = ancestryStrategy === "local" ? getBranchAncestryByLocalBranches : getBranchAncestryByCommits;
|
|
130975
|
+
const ancestryStartTime = Date.now();
|
|
130976
|
+
logger.log(`Discovering ancestor branches via "${ancestryStrategy}" strategy for ${gitBranchName} (default=${defaultBranch})...`);
|
|
130977
|
+
const ancestry = await ancestryDriver({ gitBranchName, defaultBranch, execOptions, logger });
|
|
130978
|
+
if (isDebugMode())
|
|
130979
|
+
logger.log(`[PERF] Ancestry discovery took ${Date.now() - ancestryStartTime}ms`);
|
|
130980
|
+
if (isDebugMode()) {
|
|
130981
|
+
logger.log(`Ancestry discovery found ${ancestry.length} candidate branches: ${ancestry.join(", ")}`);
|
|
130982
|
+
} else {
|
|
130983
|
+
logger.log(`Ancestry discovery found ${ancestry.length} candidate branches`);
|
|
129898
130984
|
}
|
|
129899
|
-
let allBranches =
|
|
129900
|
-
logger.log(`[PERF] Topology discovery took ${Date.now() - topologyStartTime}ms`);
|
|
130985
|
+
let allBranches = ancestry.filter((b) => b !== gitBranchName);
|
|
129901
130986
|
if (isDebugMode()) {
|
|
129902
|
-
logger.log(`
|
|
130987
|
+
logger.log(`Ancestry discovered ${allBranches.length} potential ancestor branches: ${allBranches.join(", ")}`);
|
|
129903
130988
|
} else {
|
|
129904
|
-
logger.log(`
|
|
130989
|
+
logger.log(`Ancestry discovered ${allBranches.length} potential ancestor branches`);
|
|
129905
130990
|
}
|
|
129906
130991
|
const remoteBranchesStartTime = Date.now();
|
|
129907
130992
|
if (isDebugMode()) {
|
|
@@ -129951,48 +131036,41 @@ var require_extract_git_info = __commonJS({
|
|
|
129951
131036
|
logger.log("[Remote Filtering] Continuing with all discovered branches");
|
|
129952
131037
|
}
|
|
129953
131038
|
}
|
|
129954
|
-
logger.log(`[Remote Filtering] [PERF] Remote branch filtering took ${Date.now() - remoteBranchesStartTime}ms`);
|
|
129955
131039
|
if (isDebugMode()) {
|
|
131040
|
+
logger.log(`[Remote Filtering] [PERF] Remote branch filtering took ${Date.now() - remoteBranchesStartTime}ms`);
|
|
129956
131041
|
logger.log("[Remote Filtering] ========================================");
|
|
129957
131042
|
}
|
|
129958
|
-
const filteringStartTime = Date.now();
|
|
129959
|
-
logger.log(`Filtering out sibling branches to keep only true ancestors...`);
|
|
129960
|
-
const ANCESTOR_CHECK_CONCURRENCY = 10;
|
|
129961
|
-
const ancestorChecks = await parallelWithLimit(allBranches, ANCESTOR_CHECK_CONCURRENCY, async (candidateBranch) => {
|
|
129962
|
-
try {
|
|
129963
|
-
const isAncestorResult = await executeWithLog(`git merge-base --is-ancestor ${candidateBranch} ${gitBranchName}`, {
|
|
129964
|
-
execOptions,
|
|
129965
|
-
logger
|
|
129966
|
-
});
|
|
129967
|
-
if (isAncestorResult.code === 0) {
|
|
129968
|
-
logger.log(`\u2713 ${candidateBranch} is a true ancestor`);
|
|
129969
|
-
return { branch: candidateBranch, isAncestor: true };
|
|
129970
|
-
} else if (isAncestorResult.code === 1) {
|
|
129971
|
-
logger.log(`\u2717 ${candidateBranch} is a sibling, not an ancestor`);
|
|
129972
|
-
return { branch: candidateBranch, isAncestor: false };
|
|
129973
|
-
} else {
|
|
129974
|
-
logger.log(`\u26A0 Could not determine if ${candidateBranch} is an ancestor (exit code: ${isAncestorResult.code}), including it to be safe`);
|
|
129975
|
-
return { branch: candidateBranch, isAncestor: true };
|
|
129976
|
-
}
|
|
129977
|
-
} catch (err) {
|
|
129978
|
-
logger.log(`Error checking if ${candidateBranch} is a true ancestor:`, err);
|
|
129979
|
-
return { branch: candidateBranch, isAncestor: true };
|
|
129980
|
-
}
|
|
129981
|
-
});
|
|
129982
|
-
const trueAncestors = ancestorChecks.filter((result) => result.isAncestor).map((result) => result.branch);
|
|
129983
|
-
logger.log(`[PERF] Sibling filtering took ${Date.now() - filteringStartTime}ms`);
|
|
129984
|
-
logger.log(`Filtered to ${trueAncestors.length} true ancestors: ${trueAncestors.join(", ")}`);
|
|
129985
131043
|
const timestampStartTime = Date.now();
|
|
129986
|
-
const branchesWithTimestamps = await Promise.all(
|
|
129987
|
-
|
|
131044
|
+
const branchesWithTimestamps = await Promise.all(allBranches.map(async (ancestorBranch) => {
|
|
131045
|
+
let timestamp = await (0, exports.extractBranchingTimestamp)({
|
|
129988
131046
|
branchName: gitBranchName,
|
|
129989
131047
|
parentBranchName: ancestorBranch,
|
|
129990
131048
|
execOptions,
|
|
129991
131049
|
logger
|
|
129992
131050
|
});
|
|
131051
|
+
if (!timestamp) {
|
|
131052
|
+
timestamp = await (0, exports.extractBranchingTimestamp)({
|
|
131053
|
+
branchName: gitBranchName,
|
|
131054
|
+
parentBranchName: ancestorBranch,
|
|
131055
|
+
execOptions,
|
|
131056
|
+
logger
|
|
131057
|
+
});
|
|
131058
|
+
}
|
|
131059
|
+
if (!timestamp) {
|
|
131060
|
+
const tip = await executeWithLog((0, shell_quote_1.quote)(["git", "show", "-s", "--format=%aI", ancestorBranch]), {
|
|
131061
|
+
execOptions,
|
|
131062
|
+
logger
|
|
131063
|
+
});
|
|
131064
|
+
const tipTimestamp = tip.stdout.trim();
|
|
131065
|
+
if (!tip.stderr && isISODate(tipTimestamp)) {
|
|
131066
|
+
logger.log(`No branching timestamp for confirmed ancestor '${ancestorBranch}', using tip commit date ${tipTimestamp}`);
|
|
131067
|
+
timestamp = tipTimestamp;
|
|
131068
|
+
}
|
|
131069
|
+
}
|
|
129993
131070
|
return timestamp ? { branchName: ancestorBranch, latestViableTimestamp: timestamp } : null;
|
|
129994
131071
|
}));
|
|
129995
|
-
|
|
131072
|
+
if (isDebugMode())
|
|
131073
|
+
logger.log(`[PERF] Timestamp extraction took ${Date.now() - timestampStartTime}ms`);
|
|
129996
131074
|
const validBranches = branchesWithTimestamps.filter((item) => item !== null).sort((a, b) => {
|
|
129997
131075
|
const timeDiff = new Date(b.latestViableTimestamp).getTime() - new Date(a.latestViableTimestamp).getTime();
|
|
129998
131076
|
if (timeDiff === 0) {
|
|
@@ -130008,35 +131086,22 @@ var require_extract_git_info = __commonJS({
|
|
|
130008
131086
|
if (firstCommitResult.stdout.trim()) {
|
|
130009
131087
|
const firstCommitHash = firstCommitResult.stdout.trim().split("\n")[0];
|
|
130010
131088
|
logger.log(`Found root commit: ${firstCommitHash}`);
|
|
130011
|
-
let branchesContainingRootResult = await executeWithLog(
|
|
130012
|
-
execOptions,
|
|
130013
|
-
logger
|
|
130014
|
-
});
|
|
131089
|
+
let branchesContainingRootResult = await executeWithLog((0, shell_quote_1.quote)(["git", "branch", "-r", "--contains", firstCommitHash]), { execOptions, logger });
|
|
130015
131090
|
if (!branchesContainingRootResult.stdout.trim()) {
|
|
130016
131091
|
logger.log("No remote branches contain root commit, trying local branches");
|
|
130017
|
-
branchesContainingRootResult = await executeWithLog(
|
|
130018
|
-
execOptions,
|
|
130019
|
-
logger
|
|
130020
|
-
});
|
|
131092
|
+
branchesContainingRootResult = await executeWithLog((0, shell_quote_1.quote)(["git", "branch", "--contains", firstCommitHash]), { execOptions, logger });
|
|
130021
131093
|
}
|
|
130022
131094
|
if (branchesContainingRootResult.stdout.trim()) {
|
|
130023
131095
|
const branchesContainingRoot = branchesContainingRootResult.stdout.split("\n").map((line) => line.trim()).filter((line) => line && !line.includes("->") && !line.includes("HEAD")).map((line) => line.replace(new RegExp(`^${remoteName}/`), "").replace(/^\* /, ""));
|
|
130024
|
-
const commonRootNames = ["main", "master", "develop", "trunk"];
|
|
130025
131096
|
let rootBranch = null;
|
|
130026
|
-
|
|
130027
|
-
|
|
130028
|
-
|
|
130029
|
-
logger.log(`Found root branch using common name: ${rootBranch}`);
|
|
130030
|
-
break;
|
|
130031
|
-
}
|
|
131097
|
+
if (branchesContainingRoot.includes(defaultBranch)) {
|
|
131098
|
+
rootBranch = defaultBranch;
|
|
131099
|
+
logger.log(`Found root branch via detected defaultBranch: ${rootBranch}`);
|
|
130032
131100
|
}
|
|
130033
131101
|
if (!rootBranch && branchesContainingRoot.length > 0) {
|
|
130034
131102
|
const branchTimestamps = await Promise.all(branchesContainingRoot.slice(0, 10).map(async (branch) => {
|
|
130035
131103
|
try {
|
|
130036
|
-
const branchTimestampResult = await executeWithLog(
|
|
130037
|
-
execOptions,
|
|
130038
|
-
logger
|
|
130039
|
-
});
|
|
131104
|
+
const branchTimestampResult = await executeWithLog((0, shell_quote_1.quote)(["git", "log", "-1", "--format=%aI", branch]), { execOptions, logger });
|
|
130040
131105
|
return {
|
|
130041
131106
|
branch,
|
|
130042
131107
|
timestamp: branchTimestampResult.stdout.trim()
|
|
@@ -130055,12 +131120,19 @@ var require_extract_git_info = __commonJS({
|
|
|
130055
131120
|
const alreadyIncluded = validBranches.some((b) => b.branchName === rootBranch);
|
|
130056
131121
|
if (!alreadyIncluded) {
|
|
130057
131122
|
try {
|
|
130058
|
-
const isAncestorResult = await executeWithLog(
|
|
130059
|
-
|
|
130060
|
-
|
|
130061
|
-
|
|
130062
|
-
|
|
130063
|
-
|
|
131123
|
+
const isAncestorResult = await executeWithLog((0, shell_quote_1.quote)(["git", "merge-base", "--is-ancestor", rootBranch, gitBranchName]), { execOptions, logger });
|
|
131124
|
+
let accepted = isAncestorResult.code === 0;
|
|
131125
|
+
if (!accepted && rootBranch === defaultBranch) {
|
|
131126
|
+
const sharedHistory = await executeWithLog((0, shell_quote_1.quote)(["git", "merge-base", rootBranch, gitBranchName]), { execOptions, logger });
|
|
131127
|
+
if (!sharedHistory.stderr && sharedHistory.stdout.trim()) {
|
|
131128
|
+
accepted = true;
|
|
131129
|
+
logger.log(`Root branch ${rootBranch} is the advanced base, adding it as final fallback`);
|
|
131130
|
+
}
|
|
131131
|
+
}
|
|
131132
|
+
if (accepted) {
|
|
131133
|
+
if (isAncestorResult.code === 0) {
|
|
131134
|
+
logger.log(`Root branch ${rootBranch} is a true ancestor, adding it as final fallback`);
|
|
131135
|
+
}
|
|
130064
131136
|
const rootTimestamp = await (0, exports.extractBranchingTimestamp)({
|
|
130065
131137
|
branchName: gitBranchName,
|
|
130066
131138
|
parentBranchName: rootBranch,
|
|
@@ -130089,7 +131161,9 @@ var require_extract_git_info = __commonJS({
|
|
|
130089
131161
|
} catch (err) {
|
|
130090
131162
|
logger.log("Failed to detect and add root branch, continuing without it", err);
|
|
130091
131163
|
}
|
|
130092
|
-
|
|
131164
|
+
if (isDebugMode()) {
|
|
131165
|
+
logger.log(`[PERF] extractBranchLookupFallbackList completed in ${Date.now() - functionStartTime}ms total`);
|
|
131166
|
+
}
|
|
130093
131167
|
logger.log("Successfully extracted branch lookup fallback list", JSON.stringify(validBranches));
|
|
130094
131168
|
return validBranches.length > 0 ? validBranches : void 0;
|
|
130095
131169
|
} catch (err) {
|
|
@@ -130954,7 +132028,7 @@ var require_package3 = __commonJS({
|
|
|
130954
132028
|
"../core/package.json"(exports, module) {
|
|
130955
132029
|
module.exports = {
|
|
130956
132030
|
name: "@applitools/core",
|
|
130957
|
-
version: "4.
|
|
132031
|
+
version: "4.66.1",
|
|
130958
132032
|
homepage: "https://applitools.com",
|
|
130959
132033
|
bugs: {
|
|
130960
132034
|
url: "https://github.com/applitools/eyes.sdk.javascript1/issues"
|
|
@@ -131032,6 +132106,7 @@ var require_package3 = __commonJS({
|
|
|
131032
132106
|
chalk: "4.1.2",
|
|
131033
132107
|
"node-fetch": "2.6.7",
|
|
131034
132108
|
semver: "7.6.2",
|
|
132109
|
+
"shell-quote": "^1.8.4",
|
|
131035
132110
|
throat: "6.0.2"
|
|
131036
132111
|
},
|
|
131037
132112
|
devDependencies: {
|
|
@@ -131048,6 +132123,7 @@ var require_package3 = __commonJS({
|
|
|
131048
132123
|
"@types/node": "^12.20.55",
|
|
131049
132124
|
"@types/selenium-webdriver": "^4.1.2",
|
|
131050
132125
|
"@types/semver": "^7.5.8",
|
|
132126
|
+
"@types/shell-quote": "^1",
|
|
131051
132127
|
chai: "^4.2.0",
|
|
131052
132128
|
chromedriver: "^131.0.5",
|
|
131053
132129
|
crypto: "^1.0.1",
|
|
@@ -132506,7 +133582,7 @@ var require_package4 = __commonJS({
|
|
|
132506
133582
|
"../eyes/package.json"(exports, module) {
|
|
132507
133583
|
module.exports = {
|
|
132508
133584
|
name: "@applitools/eyes",
|
|
132509
|
-
version: "1.43.
|
|
133585
|
+
version: "1.43.6",
|
|
132510
133586
|
keywords: [
|
|
132511
133587
|
"applitools",
|
|
132512
133588
|
"eyes",
|
|
@@ -134122,7 +135198,7 @@ var require_package5 = __commonJS({
|
|
|
134122
135198
|
"package.json"(exports, module) {
|
|
134123
135199
|
module.exports = {
|
|
134124
135200
|
name: "@applitools/eyes-browser",
|
|
134125
|
-
version: "1.6.
|
|
135201
|
+
version: "1.6.25",
|
|
134126
135202
|
type: "module",
|
|
134127
135203
|
keywords: [
|
|
134128
135204
|
"applitools",
|