Skip to content

chore: Add a URL parameter for the existing workspace name #2922

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/end-user-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
**** xref:url-parameter-for-container-image.adoc[]
**** xref:url-parameter-for-memory-limit.adoc[]
**** xref:url-parameter-for-cpu-limit.adoc[]
**** xref:url-parameter-for-the-existing-workspace-name.adoc[]
** xref:starting-a-workspace-from-a-raw-devfile-url.adoc[]
** xref:basic-actions-you-can-perform-on-a-workspace.adoc[]
** xref:authenticating-to-a-git-server-from-a-workspace.adoc[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ When you start a new workspace, {prod-short} configures the workspace according
* xref:url-parameter-for-container-image.adoc[]
* xref:url-parameter-for-memory-limit.adoc[]
* xref:url-parameter-for-cpu-limit.adoc[]
* xref:url-parameter-for-the-existing-workspace-name.adoc[]
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ The URL parameter for starting a duplicate workspace is `new`:
pass:c,a,q[{prod-url}]#__<git_repository_url>__?new
----

NOTE: If you currently have a workspace that you started using a URL, then visiting the URL again without the `new` URL parameter results in an error message.
[NOTE]
====
If you currently have a workspace that you started by using a URL, then visiting the URL again without the `new` URL parameter opens the existing workspace.
Copy link
Contributor

@svor svor Jul 3, 2025

Choose a reason for hiding this comment

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

Could you please add an example like
pass:c,a,q[{prod-url}]#<git_repository_url>?new

====
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
:_content-type: CONCEPT
:description: URL parameter for the existing workspace name
:keywords: existing-workspace-name, how-to-start-workspace
:navtitle: URL parameter for the existing workspace name
:page-aliases:

[id="url-parameter-for-the-existing-workspace-name"]
= URL parameter for the existing workspace name

If the URL for starting a new workspace contain a URL parameter specifying the existing workspace name,
an existing workspace created from the same URL is opened, or a new workspace is created.
Copy link
Contributor

Choose a reason for hiding this comment

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

to understand this sentence better: in which case is a new workspace created with the existing URL parameter?

Copy link
Contributor Author

@olexii4 olexii4 Jul 2, 2025

Choose a reason for hiding this comment

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

A new workspace is created with the existing URL parameter if no workspaces with the same repository URL already exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need the existing URL parameter to prioritize opening workspaces when multiple workspaces are created from the same URL.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. thanks for the explanation, I re-worded the sentence a bit. I'm wondering if there's a way to rewrite "The specified existing workspace name will be preferred " to make it more clear what's going to happen. does it mean that the workspace with the existing parameter will open instead of the others?

The specified existing workspace name will be preferred if multiple workspaces were created from the same URL.
Comment on lines +10 to +12
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
If the URL for starting a new workspace contain a URL parameter specifying the existing workspace name,
an existing workspace created from the same URL is opened, or a new workspace is created.
The specified existing workspace name will be preferred if multiple workspaces were created from the same URL.
If you start a new workspace with a URL that contains the `existing` URL parameter specifying an existing workspace name, the existing workspace created from the same URL is opened. If no workspace from the same URL exists yet, a new workspace is created.
[NOTE]
====
If you create multiple workspaces from the same URL, the specified existing workspace name will be preferred.
====


The URL parameter for the existing workspace name is `existing=`:
Copy link
Contributor

@svor svor Jul 3, 2025

Choose a reason for hiding this comment

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

@olexii4
could you please document the case when the name is not set or workspace with this name doesn't exist.
Examples:

1. `pass:c,a,q[{prod-url}]#<git_repository_url>?existing`
2. `pass:c,a,q[{prod-url}]#<git_repository_url>?existing=workspace-doesnt-exist`


[source,subs="+quotes,+attributes,+macros"]
----
pass:c,a,q[{prod-url}]#__<git_repository_url>__?existing=__<existing_workspace_name>__
----

.Example

====

`pass:c,a,q[{prod-url}]#https://github.com/eclipse-che/che-docs?existing=che-docs`
Copy link
Contributor

@svor svor Jul 3, 2025

Choose a reason for hiding this comment

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

@deerskindoll I think it should be good, because it's just an example, but to double check: would it be OK if we have che related link in the DevSpaces documentation ?

Copy link
Contributor

Choose a reason for hiding this comment

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

good catch! we shouldn't do that. we need separate example for Dev Spaces or a neutral example applicable for both.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it could be replaced with
pass:c,a,q[{prod-url}]#<git_repository_url>?existing=workspace_name


====

This URL opens the existing workspace named `che-docs` if it was created from the same URL.

.Additional resources

* xref:url-parameter-for-starting-duplicate-workspaces.adoc[]