Commit Graph
100 Commits
Author SHA1 Message Date
Mario Campos 738bd62186 Refactor changenotes validate to use helper getChangenotes
This reduces duplicate code between `assemble` and `validate`. It also has the benefit of fixing a bug in the current implementation of `validate`, where `isValidChangenoteFile` receives a relative file name where it should receive an absolute one.
2026-09-22 09:01:46 -05:00
Mario Campos 6dd161bc76 Merge pull request #4155 from github/mario-campos/merge-changenotes
Add `changenotes.mts assemble` command to move changenotes to CHANGELOG.md
2026-09-22 12:52:41 +00:00
Mario Campos b1668d6234 Flesh out a comment 2026-09-21 16:40:26 -05:00
Mario Campos c0bd54fdf4 Replace JSDoc text with @throws 2026-09-21 16:36:10 -05:00
Mario Campos 0263122209 Format code with npm run lint-fix 2026-09-21 16:32:44 -05:00
Mario Campos c496c6cceb Rename name to absolutePath for clarity 2026-09-21 16:31:55 -05:00
Mario CamposandMichael B. Gale 598cda36cf Apply suggestion from @mbg
Co-authored-by: Michael B. Gale <mbg@github.com>
2026-09-21 16:28:52 -05:00
Mario CamposandMichael B. Gale 771560691a Update JSDoc comment with parameter lines
Co-authored-by: Michael B. Gale <mbg@github.com>
2026-09-21 16:28:36 -05:00
Mario Campos a92f7fb688 Refactor changenote file listing into function to D.R.Y. 2026-09-18 15:02:17 -05:00
Mario Campos 7f54212a01 Rename flush command to assemble 2026-09-18 13:49:18 -05:00
Mario Campos 977b29b897 Replace splice with push and pop 2026-09-18 13:47:06 -05:00
Mario Campos bc0efd6d91 Simplify addBodyLinesToUnreleasedSection 2026-09-18 12:35:41 -05:00
Mario Campos 128614ad8b Simplify getHeader to operate on ChangelogSections 2026-09-18 12:24:19 -05:00
Mario Campos d63b2a40db Assume '[UNRELEASED]' section is first section 2026-09-18 11:42:46 -05:00
Mario Campos b246e56069 Use ExitCode instead of 0/1 2026-09-18 11:28:17 -05:00
Mario Campos bffae1c4b8 Use withChangelog I/O helper 2026-09-18 11:24:26 -05:00
Mario Campos 1ee3265262 Add changenotes.mts flush command
This command will "flush" or move the changenotes in the `unreleased-change-notes` directory to the `[UNRELEASED]` section of the CHANGELOG.md file.
2026-09-18 11:14:49 -05:00
Mario Campos bb1dc5460b Add CHANGELOG function addBodyLinesToUnreleasedSection
This will be used by the `pr-checks/changenotes.mts` script to "compile" the latest release entry of CHANGELOG.md.
2026-09-18 11:14:48 -05:00
Mario Campos 47d607e2c1 Add changelog parsing helper getHeader 2026-09-18 11:14:48 -05:00
Mario Campos cb31eabcd8 Do not include trailing newlines in NO_CHANGES_STR
Changing `NO_CHANGES_STR` to just be the text will make it easier to insert/use. To not break anything, I added the deleted newlines to the locations where `NO_CHANGES_STR` was used.
2026-09-18 09:35:44 -05:00
Mario Campos 9961729e06 Merge pull request #4116 from github/mario-campos/validate-cn-workflow
Validate change-notes as a PR check
2026-09-16 15:12:11 +00:00
Mario Campos e26a5c4139 Be consistent with language and conventions 2026-09-15 09:18:42 -05:00
Mario Campos 6041eff66b Update validate.test.mts test names to reflect new isValidAllChangenoteFiles
The `isValidAllChangenoteFiles` now accepts a list of file paths rather than a file path string.
2026-09-14 13:40:10 -05:00
Mario Campos f45ef9d1c5 Log something on successful changenote validation
Also, slightly improve the log statement of the validation error case.
2026-09-14 12:17:28 -05:00
Mario Campos f60f4d9500 Validate change-notes in PRs
This commit also introduces the 'empty' home directory for future change-notes.
2026-09-11 16:04:21 -05:00
Mario Campos a691c16115 Extend changetool to support directories 2026-09-11 16:04:21 -05:00
Mario Campos b1c1bbb1e0 Extend ESLint rules to *.mts files 2026-09-11 14:52:02 -05:00
Mario Campos 1cf8f518e1 Merge pull request #4140 from github/mario-campos/move-withTmpFile
Move `withTmpFile` next to `withTmpDir`
2026-09-11 18:54:51 +00:00
Mario Campos faf4f3af21 Add JSDoc to withTmpFile 2026-09-11 11:12:03 -05:00
Mario CamposandMichael B. Gale 15b91dbb92 Delete unnecessary .js file extension from import statement
Co-authored-by: Michael B. Gale <mbg@github.com>
2026-09-11 08:57:52 -05:00
Mario Campos 80d5f4e36a Always clean-up temp dirs in withTmpDir 2026-09-10 18:48:14 -05:00
Mario Campos 297617deb9 Update npm commands in sync.sh to include workspace root dependencies 2026-09-10 17:22:50 -05:00
Mario Campos f6491d646e Reduce duplication by using withTmpDir in withTmpFile 2026-09-10 15:37:39 -05:00
Mario Campos 4375107b7e Move withTmpFile to util.ts and update tests to use it 2026-09-10 15:36:26 -05:00
Mario Campos a0c73122a6 Merge pull request #4096 from github/mario-campos/use-json-module
Use `json` module for JSON validation in `output-cache`
2026-09-01 15:17:48 +00:00
Mario Campos 6f530319d8 Merge pull request #4113 from github/mario-campos/add-changenote-script
Create `changetool` script for validating change-notes
2026-08-27 18:09:46 +00:00
Mario CamposandHenry Mercer f049ecb9ce Delete unused Node.js flag --experimental-test-module-mocks
Co-authored-by: Henry Mercer <henrymercer@github.com>
2026-08-27 11:22:56 -05:00
Mario Campos cacb7b37ed Delete unused script/changetool NPM scripts 2026-08-26 23:39:11 -05:00
Mario Campos e2cd31e32e Refactor tsconfig.json to extend base configuration and simplify options 2026-08-26 23:32:24 -05:00
Mario Campos be555cf0a3 Extend scripts/changetool as a NPM workspace 2026-08-26 23:25:06 -05:00
Mario Campos 0447ab23b5 Enhance changenote validation to support nested bullet lists 2026-08-26 23:06:47 -05:00
Mario Campos 50ec5a5c18 Use Object.hasOwn instead of in operator
Apparently, the `in` operator will check inherited properties too.
2026-08-26 22:23:00 -05:00
Mario Campos 5aea817801 Replace Array.prototype.every() with for loop
`.every()` short-circuits on the first `false`
2026-08-26 22:20:25 -05:00
Mario Campos 580da893f6 Handle file errors as false 2026-08-26 22:15:34 -05:00
Mario Campos 426c10420b Create changetool script for validating change-notes 2026-08-26 17:13:40 -05:00
Mario Campos fcd8d74cda Refactor output-caching functions to accept file path dependency
This makes it easier to test. Credit to @mbg.
2026-08-14 14:41:04 -05:00
Mario Campos b5d34388b7 Refactor tests in output-cache.test.ts to use named imports from output-cache 2026-08-14 14:28:17 -05:00
Mario Campos 1f46830a1f Fix VersionInfo derived type to pass linter 2026-08-14 14:24:37 -05:00
Mario Campos b60777a215 Delete unnecessary statement from JSDoc comments 2026-08-14 14:05:42 -05:00
Mario Campos f3deecb42d Refactor OutputCache with json module 2026-08-14 11:38:38 -05:00
Mario Campos c8ba2d2a05 Refactor isVersionInfo with json module 2026-08-14 11:35:14 -05:00
Mario Campos d7d901a925 Refactor tests to use getCommandCacheFilePath
As well as fixup a few other problems.
2026-08-14 10:56:07 -05:00
Mario Campos cb9d39fcc1 Export getCommandCacheFilePath function for use in tests 2026-08-14 10:55:33 -05:00
Mario Campos 93d793c5fe Use json module for JSON validation in output-cache 2026-08-13 23:19:37 -05:00
Mario Campos c2fd8f54d1 Merge pull request #4081 from github/mario-campos/version-cache-to-disk
Persist CodeQL version output to file rather than environment
2026-08-13 14:27:41 +00:00
Mario Campos c56f48e9bd Log unexpected conditions during caching CLI output 2026-08-13 09:14:00 -05:00
Mario Campos aa0eadc572 Merge branch 'main' into mario-campos/version-cache-to-disk
# Conflicts:
#	lib/entry-points.js
2026-08-13 09:02:15 -05:00
Mario Campos 43250d671a Change cache key to string type to include CLI args 2026-08-13 08:59:09 -05:00
Mario Campos 2d49edbac6 Re-order env to be first argument for consistency 2026-08-13 08:13:49 -05:00
Mario Campos 6dc633238e Bolster output-cache unit tests with more test cases 2026-08-12 13:45:22 -05:00
Mario Campos 6c0d9018d4 Change OutputCache to use object for entries
This will ensure it works nicely with `JSON.stringify`. And, then we can validate the type before marshaling.
2026-08-12 12:01:20 -05:00
Mario Campos bf96b0df93 Expand test to ensure it does not throw an exception 2026-08-12 11:39:32 -05:00
Mario Campos 337136ab8a Rename CommandCacheRecord -> OutputCache 2026-08-12 11:29:11 -05:00
Mario Campos a9baab8dee Export CLI cache types 2026-08-12 11:26:52 -05:00
Mario Campos 33d70867d5 Pass environment explicitly to CLI caching functions 2026-08-12 11:24:37 -05:00
Mario Campos 40f80a8df0 Rename type to better match generic intention 2026-08-11 18:09:09 -05:00
Mario Campos b222c3aaea Generalize file cache data structure 2026-08-11 18:09:09 -05:00
Mario Campos 11569df0a1 Update JSDoc of getCachedCodeQlVersion 2026-08-11 15:55:16 -05:00
Mario Campos 0a99875ae5 Move VersionInfo-related types to cli/output-cache.ts
This brings them out of the crowded all-purpose `util.ts` and into `cli/output-cache.ts` where they are exclusively used.
2026-08-11 15:55:15 -05:00
Mario Campos 246018e041 Move VersionInfo to dedicated module 2026-08-11 15:55:15 -05:00
Mario Campos 1332611f51 Move cache-related util functions into dedicated module 2026-08-11 15:55:15 -05:00
Mario Campos 4dc327a942 Introduce basic cli/output-cache.ts module 2026-08-11 15:36:17 -05:00
Mario Campos bb19330c5e Add test of getCachedCodeQlVersion with no file 2026-08-11 15:36:17 -05:00
Mario Campos 0e85c0e99c Refactor unit test to extract testing values 2026-08-11 15:36:17 -05:00
Mario Campos bfcd769ba1 Fix JSDoc of env param 2026-08-11 15:36:17 -05:00
Mario CamposandMichael B. Gale 208a88adc7 Simplify JSDoc of getCachedCodeQlVersion
Co-authored-by: Michael B. Gale <mbg@github.com>
2026-08-11 11:06:17 -05:00
Mario Campos 9183a7b6e1 Handle file-read errors as cache misses
This is particularly important for the first time that `getCachedCodeQlVersion` is invoked, as this cache file will not yet exist.
2026-08-10 10:44:48 -05:00
Mario Campos 5f8c44ba62 Persist CodeQL version output to file rather than environment 2026-08-07 15:11:20 -05:00
Mario Campos 0e974e6288 Merge pull request #3980 from github/mario-campos/add-optional-to-json
Support `undefined`, `number` in JSON module
2026-07-08 13:05:24 +00:00
Mario Campos c1e7c7a0de Merge pull request #3981 from github/mario-campos/runCliJson
Create wrapper `runCliJson`
2026-07-01 21:18:51 +00:00
Mario CamposandMichael B. Gale cbf67da2fa Adjust test name
By @mbg

