Skip to content

update-pr-from-base-branch - Enable on non-own repos #7478

Closed

Description

@jkroepke

Description

I'm working for some OSS project which may not enabled the feature to offer "update branch" inside a PR.

image

To update the branch anyway, I have always go to my fork, choice the branch and click sync fork there.

image

Would be great, if Refined Github could offer a one-click button for this scenario:

Example URLs

any PR

Activity

  1. fregante commented on Jun 22, 2024

    @fregante
  2. jkroepke commented on Jun 22, 2024

    @jkroepke
    Author
  3. fregante commented on Jun 22, 2024

    @fregante
    Member

    Yes if I remember correctly. There's a chance that they have a slightly different DOM and the button is not being appended. I'll reopen as a bug report

  4. changed the title [-]Offer sync fork/branch, if not enabled by repository owner[/-] [+]`update-pr-from-base-branch` missing in cross-repo PRs[/+] on Jun 22, 2024
  5. jkroepke commented on Jun 22, 2024

    @jkroepke
    Author

    I can confirm, that there is no node with .merge-message

    observe('.merge-message', addButton, {signal});

    cross-repo PRs (at least, if I do not have the merge permission on upstream)

    Own Repo

    2024-06-22 18_50_26-Suppression by jkroepke · Pull Request #1 · jkroepke_terraform-provider-azurerm

    Upstream Repo

    2024-06-22 18_49_28-New Resource_ azurerm_advisor_suppression by jkroepke · Pull Request #26177 ·

  6. fregante commented on Jun 22, 2024

    @fregante
    Member

    I see it on cross-repo PRs: refined-github/sandbox#13

    Screenshot 1

    But I don't see it if I don't have access to the repo where the PR is opened: cletusw/eslint-plugin-local-rules#23
    Screenshot 2

    That's because the selector is targeting the Merge button itself 🤔 I don't remember why

    Screenshot 3
  7. changed the title [-]`update-pr-from-base-branch` missing in cross-repo PRs[/-] [+]`update-pr-from-base-branch` - Enable on non-own repos[/+] on Jun 23, 2024
  8. 1 remaining item

  9. fregante commented on Jun 23, 2024

    @fregante
    Member

    if (!elementExists(canMerge) || elementExists(canNativelyUpdate)) {

    I don't remember why

    I probably used that condition as a way to determine whether the user can merge the PR. This is not necessary, the condition should be "can the current user update the PR?"

    I turned this back into a feature request.

  10. jkroepke commented on Jun 23, 2024

    @jkroepke
    Author

    "can the current user update the PR?"

    I guess, if the current user is the author would be a sufficient condition?

  11. fregante commented on Jun 23, 2024

    @fregante
    Member

    If there's no other indicator, "can merge PR or is author" should be good enough. However there are cases where a repo collaborator can update PRs, but not merge them. Also the author can open a PR across repos that they don't own.

  12. jkroepke commented on Jun 23, 2024

    @jkroepke
    Author

    Maybe this indicator (checkbox -> Allow edits) on right side could be treat as indicator

    image

    It may not hits

    However there are cases where a repo collaborator can update PRs

    but, it present cases like that

    Also the author can open a PR across repos that they don't own.

  13. fregante commented on Aug 1, 2024

    @fregante
    Member

    I think the solution is to just look for the "Close pull request" button 🤯

    Users who can close it:

    • PR author
    • Maintainer

    Seems obvious in retrospect. PR welcome

  14. added
    small
    Please! ♥︎
    on Aug 1, 2024
  15. self-assigned this
    on Aug 2, 2024
  16. fregante commented on Aug 2, 2024

    @fregante
    Member

    Would you be able to test #7642?

  17. jkroepke commented on Aug 2, 2024

    @jkroepke
    Author

    How I can test PRs?

  18. fregante commented on Aug 2, 2024

    @fregante
    Member

    You'd have to check out the PR locally, build the extension and load it into your browser. If you're not familiar with npm and extensions it might be difficult. See: https://github.com/refined-github/refined-github/wiki/Contributing#workflow

    Anyway I think I covered your case in my tests already

  19. jkroepke commented on Aug 2, 2024

    @jkroepke
    Author

    You'd have to check out the PR locally, build the extension

    Is there an reason, why one of the PR actions not building and upload the crx as artifact? Then, I could just download the crx from GHA.

    On my projects, I'm doing this, for example: prometheus-community/windows_exporter#1543 (comment)

  20. fregante commented on Aug 2, 2024

    @fregante
    Member

    We just haven't set that up for PRs, we only do in releases. PR welcome to add that 😅

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

Metadata

Metadata

Assignees

Labels

Please! ♥︎acceptedenhancementsmall

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions