gitpod-io / gitpod

The developer platform for on-demand cloud development environments to create software faster and more securely.
https://www.gitpod.io
GNU Affero General Public License v3.0
12.71k stars 1.21k forks source link

Instructions from `.gitpod.yml` are build run while it does not exist #9505

Closed armanbilge closed 2 years ago

armanbilge commented 2 years ago

Bug description

Opening a new workspace of my repo outputs:

 HISTFILE=/workspace/.gitpod/cmd-0 history -r; {
[ -r /workspace/.prebuild-log-0 ] && cat /workspace/.prebuild-log-0; [ -r /workspace/.gitpod/prebuild-log-0 ] && cat /workspace/.gitpod/prebuild-log-0; true
} && {
echo 'TODO: start app'

}
gitpod /workspace/schrodinger (main) $  HISTFILE=/workspace/.gitpod/cmd-0 history -r; {
> [ -r /workspace/.prebuild-log-0 ] && cat /workspace/.prebuild-log-0; [ -r /workspace/.gitpod/prebuild-log-0 ] && cat /workspace/.gitpod/prebuild-log-0; true
> } && {
> echo 'TODO: start app'
> 
> }
TODO: start app

However, there is no .gitpod.yml in my repo and there is no "Project" for this repo either.

Steps to reproduce

Open https://github.com/armanbilge/schrodinger/ in GitPod.

Workspace affected

No response

Expected behavior

.gitpod.yml should not be processed when it doesn't exist. There should be no history -r in this situation, or at least there should be a way to disable it :)

Example repository

https://github.com/armanbilge/schrodinger/

Anything else?

Thanks to @pawlean and @axonasif for their support on Discord.

axonasif commented 2 years ago

Also, attempting to trigger manual prebuild results in: image

axonasif commented 2 years ago

It seems like I'm experiencing this too, my new changes on .gitpod.yml aren't being reflected on the resulting workspaces. So, for example, a task:command is being run on a terminal that I had removed on a git-commit before opening the repo, while at the same time, it does not exist on the .gitpod.yml file present inside my workspace.

Repo: https://github.com/axonasif/flutter-web/tree/axon/refactor_template Workspace: axonasif-flutterweb-4pvpszfp1tt.ws-us42xl

armanbilge commented 2 years ago

Update: I pushed a new commit to the main branch on my repo and the issue has gone away.

However, if you specifically create a workspace at the previous commit you can still reproduce the problem described in this issue.

https://github.com/armanbilge/schrodinger/tree/34f23cbe8e83f252d6157770fec083b006ae81cd

CyriacBr commented 2 years ago

I have this issue as well. I removed the default watch command from .gitpod.yml, committed then pushed the changes (to main), but that command is still ran whenever I open the pod.

AlexTugarev commented 2 years ago

Hi @armanbilge! Thanks for reporting. We definitely need to improve the Project creation flow and messaging around it to get to a point, where things happening get clear.

What you've been seeing is a feature in Projects (https://github.com/gitpod-io/gitpod/pull/7383). Whenever you create a new project, and there is no .gitpod.yml found, Gitpod is automatically proposes a simple configuration to help you getting started with prebuilds.

Please see, that you have created a project in your personal account, https://gitpod.io/projects/schrodinger. I just checked with a fork of your repo.

Screen Shot 2022-05-20 at 09 14 01

cc. @jldec, @geropl