Skip to content
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

Migrate getCurrentCommittish and GitHubURL here? #142

Open
kidonng opened this issue Jul 27, 2022 · 8 comments
Open

Migrate getCurrentCommittish and GitHubURL here? #142

kidonng opened this issue Jul 27, 2022 · 8 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@kidonng
Copy link
Member

kidonng commented Jul 27, 2022

Another GitHub-related browser extension Gitako encountered the infamous "slash-in-branch-name" issue: EnixCoda/Gitako#243

Refined GitHub had similar experience and that (along with other issues) resulted in the GitHubURL helper (and its dependency getCurrentCommittish). I think these helpers are generally useful for others as well, so is there any interest maintaining them here?

Issue with this approach is that the helpers are huge comparing to the existing getRepo helper. And it's not super related to URL detection, so it probably should be its own thing.

@yakov116
Copy link
Member

I think we can extract it to be its own module, I like how simple this one is no need to complicated it.

@refined-github/maintainers thoughts?

@kidonng
Copy link
Member Author

kidonng commented Jul 27, 2022

To be fair, I think most github-helpers are useful on their own1, like get-user-avatar. But let's not overcomplicate things 😅 this issue only considers branch name related stuff.

Footnotes

  1. maybe one day I extract them to modules myself, that's MIT for you

@yakov116
Copy link
Member

maybe one day I extract them to modules myself, that's MIT for you ↩

Well be glad to host them. That's refined-github for you 🤪

@fregante
Copy link
Member

fregante commented Jul 27, 2022

Link: https://github.com/refined-github/refined-github/blob/3547c9bc0e60443dafe06752bc94e9e5b73f8d55/source/github-helpers/index.ts#L37

Things I'm not excited about:

  • how transient and imperfect each of those API is
  • documenting them and releasing breaking versions more often than this module requires
  • external contributions (or lack thereof)
  • the slowing of RG’s development due to having them externally and having to consider third parties
  • having to also extract every internal function that those helpers use, further slowing RG’s development

I wouldn't be totally opposed to publishing a "gh extensions utils" package but I'd probably suggest using npm install refined-github/refined-github in order to access those files directly instead.

@fregante
Copy link
Member

I'll add, even if we go to the trouble of doing all of that, it doesn't mean it actually helps that many people. See how many repos use this very simple, very old package:

https://github.com/refined-github/github-url-detection/network/dependents

Here's the total of 2 non-fork non-ghosttown extensions that use it:

I'd argue we didn't even need to extract github-url-detection. 😃 The only reason it's still great to have is that it makes it easier to test it and work on it.

@yakov116
Copy link
Member

The only reason it's still great to have is that it makes it easier to test it and work on it.

Exactly why we extracted, the tests took too much time.

@kidonng
Copy link
Member Author

kidonng commented Jul 27, 2022

@fregante Really good points. I agree it's too much hassle for those simple helpers, I brought up about this one because I think it's an exception:

  • There are projects that could benefit from it
  • It (mostly) fits in this package
  • More people using it, more/faster bugs are found

@fregante fregante added help wanted Extra attention is needed enhancement New feature or request labels Feb 4, 2023
@fregante
Copy link
Member

fregante commented Feb 4, 2023

PR welcome to add those two:

  • utils/github-url.ts
  • utils/get-current-committish.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

No branches or pull requests

3 participants