Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-3482

Automatic setup of git remotes when starting a workspace from GitHub

    XMLWordPrintable

Details

    • False
    • None
    • False
    • Release Notes
    • Hide
      = Configuring remotes using a factory URL

      With this update, you can configure the Git remotes of a new workspace created by using the factory URL. The `remotes` query parameter can be set to a comma-separated list of Git remotes, with an optional name for each.
      Show
      = Configuring remotes using a factory URL With this update, you can configure the Git remotes of a new workspace created by using the factory URL. The `remotes` query parameter can be set to a comma-separated list of Git remotes, with an optional name for each.
    • Enhancement
    • Done

    Description

      The GitHub workflow is described in the Kubernetes contributors documentation.

      In practice we want that, if a user starts a workspace

      • from a repo (the upstream) for which he has a fork (the origin)
        Or
      • from a repo (the origin) that is a fork of another repo (the upstream)
        the git remotes should be setup automatically. For example:
      $ git remote -v
      origin	        https://github.com/eclipse-che/che-docs.git (fetch)
      origin	        https://github.com/eclipse-che/che-docs.git (push)
      upstream	https://github.com/eclipse-che/che-docs.git (fetch)
      upstream	https://github.com/eclipse-che/che-docs.git (push)
      

      This can currently be achieved if the DevWorkspace has the following projects:

      projects:   - name: che-docs
          git:       remotes:         upstream: https://github.com/eclipse-che/che-docs.git
              origin: https://github.com/amisevsk/che-docs.git
            checkoutFrom:         remote: upstream
              revision: main
      

      A possible solution is to:

      • Add a new URL parameter (remotes):
        # 1. explicit name and URL
        ?remotes={{origin,https://github...},{upstream,https://github...},...}
        
        # 2. URLs only, name is implicit: first is origin, second is upstream, subsequent are fork1, fork2 etc... 
        ?remotes={https://github...,https://github...,...}
        
      • Implement a Chrome or Firefox extension that does add the remote parameter automatically

      Another solution is let the dashboard figure this out during the generation of the DevWorkspace object.

      Upstream links:

      Attachments

        Activity

          People

            dakwon@redhat.com David Kwon
            mloriedo Mario Loriedo
            Fionn Kelleher Fionn Kelleher
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: