Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Commit

Permalink
build!: update library to use Node 12 (#595)
Browse files Browse the repository at this point in the history
* build!: Update library to use Node 12

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
sofisl and gcf-owl-bot[bot] authored May 19, 2022
1 parent d651386 commit a10f39d
Show file tree
Hide file tree
Showing 32 changed files with 68 additions and 197 deletions.
2 changes: 1 addition & 1 deletion .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ branchProtectionRules:
- "ci/kokoro: System test"
- docs
- lint
- test (10)
- test (12)
- test (14)
- test (16)
- cla/google
- windows
- OwlBot Post Processor
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12, 14]
node: [12, 14, 16]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
34 changes: 0 additions & 34 deletions .kokoro/continuous/node10/common.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions .kokoro/continuous/node10/docs.cfg

This file was deleted.

9 changes: 0 additions & 9 deletions .kokoro/continuous/node10/test.cfg

This file was deleted.

24 changes: 0 additions & 24 deletions .kokoro/continuous/node8/common.cfg

This file was deleted.

Empty file removed .kokoro/continuous/node8/test.cfg
Empty file.
34 changes: 0 additions & 34 deletions .kokoro/presubmit/node10/common.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions .kokoro/presubmit/node10/docs.cfg

This file was deleted.

4 changes: 0 additions & 4 deletions .kokoro/presubmit/node10/lint.cfg

This file was deleted.

Empty file removed .kokoro/presubmit/node10/test.cfg
Empty file.
24 changes: 0 additions & 24 deletions .kokoro/presubmit/node8/common.cfg

This file was deleted.

