Skip to content

Conversation

suztomo
Copy link
Member

@suztomo suztomo commented Sep 27, 2021

Fixes #2568

release-brancher create-pull-request \
  --branch-name="2.3.x" \
  --target-tag="v2.3.4" \
  --repo="<repo-owner>/<repo-name>" \
  --pull-request-title="feat: next release from mainline is 2.4.0"
  --release-type=java-backport

My manual test

It worked

suztomo-macbookpro44% release-brancher create-pull-request --branch-name="1.40.0-sp.4" --target-tag="v1.40.0" --repo="suztomo/google-http-java-client"  --release-type=java-lts-on-patch --pull-request-title="feat: next release from mainline is 1.41.0"
creating branch 1.40.0-sp.4 as SHA f77608fbfb41410a8f62f40bc5a2df256c751d52

Screen Shot 2021-09-28 at 15 58 35

It created suztomo/google-http-java-client#16 and suztomo/google-http-java-client#15


Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #2568 🦕

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 27, 2021
@suztomo suztomo force-pushed the i2568_with_pr_title branch from b3d0f69 to 6f3264a Compare September 27, 2021 22:44
"go-yoshi",
"java-bom",
"java-lts",
"java-lts-on-patch",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is better than "java-lts-no-sp".

@suztomo
Copy link
Member Author

suztomo commented Sep 28, 2021

My command-line fails with trying to create non-existent 'main' branch of my repository (https://api.github.com/repos/suztomo/google-http-java-client/branches/main).

suztomo-macbookpro44% release-brancher create-pull-request --branch-name="1.40.0-sp.2" --target-tag="v1.40.0" --repo="suztomo/google-http-java-client" 
creating branch 1.40.0-sp.2 as SHA f77608fbfb41410a8f62f40bc5a2df256c751d52
Creating a pull request
Creating a pull request with build: configure branch 1.40.0-sp.2 as a release branch
release-brancher create-pull-request

create a new release branch and send pull request to add release configuration

Options:
  --help          Show help                                            [boolean]
  --version       Show version number                                  [boolean]
  --branch-name   name of new branch to create               [string] [required]
  --target-tag    target tag                                 [string] [required]
  --release-type  release-please releaseType                            [string]
  --github-token  GitHub access token                        [string] [required]
  --repo          target repository                          [string] [required]

RequestError [HttpError]: Error creating Pull Request: Branch not found
    at /Users/suztomo/repo-automation-bots/packages/release-brancher/node_modules/@octokit/request/dist-node/index.js:86:21
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async getBranchHead (/Users/suztomo/repo-automation-bots/packages/release-brancher/node_modules/code-suggester/build/src/github/branch.js:37:25)
    at async Object.branch (/Users/suztomo/repo-automation-bots/packages/release-brancher/node_modules/code-suggester/build/src/github/branch.js:107:25)
    at async retry.retries (/Users/suztomo/repo-automation-bots/packages/release-brancher/node_modules/code-suggester/build/src/index.js:105:48)
    at async createPullRequest (/Users/suztomo/repo-automation-bots/packages/release-brancher/node_modules/code-suggester/build/src/index.js:105:24)
    at async Runner.createPullRequest (/Users/suztomo/repo-automation-bots/packages/release-brancher/build/src/release-brancher.js:209:16)
    at async Object.handler (/Users/suztomo/repo-automation-bots/packages/release-brancher/build/src/bin/commands/create-pull-request.js:62:9) {
  status: 404,
  response: {
    url: 'https://api.github.com/repos/suztomo/google-http-java-client/branches/main',
    status: 404,
    headers: {
      'access-control-allow-origin': '*',
      'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
      connection: 'close',
      'content-encoding': 'gzip',
      'content-security-policy': "default-src 'none'",
      'content-type': 'application/json; charset=utf-8',
      date: 'Tue, 28 Sep 2021 02:48:03 GMT',
      'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
      server: 'GitHub.com',
      'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
      'transfer-encoding': 'chunked',
      vary: 'Accept-Encoding, Accept, X-Requested-With',
      'x-accepted-oauth-scopes': '',
      'x-content-type-options': 'nosniff',
      'x-frame-options': 'deny',
      'x-github-media-type': 'github.v3; format=json',
      'x-github-request-id': 'E606:2E20:17E91F1:2C5E15E:61528262',
      'x-oauth-scopes': 'repo, workflow',
      'x-ratelimit-limit': '5000',
      'x-ratelimit-remaining': '4906',
      'x-ratelimit-reset': '1632799091',
      'x-ratelimit-resource': 'core',
      'x-ratelimit-used': '94',
      'x-xss-protection': '0'
    },
    data: {
      message: 'Branch not found',
      documentation_url: 'https://docs.github.com/rest/reference/repos#get-a-branch'
    }
  },
  request: {
    method: 'GET',
    url: 'https://api.github.com/repos/suztomo/google-http-java-client/branches/main',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-rest.js/18.11.1 octokit-core.js/3.5.1 Node.js/15.14.0 (darwin; x64)',
      authorization: 'token [REDACTED]'
    },
    request: { hook: [Function: bound bound register] }
  }
}

@suztomo
Copy link
Member Author

suztomo commented Sep 28, 2021

The default branch name has become "main" from "master" in code-suggester.

https://github.com/googleapis/code-suggester/pull/262/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L144

@suztomo
Copy link
Member Author

suztomo commented Sep 28, 2021

Created #2618 to address the problem.

