Skip to content

Commit

Permalink
Reword changelog entry and add back test
Browse files Browse the repository at this point in the history
  • Loading branch information
aeisenberg committed Jan 24, 2022
1 parent ba352d3 commit 20dbc92
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## [UNRELEASED]

- Add better error message is the workflow does not have the `security-events: write` permission. [#882](https://github.com/github/codeql-action/pull/882)
- Add a better warning message stating that experimental features will be disabled if the workflow has been triggered by a pull request from a fork or the `security-events: write` permission is not present. [#882](https://github.com/github/codeql-action/pull/882)

## 1.0.30 - 24 Jan 2022

Expand Down
10 changes: 10 additions & 0 deletions lib/feature-flags.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/feature-flags.test.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions src/feature-flags.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,28 @@ test("Feature flags are disabled if they're not returned in API response", async
});
});

test("Feature flags exception is propagated if the API request errors", async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);

const featureFlags = new GitHubFeatureFlags(
{ type: GitHubVariant.DOTCOM },
testApiDetails,
testRepositoryNwo,
getRunnerLogger(true)
);

mockFeatureFlagApiEndpoint(500, {});

await t.throwsAsync(
async () => featureFlags.getValue(FeatureFlag.DatabaseUploadsEnabled),
{
message:
"Encountered an error while trying to load feature flags: Error: some error message",
});
});
});

const FEATURE_FLAGS = [
"database_uploads_enabled",
"ml_powered_queries_enabled",
Expand Down

0 comments on commit 20dbc92

Please sign in to comment.