Empty file removed .kokoro/presubmit/node8/test.cfg
Empty file.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"repository": "googleapis/github-repo-automation",
"description": "A tool for automating multiple GitHub repositories.",
"engines": {
"node": ">=10.0.0"
"node": ">=12.0.0"
},
"bin": {
"repo": "build/src/cli.js"
Expand Down Expand Up @@ -33,19 +33,20 @@
"devDependencies": {
"@compodoc/compodoc": "^1.1.11",
"@types/js-yaml": "^4.0.0",
"@types/meow": "^6.0.0",
"@types/mocha": "^9.0.0",
"@types/node": "^16.0.0",
"@types/proxyquire": "^1.3.28",
"@types/sinon": "^10.0.0",
"@types/update-notifier": "^5.0.0",
"c8": "^7.1.0",
"gts": "^3.0.0",
"gts": "^3.1.0",
"linkinator": "^2.0.4",
"mocha": "^8.0.0",
"mocha": "^9.2.2",
"nock": "^13.0.0",
"proxyquire": "^2.1.3",
"sinon": "^14.0.0",
"typescript": "~3.8.3"
"typescript": "^4.6.4"
},
"scripts": {
"lint": "gts check",
Expand Down
2 changes: 1 addition & 1 deletion samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"license": "Apache-2.0",
"author": "Google LLC",
"engines": {
"node": ">=8"
"node": ">=12.0.0"
},
"files": [
"*.js"
Expand Down
2 changes: 1 addition & 1 deletion src/approve-prs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function processMethod(repository: GitHubRepository, pr: PullRequest) {
return true;
}

export async function approve(cli: meow.Result<typeof meowFlags>) {
export async function approve(cli: meow.Result<meow.AnyFlags>) {
return processPRs(cli, {
commandName: 'approve',
commandNamePastTense: 'approved',
Expand Down
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const meowFlags: {
author: {type: 'string'},
yespleasedoit: {type: 'boolean'},
};
const meowOptions: meow.Options<typeof meowFlags> = {
const meowOptions: meow.Options<meow.AnyFlags> = {
flags: meowFlags,
};

Expand Down
18 changes: 9 additions & 9 deletions src/lib/asyncItemIterator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function retryException<T>(
return result;
} catch (err) {
if (i < retryStrategy.length) {
debug(`operation failed: ${err.toString()}`);
debug(`operation failed: ${(err as Error).toString()}`);
const delay = nextDelay(retryStrategy[i]);
debug(`retrying in ${delay}ms`);
await delayMs(delay);
Expand Down Expand Up @@ -99,15 +99,15 @@ export interface PRIteratorOptions extends IteratorOptions {
processMethod: (
repository: GitHubRepository,
item: PullRequest,
cli: meow.Result<typeof meowFlags>
cli: meow.Result<meow.AnyFlags>
) => Promise<boolean>;
}

export interface IssueIteratorOptions extends IteratorOptions {
processMethod: (
repository: GitHubRepository,
item: Issue,
cli: meow.Result<typeof meowFlags>
cli: meow.Result<meow.AnyFlags>
) => Promise<boolean>;
}

Expand All @@ -126,7 +126,7 @@ export interface IteratorOptions {
* @param {string[]} args Command line arguments.
*/
async function process(
cli: meow.Result<typeof meowFlags>,
cli: meow.Result<meow.AnyFlags>,
options: PRIteratorOptions | IssueIteratorOptions,
processIssues = false
) {
Expand Down Expand Up @@ -206,9 +206,9 @@ async function process(
scanned++;
orb1.text = `[${scanned}/${repos.length}] Scanning repos for PRs`;
} catch (err) {
error = `cannot list open ${
processIssues ? 'issue' : 'PR'
}s: ${err.toString()}`;
error = `cannot list open ${processIssues ? 'issue' : 'PR'}s: ${(
err as Error
).toString()}`;
}
};
})
Expand Down Expand Up @@ -343,15 +343,15 @@ async function process(

// Shorthand for processing list of PRs:
export async function processPRs(
cli: meow.Result<typeof meowFlags>,
cli: meow.Result<meow.AnyFlags>,
options: PRIteratorOptions | IssueIteratorOptions
) {
return process(cli, options, false);
}

// Shorthand for processing list of issues:
export async function processIssues(
cli: meow.Result<typeof meowFlags>,
cli: meow.Result<meow.AnyFlags>,
options: PRIteratorOptions | IssueIteratorOptions
) {
return process(cli, options, true);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/update-file-in-branch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function processRepository(
} catch (err) {
console.warn(
' cannot get file, skipping this repository:',
err.toString()
(err as Error).toString()
);
return;
}
Expand Down Expand Up @@ -75,7 +75,7 @@ async function processRepository(
} catch (err) {
console.warn(
` cannot commit file ${path} to branch ${branch}, skipping this repository:`,
err.toString()
(err as Error).toString()
);
return;
}
Expand Down
12 changes: 6 additions & 6 deletions src/lib/update-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function processRepository(
} catch (err) {
console.warn(
' cannot get file, skipping this repository:',
err.toString()
(err as Error).toString()
);
return;
}
Expand All @@ -74,7 +74,7 @@ async function processRepository(
} catch (err) {
console.warn(
' cannot get sha of latest commit, skipping this repository:',
err.toString()
(err as Error).toString()
);
return;
}
Expand All @@ -85,7 +85,7 @@ async function processRepository(
} catch (err) {
console.warn(
` cannot create branch ${branch}, skipping this repository:`,
err.toString()
(err as Error).toString()
);
return;
}
Expand All @@ -101,7 +101,7 @@ async function processRepository(
} catch (err) {
console.warn(
` cannot commit file ${path} to branch ${branch}, skipping this repository:`,
err.toString()
(err as Error).toString()
);
return;
}
Expand All @@ -112,7 +112,7 @@ async function processRepository(
} catch (err) {
console.warn(
` cannot create pull request for branch ${branch} -> base ${repository.baseBranch}! Branch is still there.`,
err.toString()
(err as Error).toString()
);
return;
}
Expand All @@ -125,7 +125,7 @@ async function processRepository(
} catch (err) {
console.warn(
` cannot request review for pull request #${pullRequestNumber}! Pull request is still there.`,
err.toString()
(err as Error).toString()
);
return;
}
Expand Down
Loading

0 comments on commit a10f39d

Please sign in to comment.