| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
In general, I'd prefer to avoid adding operations that take time and are unused, but in this case we're very likely to use the feature flags in another Action, meaning we'd need to make the API call anyway. So LGTM.
Sorry, something went wrong.
| features = new Features( | ||
| gitHubVersion, | ||
| repositoryNwo, | ||
| actionsUtil.getTemporaryDirectory(), | ||
| logger, | ||
| ); |
Code scanning / CodeQL
Useless assignment to local variable Warning
AI 7 months ago
To fix the problem, we should remove the unused local variable and its assignment while preserving any intentional side effects from constructing Features. Instead of declaring let features and assigning to it, we can (a) remove the features declaration, and (b) replace features = new Features(...) with a bare new Features(...) call. This keeps the intended “initialise FFs” behavior but no longer suggests that a features value is used later.
Concretely in src/start-proxy-action.ts:
No new imports, methods, or other definitions are required.
cat << 'EOF' | git apply
diff --git a/src/start-proxy-action.ts b/src/start-proxy-action.ts
--- a/src/start-proxy-action.ts
+++ b/src/start-proxy-action.ts
@@ -95,7 +95,6 @@
// possible, and only use safe functions outside.
const logger = getActionsLogger();
- let features: Features | undefined;
let language: KnownLanguage | undefined;
try {
@@ -110,8 +109,7 @@
// Initialise FFs, but only load them from disk if they are already available.
const repositoryNwo = getRepositoryNwo();
const gitHubVersion = await getGitHubVersion();
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- features = new Features(
+ new Features(
gitHubVersion,
repositoryNwo,
actionsUtil.getTemporaryDirectory(),
EOF
| @@ -95,7 +95,6 @@ | ||
| // possible, and only use safe functions outside. | ||
|
|
||
| const logger = getActionsLogger(); | ||
| let features: Features | undefined; | ||
| let language: KnownLanguage | undefined; | ||
|
|
||
| try { | ||
| @@ -110,8 +109,7 @@ | ||
| // Initialise FFs, but only load them from disk if they are already available. | ||
| const repositoryNwo = getRepositoryNwo(); | ||
| const gitHubVersion = await getGitHubVersion(); | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| features = new Features( | ||
| new Features( | ||
| gitHubVersion, | ||
| repositoryNwo, | ||
| actionsUtil.getTemporaryDirectory(), |
| Back | FazBrowse Home | New Git URL |
(Based on #3464 which should be merged first.)
This PR makes a Features object available in the start-proxy action. While we don't make any use of this yet, we plan to in later changes.
Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
Products:
Environments:
How did/will you validate this change?
If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist