Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
gitlab-vscode-extension
gitlab-vscode-extension
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 103
    • Issues 103
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 4
    • Merge Requests 4
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GitLab.org
  • gitlab-vscode-extensiongitlab-vscode-extension
  • Merge Requests
  • !90

Merged
Opened Aug 28, 2020 by Murad Yusufov@flood4lifeContributor

feat: detect instanceUrl from git remotes and PATs

  • Overview 62
  • Commits 14
  • Pipelines 17
  • Changes 4

Part of #34

find the intersection of git remotes hostnames and PATs hostnames, and if the intersection has exactly one hostname, use that as the instanceUrl otherwise, just do nothing.

Testing strategy

  1. The configured instanceUrl takes precedence
    1. configure "gitlab.instanceUrl" in the workspace settings and make sure that GitLab Workflow always uses this instanceUrl
  2. We use the heuristic (no instanceUrl config)
    1. We have 2 tokens configured
      • https://gitlab.com
      • https://dev.gitlab.org (this can be any other instance)
    2. Have a project with only one remote
      git remote -v
      dev	git@dev.gitlab.org:gitlab/gitter/webapp.git (fetch)
      dev	git@dev.gitlab.org:gitlab/gitter/webapp.git (push)
      1. Run GitLab: Show issues assigned to me command
      2. The extension opens the dev.gitlab.org web
    3. Have a project with both remotes (heuristic matches 2 intersections)
      git remote -v
      dev	git@dev.gitlab.org:gitlab/gitter/webapp.git (fetch)
      dev	git@dev.gitlab.org:gitlab/gitter/webapp.git (push)
      origin	git@example.com:gitlab-org/gitter/webapp.git (fetch)
      origin	git@example.com:gitlab-org/gitter/webapp.git (push)
      1. Run GitLab: Show issues assigned to me command
      2. Extension tries to open the gitlab.com web (default)
Edited Sep 10, 2020 by Tomas Vik
Assignee
Assign to
Reviewer
Request review from
13.4
Milestone
13.4 (Past due)
Assign milestone
Time tracking
Reference: gitlab-org/gitlab-vscode-extension!90
Source branch: detect-gitlab-instance-from-remote

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.