Co-authored-by: Michael B. Gale <mbg@github.com>
2026-07-01 15:46:20 -05:00
Mario Campos 4c18ab020b Change optional to include undefined
The previous implementation of `optional` is now `optionalOrNull`.
2026-07-01 15:46:15 -05:00
Mario Campos d5b8046386 Add JSDoc comment to runCliJson 2026-07-01 14:20:36 -05:00
Mario Campos a8958a9883 Keep the JSON exception message consistent 2026-07-01 14:20:36 -05:00
Mario Campos 7d1c6e90aa Include codeql path in runCliJson error 2026-06-30 23:13:36 -05:00
Mario Campos 6cdc6063c0 Create wrapper runCliJson 2026-06-30 23:07:02 -05:00
Mario Campos ffb3423848 Add isNumber/number validator 2026-06-30 16:35:16 -05:00
Mario Campos b623f5fd57 Merge pull request #3799 from github/mario-campos/test-multiple-registries
Add tests for getCredentials with multiple goproxy_servers and maven_…
2026-04-07 14:52:14 +00:00
Mario CamposandMichael B. Gale 35a38985d3 Specify "Java" for a test case
Co-authored-by: Michael B. Gale <mbg@github.com>
2026-04-07 09:01:00 -05:00
Mario CamposandMichael B. Gale 14ed573199 Specify "Go" for a test case
Co-authored-by: Michael B. Gale <mbg@github.com>
2026-04-07 09:01:00 -05:00
Mario Campos 43d8864b35 Run npm run lint-fix to format the code 2026-04-07 09:01:00 -05:00
Mario Campos f8aff3ad8b Add tests for getCredentials with multiple goproxy_servers and maven_repositories 2026-04-07 09:01:00 -05:00
Mario Campos e2203c62cf Delete fromJSON() calls in test validation step 2026-03-31 13:19:33 -05:00
Mario Campos 7b0c5b1669 Keep validation steps named consistently 2026-03-31 12:49:07 -05:00
Mario Campos faf45e07f9 Use different maven URL for start-proxy.yml test 2026-03-31 12:44:43 -05:00
Mario Campos 8b5e60477c Use maven_repository, not maven-repository
The registry/language mapping table does not map the one with hyphens.
2026-03-31 11:36:17 -05:00
Mario Campos 99b8dd4d57 Run pr-checks/sync.sh to generate __start-proxy.yml. 2026-03-31 09:32:42 -05:00
Mario Campos 9fd9b64766 Replace jq with Actions expression for proxy_urls validation
For the sake of consistency with the other pre-existing validation code.
2026-03-30 22:47:06 -05:00
Mario Campos 0c7c298b2a Extend start-proxy.yml to test multiple registry support 2026-03-30 18:35:04 -05:00
Mario Campos 07eae6420a Merge pull request #3303 from github/mario-campos/v3-core-warning
Change v3 deprecation message to warning.
2025-11-17 11:35:30 -06:00