@configdirector/cli 0.19.0 → 0.20.0
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 +6 -0
- package/README.md +1 -1
- package/dist/configdirector.mjs +8 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to `@configdirector/cli` are documented here. The format fol
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.20.0] - 2026-11-06
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- `configdirector evaluate` says when a percentage rollout was skipped because the context has no identifier. The rule's line ends with `rollout skipped: the context has no identifier`, where it showed `not matched` with no reason, both for a percentage rule and for a conditional rule that serves a percentage rollout once its conditions matched. The rules after it show `not evaluated` and the context gets the default targeting rule value, as before. `--json` prints the Admin API's response as received, as before.
|
|
12
|
+
|
|
7
13
|
## [0.19.0] - 2026-11-04
|
|
8
14
|
|
|
9
15
|
### Added
|
package/README.md
CHANGED
|
@@ -159,7 +159,7 @@ true, served by rule 2
|
|
|
159
159
|
Default targeting rule: false
|
|
160
160
|
```
|
|
161
161
|
|
|
162
|
-
A rule that did not match names the first condition that failed and the context's value for it, as in `plan is one of pro, team, but it is "free"`, or the bucket a percentage rollout put the context in. A rule after the one that served the value is not evaluated, and a rule that could not be evaluated is shown as errored.
|
|
162
|
+
A rule that did not match names the first condition that failed and the context's value for it, as in `plan is one of pro, team, but it is "free"`, or the bucket a percentage rollout put the context in. A context without an identifier gets no bucket: the first percentage rollout it reaches shows `rollout skipped: the context has no identifier`, and the context gets the default targeting rule value. A rule after the one that served the value, or after a skipped rollout, is not evaluated, and a rule that could not be evaluated is shown as errored.
|
|
163
163
|
|
|
164
164
|
`--environment` takes the environment's slug and is required. Give the context one of three ways:
|
|
165
165
|
|
package/dist/configdirector.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { promisify } from "node:util";
|
|
|
14
14
|
import { randomUUID } from "node:crypto";
|
|
15
15
|
import { text } from "node:stream/consumers";
|
|
16
16
|
//#region package.json
|
|
17
|
-
var version = "0.
|
|
17
|
+
var version = "0.20.0";
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/CliError.ts
|
|
20
20
|
var CliError = class extends Error {
|
|
@@ -399,7 +399,6 @@ const ConditionExplanationSchema = v.union([
|
|
|
399
399
|
SegmentConditionExplanationSchema
|
|
400
400
|
]);
|
|
401
401
|
const BucketSchema = v.object({
|
|
402
|
-
defaultedToPredefinedBucket: v.boolean(),
|
|
403
402
|
assignedPercentage: v.number(),
|
|
404
403
|
shares: v.array(v.object({
|
|
405
404
|
percentageId: v.string(),
|
|
@@ -417,7 +416,8 @@ const RuleExplanationSchema = v.object({
|
|
|
417
416
|
"errored"
|
|
418
417
|
]),
|
|
419
418
|
conditions: v.array(ConditionExplanationSchema),
|
|
420
|
-
bucket: v.optional(BucketSchema)
|
|
419
|
+
bucket: v.optional(BucketSchema),
|
|
420
|
+
rolloutSkippedNoIdentifier: v.boolean()
|
|
421
421
|
});
|
|
422
422
|
const ConfigEvaluationSchema = v.object({
|
|
423
423
|
key: v.string(),
|
|
@@ -2009,8 +2009,7 @@ const bucketPlacement = (bucket) => {
|
|
|
2009
2009
|
if (selectedShare !== void 0) return `${assigned} is in ${describeShareRange(selectedShare.from, selectedShare.to)}`;
|
|
2010
2010
|
return `${assigned} is outside ${describeShareRange(0, bucket.shares.at(-1)?.to ?? 0)}`;
|
|
2011
2011
|
};
|
|
2012
|
-
const
|
|
2013
|
-
const withBucket = (outcome, bucket) => bucket === void 0 ? outcome : `${outcome}: ${describeBucket(bucket)}`;
|
|
2012
|
+
const withBucket = (outcome, bucket) => bucket === void 0 ? outcome : `${outcome}: ${bucketPlacement(bucket)}`;
|
|
2014
2013
|
const conditionsOf = (rule) => rule?.type === "conditional" ? rule.conditions : [];
|
|
2015
2014
|
const segmentMismatchEvidence = (explanation) => {
|
|
2016
2015
|
if (!explanation.segmentFound) return "the segment was not found";
|
|
@@ -2032,17 +2031,19 @@ const describeNotMatched = (explanation, conditions, segments) => {
|
|
|
2032
2031
|
const failingCondition = failingConditionDescription(explanation, conditions, segments);
|
|
2033
2032
|
return failingCondition === void 0 ? withBucket("not matched", explanation.bucket) : `not matched: ${failingCondition}`;
|
|
2034
2033
|
};
|
|
2034
|
+
const evaluatorRuleOutcomeOf = (explanation) => explanation.rolloutSkippedNoIdentifier ? "rollout-skipped-no-identifier" : explanation.outcome;
|
|
2035
2035
|
const RULE_OUTCOME_DESCRIPTIONS = {
|
|
2036
2036
|
matched: (explanation) => withBucket("matched", explanation.bucket),
|
|
2037
2037
|
"not-matched": describeNotMatched,
|
|
2038
2038
|
"not-evaluated": () => "not evaluated",
|
|
2039
|
-
errored: () => "errored"
|
|
2039
|
+
errored: () => "errored",
|
|
2040
|
+
"rollout-skipped-no-identifier": () => "rollout skipped: the context has no identifier"
|
|
2040
2041
|
};
|
|
2041
2042
|
const ruleLines = (evaluation) => {
|
|
2042
2043
|
const rulesById = new Map(evaluation.targetingRules.rules.map((rule) => [rule.id, rule]));
|
|
2043
2044
|
return alignedColumns(evaluation.rules.map((explanation, index) => {
|
|
2044
2045
|
const rule = rulesById.get(explanation.ruleId);
|
|
2045
|
-
return [`${index + 1}. ${rule === void 0 ? explanation.ruleId : describeRule(rule, evaluation.segments, evaluation.variations)}`, RULE_OUTCOME_DESCRIPTIONS[explanation
|
|
2046
|
+
return [`${index + 1}. ${rule === void 0 ? explanation.ruleId : describeRule(rule, evaluation.segments, evaluation.variations)}`, RULE_OUTCOME_DESCRIPTIONS[evaluatorRuleOutcomeOf(explanation)](explanation, conditionsOf(rule), evaluation.segments)];
|
|
2046
2047
|
}));
|
|
2047
2048
|
};
|
|
2048
2049
|
const evaluationText = (evaluation, requested) => [
|
package/package.json
CHANGED