Compare commits

...

11 Commits

Author SHA1 Message Date
Thomas Boop
3cc1237663 Merge pull request #670 from actions/thboop/node16upgrade
Update default runtime to node16
2022-02-28 16:18:50 -05:00
Thomas Boop
76e9fbc6ae update node version 2022-02-10 14:40:59 -05:00
Thomas Boop
6467b96231 Update default runtime to node16
Node 12 has an end of life on April 30, 2022.

This PR updates the default runtime to [node16](https://github.blog/changelog/2021-12-10-github-actions-github-hosted-runners-now-run-node-js-16-by-default/), rather then node12. 

This is supported on all Actions Runners v2.285.0 or later.
2022-02-07 14:05:30 -05:00
dependabot[bot]
8af60513da build(deps-dev): bump jest-circus from 27.2.0 to 27.4.6 (#665)
Bumps [jest-circus](https://github.com/facebook/jest/tree/HEAD/packages/jest-circus) from 27.2.0 to 27.4.6.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v27.4.6/packages/jest-circus)

---
updated-dependencies:
- dependency-name: jest-circus
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-04 09:55:05 -05:00
m.bell
7a7efcae1f Fix per issue operation count (#662)
* Fix per issue operation count

* Run pack
2022-02-04 09:54:35 -05:00
dependabot[bot]
04a1828bc1 build(deps-dev): bump ts-jest from 27.0.5 to 27.1.2 (#641)
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 27.0.5 to 27.1.2.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v27.0.5...v27.1.2)

---
updated-dependencies:
- dependency-name: ts-jest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-29 19:52:14 +03:00
dependabot[bot]
65ca3956bd build(deps-dev): bump eslint-plugin-jest from 24.4.2 to 25.3.2 (#639)
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 24.4.2 to 25.3.2.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v24.4.2...v25.3.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-jest
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-29 16:55:51 +03:00
dependabot[bot]
eee276c280 build(deps-dev): bump prettier from 2.4.1 to 2.5.1 (#628)
Bumps [prettier](https://github.com/prettier/prettier) from 2.4.1 to 2.5.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.4.1...2.5.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-29 14:23:59 +03:00
MaksimZhukov
6c2f9f3f54 Merge pull request #640 from dmitry-shibanov/v-dmshib/fix-check-dist
Fix check-dist.yml
2021-12-29 13:36:23 +03:00
Dmitry Shibanov
37323f14dd fix check-dist.yml 2021-12-29 12:56:54 +03:00
Luke Tomlinson
3be940e59b Merge pull request #627 from actions/prep-release
Bump release to 4.1.0
2021-12-10 15:00:13 -05:00
7 changed files with 689 additions and 555 deletions

View File

@@ -23,16 +23,18 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set Node.js 12.x - name: Set Node.js 16.x
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 12.x node-version: 16.x
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
- name: Rebuild the dist/ directory - name: Rebuild the dist/ directory
run: npm run build run: |
npm run build
npm run pack
- name: Compare the expected and actual dist/ directories - name: Compare the expected and actual dist/ directories
run: | run: |

View File

@@ -9,7 +9,7 @@ export class IssuesProcessorMock extends IssuesProcessor {
options: IIssuesProcessorOptions, options: IIssuesProcessorOptions,
getIssues?: (page: number) => Promise<Issue[]>, getIssues?: (page: number) => Promise<Issue[]>,
listIssueComments?: ( listIssueComments?: (
issueNumber: number, issue: Issue,
sinceDate: string sinceDate: string
) => Promise<IComment[]>, ) => Promise<IComment[]>,
getLabelCreationDate?: ( getLabelCreationDate?: (

View File

@@ -198,5 +198,5 @@ outputs:
staled-issues-prs: staled-issues-prs:
description: 'List of all staled issues and pull requests.' description: 'List of all staled issues and pull requests.'
runs: runs:
using: 'node12' using: 'node16'
main: 'dist/index.js' main: 'dist/index.js'

10
dist/index.js vendored
View File

@@ -613,17 +613,17 @@ class IssuesProcessor {
}); });
} }
// Grab comments for an issue since a given date // Grab comments for an issue since a given date
listIssueComments(issueNumber, sinceDate) { listIssueComments(issue, sinceDate) {
var _a; var _a;
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
// Find any comments since date on the given issue // Find any comments since date on the given issue
try { try {
this.operations.consumeOperation(); this._consumeIssueOperation(issue);
(_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementFetchedItemsCommentsCount(); (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementFetchedItemsCommentsCount();
const comments = yield this.client.issues.listComments({ const comments = yield this.client.issues.listComments({
owner: github_1.context.repo.owner, owner: github_1.context.repo.owner,
repo: github_1.context.repo.repo, repo: github_1.context.repo.repo,
issue_number: issueNumber, issue_number: issue.number,
since: sinceDate since: sinceDate
}); });
return comments.data; return comments.data;
@@ -763,7 +763,7 @@ class IssuesProcessor {
return true; return true;
} }
// find any comments since the date // find any comments since the date
const comments = yield this.listIssueComments(issue.number, sinceDate); const comments = yield this.listIssueComments(issue, sinceDate);
const filteredComments = comments.filter(comment => comment.user.type === 'User' && const filteredComments = comments.filter(comment => comment.user.type === 'User' &&
comment.body.toLowerCase() !== staleMessage.toLowerCase()); comment.body.toLowerCase() !== staleMessage.toLowerCase());
issueLogger.info(`Comments that are not the stale comment or another bot: ${logger_service_1.LoggerService.cyan(filteredComments.length)}`); issueLogger.info(`Comments that are not the stale comment or another bot: ${logger_service_1.LoggerService.cyan(filteredComments.length)}`);
@@ -1014,7 +1014,7 @@ class IssuesProcessor {
issueLogger.info(`Adding all the labels specified via the ${this._logger.createOptionLink(option_1.Option.LabelsToAddWhenUnstale)} option.`); issueLogger.info(`Adding all the labels specified via the ${this._logger.createOptionLink(option_1.Option.LabelsToAddWhenUnstale)} option.`);
this.addedLabelIssues.push(issue); this.addedLabelIssues.push(issue);
try { try {
this.operations.consumeOperation(); this._consumeIssueOperation(issue);
(_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementAddedItemsLabel(issue); (_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementAddedItemsLabel(issue);
if (!this.options.debugOnly) { if (!this.options.debugOnly) {
yield this.client.issues.addLabels({ yield this.client.issues.addLabels({

1204
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -54,15 +54,15 @@
"ansi-styles": "5.2.0", "ansi-styles": "5.2.0",
"eslint": "^7.28.0", "eslint": "^7.28.0",
"eslint-plugin-github": "^4.1.2", "eslint-plugin-github": "^4.1.2",
"eslint-plugin-jest": "^24.4.2", "eslint-plugin-jest": "^25.3.2",
"jest": "^27.2.5", "jest": "^27.2.5",
"jest-circus": "^27.2.0", "jest-circus": "^27.4.6",
"jest-silent-reporter": "^0.5.0", "jest-silent-reporter": "^0.5.0",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"prettier": "^2.4.1", "prettier": "^2.5.1",
"standard-version": "^9.3.1", "standard-version": "^9.3.1",
"terminal-link": "^2.1.1", "terminal-link": "^2.1.1",
"ts-jest": "^27.0.5", "ts-jest": "^27.1.2",
"typescript": "^4.3.2" "typescript": "^4.3.2"
} }
} }

View File

@@ -510,17 +510,17 @@ export class IssuesProcessor {
// Grab comments for an issue since a given date // Grab comments for an issue since a given date
async listIssueComments( async listIssueComments(
issueNumber: Readonly<number>, issue: Readonly<Issue>,
sinceDate: Readonly<string> sinceDate: Readonly<string>
): Promise<IComment[]> { ): Promise<IComment[]> {
// Find any comments since date on the given issue // Find any comments since date on the given issue
try { try {
this.operations.consumeOperation(); this._consumeIssueOperation(issue);
this.statistics?.incrementFetchedItemsCommentsCount(); this.statistics?.incrementFetchedItemsCommentsCount();
const comments = await this.client.issues.listComments({ const comments = await this.client.issues.listComments({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
issue_number: issueNumber, issue_number: issue.number,
since: sinceDate since: sinceDate
}); });
return comments.data; return comments.data;
@@ -734,7 +734,7 @@ export class IssuesProcessor {
} }
// find any comments since the date // find any comments since the date
const comments = await this.listIssueComments(issue.number, sinceDate); const comments = await this.listIssueComments(issue, sinceDate);
const filteredComments = comments.filter( const filteredComments = comments.filter(
comment => comment =>
@@ -1065,7 +1065,7 @@ export class IssuesProcessor {
this.addedLabelIssues.push(issue); this.addedLabelIssues.push(issue);
try { try {
this.operations.consumeOperation(); this._consumeIssueOperation(issue);
this.statistics?.incrementAddedItemsLabel(issue); this.statistics?.incrementAddedItemsLabel(issue);
if (!this.options.debugOnly) { if (!this.options.debugOnly) {
await this.client.issues.addLabels({ await this.client.issues.addLabels({