Commit ad0b9cb
authored
remove: test suite and dependencies. (#51)
* style: auto formatting
* style: re-order functions in the update-changelog CI script for readability
* ci: add `context` and `github` params and change functions to `async`.
- Added `context` and `github` params to:
- The main `updateChangelog` function passing them from it's call in the CI step.
- `buildEntry` function
- `formatPRDescription` function.
- The corresponding docblocks.
- Refactored `buildEntry` function so the return statement isn't one long string. Split multiple sections into variables for ease.
- Changed `formatPRDescription` and `buildEntry` functions to be `async`, and their function calls now `await` them.
* ci: update docblocks of the update changelog CI script.
- Remove the `-` in the params description because it's rendered as a bullet point in vscode intellisense.
- Updated the return type of `findOrCreateUnreleased` function.
* build: added dev dependencies to allow prettier to wrap arrays onto multi-lines.
- Added the `prettier-plugin-multiline-arrays` dev dependency to force prettier to wrap arrays onto muliple lines.
- Added the prettier dev dependency because the prettier vscode extension only supports prettier plugins when installed locally in a project.
- Specified the prettier plugin and it's `multilineArraysWrapThreshold` option in the prettierrc.json file to enable the usage of the plugin.
* style: auto formatting
* style: re-ordered functions in the check-changelog-exclusions CI script for readability
* ci: linkify issue/pr reference numbers with proper markdown links.
- Added `linkifyReferences` function to orchestrate all other intermediate functions in order to find issue/pr references, resolve the correct GitHub URLs and linkify them into proper markdown links in the new changelog section. Also added its function call to the `formatPRDescription` function.
- Added `findBareReferences` function to find all bare issue or pr references that aren't already linked within specified text, and collect the unique numbers.
- Added `findClosingKeywordReferences` utils function in the new utils script to find all bare references that are preceded with closing keywords like close(s/d), fix(es/ed), resolve(s/d), and collect the unique numbers.
- Added `resolveClosingKeywordReferenceUrl` function to resolve the closing keyword issue reference URL. It only needs to construct the URL from the context and reference number without an API call since closing keywords always references issues.
- Added `resolveBareReferenceUrl` function to resolve the bare reference URL, using the GitHub REST API to lookup the reference number and determine whether it's an issue or a pull request, and returns the correct URL, or an empty string if errors occurred.
- Updated the changelog CI permissions to include reading issues.
- Updated the "Sparse checkout exclusion script" step in the CI to also checkout the utils script.
- Updated the "Copy changelog script" step in the CI to also copy the utils script to a temp file so it can be imported properly in the temp update-changelog file.
* refactor: cross-file `const` variables moving them to the utils script.
- Moved `TYPE_TO_SECTION` and `INCLUDED_TYPES` const variables from the update-changelog script to the utils script for better organisation of cross-file variables. Updated the references in the update-changelog script to use the `utils` namespace import.
- Changed the `update-changelog` import to `utils` import in the check-changelog-exclusions script.
- Updated the "Sparse checkout exclusion script" step name to "Sparse checkout scripts for PR exclusion checks" in the changelog CI so that it doesn't sound like it's excluding the specified files.
- Removed the update-changelog script from the sparse checkout step in the changelog CI.
* refactor: global variables to be local variables in `checkExclusions` function
- Moved the `ALL_COMMIT_TYPES` and `typeRegex` global variables to be local variables in the `checkExclusions` function of the `check-changelog-exclusions` script. This is because they're not used in any other function so they don't need to be global variables. Also made the `ALL_COMMIT_TYPES` all lowercase. All uppercase should be kept for global variables/constants.
* ci: support auto commenting on closed linked issues after release
- Refactored `findClosingKeywordReferences` utils function to optionally match already linked references via Markdown links with a new `matchMarkdownLinks` param.
- Added new step in the publish CI to comment on closed issues that are referenced in the changelog of the newly released version. This step takes place after the publishing step, and uses the new script file.
- Added new `comment-on-linked-issues` script file for the functionality of finding any reference numbers in the changelog and auto comment on the issues that the new release has been published.
The script has:
- `commentOnLinkedIssues` main function to retrieve the closing issues from the changelog version entry, and add comment on them to let the issue author know that the resolution of the issues has been released in a new version.
This uses the `findClosingKeywordReferences` utils function to retrieve the issue-closing keyword references using the new `matchMarkdownLinks` param as `true`. The script also uses the Octokit GitHub API to create the comment.
- `extractChangelogEntry` function to extract the changelog section for a specified version.
- `commentExists` function to check if a comment already exists for the specific version on the issue. This uses the Octokit GitHub API to paginate through the issue's comments and filters the comments that match the criteria.
- Updated permissions to allow writing issues in the publish CI.
* remove: test suite and dependencies.
The test suite is not used, and the tests are still example files anyway.
- Removed `@types/mocha` and `mocha` dependencies.
- Removed the `test` script from package.json.
- Removed the `Run Extension Tests` configuration from the launch.json.
- Removed the test files: `extension.test.ts` and `index.ts`.
* remove: test suite and dependencies.
The test suite is not used, and the tests are still example files anyway.
- Removed `@types/mocha` and `mocha` dependencies.
- Removed the `test` script from package.json.
- Removed the `Run Extension Tests` configuration from the launch.json.
- Removed the test files: `extension.test.ts` and `index.ts`.1 parent 65cd906 commit ad0b9cb
4 files changed
Lines changed: 1 addition & 64 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 19 | | |
36 | 20 | | |
37 | 21 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
| 133 | + | |
135 | 134 | | |
136 | 135 | | |
137 | | - | |
138 | 136 | | |
139 | 137 | | |
140 | | - | |
141 | 138 | | |
142 | 139 | | |
143 | 140 | | |
| |||
This file was deleted.
This file was deleted.
0 commit comments