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

It should be easier to configure remotes in Devfile v2 flow #21315

Closed
amisevsk opened this issue Mar 31, 2022 · 6 comments
Closed

It should be easier to configure remotes in Devfile v2 flow #21315

amisevsk opened this issue Mar 31, 2022 · 6 comments
Labels
area/dashboard area/devfile-spec Issues related to Devfile v2 engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. kind/enhancement A feature request - must adhere to the feature request template. severity/P2 Has a minor but important impact to the usage or development of the system.

Comments

@amisevsk
Copy link
Contributor

Is your enhancement related to a problem? Please describe

By default, I set up repos I work in with remotes

  upstream: <the main repo -- e.g. github.com/eclipse/che>
  origin: <my fork of the repo -- e.g. github.com/amisevsk/che>

However, with the devfile v2 flow, only one repo can be specified and the devfile from that repo is used for the workspace. This can lead to issues if a fork is out of date, and requires adding remotes manually after the fact.

Describe the solution you'd like

Ideally it would be possible to specify a full list of remotes that the workspace should use. If not that, specifying (or automatically detecting) a fork + upstream set of remotes would be very useful

When cloning a new repo for the first time, I would like it to be configured so that

  1. The upstream remote is cloned, in order to pull the latest changes from main into the workspace and track upstream/main in the local main branch
  2. The origin remote is configured, allowing me to push branches to origin in order to open a PR

Describe alternatives you've considered

No response

Additional context

On a DevWorkspace level, the configuration looks like

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: master

(revision can be omitted if the default branch is to be used)

Related issue: Sometimes Che-Theia overwrites the DevWorkspace CR when adding remotes via UI: #21244

@amisevsk amisevsk added kind/enhancement A feature request - must adhere to the feature request template. area/dashboard engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. area/devfile-spec Issues related to Devfile v2 labels Mar 31, 2022
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Mar 31, 2022
@ibuziuk ibuziuk added severity/P2 Has a minor but important impact to the usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Apr 4, 2022
@che-bot
Copy link
Contributor

che-bot commented Oct 1, 2022

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 1, 2022
@amisevsk
Copy link
Contributor Author

amisevsk commented Oct 3, 2022

/remove-lifecycle stale

@che-bot che-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 3, 2022
@l0rd
Copy link
Contributor

l0rd commented Oct 25, 2022

@amisevsk to clarify: on the devfile / devworkspace API level everything is already there. What's missing is something like a remotes URL parameter that the dashboard can process and inject in the DevWorkspace object. Is that correct?

@l0rd
Copy link
Contributor

l0rd commented Oct 25, 2022

In this case, with the help of a browser extension, we could make it automatic.

@amisevsk
Copy link
Contributor Author

Right, devfiles/devworkspaces support everything that would be needed to support this currently, and it's possible to manually create a devfile that works as expected.

I'm not sure an ideal solution, and maybe a browser extension is the best option. Overall the outcome I would want is that when I start a workspace e.g. https://github.com/eclipse-che/che-operator, the remotes automatically get configured also include my fork (https://github.com/amisevsk/che-operator). Fully automating that may not work though, as there's potentially different remote naming conventions (I use origin and upstream, for example). Ideally it wouldn't require a browser extensions but I don't know that I see an easy way to do it unless the GitHub/GitLab/Bitbucket apis provide easy ways of getting the current user's fork.

@l0rd
Copy link
Contributor

l0rd commented Jan 19, 2023

I am assuming this can be closed now

@l0rd l0rd closed this as completed Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dashboard area/devfile-spec Issues related to Devfile v2 engine/devworkspace Issues related to Che configured to use the devworkspace controller as workspace engine. kind/enhancement A feature request - must adhere to the feature request template. severity/P2 Has a minor but important impact to the usage or development of the system.
Projects
None yet
Development

No branches or pull requests

4 participants