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

Properly handle the workspace list when the workspace context ref is undefined #10377

Merged
merged 1 commit into from
May 31, 2022

Conversation

felladrin
Copy link
Contributor

@felladrin felladrin commented May 31, 2022

Description

Properly handle the workspace list when the workspace context ref is undefined.

This fixes the issue on JetBrains Gateway preventing the workspace list from being displayed when a workspace had been created from a detached commit instead of a branch. For example, creating a workspace from https://github.com/jenkinsci/design-library-plugin/tree/73f12733d95932c333ba4155521ff78b4ed40dfc

This is the info that comes with this workspace, which does not contain the workspace.context.ref:

{
    "jsonrpc": "2.0",
    "result": [
        {
            "workspace": {
                "context": {
                    "isFile": false,
                    "path": "",
                    "title": "jenkinsci/design-library-plugin - 73f12733:",
                    "revision": "73f12733d95932c333ba4155521ff78b4ed40dfc",
                    "repository": {
                        "cloneUrl": "https://github.com/jenkinsci/design-library-plugin.git",
                        "host": "github.com",
                        "name": "design-library-plugin",
                        "owner": "jenkinsci",
                        "private": false
                    },
                    "normalizedContextURL": "https://github.com/jenkinsci/design-library-plugin/tree/73f12733d95932c333ba4155521ff78b4ed40dfc",
                    "checkoutLocation": "design-library-plugin",
                    "referrer": "jetbrains-gateway",
                    "referrerIde": "intellij"
                }
            }
        }
    ]
}

Related Issue(s)

None.

How to test

Extra Info

If you want to build the extension yourself and test it locally, please open this branch IntelliJ IDEA (running in your machine, not in Gitpod) and follow these instructions.

Release Notes

Fixed an issue on JetBrains Gateway, preventing the workspace list from being displayed when a workspace had been created from a detached commit instead of a branch.

Documentation

  • /werft no-preview=true

@felladrin felladrin force-pushed the vn/fix-undefined-context-ref-on-jb-gateway branch from 35b775c to 12a32bd Compare May 31, 2022 09:49
@roboquat roboquat added size/S and removed size/XS labels May 31, 2022
@felladrin felladrin marked this pull request as ready for review May 31, 2022 10:31
@felladrin felladrin requested review from a team May 31, 2022 10:31
@github-actions github-actions bot added team: IDE team: webapp Issue belongs to the WebApp team labels May 31, 2022
Copy link
Contributor

@mustard-mh mustard-mh left a comment

Choose a reason for hiding this comment

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

code LGTM

@mustard-mh
Copy link
Contributor

/hold

Copy link
Contributor

@mustard-mh mustard-mh left a comment

Choose a reason for hiding this comment

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

@felladrin I found that normalizedContextURL is also an optional prop, and we use it in Gateway plugin, maybe we should make it optional in java too?

export interface WorkspaceContext {
title: string;
/** This contains the URL portion of the contextURL (which might contain other modifiers as well). It's optional because it's not set for older workspaces. */
normalizedContextURL?: string;
forceCreateNewWorkspace?: boolean;
forceImageBuild?: boolean;
}

public class WorkspaceContext {
private String normalizedContextURL;
private String ref;

We can do it in another PR

image

@mustard-mh
Copy link
Contributor

/unhold

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

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

👍

@roboquat roboquat merged commit 366c211 into main May 31, 2022
@roboquat roboquat deleted the vn/fix-undefined-context-ref-on-jb-gateway branch May 31, 2022 12:44
@felladrin
Copy link
Contributor Author

@felladrin I found that normalizedContextURL is also an optional prop, and we use it in Gateway plugin, maybe we should make it optional in java too?

Agreed, we need to make it optional, even if nowadays there are no more workspaces without normalizedContextURL.
I'll do a fix in another PR. Thanks, @mustard-mh!

@roboquat roboquat added the deployed: IDE IDE change is running in production label May 31, 2022
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: IDE IDE change is running in production deployed: webapp Meta team change is running in production deployed Change is completely running in production editor: jetbrains release-note size/S team: IDE team: webapp Issue belongs to the WebApp team
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants