René's URL Explorer Experiment


Title: Cache CLI extractor paths across Actions steps by mario-campos · Pull Request #3950 · github/codeql-action · GitHub

Open Graph Title: Cache CLI extractor paths across Actions steps by mario-campos · Pull Request #3950 · github/codeql-action

X Title: Cache CLI extractor paths across Actions steps by mario-campos · Pull Request #3950 · github/codeql-action

Description: Similar to #3943, this PR caches the output of codeql resolve languages, which contains the paths to the various extractors so that repeated calls to resolveLanguages() are idempotent. Additionally, re-implement resolveExtractor() as a wrapper over resolveLanguages() (to re-use the cached output) rather than shell out to codeql resolve extractor. In one experiment, I counted seven instances of shelling out to codeql resolve extractor. When you dig into the code, you can see why: resolveExtractor() is not called often or from many places; But one caller is isTracedLanguage(), which is wrapped by isScannedLanguage(). And these functions are often used in a loop/map over all/some languages. This can explain why we see consecutive executions of codeql resolve extractor. In support of the above goals, this PR also adds some additional functions to the json module, to enable validation of the codeql version output. Risk assessment For internal use only. Please select the risk level of this change: Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only. Which use cases does this change impact? Workflow types: Advanced setup - Impacts users who have custom CodeQL workflows. Managed - Impacts users with dynamic workflows (Default Setup, Code Quality, ...). Products: Code Scanning - The changes impact analyses when analysis-kinds: code-scanning. Code Quality - The changes impact analyses when analysis-kinds: code-quality. Other first-party - The changes impact other first-party analyses. Third-party analyses - The changes affect the upload-sarif action. Environments: Dotcom - Impacts CodeQL workflows on github.com and/or GitHub Enterprise Cloud with Data Residency. GHES - Impacts CodeQL workflows on GitHub Enterprise Server. Testing/None - This change does not impact any CodeQL workflows in production. How did/will you validate this change? Unit tests - I am depending on unit test coverage (i.e. tests in .test.ts files). End-to-end tests - I am depending on PR checks (i.e. tests in pr-checks). Other - Manual/local testing If something goes wrong after this change is released, what are the mitigation and rollback strategies? Feature flags - All new or changed code paths can be fully disabled with corresponding feature flags. Rollback - Change can only be disabled by rolling back the release or releasing a new version with a fix. Development/testing only - This change cannot cause any failures in production. Other - Please provide details. How will you know if something goes wrong after this change is released? Telemetry - I rely on existing telemetry or have made changes to the telemetry. Dashboards - I will watch relevant dashboards for issues after the release. Consider whether this requires this change to be released at a particular time rather than as part of a regular release. Alerts - New or existing monitors will trip if something goes wrong with this change. Other - Please provide details. Are there any special considerations for merging or releasing this change? No special considerations - This change can be merged at any time. Special considerations - This change should only be merged once certain preconditions are met. Please provide details of those or link to this PR from an internal issue. Merge / deployment checklist Confirm this change is backwards compatible with existing workflows. Consider adding a changelog entry for this change. Confirm the readme and docs have been updated if necessary.

Open Graph Description: Similar to #3943, this PR caches the output of codeql resolve languages, which contains the paths to the various extractors so that repeated calls to resolveLanguages() are idempotent. Additionally...

X Description: Similar to #3943, this PR caches the output of codeql resolve languages, which contains the paths to the various extractors so that repeated calls to resolveLanguages() are idempotent. Additionally...

