@node-core/utils 4.2.1 → 4.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/pr_checker.js CHANGED
@@ -548,6 +548,15 @@ export default class PRChecker {
548
548
  });
549
549
 
550
550
  const totalCommits = afterCommits.length;
551
+ if (totalCommits === 0 && this.pr.timelineItems.updatedAt > reviewDate) {
552
+ // Some commits were pushed, but all the commits have a commit date prior
553
+ // to the last review. It means that either that a long time elapsed
554
+ // between the commit and the push, or that the clock on the dev machine
555
+ // is wrong, or the commit date was forged.
556
+ cli.warn('Something was pushed to the Pull Request branch since the last approving review.');
557
+ return false;
558
+ }
559
+
551
560
  if (totalCommits > 0) {
552
561
  cli.warn('Commits were pushed since the last approving review:');
553
562
  const sliceLength = maxCommits === 0 ? totalCommits : -maxCommits;
@@ -78,7 +78,7 @@ class SecurityReleaseIssue {
78
78
  let reportsContent = '';
79
79
  for (const report of reports.data) {
80
80
  const { id, attributes: { title }, relationships: { severity } } = report;
81
- const reportLevel = severity.data.attributes.rating;
81
+ const reportLevel = severity ? severity.data.attributes.rating : 'TBD';
82
82
  cli.separator();
83
83
  cli.info(`Report: ${id} - ${title} (${reportLevel})`);
84
84
  const include = await cli.prompt(
@@ -23,6 +23,9 @@ query PR($prid: Int!, $owner: String!, $repo: String!) {
23
23
  path
24
24
  }
25
25
  },
26
+ timelineItems(itemTypes: [HEAD_REF_FORCE_PUSHED_EVENT, PULL_REQUEST_COMMIT]) {
27
+ updatedAt
28
+ },
26
29
  title,
27
30
  baseRefName,
28
31
  headRefName,
@@ -5,18 +5,11 @@ import updateVersionNumbers from './updateVersionNumbers.js';
5
5
  import commitUpdate from './commitUpdate.js';
6
6
  import majorUpdate from './majorUpdate.js';
7
7
  import minorUpdate from './minorUpdate.js';
8
- import updateMaintainingDependencies from './updateMaintainingDependencies.js';
9
8
  import updateV8Clone from './updateV8Clone.js';
10
9
 
11
10
  export function major(options) {
12
11
  const tasks = new Listr(
13
- [
14
- updateV8Clone(),
15
- majorUpdate(),
16
- updateMaintainingDependencies(),
17
- commitUpdate(),
18
- updateVersionNumbers()
19
- ],
12
+ [updateV8Clone(), majorUpdate(), commitUpdate(), updateVersionNumbers()],
20
13
  getOptions(options)
21
14
  );
22
15
  return tasks.run(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-core/utils",
3
- "version": "4.2.1",
3
+ "version": "4.2.3",
4
4
  "description": "Utilities for Node.js core collaborators",
5
5
  "type": "module",
6
6
  "engines": {
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "scripts": {
17
17
  "test": "npm run test-unit && npm run lint",
18
- "test-unit": "node --test test/unit",
19
- "test:reporters": "node --test --test-reporter=spec --test-reporter-destination=stdout --test-reporter=@reporters/github --test-reporter-destination=stdout test/unit",
18
+ "test-unit": "node --test test/unit/**",
19
+ "test:reporters": "node --test --test-reporter=spec --test-reporter-destination=stdout --test-reporter=@reporters/github --test-reporter-destination=stdout test/unit/**",
20
20
  "coverage": "c8 --reporter=html --reporter=text --reporter=text-summary npm test",
21
21
  "coverage:ci": "c8 --reporter=lcov --reporter=text --reporter=text-summary npm run test:reporters",
22
22
  "lint": "eslint . --cache",
@@ -44,7 +44,7 @@
44
44
  "clipboardy": "^4.0.0",
45
45
  "core-validate-commit": "^4.0.0",
46
46
  "figures": "^6.0.1",
47
- "ghauth": "^5.0.1",
47
+ "ghauth": "^6.0.0",
48
48
  "inquirer": "^9.2.11",
49
49
  "js-yaml": "^4.1.0",
50
50
  "listr2": "^7.0.2",
@@ -1,34 +0,0 @@
1
- import { promises as fs } from 'node:fs';
2
- import { getNodeV8Version } from './util.js';
3
-
4
- export default function updateMaintainingDependencies() {
5
- return {
6
- title: 'Update V8 version in maintaining-dependencies.md',
7
- task: async(ctx) => {
8
- const path = `${ctx.nodeDir}/doc/contributing/maintaining/maintaining-dependencies.md`;
9
- let maintainingDependenciesMd = await fs.readFile(path, 'utf8');
10
- const v8Version = (await getNodeV8Version(ctx.nodeDir)).toString();
11
- const v8VersionNoDots = v8Version.replaceAll('.', '');
12
- // V8 itemlist link
13
- maintainingDependenciesMd = maintainingDependenciesMd.replace(
14
- /\* \[V8.*/,
15
- `* [V8 ${v8Version}][]`
16
- );
17
- // V8 link to section
18
- maintainingDependenciesMd = maintainingDependenciesMd.replace(
19
- /\[v8.*\]: #v8.*/,
20
- `[v8 ${v8Version}]: #v8-${v8VersionNoDots}`
21
- );
22
- // V8 section title
23
- maintainingDependenciesMd = maintainingDependenciesMd.replace(
24
- /### V8.*/,
25
- `### V8 ${v8Version}`
26
- );
27
- await fs.writeFile(path, maintainingDependenciesMd);
28
- await ctx.execGitNode(
29
- 'add',
30
- ['doc/contributing/maintaining/maintaining-dependencies.md']
31
- );
32
- }
33
- };
34
- };