mirror of
https://github.com/morluto/rea.git
synced 2026-12-04 22:11:12 +00:00
* chore(deps): bump the npm-minor-and-patch group across 2 directories with 38 updates Bumps the npm-minor-and-patch group with 37 updates in the / directory: | Package | From | To | | --- | --- | --- | | [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) | `8.0.4` | `8.1.2` | | [@babel/types](https://github.com/babel/babel/tree/HEAD/packages/babel-types) | `8.0.4` | `8.1.2` | | [@bufbuild/protobuf](https://github.com/bufbuild/protobuf-es/tree/HEAD/packages/protobuf) | `2.16.0` | `2.17.0` | | [@clack/prompts](https://github.com/bombshell-dev/clack/tree/HEAD/packages/prompts) | `1.7.0` | `1.9.0` | | [@zip.js/zip.js](https://github.com/gildas-lormeau/zip.js) | `2.15.0` | `2.25.0` | | [evmole](https://github.com/cdump/evmole/tree/HEAD/javascript) | `0.9.3` | `0.9.4` | | [ignore](https://github.com/kaelzhang/node-ignore) | `7.0.6` | `7.0.14` | | [isomorphic-git](https://github.com/isomorphic-git/isomorphic-git) | `1.38.7` | `1.44.15` | | [lossless-json](https://github.com/josdejong/lossless-json) | `4.3.1` | `4.3.3` | | [parse5](https://github.com/inikulin/parse5) | `8.0.1` | `8.1.1` | | [playwright-core](https://github.com/microsoft/playwright) | `1.64.1` | `1.65.1` | | [plist](https://github.com/TooTallNate/plist.js) | `5.0.0` | `5.1.1` | | [semver](https://github.com/npm/node-semver) | `7.8.5` | `7.8.6` | | [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver) | `7.7.1` | `7.8.0` | | [smol-toml](https://github.com/squirrelchat/smol-toml) | `1.9.0` | `1.9.1` | | [stream-chain](https://github.com/uhop/stream-chain) | `4.2.6` | `4.4.2` | | [stream-json](https://github.com/uhop/stream-json) | `3.7.0` | `3.9.0` | | [ws](https://github.com/websockets/ws) | `8.21.0` | `8.23.0` | | [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) | `8.18.1` | `8.18.2` | | [yaml](https://github.com/eemeli/yaml) | `2.9.0` | `2.9.1` | | [zod](https://github.com/colinhacks/zod) | `4.6.6` | `4.6.7` | | [@electron/asar](https://github.com/electron/asar) | `4.2.0` | `4.3.2` | | [@stryker-mutator/core](https://github.com/stryker-mutator/stryker-js/tree/HEAD/packages/core) | `10.0.0` | `10.1.1` | | [@stryker-mutator/typescript-checker](https://github.com/stryker-mutator/stryker-js/tree/HEAD/packages/typescript-checker) | `10.0.0` | `10.1.1` | | [@stryker-mutator/vitest-runner](https://github.com/stryker-mutator/stryker-js/tree/HEAD/packages/vitest-runner) | `10.0.0` | `10.1.1` | | [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `26.6.4` | `26.6.6` | | [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver) | `7.7.1` | `7.8.0` | | [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) | `8.18.1` | `8.18.2` | | [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) | `5.0.3` | `5.1.0` | | [jscpd](https://github.com/kucherenko/jscpd/tree/HEAD/rust/jscpd) | `5.0.12` | `5.4.3` | | [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip) | `6.39.0` | `6.45.1` | | [oxfmt](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxfmt) | `0.72.0` | `0.79.0` | | [oxlint](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxlint) | `1.87.0` | `1.94.0` | | [oxlint-tsgolint](https://github.com/oxc-project/tsgolint) | `7.0.2005` | `7.0.2007` | | [release-please](https://github.com/googleapis/release-please) | `17.3.0` | `17.11.2` | | [rolldown](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown) | `1.2.12` | `1.3.2` | | [turbo](https://github.com/vercel/turborepo) | `2.11.7` | `2.11.11` | | [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) | `5.0.3` | `5.1.0` | | [frida](https://github.com/frida/frida-node) | `17.23.2` | `17.26.4` | Bumps the npm-minor-and-patch group with 1 update in the /scripts/verify-tools/skills directory: [skills](https://github.com/vercel-labs/skills). Updates `@babel/parser` from 8.0.4 to 8.1.2 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v8.1.2/packages/babel-parser) Updates `@babel/types` from 8.0.4 to 8.1.2 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v8.1.2/packages/babel-types) Updates `@bufbuild/protobuf` from 2.16.0 to 2.17.0 - [Release notes](https://github.com/bufbuild/protobuf-es/releases) - [Commits](https://github.com/bufbuild/protobuf-es/commits/v2.17.0/packages/protobuf) Updates `@clack/prompts` from 1.7.0 to 1.9.0 - [Release notes](https://github.com/bombshell-dev/clack/releases) - [Changelog](https://github.com/bombshell-dev/clack/blob/main/packages/prompts/CHANGELOG.md) - [Commits](https://github.com/bombshell-dev/clack/commits/@clack/prompts@1.9.0/packages/prompts) Updates `@zip.js/zip.js` from 2.15.0 to 2.25.0 - [Release notes](https://github.com/gildas-lormeau/zip.js/releases) - [Commits](https://github.com/gildas-lormeau/zip.js/compare/v2.15.0...v2.25.0) Updates `evmole` from 0.9.3 to 0.9.4 - [Release notes](https://github.com/cdump/evmole/releases) - [Commits](https://github.com/cdump/evmole/commits/0.9.4/javascript) Updates `ignore` from 7.0.6 to 7.0.14 - [Release notes](https://github.com/kaelzhang/node-ignore/releases) - [Commits](https://github.com/kaelzhang/node-ignore/compare/7.0.6...7.0.14) Updates `isomorphic-git` from 1.38.7 to 1.44.15 - [Release notes](https://github.com/isomorphic-git/isomorphic-git/releases) - [Commits](https://github.com/isomorphic-git/isomorphic-git/compare/v1.38.7...v1.44.15) Updates `lossless-json` from 4.3.1 to 4.3.3 - [Changelog](https://github.com/josdejong/lossless-json/blob/main/CHANGELOG.md) - [Commits](https://github.com/josdejong/lossless-json/compare/v4.3.1...v4.3.3) Updates `parse5` from 8.0.1 to 8.1.1 - [Release notes](https://github.com/inikulin/parse5/releases) - [Commits](https://github.com/inikulin/parse5/compare/v8.0.1...v8.1.1) Updates `playwright-core` from 1.64.1 to 1.65.1 - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](https://github.com/microsoft/playwright/compare/v1.64.1...v1.65.1) Updates `plist` from 5.0.0 to 5.1.1 - [Release notes](https://github.com/TooTallNate/plist.js/releases) - [Changelog](https://github.com/TooTallNate/plist.js/blob/master/CHANGELOG.md) - [Commits](https://github.com/TooTallNate/plist.js/compare/plist@5.0.0...plist@5.1.1) Updates `semver` from 7.8.5 to 7.8.6 - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v7.8.5...v7.8.6) Updates `@types/semver` from 7.7.1 to 7.8.0 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver) Updates `smol-toml` from 1.9.0 to 1.9.1 - [Release notes](https://github.com/squirrelchat/smol-toml/releases) - [Commits](https://github.com/squirrelchat/smol-toml/compare/v1.9.0...v1.9.1) Updates `stream-chain` from 4.2.6 to 4.4.2 - [Commits](https://github.com/uhop/stream-chain/compare/4.2.6...4.4.2) Updates `stream-json` from 3.7.0 to 3.9.0 - [Commits](https://github.com/uhop/stream-json/compare/3.7.0...3.9.0) Updates `ws` from 8.21.0 to 8.23.0 - [Release notes](https://github.com/websockets/ws/releases) - [Commits](https://github.com/websockets/ws/compare/8.21.0...8.23.0) Updates `@types/ws` from 8.18.1 to 8.18.2 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws) Updates `yaml` from 2.9.0 to 2.9.1 - [Release notes](https://github.com/eemeli/yaml/releases) - [Commits](https://github.com/eemeli/yaml/compare/v2.9.0...v2.9.1) Updates `zod` from 4.6.6 to 4.6.7 - [Release notes](https://github.com/colinhacks/zod/releases) - [Commits](https://github.com/colinhacks/zod/compare/v4.6.6...v4.6.7) Updates `@electron/asar` from 4.2.0 to 4.3.2 - [Release notes](https://github.com/electron/asar/releases) - [Changelog](https://github.com/electron/asar/blob/main/CHANGELOG.md) - [Commits](https://github.com/electron/asar/compare/v4.2.0...v4.3.2) Updates `@stryker-mutator/core` from 10.0.0 to 10.1.1 - [Release notes](https://github.com/stryker-mutator/stryker-js/releases) - [Changelog](https://github.com/stryker-mutator/stryker-js/blob/master/packages/core/CHANGELOG.md) - [Commits](https://github.com/stryker-mutator/stryker-js/commits/v10.1.1/packages/core) Updates `@stryker-mutator/typescript-checker` from 10.0.0 to 10.1.1 - [Release notes](https://github.com/stryker-mutator/stryker-js/releases) - [Changelog](https://github.com/stryker-mutator/stryker-js/blob/master/packages/typescript-checker/CHANGELOG.md) - [Commits](https://github.com/stryker-mutator/stryker-js/commits/v10.1.1/packages/typescript-checker) Updates `@stryker-mutator/vitest-runner` from 10.0.0 to 10.1.1 - [Release notes](https://github.com/stryker-mutator/stryker-js/releases) - [Changelog](https://github.com/stryker-mutator/stryker-js/blob/master/packages/vitest-runner/CHANGELOG.md) - [Commits](https://github.com/stryker-mutator/stryker-js/commits/v10.1.1/packages/vitest-runner) Updates `@types/node` from 26.6.4 to 26.6.6 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Updates `@types/semver` from 7.7.1 to 7.8.0 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver) Updates `@types/ws` from 8.18.1 to 8.18.2 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws) Updates `@vitest/coverage-v8` from 5.0.3 to 5.1.0 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md) - [Commits](https://github.com/vitest-dev/vitest/commits/v5.1.0/packages/coverage-v8) Updates `jscpd` from 5.0.12 to 5.4.3 - [Release notes](https://github.com/kucherenko/jscpd/releases) - [Commits](https://github.com/kucherenko/jscpd/commits/v5.4.3/rust/jscpd) Updates `knip` from 6.39.0 to 6.45.1 - [Release notes](https://github.com/webpro-nl/knip/releases) - [Commits](https://github.com/webpro-nl/knip/commits/knip@6.45.1/packages/knip) Updates `oxfmt` from 0.72.0 to 0.79.0 - [Release notes](https://github.com/oxc-project/oxc/releases) - [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxfmt/CHANGELOG.md) - [Commits](https://github.com/oxc-project/oxc/commits/oxfmt_v0.79.0/npm/oxfmt) Updates `oxlint` from 1.87.0 to 1.94.0 - [Release notes](https://github.com/oxc-project/oxc/releases) - [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxlint/CHANGELOG.md) - [Commits](https://github.com/oxc-project/oxc/commits/oxlint_v1.94.0/npm/oxlint) Updates `oxlint-tsgolint` from 7.0.2005 to 7.0.2007 - [Release notes](https://github.com/oxc-project/tsgolint/releases) - [Commits](https://github.com/oxc-project/tsgolint/compare/v7.0.2005...v7.0.2007) Updates `release-please` from 17.3.0 to 17.11.2 - [Release notes](https://github.com/googleapis/release-please/releases) - [Changelog](https://github.com/googleapis/release-please/blob/main/CHANGELOG.md) - [Commits](https://github.com/googleapis/release-please/compare/v17.3.0...v17.11.2) Updates `rolldown` from 1.2.12 to 1.3.2 - [Release notes](https://github.com/rolldown/rolldown/releases) - [Changelog](https://github.com/rolldown/rolldown/blob/main/CHANGELOG.md) - [Commits](https://github.com/rolldown/rolldown/commits/v1.3.2/packages/rolldown) Updates `turbo` from 2.11.7 to 2.11.11 - [Release notes](https://github.com/vercel/turborepo/releases) - [Changelog](https://github.com/vercel/turborepo/blob/main/RELEASE.md) - [Commits](https://github.com/vercel/turborepo/compare/v2.11.7...v2.11.11) Updates `vitest` from 5.0.3 to 5.1.0 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md) - [Commits](https://github.com/vitest-dev/vitest/commits/v5.1.0/packages/vitest) Updates `frida` from 17.23.2 to 17.26.4 - [Commits](https://github.com/frida/frida-node/compare/17.23.2...17.26.4) Updates `skills` from 1.7.2 to 1.9.0 - [Release notes](https://github.com/vercel-labs/skills/releases) - [Commits](https://github.com/vercel-labs/skills/compare/v1.7.2...v1.9.0) --- updated-dependencies: - dependency-name: "@babel/parser" dependency-version: 8.1.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@babel/types" dependency-version: 8.1.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@bufbuild/protobuf" dependency-version: 2.17.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@clack/prompts" dependency-version: 1.9.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@electron/asar" dependency-version: 4.3.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@stryker-mutator/core" dependency-version: 10.1.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@stryker-mutator/typescript-checker" dependency-version: 10.1.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@stryker-mutator/vitest-runner" dependency-version: 10.1.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@types/node" dependency-version: 26.6.6 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: "@types/semver" dependency-version: 7.8.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@types/semver" dependency-version: 7.8.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@types/ws" dependency-version: 8.18.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: "@types/ws" dependency-version: 8.18.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: "@vitest/coverage-v8" dependency-version: 5.1.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: "@zip.js/zip.js" dependency-version: 2.25.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: evmole dependency-version: 0.9.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: frida dependency-version: 17.26.4 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: ignore dependency-version: 7.0.14 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: isomorphic-git dependency-version: 1.44.15 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: jscpd dependency-version: 5.4.3 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: knip dependency-version: 6.45.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: lossless-json dependency-version: 4.3.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: oxfmt dependency-version: 0.79.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: oxlint dependency-version: 1.94.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: oxlint-tsgolint dependency-version: 7.0.2007 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: parse5 dependency-version: 8.1.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: playwright-core dependency-version: 1.65.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: plist dependency-version: 5.1.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: release-please dependency-version: 17.11.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: rolldown dependency-version: 1.3.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: semver dependency-version: 7.8.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: skills dependency-version: 1.9.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: smol-toml dependency-version: 1.9.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: stream-chain dependency-version: 4.4.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: stream-json dependency-version: 3.9.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: turbo dependency-version: 2.11.11 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: vitest dependency-version: 5.1.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: ws dependency-version: 8.23.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: npm-minor-and-patch - dependency-name: yaml dependency-version: 2.9.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-and-patch - dependency-name: zod dependency-version: 4.6.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-minor-and-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix(deps): adapt release tooling and capture metadata to the new npm pins * fix(deps): preserve numeric, plist and archive evidence semantics * test(zip): verify malformed compression with CRC checks enabled * fix(capture): preserve exact decimal projections and redaction * test(apple): verify keyed archive controls before altering the trailer * test(lint): cover safe and suggested regex escape fixes * fix(reference): preserve directory exclusion provenance with ignore 7 * docs(examples): refresh HAR evidence identities for the current decoder * fix(reference): preserve metadata failures with strict Git ref reads * chore(config): remove the unused MCP profile type alias --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
323 lines
16 KiB
Diff
323 lines
16 KiB
Diff
--- a/build/src/github-api.js
|
|
+++ b/build/src/github-api.js
|
|
@@ -605,19 +605,47 @@
|
|
* @returns {string} HTML URL of the new file
|
|
*/
|
|
async createFileOnNewBranch(filename, contents, newBranchName, baseBranchName) {
|
|
- // create or update new branch to match base branch
|
|
- await this.forkBranch(newBranchName, baseBranchName);
|
|
- // use the single file upload API
|
|
+ // Preserve existing notes until the replacement file is committed.
|
|
+ // A failed write must not leave an open proposal pointing at a missing file.
|
|
+ if (!(await this.getBranchSha(newBranchName))) {
|
|
+ const baseSha = await this.getBranchSha(baseBranchName);
|
|
+ if (!baseSha) {
|
|
+ throw new Error(`Unable to find base branch: ${baseBranchName}`);
|
|
+ }
|
|
+ await this.createNewBranch(newBranchName, baseSha);
|
|
+ }
|
|
+ let existingSha;
|
|
+ try {
|
|
+ const { data } = await this.octokit.repos.getContent({
|
|
+ owner: this.repository.owner,
|
|
+ repo: this.repository.repo,
|
|
+ path: filename,
|
|
+ ref: newBranchName,
|
|
+ });
|
|
+ if (Array.isArray(data) || data.type !== 'file' || !data.sha) {
|
|
+ throw new Error(`Expected a file at ${filename} on branch: ${newBranchName}`);
|
|
+ }
|
|
+ existingSha = data.sha;
|
|
+ }
|
|
+ catch (error) {
|
|
+ if (!(error && error.status === 404)) {
|
|
+ throw error;
|
|
+ }
|
|
+ }
|
|
const { data: { content }, } = await this.octokit.repos.createOrUpdateFileContents({
|
|
owner: this.repository.owner,
|
|
repo: this.repository.repo,
|
|
path: filename,
|
|
// contents need to be base64 encoded
|
|
- content: Buffer.from(contents, 'binary').toString('base64'),
|
|
+ content: Buffer.from(contents, 'utf8').toString('base64'),
|
|
+ ...(existingSha ? { sha: existingSha } : {}),
|
|
message: 'Saving release notes',
|
|
branch: newBranchName,
|
|
});
|
|
- return (content === null || content === void 0 ? void 0 : content.html_url) || '';
|
|
+ if (!(content === null || content === void 0 ? void 0 : content.html_url)) {
|
|
+ throw new Error(`Failed to write to file: ${filename} on branch: ${newBranchName}`);
|
|
+ }
|
|
+ return content.html_url;
|
|
}
|
|
/**
|
|
* Fork a branch from a base branch.
|
|
--- a/build/src/github.js
|
|
+++ b/build/src/github.js
|
|
@@ -14,6 +14,7 @@
|
|
// limitations under the License.
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.sleepInMs = exports.GitHub = void 0;
|
|
+const graphql_1 = require("@octokit/graphql");
|
|
const request_error_1 = require("@octokit/request-error");
|
|
const code_suggester_1 = require("./util/code-suggester");
|
|
const errors_1 = require("./errors");
|
|
@@ -25,6 +26,7 @@
|
|
const signoff_commit_message_1 = require("./util/signoff-commit-message");
|
|
const git_file_utils_1 = require("@google-automations/git-file-utils");
|
|
const composite_1 = require("./updaters/composite");
|
|
+class IncompleteGitBlobError extends Error {}
|
|
class GitHub {
|
|
constructor(options) {
|
|
var _a;
|
|
@@ -72,14 +74,26 @@
|
|
this.logger.trace('no GraphQL response, retrying');
|
|
}
|
|
catch (err) {
|
|
- if (err.status !== 502) {
|
|
+ // Octokit assigns status 500 to transport failures without an HTTP response.
|
|
+ const disconnected = err instanceof request_error_1.RequestError &&
|
|
+ err.status === 500 && err.response === undefined &&
|
|
+ err.message === 'other side closed';
|
|
+ // These extra retries apply only to commit-history reads.
|
|
+ const retryHistoryError = options?.retryHistoryErrors && (err.status === 504 || disconnected ||
|
|
+ err instanceof graphql_1.GraphqlResponseError &&
|
|
+ err.errors.length > 0 &&
|
|
+ err.errors.every(error => typeof error.message === 'string' &&
|
|
+ error.message.startsWith('Something went wrong while executing your query')));
|
|
+ if (err.status !== 502 && !retryHistoryError) {
|
|
throw err;
|
|
}
|
|
if (maxRetries === 0) {
|
|
this.logger.warn('ran out of retries and response is required');
|
|
throw err;
|
|
}
|
|
- this.logger.info(`received 502 error, ${maxRetries} attempts remaining`);
|
|
+ const failure = disconnected ? 'transport disconnect' :
|
|
+ err.status === 502 || err.status === 504 ? `HTTP ${err.status}` : 'internal GraphQL error';
|
|
+ this.logger.info(`received ${failure}, ${maxRetries} attempts remaining`);
|
|
if (typeof opts.num === 'number') {
|
|
if (maxRetries === 1) {
|
|
this.logger.info('last retry, forcing batch size to 1');
|
|
@@ -163,6 +177,16 @@
|
|
this.repository = options.repository;
|
|
this.octokit = options.octokitAPIs.octokit;
|
|
this.graphql = options.octokitAPIs.graphql;
|
|
+ // Check the parsed response before git-file-utils decodes or caches it.
|
|
+ this.octokit.hook.after('request', (response, request) => {
|
|
+ if (request.method === 'GET' &&
|
|
+ request.url === '/repos/{owner}/{repo}/git/blobs/{file_sha}' &&
|
|
+ (response.data?.encoding !== 'base64' ||
|
|
+ typeof response.data?.content !== 'string' ||
|
|
+ (response.data.size > 0 && response.data.content.length === 0))) {
|
|
+ throw new IncompleteGitBlobError('GitHub Git blob did not include a base64 payload');
|
|
+ }
|
|
+ });
|
|
this.fileCache = new git_file_utils_1.RepositoryFileCache(this.octokit, this.repository);
|
|
this.logger = (_a = options.logger) !== null && _a !== void 0 ? _a : logger_1.logger;
|
|
this.gitHubApi = new github_api_1.GitHubApi({
|
|
@@ -244,8 +268,9 @@
|
|
async mergeCommitsGraphQL(targetBranch, cursor, options = {}) {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
var _l;
|
|
+ const includeFiles = options.includeFiles ?? true;
|
|
this.logger.debug(`Fetching merge commits on branch ${targetBranch} with cursor: ${cursor}`);
|
|
- const query = `query pullRequestsSince($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $targetBranch: String!, $cursor: String) {
|
|
+ const query = `query pullRequestsSince($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $includeFiles: Boolean!, $targetBranch: String!, $cursor: String) {
|
|
repository(owner: $owner, name: $repo) {
|
|
ref(qualifiedName: $targetBranch) {
|
|
target {
|
|
@@ -267,7 +292,7 @@
|
|
mergeCommit {
|
|
oid
|
|
}
|
|
- files(first: $maxFilesChanged) {
|
|
+ files(first: $maxFilesChanged) @include(if: $includeFiles) {
|
|
nodes {
|
|
path
|
|
}
|
|
@@ -305,11 +330,12 @@
|
|
num: (_a = options.batchSize) !== null && _a !== void 0 ? _a : 10,
|
|
targetBranch,
|
|
maxFilesChanged: 100, // max is 100
|
|
+ includeFiles,
|
|
};
|
|
const response = await this.graphqlRequest({
|
|
query,
|
|
...params,
|
|
- });
|
|
+ }, { retryHistoryErrors: true });
|
|
if (!response) {
|
|
this.logger.warn(`Did not receive a response for query: ${query}`, params);
|
|
return null;
|
|
@@ -369,10 +395,12 @@
|
|
title: pullRequest.title,
|
|
body: pullRequest.body,
|
|
labels: pullRequest.labels.nodes.map(node => node.name),
|
|
- files: (((_g = pullRequest.files) === null || _g === void 0 ? void 0 : _g.nodes) || []).map(node => node.path),
|
|
+ ...(includeFiles ? {
|
|
+ files: (((_g = pullRequest.files) === null || _g === void 0 ? void 0 : _g.nodes) || []).map(node => node.path),
|
|
+ } : {}),
|
|
};
|
|
}
|
|
- if (mergePullRequest) {
|
|
+ if (includeFiles && mergePullRequest) {
|
|
if (((_j = (_h = mergePullRequest.files) === null || _h === void 0 ? void 0 : _h.pageInfo) === null || _j === void 0 ? void 0 : _j.hasNextPage) &&
|
|
options.backfillFiles) {
|
|
this.logger.info(`PR #${mergePullRequest.number} has many files, backfilling`);
|
|
@@ -384,7 +412,7 @@
|
|
commit.files = (((_k = mergePullRequest.files) === null || _k === void 0 ? void 0 : _k.nodes) || []).map(node => node.path);
|
|
}
|
|
}
|
|
- else if (options.backfillFiles) {
|
|
+ else if (includeFiles && options.backfillFiles) {
|
|
// In this case, there is no squashed merge commit. This could be a simple
|
|
// merge commit, a rebase merge commit, or a direct commit to the branch.
|
|
// Fallback to fetching the list of commits from the REST API. In the future
|
|
@@ -475,14 +503,27 @@
|
|
*/
|
|
async getFileContentsOnBranch(path, branch) {
|
|
this.logger.debug(`Fetching ${path} from branch ${branch}`);
|
|
- try {
|
|
- return await this.fileCache.getFileContents(path, branch);
|
|
- }
|
|
- catch (e) {
|
|
- if (e instanceof git_file_utils_1.FileNotFoundError) {
|
|
- throw new errors_1.FileNotFoundError(path);
|
|
- }
|
|
- throw e;
|
|
+ for (let attempt = 0; ; attempt++) {
|
|
+ try {
|
|
+ return await this.fileCache.getFileContents(path, branch);
|
|
+ }
|
|
+ catch (e) {
|
|
+ if (e instanceof git_file_utils_1.FileNotFoundError) {
|
|
+ throw new errors_1.FileNotFoundError(path);
|
|
+ }
|
|
+ // Retrying this read is safe even when a release proposal is being updated.
|
|
+ const incompleteBlob = e instanceof IncompleteGitBlobError;
|
|
+ if (incompleteBlob && attempt >= 2) {
|
|
+ throw new Error(`GitHub returned an incomplete Git blob for ${path} on ${branch}`, { cause: e });
|
|
+ }
|
|
+ if ((!incompleteBlob && e?.status !== 504) || attempt >= 2) {
|
|
+ throw e;
|
|
+ }
|
|
+ this.logger.info(incompleteBlob
|
|
+ ? 'Received an incomplete Git blob reading a repository file, retrying'
|
|
+ : 'Received HTTP 504 reading a repository file, retrying');
|
|
+ await (0, exports.sleepInMs)(1000 * (attempt + 1));
|
|
+ }
|
|
}
|
|
}
|
|
async getFileJson(path, branch) {
|
|
--- a/build/src/manifest.js
|
|
+++ b/build/src/manifest.js
|
|
@@ -250,6 +250,14 @@
|
|
releasesFound++;
|
|
}
|
|
}
|
|
+ // A recorded version requires its release boundary, even while a
|
|
+ // concurrent publisher has not created the matching release/tag yet.
|
|
+ for (const path of Object.keys(strategiesByPath)) {
|
|
+ const expectedVersion = this.releasedVersions[path];
|
|
+ if (expectedVersion && expectedVersion.toString() !== '0.0.0' && !releasesByPath[path]) {
|
|
+ throw new Error(`Missing expected release for path ${path} at version ${expectedVersion.toString()}: no matching release or tag found. Refusing to bootstrap an already released package.`);
|
|
+ }
|
|
+ }
|
|
const needsBootstrap = releasesFound < expectedReleases;
|
|
if (releasesFound < expectedReleases) {
|
|
this.logger.warn(`Expected ${expectedReleases} releases, only found ${releasesFound}`);
|
|
@@ -263,9 +271,20 @@
|
|
this.logger.info('Collecting commits since all latest releases');
|
|
const commits = [];
|
|
this.logger.debug(`commit search depth: ${this.commitSearchDepth}`);
|
|
+ // The root receives every commit without path splitting. Node's strategy,
|
|
+ // default changelog and extra-file updaters do not inspect commit.files.
|
|
+ // Keep the general path for exclusions, plugins and other strategies.
|
|
+ const rootConfig = this.repositoryConfig[exports.ROOT_PROJECT_PATH];
|
|
+ const rootOnlyNode = Object.keys(this.repositoryConfig).length === 1 &&
|
|
+ rootConfig?.releaseType === 'node' &&
|
|
+ (!rootConfig.changelogType || rootConfig.changelogType === 'default') &&
|
|
+ (!rootConfig.versioning || ['default', 'always-bump-minor'].includes(rootConfig.versioning)) &&
|
|
+ !rootConfig.excludePaths?.length &&
|
|
+ this.plugins.length === 0;
|
|
const commitGenerator = this.github.mergeCommitIterator(this.targetBranch, {
|
|
maxResults: this.commitSearchDepth,
|
|
- backfillFiles: true,
|
|
+ backfillFiles: !rootOnlyNode,
|
|
+ includeFiles: !rootOnlyNode,
|
|
batchSize: this.commitBatchSize,
|
|
});
|
|
const releaseShas = new Set(Object.values(releaseShasByPath));
|
|
@@ -274,6 +293,7 @@
|
|
// sha => release pull request
|
|
const releasePullRequestsBySha = {};
|
|
let releaseCommitsFound = 0;
|
|
+ let historyBoundaryFound = false;
|
|
for await (const commit of commitGenerator) {
|
|
if (releaseShas.has(commit.sha)) {
|
|
if (commit.pullRequest) {
|
|
@@ -286,14 +306,17 @@
|
|
}
|
|
if (this.lastReleaseSha && this.lastReleaseSha === commit.sha) {
|
|
this.logger.info(`Using configured lastReleaseSha ${this.lastReleaseSha} as last commit.`);
|
|
+ historyBoundaryFound = true;
|
|
break;
|
|
}
|
|
else if (needsBootstrap && commit.sha === this.bootstrapSha) {
|
|
this.logger.info(`Needed bootstrapping, found configured bootstrapSha ${this.bootstrapSha}`);
|
|
+ historyBoundaryFound = true;
|
|
break;
|
|
}
|
|
else if (!needsBootstrap && releaseCommitsFound >= expectedShas) {
|
|
// found enough commits
|
|
+ historyBoundaryFound = true;
|
|
break;
|
|
}
|
|
commits.push({
|
|
@@ -303,16 +326,18 @@
|
|
pullRequest: commit.pullRequest,
|
|
});
|
|
}
|
|
+ if (releaseCommitsFound < expectedShas && !historyBoundaryFound) {
|
|
+ throw new Error(`Incomplete release history: expected ${expectedShas} release boundaries, found ${releaseCommitsFound}. Refusing a partial release proposal.`);
|
|
+ }
|
|
if (releaseCommitsFound < expectedShas) {
|
|
this.logger.warn(`Expected ${expectedShas} commits, only found ${releaseCommitsFound}`);
|
|
}
|
|
// split commits by path
|
|
this.logger.info(`Splitting ${commits.length} commits by path`);
|
|
- const cs = new commit_split_1.CommitSplit({
|
|
+ const splitCommits = rootOnlyNode ? {} : new commit_split_1.CommitSplit({
|
|
includeEmpty: true,
|
|
packagePaths: Object.keys(this.repositoryConfig),
|
|
- });
|
|
- const splitCommits = cs.split(commits);
|
|
+ }).split(commits);
|
|
// limit paths to ones since the last release
|
|
let commitsPerPath = {};
|
|
for (const path in this.repositoryConfig) {
|
|
--- a/build/src/pull-request.d.ts
|
|
+++ b/build/src/pull-request.d.ts
|
|
@@ -6,6 +6,7 @@
|
|
readonly title: string;
|
|
readonly body: string;
|
|
readonly labels: string[];
|
|
- readonly files: string[];
|
|
+ /** Unknown when commit-history file collection is explicitly disabled. */
|
|
+ readonly files?: string[];
|
|
readonly sha?: string;
|
|
}
|
|
--- a/build/src/scm.d.ts
|
|
+++ b/build/src/scm.d.ts
|
|
@@ -15,6 +15,8 @@
|
|
export interface ScmCommitIteratorOptions {
|
|
maxResults?: number;
|
|
backfillFiles?: boolean;
|
|
+ /** Include PR files and permit REST backfill. Defaults to true. */
|
|
+ includeFiles?: boolean;
|
|
batchSize?: number;
|
|
}
|
|
export interface ScmReleaseIteratorOptions {
|