Opengraph URL: https://github.com/github/codeql-action/pull/3950

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:487a35a4-5d36-e0a2-c297-79f04bae9840
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9952:3073D:732738:9FDAA1:6A4C8FA7
html-safe-nonce2f187cb9f134859d6ca95b79fd0c5046fcb11b0c848da929bb0368c8eaff9f7a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTUyOjMwNzNEOjczMjczODo5RkRBQTE6NkE0QzhGQTciLCJ2aXNpdG9yX2lkIjoiNzIzMDA4MTExODE3ODY3NjY0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmace2c41fee67b41f91de5e36f20c705d3a281760225f9580191de3fe635c8f55eb
hovercard-subject-tagpull_request:3803480968
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/github/codeql-action/pull/3950/files
twitter:imagehttps://avatars.githubusercontent.com/u/1663284?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1663284?s=400&v=4
og:image:altSimilar to #3943, this PR caches the output of codeql resolve languages, which contains the paths to the various extractors so that repeated calls to resolveLanguages() are idempotent. Additionally...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/github/codeql-action git https://github.com/github/codeql-action.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id259445878
octolytics-dimension-repository_nwogithub/codeql-action
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id259445878
octolytics-dimension-repository_network_root_nwogithub/codeql-action
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7a2dede45637df6b92ddcfe2a557e67d4b5854ae
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/codeql-action/pull/3950/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql-action%2Fpull%2F3950%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql-action%2Fpull%2F3950%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=github%2Fcodeql-action
Reloadhttps://github.com/github/codeql-action/pull/3950/files
Reloadhttps://github.com/github/codeql-action/pull/3950/files
Reloadhttps://github.com/github/codeql-action/pull/3950/files
Please reload this pagehttps://github.com/github/codeql-action/pull/3950/files
github https://github.com/github
codeql-actionhttps://github.com/github/codeql-action
Notifications https://github.com/login?return_to=%2Fgithub%2Fcodeql-action
Fork 470 https://github.com/login?return_to=%2Fgithub%2Fcodeql-action
Star 1.6k https://github.com/login?return_to=%2Fgithub%2Fcodeql-action
Code https://github.com/github/codeql-action
Issues 156 https://github.com/github/codeql-action/issues
Pull requests 27 https://github.com/github/codeql-action/pulls
Actions https://github.com/github/codeql-action/actions
Models https://github.com/github/codeql-action/models
Security and quality 2 https://github.com/github/codeql-action/security
Insights https://github.com/github/codeql-action/pulse
Code https://github.com/github/codeql-action
Issues https://github.com/github/codeql-action/issues
Pull requests https://github.com/github/codeql-action/pulls
Actions https://github.com/github/codeql-action/actions
Models https://github.com/github/codeql-action/models
Security and quality https://github.com/github/codeql-action/security
Insights https://github.com/github/codeql-action/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fgithub%2Fcodeql-action%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgithub%2Fcodeql-action%2Fissues%2Fnew%2Fchoose
mario-camposhttps://github.com/mario-campos
mainhttps://github.com/github/codeql-action/tree/main
mario-campos/cache-cli-resolve-langshttps://github.com/github/codeql-action/tree/mario-campos/cache-cli-resolve-langs
Conversation 58 https://github.com/github/codeql-action/pull/3950
Findings https://github.com/github/codeql-action/pull/3950/findings
Commits 26 https://github.com/github/codeql-action/pull/3950/commits
Checks 8 https://github.com/github/codeql-action/pull/3950/checks
Files changed https://github.com/github/codeql-action/pull/3950/files
Please reload this pagehttps://github.com/github/codeql-action/pull/3950/files
Cache CLI extractor paths across Actions steps https://github.com/github/codeql-action/pull/3950/files#top
Show all changes 26 commits https://github.com/github/codeql-action/pull/3950/files
311292c Cache the output of `codeql resolve languages` mario-campos Jun 3, 2026 https://github.com/github/codeql-action/pull/3950/commits/311292c28fcad4d4c3efb0b85ec3f23b2785a19f
6010f85 Reimplement `resolveExtractor()` as wrapper over `resolveLanguages()` mario-campos Jun 3, 2026 https://github.com/github/codeql-action/pull/3950/commits/6010f85d81311aee3e4d090b444e82855e90740b
445107e Validate numbers, objects, and undefinables in the `json` module mario-campos Jun 16, 2026 https://github.com/github/codeql-action/pull/3950/commits/445107e23af9b5ae4b0e0d68e638eaf4da59d014
587fcb3 Refactor `isVersionInfo()`` to use `json` module mario-campos Jun 16, 2026 https://github.com/github/codeql-action/pull/3950/commits/587fcb33c738fe65109c7fbcda01b693e9b9614a
889ae42 Refactor CLI executions into helper functions mario-campos Jun 17, 2026 https://github.com/github/codeql-action/pull/3950/commits/889ae42672fcfc9f2570842bca674d6989c02f69
dc8e1e9 Refactor CLI JSON handling into a dedicated `runCliJson` function mario-campos Jun 17, 2026 https://github.com/github/codeql-action/pull/3950/commits/dc8e1e9aa030ff727aca68fda116800bf38b8eb3
a602287 Refactor CLI caching with in-memory and file storage mario-campos Jun 18, 2026 https://github.com/github/codeql-action/pull/3950/commits/a602287f735f45c60ac6df611e76a9e54a28347b
b18df17 Rebased onto main; fixups were needed mario-campos Jun 18, 2026 https://github.com/github/codeql-action/pull/3950/commits/b18df17ee7608277c4d8ac617d62bd3878135de1
553eef0 Add error handling for undefined extractors in language resolution mario-campos Jun 18, 2026 https://github.com/github/codeql-action/pull/3950/commits/553eef0d3fb88d9d9478e100a556cf047da13c07
c8e32e4 Refactor `resolveLanguages()` to cache output according to CLI featur… mario-campos Jun 18, 2026 https://github.com/github/codeql-action/pull/3950/commits/c8e32e423db7a4baa7df978f7fff4c7773fdd378
defcf1b Rename `optional` and `undefinable` functions for clarity; update rel… mario-campos Jun 19, 2026 https://github.com/github/codeql-action/pull/3950/commits/defcf1bff6e0bd3d59991cbe4c608eeb1eedb41e
420c97e Improve documentation for cache file and command keys in CLI mario-campos Jun 19, 2026 https://github.com/github/codeql-action/pull/3950/commits/420c97eadde1b53f6fb590ecf837b21d11a01cd8
dd7ff30 Replace `string` with `CommandCacheKey` for better type safety mario-campos Jun 19, 2026 https://github.com/github/codeql-action/pull/3950/commits/dd7ff302052d32dd1ffd25528cf0ac83e33d755f
126166c Rename `CacheEntry` to `CommandCacheEntry` for consistency mario-campos Jun 19, 2026 https://github.com/github/codeql-action/pull/3950/commits/126166c21209f7c4537f0bd342c2b5907460e656
94b1260 Refactor cache file reading to check for existence before attempting … mario-campos Jun 19, 2026 https://github.com/github/codeql-action/pull/3950/commits/94b12602ac7a37849b55dd401b0c1207f3438564
d1bd5ec Add logging for command cache file read/write failures mario-campos Jun 19, 2026 https://github.com/github/codeql-action/pull/3950/commits/d1bd5ec7b0d24e2aece3fc1fb9d8761318d83943
805b590 Remove duplicate key check in cacheCommandOutput and related tests mario-campos Jun 19, 2026 https://github.com/github/codeql-action/pull/3950/commits/805b59092e7efaab37053dc1898e5fb1a435636f
895ffe7 Front-load caching and rear-load saving to disk mario-campos Jun 19, 2026 https://github.com/github/codeql-action/pull/3950/commits/895ffe7eb5dc00f0e37304117af54df325cf26ee
649baba Refactor cache storage to use cacheCommandOutput for consistency mario-campos Jun 19, 2026 https://github.com/github/codeql-action/pull/3950/commits/649bababe740aae717fbfd30fc0b4af8f7676a17
b3c7aa7 Add warning log for invalid data in command cache retrieval mario-campos Jun 19, 2026 https://github.com/github/codeql-action/pull/3950/commits/b3c7aa7372bb8c2a98069821038d3ed34bd4d90f
41965b0 Move `cache.ts` to `cli/output-cache.ts` mario-campos Jun 30, 2026 https://github.com/github/codeql-action/pull/3950/commits/41965b0e7be3045e3ddf8d5c7c30fe3f19a1480b
c2f4379 Refactor `CommandCacheKey` as a string union mario-campos Jun 30, 2026 https://github.com/github/codeql-action/pull/3950/commits/c2f43799c5aca5fdaebaed44e5f4ef63d80a6987
0d69817 Move output type validators to `output-cache.ts` module mario-campos Jun 30, 2026 https://github.com/github/codeql-action/pull/3950/commits/0d698171d350266bf2b7dafa80e83d2479fa79a3
da14981 Switch `CommandCacheKey` back to an `enum` mario-campos Jun 30, 2026 https://github.com/github/codeql-action/pull/3950/commits/da149812f1432ca8dd89eb2c43d4acbbdb5f486c
bba0d6c Revert JSON module changes mario-campos Jul 1, 2026 https://github.com/github/codeql-action/pull/3950/commits/bba0d6c67cb441000dde909b0cc8ad52e67561d5
7f4f27e Revert change to `resolveExtractor` mario-campos Jul 1, 2026 https://github.com/github/codeql-action/pull/3950/commits/7f4f27e7e62ffbdfee14c96f3c882d09d8a62e64
Clear filters https://github.com/github/codeql-action/pull/3950/files
Please reload this pagehttps://github.com/github/codeql-action/pull/3950/files
Please reload this pagehttps://github.com/github/codeql-action/pull/3950/files
entry-points.js https://github.com/github/codeql-action/pull/3950/files#diff-73697317a7dd14441dcfb24bc586f637ae2b815b5e503a05a81816be74fcd815
output-cache.test.ts https://github.com/github/codeql-action/pull/3950/files#diff-8218f87148350d9b3551df1d359ed41fc65374c7997de3c7d031ae8f99b40b26
output-cache.ts https://github.com/github/codeql-action/pull/3950/files#diff-1da25bf67e8e047dbb84783778ba7c946308597fd8f0c7841df204d98509434f
codeql.ts https://github.com/github/codeql-action/pull/3950/files#diff-473ad8cf33ad034dc4f9ae468a3ce5d87106ace4f96f6a23a000261d46efaa60
config-utils.test.ts https://github.com/github/codeql-action/pull/3950/files#diff-b89137bd6c9c170b54007f695c569094adf83a0f79f9f29272cc1a801f34c3e0
config-utils.ts https://github.com/github/codeql-action/pull/3950/files#diff-14691739edd81c7a3c8a30fec2e77ee99f2d57f323523e502a73ab375982d6fa
environment.ts https://github.com/github/codeql-action/pull/3950/files#diff-c0b3266a3c4f1c4857b2a8bc79c4b463560bb7da30deb7c2b6e852f705723827
init-action.ts https://github.com/github/codeql-action/pull/3950/files#diff-87bf9e0a2a9244ba1f26eb01d404deaccbc9580479d2e2530a4ff2fd5bd91565
status-report.ts https://github.com/github/codeql-action/pull/3950/files#diff-3abb83ffc5df1d349d32759ed4876c4c1a50b63d3187ec177d67cb76f0bd50e7
testing-utils.ts https://github.com/github/codeql-action/pull/3950/files#diff-b5e75f890eca9e7fbfff472427b39ce0f5628833109b50e7b2d165729bd8c124
tools-features.ts https://github.com/github/codeql-action/pull/3950/files#diff-a2b4f46aa09bd648db18893b59331e2e037dfb60954c80383d820703b09d2519
util.test.ts https://github.com/github/codeql-action/pull/3950/files#diff-5b8db3845646ec2fda6f1a8fb2b5b8c67460b5070568f4be6320f344704969cd
util.ts https://github.com/github/codeql-action/pull/3950/files#diff-3294a832ea2276e554177e0b3007cc2d401c082912c7fbde49fa09141bf1aed1
https://github.com/github/codeql-action/blob/main/CODEOWNERS#L1
lib/entry-points.jshttps://github.com/github/codeql-action/pull/3950/files#diff-73697317a7dd14441dcfb24bc586f637ae2b815b5e503a05a81816be74fcd815
View file https://github.com/github/codeql-action/blob/7f4f27e7e62ffbdfee14c96f3c882d09d8a62e64/lib/entry-points.js
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/github/codeql-action/pull/3950/files
https://github.com/github/codeql-action/blob/main/CODEOWNERS#L1
src/cli/output-cache.test.tshttps://github.com/github/codeql-action/pull/3950/files#diff-8218f87148350d9b3551df1d359ed41fc65374c7997de3c7d031ae8f99b40b26
View file https://github.com/github/codeql-action/blob/7f4f27e7e62ffbdfee14c96f3c882d09d8a62e64/src/cli/output-cache.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql-action/pull/3950/{{ revealButtonHref }}
Please reload this pagehttps://github.com/github/codeql-action/pull/3950/files
Please reload this pagehttps://github.com/github/codeql-action/pull/3950/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.