app icon indicating copy to clipboard operation
app copied to clipboard

Add support for new GitHub feature

Open zer0Kerbal opened this issue 3 years ago • 11 comments

suggest updating pull request branches is a recent addition. I skimmed probot's documentation, PR's and issues and didn't find it reference.

thank you!

located under

  • Settings
    • Pull Requests
      • Control how and when users are prompted to update their branches if there are new changes available in the base branch.
      • Whenever there are new changes available in the base branch, present an “update branch” option in the pull request.
        • [ ] Always suggest updating pull request branches

zer0Kerbal avatar Mar 31 '22 06:03 zer0Kerbal

keep your pull request branch up-to-date (aka Managing suggestions to update pull request branches) lacks of REST API which is utilized by ProBot Settings.

electriquo avatar Apr 18 '22 15:04 electriquo

Probably, it works but it is not documented? -> https://github.com/google/go-github/pull/2313

I tested using github-cli in one of my repos, and it is working (same for allow_auto_merge):

OR="myORG/myREPO"
gh api \
  --method PATCH \
  -H "Accept: application/vnd.github.v3+json" \
  /repos/"${OR}" \
  -F allow_update_branch=true

Except:

Default to PR title for squash merge commits This will pre-populate the commit message with the PR title when performing a squash merge.

I see how the web UI works, and it is using the same URL (https://github.com/ORG/repos/settings/update_merge_settings) adding a new element squash_pr_title but I do not know the GitHub API id (I tested with squash_pr_title and allow_squash_pr_title, but do not work)

svg153 avatar May 19 '22 11:05 svg153

+1 for this feature. does it still lack REST API?

dgokcin avatar Jun 22 '22 08:06 dgokcin

The parameter is called use_squash_pr_title_as_default as per GitHub's OpenAPI spec

Either true to allow squash-merge commits to use pull request title, or false to use commit message.

gr2m avatar Jun 22 '22 08:06 gr2m

The parameter is called use_squash_pr_title_as_default as per GitHub's OpenAPI spec

Either true to allow squash-merge commits to use pull request title, or false to use commit message.

👌. Released in the last version of octokit.js_v1.8.0

svg153 avatar Jun 22 '22 08:06 svg153

@gr2m I am referring to "Always suggest updating pull request branches" feature. I believe what you are talking about is something different.

dgokcin avatar Jun 22 '22 08:06 dgokcin

I'm not seeing a REST API parameter for that feature yet, sorry. I didn't check the GraphQL schema though, sometimes it has features that the REST API does not, and vice versa

gr2m avatar Jun 22 '22 08:06 gr2m

I'm not seeing a REST API parameter for that feature yet, sorry. I didn't check the GraphQL schema though, sometimes it has features that the REST API does not, and vice versa

Have you seen this rest/repos/repos#update-a-repository ?

image

Other links:

  • https://github.com/octokit/types.ts/blob/master/scripts/update-endpoints/generated/endpoints.json#L12868
  • https://github.com/octokit/openapi/blob/0e636a10f9872a0ee0d633039e21ecef6b0caef2/generated/ghes-3.3-diff-to-ghes-3.4.json#L5432
GitHub
Shared TypeScript definitions for Octokit projects - types.ts/endpoints.json at master · octokit/types.ts
GitHub
GitHub's official OpenAPI spec with Octokit extensions - openapi/ghes-3.3-diff-to-ghes-3.4.json at 0e636a10f9872a0ee0d633039e21ecef6b0caef2 · octokit/openapi

svg153 avatar Jun 22 '22 09:06 svg153

@svg153 does this mean that it is doable with the current version of the probot settings or there is a development effort for this functionality to work?

dgokcin avatar Jun 22 '22 09:06 dgokcin

@dgokcin if it has a rest api for the repos, then it is already supported by probot settings.

electriquo avatar Jun 22 '22 10:06 electriquo

@foolioo thanks. I can confirm that it is working with allow_update_branch: true under repository settings.

dgokcin avatar Jun 22 '22 10:06 dgokcin

@foolioo thanks. I can confirm that it is working with allow_update_branch: true under repository settings.

Should documentation be updated?

taliastocks avatar Mar 20 '24 18:03 taliastocks

Should documentation be updated?

from the configuration example:

repository:

See https://docs.github.com/en/rest/reference/repos#update-a-repository for all available settings.

please feel free to suggest changes to make the idea more obvious, but all repo properties are supported in the settings file. it isnt realistic for us to keep them all listed in the example when the api docs already provide details

travi avatar Mar 20 '24 21:03 travi

Should documentation be updated?

from the configuration example:

repository:

See https://docs.github.com/en/rest/reference/repos#update-a-repository for all available settings.

please feel free to suggest changes to make the idea more obvious, but all repo properties are supported in the settings file. it isnt realistic for us to keep them all listed in the example when the api docs already provide details

@travi I agree that continuously updating the documentation about the features in the GitHub API is not a good idea, but I don't think many users of this action know that if a property is available in the GitHub API, it is supported by the Settings Bot. As a loyal user of this app for a few years now, I believe the main README deserves a mention of this in a more visible place, rather than a commented-out link.

dgokcin avatar Mar 21 '24 08:03 dgokcin

deserves a mention of this in a more visible place, rather than a commented-out link

https://github.com/repository-settings/app/pull/893 pulls the reference to a more prominent location. closing this thread as a result of that change, but would entertain PRs to further improve the clarity of configuration docs

travi avatar Mar 24 '24 05:03 travi

but would entertain PRs to further improve the clarity of configuration docs

@travi https://github.com/repository-settings/app/pull/480

electriquo avatar Mar 24 '24 06:03 electriquo