Skip to content

feat: make user aware of the current workspace-image #945

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

Closed
wants to merge 1 commit into from

Conversation

axonasif
Copy link
Member

@axonasif axonasif commented Oct 9, 2022

Description

  • Show the current workspace-image info only when the user is using an official gitpod image. (by parsing .gitpod.yml and the dockerfile if-exists)
  • Include a link to the source code of the current workspace-image that also contains a dedicated README.md
  • Once every session whenever someone creates a new terminal manually. After first execution, the script removes itself.
  • Will avoid task terminals, because showing there would not be very visible most of the time.
  • User can completely disable this by adding GITPOD_DISABLE_WORKSPACE_IMAGE_INFO=true at https://gitpod.io/variables with */* as the scope.
base full
Screenshot 2022-10-09 at 3 59 42 PM Screenshot 2022-10-09 at 4 04 05 PM
full-vnc other
Screenshot 2022-10-09 at 4 01 14 PM Screenshot 2022-10-09 at 4 02 09 PM

Related Issue(s)

Relates with gitpod-io/gitpod#10683

Next steps:

  • Add README to each chunk/*/ dir explaining what this chunk contains and if there's something special to be aware of.
  • Add README to base/ dir to explain how the base image sets up the required things for a minimal but functional docker image. In case someone wants to create their own minimal base image of a different distro (i.e Arch or Fedora)
  • Add workspace-images changelog on these READMEs
  • We could repurpose the READMEs for Add docs command dazzle#56 when it's used here.

So that the user can click the scoped link from their terminal to read these READMEs

How to test

  • Open this PR on Gitpod.
  • Run:
docker build -t base base/ && docker run -v /workspace:/workspace -e GITPOD_REPO_ROOT -e GITPOD_GIT_USER_NAME -it base
  • Change the image values on .gitpod.yml and rerun the above command to get different info. Or you can remove .gitpod.yml and it will assume the default image, which is workspace-full. You may change the image name on .gitpod.Dockerfile as well.

Release Notes

Current workspace-image info is shown once every session on the terminal

Documentation

@axonasif axonasif requested a review from a team October 9, 2022 10:09
@gitpod-io
Copy link

gitpod-io bot commented Oct 9, 2022

@gitpod-staging
Copy link

gitpod-staging bot commented Oct 9, 2022

@axonasif axonasif requested a review from a team October 9, 2022 10:13
@kylos101
Copy link
Collaborator

kylos101 commented Oct 9, 2022

👋 @axonasif thanks for sharing, we really appreciate your effort with workspace-images. 😸

Could I ask some favors?

  1. Move this PR back to draft and share if the next steps tasks are for this PR, or a future PR. This is just temporary, so we can socialize next steps for this awesome contribution.
  2. Help us breakdown this PR as a related option for this epic, by creating and sharing a RFC to socialize what you've done in this PR as a 3rd option, sharing current workspace image details in the context of a running workspace.
    • For example, you can link to this PR in the RFC, outline why you think it's appropriate, and seek out feedback for other in-workspace options from @atduarte and @loujaybee . e.g. using a task terminal that doesn't have to be opted out of, a file in /workspace that we can link to perhaps from the IDE, or other means.

Why?

  1. If we align, we'll get possible outcome. In this case, because it impacts UX, it's good to pause (before continuing to iterate on the PR) to save time.
  2. I'd like to be careful adding script to workspace-images, because it can create maintenance needs and complexity, potentially even conflicting with the IDE experience.

Referring back to the epic this is related to, I like the idea of option 2 (improving docs), because as a 🛹 we could improve documentation and readme content, to help improve the user experience. A benefit of this would be that (1) we're not adding complexity to workspace-images and (2) not risking IDE compatibility issues (like we recently had with Python and VSCode).

edit: don't get me wrong, this PR is 🦸 🍬 , it'd be great to socialize next steps, which'll help us be mindful of engineering resources and the user experience.

printf '' > "$lockfile"

# The supervisor creates the task terminals, supervisor calls BASH from `/bin/bash` instead of the realpath `/usr/bin/bash`
# So we will only print the info once, on a non-task terminal that the user created manually
Copy link
Collaborator

@kylos101 kylos101 Oct 9, 2022

Choose a reason for hiding this comment

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

@axonasif as an alternative, it would be nice if this output were visible in a separate (exclusive) task terminal, avoiding user opened terminals altogether. In other words, then, they could always "reference it", by simplying looking at it, without having to ever opt-out.

Another thought is, we persist this output somewhere in /workspace, and then link to it from the Gitpod menu "in workspace". In other words, never present this content in a Terminal.

☝️ are example thoughts that would be best to socialize as feedback in a RFC. 🙏

Copy link
Member

@akosyakov akosyakov Oct 11, 2022

Choose a reason for hiding this comment

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

I think it is good idea to have one task terminal which shows such info. I also like idea of doing it in supervisor only for regular workspaces if we would like generally welcome a user. In this case though we need to check somehow whether it is default image or not.

@atduarte atduarte self-requested a review October 9, 2022 17:55
@axonasif axonasif marked this pull request as draft October 10, 2022 01:00
@axonasif axonasif self-assigned this Oct 10, 2022
@akosyakov
Copy link
Member

Would it pop up in each terminal?

@axonasif
Copy link
Member Author

Would it pop up in each terminal?

Hey @akosyakov, it will be printed once for a user created terminal.
More info on this RFC 🙏

@akosyakov
Copy link
Member

Hey @akosyakov, it will be printed once for a user created terminal.
More info on this RFC 🙏

Not for supervisor task terminals right?

@axonasif
Copy link
Member Author

Hey @akosyakov, it will be printed once for a user created terminal.
More info on this RFC 🙏

Not for supervisor task terminals right?

Right. It won't show on them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants