Skip to content

Commit 1a7b87e

Browse files
henrymercerCopilot
andcommitted
Remove TRAP cache cleanup
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent ae098fa commit 1a7b87e

7 files changed

Lines changed: 3 additions & 347 deletions

File tree

‎lib/entry-points.js‎

Lines changed: 1 addition & 102 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/analyze-action.ts‎

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ import {
4949
getActionsStatus,
5050
StatusReportBase,
5151
} from "./status-report";
52-
import {
53-
cleanupTrapCaches,
54-
TrapCacheCleanupStatusReport,
55-
uploadTrapCaches,
56-
} from "./trap-caching";
52+
import { uploadTrapCaches } from "./trap-caching";
5753
import * as uploadLib from "./upload-lib";
5854
import { UploadResult } from "./upload-lib";
5955
import { postProcessAndUploadSarif } from "./upload-sarif";
@@ -86,7 +82,6 @@ async function sendStatusReport(
8682
trapCacheUploadTime: number | undefined,
8783
dbCreationTimings: DatabaseCreationTimings | undefined,
8884
didUploadTrapCaches: boolean,
89-
trapCacheCleanup: TrapCacheCleanupStatusReport | undefined,
9085
dependencyCacheResults: DependencyCacheUploadStatusReport | undefined,
9186
databaseUploadResults: DatabaseUploadResult[],
9287
logger: Logger,
@@ -107,7 +102,6 @@ async function sendStatusReport(
107102
...statusReportBase,
108103
...(stats || {}),
109104
...(dbCreationTimings || {}),
110-
...(trapCacheCleanup || {}),
111105
dependency_caching_upload_results: dependencyCacheResults,
112106
database_upload_results: databaseUploadResults,
113107
};
@@ -229,8 +223,6 @@ async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
229223
| undefined = undefined;
230224
let runStats: QueriesStatusReport | undefined = undefined;
231225
let config: Config | undefined = undefined;
232-
let trapCacheCleanupTelemetry: TrapCacheCleanupStatusReport | undefined =
233-
undefined;
234226
let trapCacheUploadTime: number | undefined = undefined;
235227
let dbCreationTimings: DatabaseCreationTimings | undefined = undefined;
236228
let didUploadTrapCaches = false;
@@ -415,13 +407,6 @@ async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
415407
didUploadTrapCaches = await uploadTrapCaches(codeql, config, logger);
416408
trapCacheUploadTime = performance.now() - trapCacheUploadStartTime;
417409

418-
// Clean up TRAP caches
419-
trapCacheCleanupTelemetry = await cleanupTrapCaches(
420-
config,
421-
features,
422-
logger,
423-
);
424-
425410
// Store dependency cache(s) if dependency caching is enabled.
426411
if (shouldStoreCache(config.dependencyCachingEnabled)) {
427412
dependencyCacheResults = await uploadDependencyCaches(
@@ -471,7 +456,6 @@ async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
471456
trapCacheUploadTime,
472457
dbCreationTimings,
473458
didUploadTrapCaches,
474-
trapCacheCleanupTelemetry,
475459
dependencyCacheResults,
476460
databaseUploadResults,
477461
logger,
@@ -494,7 +478,6 @@ async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
494478
trapCacheUploadTime,
495479
dbCreationTimings,
496480
didUploadTrapCaches,
497-
trapCacheCleanupTelemetry,
498481
dependencyCacheResults,
499482
databaseUploadResults,
500483
logger,
@@ -508,7 +491,6 @@ async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
508491
trapCacheUploadTime,
509492
dbCreationTimings,
510493
didUploadTrapCaches,
511-
trapCacheCleanupTelemetry,
512494
dependencyCacheResults,
513495
databaseUploadResults,
514496
logger,
@@ -522,7 +504,6 @@ async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
522504
trapCacheUploadTime,
523505
dbCreationTimings,
524506
didUploadTrapCaches,
525-
trapCacheCleanupTelemetry,
526507
dependencyCacheResults,
527508
databaseUploadResults,
528509
logger,

‎src/api-client.ts‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -401,21 +401,6 @@ export async function listActionsCaches(
401401
);
402402
}
403403

404-
/**
405-
* Delete an Actions cache item by its ID.
406-
*
407-
* See https://docs.github.com/en/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id.
408-
*/
409-
export async function deleteActionsCache(id: number) {
410-
const repositoryNwo = getRepositoryNwo();
411-
412-
await getApiClient().rest.actions.deleteActionsCacheById({
413-
owner: repositoryNwo.owner,
414-
repo: repositoryNwo.repo,
415-
cache_id: id,
416-
});
417-
}
418-
419404
/**
420405
* Retrieve all custom repository properties.
421406
*

‎src/doc-url.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/
44

55
export enum DocUrl {
6-
ASSIGNING_PERMISSIONS_TO_JOBS = "https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs",
76
AUTOMATIC_BUILD_FAILED = "https://docs.github.com/en/code-security/code-scanning/troubleshooting-code-scanning/automatic-build-failed",
87
CODEQL_BUILD_MODES = "https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages#codeql-build-modes",
98
DEFINE_ENV_VARIABLES = "https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow",

‎src/feature-flags.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export enum Feature {
7474
AllowMergeConfigFiles = "allow_merge_config_files",
7575
/** Controls whether we allow multiple values for the `analysis-kinds` input. */
7676
AllowMultipleAnalysisKinds = "allow_multiple_analysis_kinds",
77-
CleanupTrapCaches = "cleanup_trap_caches",
7877
/** Whether to allow the `config-file` input to be specified via a repository property. */
7978
ConfigFileRepositoryProperty = "config_file_repository_property",
8079
CppDependencyInstallation = "cpp_dependency_installation_enabled",
@@ -216,11 +215,6 @@ export const featureConfig = {
216215
envVar: "CODEQL_ACTION_ALLOW_MULTIPLE_ANALYSIS_KINDS",
217216
minimumVersion: undefined,
218217
},
219-
[Feature.CleanupTrapCaches]: {
220-
defaultValue: false,
221-
envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES",
222-
minimumVersion: undefined,
223-
},
224218
[Feature.ConfigFileRepositoryProperty]: {
225219
defaultValue: false,
226220
envVar: "CODEQL_ACTION_CONFIG_FILE_REPOSITORY_PROPERTY",

0 commit comments

Comments
 (0)