Track outcomes of querying FFs with getValue

This commit is contained in:
Michael B. Gale
2026-01-28 12:03:10 +00:00
parent b126facd4e
commit 9d2031faa4
8 changed files with 117 additions and 1 deletions
+11
View File
@@ -90761,6 +90761,12 @@ var Features = class {
);
}
gitHubFeatureFlags;
// Tracks features that have been queried at some point and the outcome.
queriedFeatures = {};
/** Gets a record of features that were queried and the corresponding outcomes. */
getQueriedFeatures() {
return this.queriedFeatures;
}
async getDefaultCliVersion(variant) {
return await this.gitHubFeatureFlags.getDefaultCliVersion(variant);
}
@@ -90777,6 +90783,11 @@ var Features = class {
* @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided.
*/
async getValue(feature, codeql) {
const value = await this.getValueInternal(feature, codeql);
this.queriedFeatures[feature] = { value };
return value;
}
async getValueInternal(feature, codeql) {
const config = featureConfig[feature];
if (!codeql && config.minimumVersion) {
throw new Error(
+11
View File
@@ -87094,6 +87094,12 @@ var Features = class {
);
}
gitHubFeatureFlags;
// Tracks features that have been queried at some point and the outcome.
queriedFeatures = {};
/** Gets a record of features that were queried and the corresponding outcomes. */
getQueriedFeatures() {
return this.queriedFeatures;
}
async getDefaultCliVersion(variant) {
return await this.gitHubFeatureFlags.getDefaultCliVersion(variant);
}
@@ -87110,6 +87116,11 @@ var Features = class {
* @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided.
*/
async getValue(feature, codeql) {
const value = await this.getValueInternal(feature, codeql);
this.queriedFeatures[feature] = { value };
return value;
}
async getValueInternal(feature, codeql) {
const config = featureConfig[feature];
if (!codeql && config.minimumVersion) {
throw new Error(
+11
View File
@@ -131403,6 +131403,12 @@ var Features = class {
);
}
gitHubFeatureFlags;
// Tracks features that have been queried at some point and the outcome.
queriedFeatures = {};
/** Gets a record of features that were queried and the corresponding outcomes. */
getQueriedFeatures() {
return this.queriedFeatures;
}
async getDefaultCliVersion(variant) {
return await this.gitHubFeatureFlags.getDefaultCliVersion(variant);
}
@@ -131419,6 +131425,11 @@ var Features = class {
* @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided.
*/
async getValue(feature, codeql) {
const value = await this.getValueInternal(feature, codeql);
this.queriedFeatures[feature] = { value };
return value;
}
async getValueInternal(feature, codeql) {
const config = featureConfig[feature];
if (!codeql && config.minimumVersion) {
throw new Error(
+11
View File
@@ -88252,6 +88252,12 @@ var Features = class {
);
}
gitHubFeatureFlags;
// Tracks features that have been queried at some point and the outcome.
queriedFeatures = {};
/** Gets a record of features that were queried and the corresponding outcomes. */
getQueriedFeatures() {
return this.queriedFeatures;
}
async getDefaultCliVersion(variant) {
return await this.gitHubFeatureFlags.getDefaultCliVersion(variant);
}
@@ -88268,6 +88274,11 @@ var Features = class {
* @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided.
*/
async getValue(feature, codeql) {
const value = await this.getValueInternal(feature, codeql);
this.queriedFeatures[feature] = { value };
return value;
}
async getValueInternal(feature, codeql) {
const config = featureConfig[feature];
if (!codeql && config.minimumVersion) {
throw new Error(
+11
View File
@@ -86995,6 +86995,12 @@ var Features = class {
);
}
gitHubFeatureFlags;
// Tracks features that have been queried at some point and the outcome.
queriedFeatures = {};
/** Gets a record of features that were queried and the corresponding outcomes. */
getQueriedFeatures() {
return this.queriedFeatures;
}
async getDefaultCliVersion(variant) {
return await this.gitHubFeatureFlags.getDefaultCliVersion(variant);
}
@@ -87011,6 +87017,11 @@ var Features = class {
* @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided.
*/
async getValue(feature, codeql) {
const value = await this.getValueInternal(feature, codeql);
this.queriedFeatures[feature] = { value };
return value;
}
async getValueInternal(feature, codeql) {
const config = featureConfig[feature];
if (!codeql && config.minimumVersion) {
throw new Error(
+11
View File
@@ -89949,6 +89949,12 @@ var Features = class {
);
}
gitHubFeatureFlags;
// Tracks features that have been queried at some point and the outcome.
queriedFeatures = {};
/** Gets a record of features that were queried and the corresponding outcomes. */
getQueriedFeatures() {
return this.queriedFeatures;
}
async getDefaultCliVersion(variant) {
return await this.gitHubFeatureFlags.getDefaultCliVersion(variant);
}
@@ -89965,6 +89971,11 @@ var Features = class {
* @throws if a `minimumVersion` is specified for the feature, and `codeql` is not provided.
*/
async getValue(feature, codeql) {
const value = await this.getValueInternal(feature, codeql);
this.queriedFeatures[feature] = { value };
return value;
}
async getValueInternal(feature, codeql) {
const config = featureConfig[feature];
if (!codeql && config.minimumVersion) {
throw new Error(