@suztomo suztomo marked this pull request as ready for review September 28, 2021 15:13
@suztomo suztomo changed the title feat(release-brancher): argument to override pull request title feat(release-brancher): add argument to override pull request title Sep 28, 2021
@suztomo suztomo force-pushed the i2568_with_pr_title branch from 6f3264a to 8f594fa Compare September 28, 2021 19:52
@suztomo suztomo force-pushed the i2568_with_pr_title branch from 8f594fa to 9583104 Compare September 28, 2021 19:54
@suztomo
Copy link
Member Author

suztomo commented Sep 28, 2021

Now #2618 is merged.

}
}
const message = 'feat: configure initial sp version';
const message = 'feat: configure the protected branch';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chingor13 Does "configure initial sp version" have special effect somewhere? In past (https://github.com/googleapis/repo-automation-bots/pull/1674/files#diff-4b2e8d3f62c327048db13c5f552d94303eac7ed241728c5fd5dbc3e5842961c9R327), you updated this message from 'ci: setup workflows for new release branch' to 'feat: configure initial sp version'.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, any releasable commit (feat, fix, etc, will trigger a new library release). For the -sp versions, we wanted to force a release. For the new backport releases, we don't need to force a new release, so ci is probably a better message.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #2622 (review)

"go-yoshi",
"java-bom",
"java-lts",
"java-backport",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it's "java-backport"

@suztomo
Copy link
Member Author

suztomo commented Sep 28, 2021

"ci / docs" failed but I believe it's irrelevant.

rewrite repo to suztomo/repo-automation-bots
Scanning **/*.md
Error: [429] https://www.github.com/googleapis/repo-automation-bots/commit/b6ed87e64d6c7599ab463337c3b0990e21ad7a13
Error: [429] https://www.github.com/googleapis/repo-automation-bots/commit/90430f3024cfd4c502f3001ab90ea585f8b8a85b
Error: [429] https://www.github.com/googleapis/repo-automation-bots/commit/4cb9d40c715a9a795e54711811e509df85174e60
Error: [429] https://www.github.com/googleapis/repo-automation-bots/commit/534e26bce3efb81556c7ce49bb84f2082deb1121
Error: [429] https://www.github.com/googleapis/repo-automation-bots/commit/a99805cacd2c534164c90c90072a1ab72fdccc58
Error: [429] https://www.github.com/googleapis/repo-automation-bots/commit/42e9ffc19ef8f0349b243969a7306129a27b4fa2
Error: [429] https://www.github.com/googleapis/repo-automation-bots/commit/ea93fe27d5401e9ca32e08f50914a03a8712a08b
Error: [429] https://github.com/googleapis/repo-automation-bots/commit/0032e84
Error: [429] https://www.github.com/googleapis/repo-automation-bots/commit/22c17c080235a0c1e93f05fb569004d648115bc0
Scanned total of 399 links!
Error: Detected 9 broken links.
 packages/gcf-utils/CHANGELOG.md
   [429] https://www.github.com/googleapis/repo-automation-bots/commit/b6ed87e64d6c7599ab463337c3b0990e21ad7a13
   [429] https://www.github.com/googleapis/repo-automation-bots/commit/90430f3024cfd4c502f3001ab90ea585f8b8a85b
   [429] https://www.github.com/googleapis/repo-automation-bots/commit/4cb9d40c715a9a795e54711811e509df85174e60
   [429] https://www.github.com/googleapis/repo-automation-bots/commit/534e26bce3efb81556c7ce49bb84f2082deb1121
   [429] https://www.github.com/googleapis/repo-automation-bots/commit/a99805cacd2c534164c90c90072a1ab72fdccc58
   [429] https://www.github.com/googleapis/repo-automation-bots/commit/42e9ffc19ef8f0349b243969a7306129a27b4fa2
   [429] https://www.github.com/googleapis/repo-automation-bots/commit/ea93fe27d5401e9ca32e08f50914a03a8712a08b
   [429] https://github.com/googleapis/repo-automation-bots/commit/0032e84
 packages/label-utils/CHANGELOG.md
   [429] https://www.github.com/googleapis/repo-automation-bots/commit/22c17c080235a0c1e93f05fb569004d648115bc0

@chingor13 chingor13 merged commit 1f952c7 into googleapis:main Sep 28, 2021
gcf-merge-on-green bot pushed a commit that referenced this pull request Sep 28, 2021
🤖 I have created a release \*beep\* \*boop\*
---
<details><summary>@google-cloud/release-brancher: 1.3.0</summary>


### Features

* **release-brancher:** add argument to override pull request title ([#2615](https://www.github.com/googleapis/repo-automation-bots/issues/2615)) ([1f952c7](https://www.github.com/googleapis/repo-automation-bots/commit/1f952c73eba10bc8eedc5c5a16944622b8e84c46))


### Bug Fixes

* **release-brancher:** provide default branch name for PRs ([#2618](https://www.github.com/googleapis/repo-automation-bots/issues/2618)) ([24a15a8](https://www.github.com/googleapis/repo-automation-bots/commit/24a15a89a76e15153f0e6cce2c7d69d97464df5c))
</details>


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
gcf-merge-on-green bot pushed a commit that referenced this pull request Sep 30, 2021
Use "ci: " suffix in the commit message when it creates a workflow pull request for initializing the protected branch. This addresses @chingor13 's comment in #2615 (comment)

Fixes #2568 🦕
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

release-brancher: allow customization of pull request to default branch

3 participants