bitrise icon indicating copy to clipboard operation
bitrise copied to clipboard

Don't specify `master` if no git branch is provided

Open hisaac opened this issue 3 years ago • 6 comments

Currently, the Bitrise CLI attempts to clone master explicitly if no git branch is provided in a bitrise.yml file. We should rely on the git server being used to provide us the default branch instead of assuming the default is master.

In addition to the CI run, I tested this locally on my machine by removing the @main from the generate_readme workflow for one of my steps. The workflow pulls the default branch (main) correctly, and runs successfully. 🎉

hisaac avatar Jul 11 '22 15:07 hisaac

Moving this to a draft, as it's not working correctly yet.

hisaac avatar Jul 11 '22 17:07 hisaac

@godrei I'd appreciate your insight here on if there are unintended side-effects this will cause.

hisaac avatar Jul 11 '22 18:07 hisaac

So part of the release process for the CLI involves updating dependencies, but that seems to break things. I'm going to update dependencies in a separate PR to fix those problems, and come back to this one after that's merged.

hisaac avatar Jul 13 '22 15:07 hisaac

@matrangam updated the dependencies in https://github.com/bitrise-io/bitrise/pull/797, so I didn't have to! This is ready for a re-review. 👍

hisaac avatar Jul 20 '22 14:07 hisaac

I'm wondering now if this change should also update the version number used in the format_version property in bitrise.yml files? (I think that's defined here)

Seems like it'd be appropriate, so we know that if format_version is 12 or higher, we don't need to explicitly define the git branch if we want the default.

@ofalvai wdyt?

hisaac avatar Jul 21 '22 13:07 hisaac

@hisaac I'm not familiar with how and when we increment the counter, but I like the idea and reasoning. I would ask someone else who knows why and when we increment the counter.

ofalvai avatar Jul 22 '22 07:07 ofalvai

🎉 thanks for finishing this up @ofalvai!

hisaac avatar Oct 07 '22 16:10 hisaac