-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add show-open-prs-of-forks feature
#2880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I think I've addressed all points from the previous review, except one thing: I could not move the Also, besides the suggested simplification of the Also, my question about GHE still needs to be sorted out. |
The reason is that you're using Since |
Co-Authored-By: Federico Brigante <github@bfred.it>
|
Sorry, I'm a little bit stumped on your last example. To do that ouside the function, we'd need top-level await (which we don't have, do we?) Or are you suggesting to put it into a Promise? const hasSettings = elementReady('settings tab selector'); |
|
It should go inside the |
|
Okay, so that's basically how I had it in the first place. I ultimately outsourced all those checks into the Going to continue working on this tomorrow, it's getting late here and my coding as well as my writing is getting noticeably worse. 😁 |
Co-Authored-By: Federico Brigante <github@bfred.it>
|
Okay, I've renamed |
- Adds proper support for `nowAndOnAjaxedPages` - Reduces duplication
Good idea! I reorganized the code so "getOpenPullRequestsData" returns the full required data, which is I'm resolving the conflicts |
fregante
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤩
| return {ownerName, repoName}; | ||
| }; | ||
|
|
||
| export function getForkedRepo(): string | undefined { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ambiguous. Is it the repo that was forked or the fork itself?
The correct term would be "source repo". Perhaps getForkSourceRepo would be the correct term.
Can you change this name everywhere? Including const forkedRepo = ... (but not isForkedRepo, that's more clear, I think)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought so as well, but I trusted the existing naming (the function existed before, I just moved it to utils).
Yes, I'll take care of it when I'm going to handle #2934.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, there's already a function with that name in the forked-to feature.
const getForkSourceRepo = (): string => getForkedRepo() ?? getRepoURL();There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
getParentRepo: only works if there’s a parent)getSourceRepo: always gets the source repo, whether it’s the parent or the current
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sound's good to me. I'll do some refactoring of these, but I think I'll open a separate PR for that.
| }; | ||
|
|
||
| export function getForkedRepo(): string | undefined { | ||
| return select<HTMLAnchorElement>('.fork-flag a')?.pathname.slice(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also you could use the same meta tags I used in the isForkedRepo since they're available earlier on the page:
<meta name="octolytics-dimension-repository_parent_nwo" content="sindresorhus/refined-github" />
| return select<HTMLAnchorElement>('.fork-flag a')?.pathname.slice(1); | |
| return select<HTMLMetaElement>('[name="octolytics-dimension-repository_parent_nwo"]')?.content; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. 👍
This PR adds the new
show-open-prs-of-forksfeature. It triggers in all your repositories which are forks. Because of the user-centric nature of this feature, I unfortunately can not provide test links.Repo Headline Hints
This feature adds a hint in the secondary repo headline, linking to your open PRs in the original repo:
Single Pull Request
Multiple Pull Requests
Repo Deletion Warnings
The feature also adds a paragraph to the repo deletion dialog, raising your awareness that there are unmerged outgoing PRs from this repo which you will abandon. (I ran a quick test for this — PRs are not actually deleted when the fork is gone, they're just attributed to an "unknown repo", so the warning will be about the loss of write access to the PR.)
Rules for link targets are the same as in the headline hints layed out above.
Closes #2268
IssueHunt Summary
Referenced issues
This pull request has been submitted to:
IssueHunt has been backed by the following sponsors. Become a sponsor