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

Validate if branch exists before creating project #9942

Open
benjaoming opened this issue Jan 25, 2023 · 3 comments
Open

Validate if branch exists before creating project #9942

benjaoming opened this issue Jan 25, 2023 · 3 comments
Labels
Bug A bug Needed: design decision A core team decision is required Priority: low Low priority

Comments

@benjaoming
Copy link
Contributor

benjaoming commented Jan 25, 2023

When importing a project using "Import Manually", the branch field can be specified or left empty (to choose the repo's default branch).

Let's say that we specify it like this:

image

Validation is needed / nice-to-have

If the field is specified with a branch that does NOT exist, the project is again locked* in the same state as #9367 - because the initial checkout fails (the branch does not exist), we will not be able to select a new branch using the Settings UI:

image

locked*) the workaround is to save the project with a blank default branch. This will trigger a new build to start, using the default branch of the git repository.

Edit: description is updated

@benjaoming benjaoming added the Bug A bug label Jan 25, 2023
@stsewd
Copy link
Member

stsewd commented Jan 25, 2023

I think re-saving the project should fix this problem, that way the project goes back to choose the default branch.

@benjaoming
Copy link
Contributor Author

Oh yeah, that's true! And a good, simple work-around. The first build fails correctly since the branch does not exist:

image

Afterwards, the list of choices in "Default branch" is empty. But clicking "Save" again will trigger the new functionality to correctly use the repo's default branch instead of the broken one 👍

@humitos
Copy link
Member

humitos commented Jun 5, 2023

At some point, if we implement this part of #10352

Detection of a missing configuration file without building

We could use the same mechanism to check/detect if the defined branch exists or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Needed: design decision A core team decision is required Priority: low Low priority
Projects
None yet
Development

No branches or pull requests

3 participants