@lark-apaas/fullstack-cli 1.1.40-alpha.2 → 1.1.40-alpha.3
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/dist/index.js +10 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3113,11 +3113,13 @@ function getGrayscaleConfig(configJson) {
|
|
|
3113
3113
|
return null;
|
|
3114
3114
|
}
|
|
3115
3115
|
try {
|
|
3116
|
-
const
|
|
3116
|
+
const parsed = JSON.parse(raw);
|
|
3117
|
+
const config = parsed.config || parsed;
|
|
3118
|
+
const tenantId = parsed.tenant_id != null ? String(parsed.tenant_id) : void 0;
|
|
3117
3119
|
if (!config.enabled) {
|
|
3118
3120
|
return null;
|
|
3119
3121
|
}
|
|
3120
|
-
return config;
|
|
3122
|
+
return { config, tenantId };
|
|
3121
3123
|
} catch {
|
|
3122
3124
|
console.warn("[grayscale] Failed to parse grayscale config");
|
|
3123
3125
|
return null;
|
|
@@ -3244,6 +3246,7 @@ function matchConditions(rule, identity) {
|
|
|
3244
3246
|
}
|
|
3245
3247
|
}
|
|
3246
3248
|
if (conditions.percentage != null && conditions.percentage > 0) {
|
|
3249
|
+
if (conditions.percentage >= 100) return true;
|
|
3247
3250
|
if (identity.tenantId && isInPercentage(identity.tenantId, conditions.percentage)) {
|
|
3248
3251
|
return true;
|
|
3249
3252
|
}
|
|
@@ -3291,15 +3294,15 @@ function resolveTargetVersions(config, identity) {
|
|
|
3291
3294
|
|
|
3292
3295
|
// src/utils/grayscale/index.ts
|
|
3293
3296
|
function resolveGrayscaleVersions(cwd, configJson) {
|
|
3294
|
-
const
|
|
3295
|
-
if (!
|
|
3297
|
+
const result = getGrayscaleConfig(configJson);
|
|
3298
|
+
if (!result) {
|
|
3296
3299
|
console.log("[grayscale] Config not available, skipping grayscale");
|
|
3297
3300
|
return null;
|
|
3298
3301
|
}
|
|
3302
|
+
const { config, tenantId: payloadTenantId } = result;
|
|
3299
3303
|
const identity = readProjectIdentity(cwd);
|
|
3300
|
-
if (
|
|
3301
|
-
|
|
3302
|
-
return null;
|
|
3304
|
+
if (payloadTenantId) {
|
|
3305
|
+
identity.tenantId = payloadTenantId;
|
|
3303
3306
|
}
|
|
3304
3307
|
console.log(`[grayscale] Project identity: appId=${identity.appId || "N/A"}, tenantId=${identity.tenantId || "N/A"}`);
|
|
3305
3308
|
const versions = resolveTargetVersions(config, identity);
|