gitpod-io / gitpod-io/gitpod

Running Prebuild on Branch Without New Commits Doesn't Behave as Expected

Open
#14,797 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature: prebuilds meta: never-stale team: webapp type: bug
Dominant language
TypeScript
Stars
13.8k
Forks
1.4k
Avg merge
17h 58m
Merged PRs (30d)
5

Description

Bug description

When running a prebuild manually from the dashboard UI on a branch that doesn't have any new commits compared to where it was branched from it will run a prebuild against where the branch was created from and not the branch itself. For example, if main is my main branch and I create a branch from that, my-new-branch and run a prebuild. It will run the prebuild on main and not my-new-branch. This issue may be related to #14017.

Of note, when a commit is made to the branch and then a prebuild is manually run, this seems to work correctly and the prebuild is made against the branch.

Screenshot 2022-11-18 at 11 03 08
Steps to reproduce
  1. Create a repository, I used GitHub.
  2. Create a Project in Gitpod using your repository.
  3. Spin up a new workspace from your default branch.
  4. Create a .gitpod.yml file within your repositories default branch. My .gitpod.yml file contains:
    tasks:
      - init: |
        echo 'TODO: build project'
      command: |
        echo 'TODO: start app'
    
      vscode:
        extensions:
          - github.github-vscode-theme
          - esbenp.prettier-vscode
    
  5. Commit and push the newly created .gitpod.yml file.
  6. At GitHub create a new branch, I called mine my-new-branch. The branch should appear in the 'Branches' tab in the Gitpod dashboard.
Screenshot 2022-11-18 at 10 59 05 7. Click on the 3 dots to the right of your new branches name and a dropdown menu should appear. Click on the 'Run Prebuild...' option.
  1. Observe that the prebuild page shows the name of the default branch, in my case 'main' instead of the name of the branch I ran the prebuild from:
Screenshot 2022-11-18 at 10 48 00 9. Observe when opening a new workspace from that prebuild the terminal prompt indicates you are on the `main` branch instead of `my-new-branch`.
Workspace affected

No response

Expected behavior

I would expect even if there is no new commits made to the new branch that it still uses that branch when I tell it to Run Prebuild on that branch.

Example repository

No response

Anything else?

No response

Front logo Front conversations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the dashboard UI's “Run Prebuild...” flow for a branch with no commits, then compare it with a branch containing a new commit. Trace how the selected branch is passed into the prebuild and workspace flow; done means the prebuild page and resulting workspace use the selected branch rather than the default branch.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cloud, developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.