Skip to content

Searches by URL for self hosted GitHub and GitLab on Launchpad #3942

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

Merged
merged 3 commits into from
Apr 17, 2025

Conversation

sergeibbb
Copy link
Member

@sergeibbb sergeibbb commented Jan 17, 2025

follow up of #3923 and #3934

Description

  • Adds search by URL for GitLab Self Managed to the Launchpad
  • Adds search by URL for GitHub Enterprise to the Launchpad

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

@sergeibbb sergeibbb force-pushed the feature/search-by-url-for-self-hosted branch from 0d463ae to 261dc44 Compare January 17, 2025 02:33
@sergeibbb
Copy link
Member Author

sergeibbb commented Jan 17, 2025

@axosoft-ramint

Now it doesn't harm users. Just search by URL doesn't work for self hosted GitHub and GitLab. That is why I suppose this PR can be merged after the release as a follow-up.

I haven't changed the CHANGELOG yet, because if we decide to merge before the release, it will be covered by general notes of adding self-hosted GitLab and GitHub.

Also, I've noticed that GitLab's and GitHub's methods are similar: they get a value without provider field and then extend it with this.id. I wanted to move it to the base class, but the return type is incompatible with Jira.

sergeibbb added a commit that referenced this pull request Jan 23, 2025
@sergeibbb sergeibbb force-pushed the feature/search-by-url-for-self-hosted branch from 261dc44 to e4ccda5 Compare January 23, 2025 11:23
sergeibbb added a commit that referenced this pull request Jan 23, 2025
@sergeibbb sergeibbb force-pushed the feature/search-by-url-for-self-hosted branch from e4ccda5 to dd4e3ca Compare January 23, 2025 11:24
@sergeibbb sergeibbb requested review from axosoft-ramint and removed request for axosoft-ramint January 23, 2025 11:24
sergeibbb added a commit that referenced this pull request Jan 23, 2025
@sergeibbb sergeibbb force-pushed the feature/search-by-url-for-self-hosted branch from dd4e3ca to 54f2e07 Compare January 23, 2025 11:26
sergeibbb added a commit that referenced this pull request Apr 11, 2025
@sergeibbb sergeibbb force-pushed the feature/search-by-url-for-self-hosted branch from 54f2e07 to cfa54e2 Compare April 11, 2025 12:19
@sergeibbb sergeibbb added this to the 17.1 milestone Apr 11, 2025
@sergeibbb
Copy link
Member Author

sergeibbb commented Apr 11, 2025

@axosoft-ramint

i've fixed the conflicts here and did some testing

@sergeibbb sergeibbb force-pushed the feature/search-by-url-for-self-hosted branch from cfa54e2 to 25b7a5e Compare April 14, 2025 09:41
sergeibbb added a commit that referenced this pull request Apr 14, 2025
sergeibbb added a commit that referenced this pull request Apr 14, 2025
@sergeibbb sergeibbb force-pushed the feature/search-by-url-for-self-hosted branch from 25b7a5e to 643b569 Compare April 14, 2025 10:04
Copy link
Contributor

@axosoft-ramint axosoft-ramint left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together. Just a few very minor suggestions, then it looks good to me after.

CHANGELOG.md Outdated
@@ -162,6 +162,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Fixes [#3940](https://github.com/gitkraken/vscode-gitlens/issues/3940) - Commit Details: issue autolinks can disappear after enrichment
- Fixes [#4035](https://github.com/gitkraken/vscode-gitlens/issues/4035) - Repo is lost when "Generate commit" is requested

#### Added

- Searches by URL for self hosted GitHub and GitLab on Launchpad
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Searches by URL for self hosted GitHub and GitLab on Launchpad
- Adds the ability to search for GitHub Enterprise and GitLab Self-Managed pull requests by URL in the main step of Launchpad

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

return getGitHubPullRequestIdentityFromMaybeUrl(url) != null;
}

export function getGitHubPullRequestIdentityFromMaybeUrl(
search: string,
): (PullRequestUrlIdentity & { provider: HostingIntegrationId.GitHub }) | undefined {
): Omit<PullRequestUrlIdentity, 'provider'> | undefined {
Copy link
Contributor

@axosoft-ramint axosoft-ramint Apr 16, 2025

Choose a reason for hiding this comment

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

What if we just updated this function to require, in addition to the search parameter, an id parameter of type GitHubRelatedIntegrationIds? Then you don't need to add on the id afterwards in the integration fn and can directly call this with its id.

Both ways achieve the same effect, maybe just easier not to have to shallow-clone the object afterwards, and you don't need to apply Omit on the return type either.

And I would say the same thing for getGitLabPullRequestIdentityFromMaybeUrl.

Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -11,7 +10,7 @@ export function isMaybeGitLabPullRequestUrl(url: string): boolean {

export function getGitLabPullRequestIdentityFromMaybeUrl(
search: string,
): (PullRequestUrlIdentity & { provider: HostingIntegrationId.GitLab }) | undefined {
): Omit<PullRequestUrlIdentity, 'provider'> | undefined {
Copy link
Contributor

Choose a reason for hiding this comment

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

See above comment on getGitHubPullRequestIdentityFromMaybeUrl

Copy link
Member Author

Choose a reason for hiding this comment

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

@sergeibbb sergeibbb force-pushed the feature/search-by-url-for-self-hosted branch from 643b569 to 2148232 Compare April 17, 2025 11:03
@sergeibbb sergeibbb merged commit 2f2609b into main Apr 17, 2025
3 checks passed
@sergeibbb sergeibbb deleted the feature/search-by-url-for-self-hosted branch April 17, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants