Skip to content

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

@jimmybrancaccio

Description

@jimmybrancaccio

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions