lando / pantheon

The Official Lando Pantheon plugin.
https://docs.lando.dev/pantheon
GNU General Public License v3.0
10 stars 16 forks source link

Lando init Pantheon recipe default to "main" branch but Pantheon build pipeline only works on "master" #134

Open mrspiderbrain opened 1 year ago

mrspiderbrain commented 1 year ago

Currently lando init pantheon recipe fails. Default to main branch which does not connect to the cloud build process. Pantheon are planning to move to "main" but not yet.

ethangeorgi commented 2 months ago

Assuming you've resolved this issue by now. If the issue persists, and updating Lando does not resolve it, please re-open this issue and provide more details.

mrspiderbrain commented 1 week ago

I just initiated a new D10 project and the same problem is still there.

Steps to reproduce

  1. Create new D10 site on pantheon
  2. Do a lando init locally, make changes and commit
  3. Push to origin.
  4. No workflow occurs on pantheon because lando init is defaulting to a "main" branch which isn't recognised by the pantheon UI. Workflow is linked to master branch. There is no option to create a multidev from the git branch "main" that does actually exist in the repo.
  5. Current workaround - switch to master branch immediately after the lando init. If changes get lost - switch to master branch on local, merge main into master and then push.

mrspiderbrain commented 1 week ago

@ethangeorgi it doesn't look like I have permission to reopen this issue.

reynoldsalec commented 1 week ago

I did replicate this and took a look into the code. AFAIK, Lando doesn't do anything "extra" to set the default remote branch when initializing a project.

Instead, the problem seems to be that Pantheon has chosen main as the default branch for its Drupal 10 upstream (see https://github.com/pantheon-upstreams/drupal-10-composer-managed for example), but is still using master to drive its workflows. Most of the other (older) upstreams seem to use master. This is reinforced by Pantheon's cut-and-paste git clone command for Drupal 10 sites specifying -b master.

Lando's lando pull/push commands do use master by default. A potential solution could be having Lando checkout master and set it as the default after cloning the repo or possibly passing in the -b master option to get-remote-url.sh, which I think accepts options. I'm a little conflicted on whether that's appropriate or not considering we're basically handling an inconsistency of the Pantheon platform, would definitely entertain the PR though.

mrspiderbrain commented 4 days ago

@reynoldsalec I agree that Pantheon should fix this given your analysis. I'll open a pantheon support ticket and point to this ticket for reference so they get the chance to fix it their end.

mrspiderbrain commented 4 days ago

I've made a customer support ticket, not public but the ID is 925842 for general reference. It would be good if we could leave this ticket open until we get some info from Pantheon on what they intend to do.

reynoldsalec commented 3 days ago

Sounds good, thanks for following up on it @mrspiderbrain!