Skip to content

Commit 09e7383

Browse files
committed
chore: merge main and resolve the conflicts
2 parents cb1d8bd + 9781e3c commit 09e7383

18 files changed

Lines changed: 39 additions & 119 deletions

‎CHANGELOG.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.26.0]
11+
1012
### Changed
1113

1214
- `merge-approved-pr` only merges when a release-team member approved the current head commit, and the head branch is in the same repository ([#324](https://github.com/MetaMask/github-tools/pull/324))
@@ -351,7 +353,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
351353
- Some inputs were renamed for consistency across actions.
352354
- Bump `actions/checkout` and `actions/setup-node` to `v6` ([#173](https://github.com/MetaMask/github-tools/pull/173))
353355

354-
[Unreleased]: https://github.com/MetaMask/github-tools/compare/v1.25.0...HEAD
356+
[Unreleased]: https://github.com/MetaMask/github-tools/compare/v1.26.0...HEAD
357+
[1.26.0]: https://github.com/MetaMask/github-tools/compare/v1.25.0...v1.26.0
355358
[1.25.0]: https://github.com/MetaMask/github-tools/compare/v1.24.0...v1.25.0
356359
[1.24.0]: https://github.com/MetaMask/github-tools/compare/v1.23.0...v1.24.0
357360
[1.23.0]: https://github.com/MetaMask/github-tools/compare/v1.22.2...v1.23.0

‎oxlint-suppressions.json‎

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -312,111 +312,16 @@
312312
"count": 1
313313
}
314314
},
315-
"src/cache-utils.ts": {
316-
"jsdoc/require-returns": {
317-
"count": 1
318-
}
319-
},
320-
"src/changelog-check.mts": {
321-
"typescript/explicit-function-return-type": {
322-
"count": 1
323-
},
324-
"typescript/no-unsafe-argument": {
325-
"count": 1
326-
},
327-
"typescript/no-unsafe-member-access": {
328-
"count": 1
329-
}
330-
},
331-
"src/error-utils.ts": {
332-
"typescript/explicit-function-return-type": {
333-
"count": 1
334-
}
335-
},
336-
"src/fs-utils.ts": {
337-
"typescript/no-unsafe-return": {
338-
"count": 1
339-
}
340-
},
341315
"src/get-review-metrics.ts": {
342-
"jsdoc/require-returns": {
343-
"count": 1
344-
},
345-
"typescript/explicit-function-return-type": {
346-
"count": 1
347-
},
348-
"typescript/no-unnecessary-type-assertion": {
349-
"count": 1
350-
},
351-
"typescript/no-unsafe-argument": {
352-
"count": 1
353-
},
354-
"typescript/no-unsafe-assignment": {
355-
"count": 1
356-
},
357-
"typescript/no-unsafe-member-access": {
358-
"count": 1
359-
}
360-
},
361-
"src/github/octokit.ts": {
362-
"jsdoc/require-returns": {
363-
"count": 1
364-
}
365-
},
366-
"src/scripts/count-references-to-contributor-docs/cli.ts": {
367-
"typescript/explicit-function-return-type": {
368-
"count": 1
369-
}
370-
},
371-
"src/segment-schema-draft-pr/analytics-model.ts": {
372-
"unicorn/no-useless-undefined": {
373-
"count": 1
374-
}
375-
},
376-
"src/segment-schema-draft-pr/apply-changes.ts": {
377-
"import/consistent-type-specifier-style": {
378-
"count": 1
379-
},
380-
"typescript/explicit-function-return-type": {
381-
"count": 1
382-
},
383316
"typescript/no-unnecessary-type-assertion": {
384-
"count": 2
385-
}
386-
},
387-
"src/segment-schema-draft-pr/cli.ts": {
388-
"import/consistent-type-specifier-style": {
389317
"count": 1
390318
}
391319
},
392-
"src/segment-schema-draft-pr/diff-models.ts": {
393-
"typescript/no-unsafe-assignment": {
394-
"count": 6
395-
}
396-
},
397-
"src/segment-schema-draft-pr/generate.test.ts": {
398-
"typescript/return-await": {
399-
"count": 2
400-
}
401-
},
402320
"src/segment-schema-draft-pr/github-output.ts": {
403321
"node/no-sync": {
404322
"count": 1
405323
}
406324
},
407-
"src/segment-schema-draft-pr/publish.test.ts": {
408-
"import/consistent-type-specifier-style": {
409-
"count": 1
410-
},
411-
"typescript/no-unsafe-member-access": {
412-
"count": 1
413-
}
414-
},
415-
"src/segment-schema-draft-pr/schema-index.ts": {
416-
"typescript/no-unnecessary-type-assertion": {
417-
"count": 2
418-
}
419-
},
420325
"yarn.config.cjs": {
421326
"import/unambiguous": {
422327
"count": 1

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/github-tools",
3-
"version": "1.25.0",
3+
"version": "1.26.0",
44
"private": true,
55
"description": "Tools for interacting with the GitHub API to do metrics gathering",
66
"repository": {

‎src/cache-utils.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const DEFAULT_MAX_AGE = 60 * 60 * 1000; // 1 hour
2828
* considered "fresh". Affects subsequent calls: if `fetchOrPopulateFileCache`
2929
* is called again with the same file path within the duration specified here,
3030
* `getDataToCache` will not get called again, otherwise it will.
31+
* @returns The cached data if it is fresh, otherwise the newly generated data.
3132
*/
3233
export async function fetchOrPopulateFileCache<Data extends Json>({
3334
filePath,

‎src/changelog-check.mts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ async function getChangedPackages(
529529
/**
530530
* Main function to run the changelog check.
531531
*/
532-
async function main() {
532+
async function main(): Promise<void> {
533533
// Parse command-line arguments
534534
const args = process.argv.slice(2);
535535

@@ -623,7 +623,7 @@ async function main() {
623623
}
624624
}
625625

626-
main().catch((error) => {
626+
main().catch((error: { message: string }) => {
627627
logError(error.message);
628628
// eslint-disable-next-line n/no-process-exit
629629
process.exit(1);

‎src/error-utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function isErrorWithCode(error: unknown): error is { code: string } {
4141
* something throwable).
4242
* @returns A new error object.
4343
*/
44-
export function wrapError(message: string, originalError: unknown) {
44+
export function wrapError(message: string, originalError: unknown): Error {
4545
if (isError(originalError)) {
4646
const error: Error & { code?: string } = new Error(message, {
4747
cause: originalError,

‎src/fs-utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export async function readJsonFile<Value extends Json>(
5454
): Promise<Value> {
5555
try {
5656
const content = await readFile(filePath);
57-
return JSON.parse(content);
57+
return JSON.parse(content) as Value;
5858
} catch (error) {
5959
throw wrapError(`Could not read JSON file '${filePath}'`, error);
6060
}

‎src/get-review-metrics.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ const pullRequests: {
3333
* Get all review comments for the repository specified.
3434
*
3535
* @param page - The page number of results to fetch.
36+
* @returns Whether the last page of results has been reached.
3637
*/
37-
async function getAllComments(page = 1) {
38+
async function getAllComments(page = 1): Promise<boolean> {
3839
const { data } = await octokit.rest.pulls.listReviewCommentsForRepo({
3940
owner: 'MetaMask',
4041
repo: 'metamask-extension',
@@ -75,7 +76,9 @@ async function execute(): Promise<void> {
7576
});
7677
const pulls = Object.keys(pullRequests);
7778
for (const pull of pulls) {
78-
const { data } = await octokit.request(pull);
79+
const { data } = (await octokit.request(pull)) as {
80+
data: { user: { login: string } };
81+
};
7982
if (TEAM.includes(data.user.login) && pullRequests[pull]) {
8083
(pullRequests[pull] as PullRequestData).isInternal = true;
8184
}

‎src/github/octokit.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { getRequiredEnvironmentVariable } from '../env-utils';
99
*
1010
* @param args - The same arguments that
1111
* [`graphql`](https://github.com/octokit/graphql.js) takes.
12+
* @returns The response data of the GraphQL request.
1213
*/
1314
export async function graphql<ResponseData>(
1415
...args: Parameters<typeof octokitGraphql>

‎src/scripts/count-references-to-contributor-docs/cli.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ main().catch(console.error);
3030
* This script counts the number of references to the `contributor-docs` repo
3131
* across a selection of MetaMask repositories.
3232
*/
33-
async function main() {
33+
async function main(): Promise<void> {
3434
const spinner = ora();
3535

3636
console.log(

0 commit comments

Comments
 (0)