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

Plugin fails after removal of master branch #155

Open
paullewisn opened this issue Nov 18, 2020 · 4 comments
Open

Plugin fails after removal of master branch #155

paullewisn opened this issue Nov 18, 2020 · 4 comments

Comments

@paullewisn
Copy link

paullewisn commented Nov 18, 2020

I branched master to main some time ago and set this as the default branch on our repos, today I deleted the master branch but this has caused an error on our build pipeline:

Interaction with plugin with id 'github.pr' implementing 'scm' extension failed while requesting for 'checkout'. 
Reason: [The plugin sent a response that could not be understood by Go. 
Plugin returned with code '500' and the following response: 
'"Exception (Process exited with an error: 128 (Exit value: 128)) 
Occurred: [git, clone, --branch\u003dmaster, [email protected]:myorg/myrepo.git, /var/lib/go-agent-2/pipelines/build.pr] - null"']

Is there a configuration/env vars I need to update? I have restored master for now.

v1.3.4
GoCD Version: 19.2.0

@paullewisn
Copy link
Author

I am also seeing this response periodically

Interaction with plugin with id 'github.pr' implementing 'scm' extension failed while requesting for 'checkout'. 
Reason: [The plugin sent a response that could not be understood by Go. 
Plugin returned with code '500' and the following response: '"Exception (Process exited with an error: 1 (Exit value: 1)) Occurred: [git, checkout, -f, master] - /var/lib/go-agent-2/pipelines/build.pr"']

@mirogta
Copy link

mirogta commented May 18, 2021

This is slowly becoming a blocker for us - since new GitHub repositories have the main as the default branch and not all people (who can create new repos) have an easy way or permission to change the default repo back to master to make their GoCD pipelines work with this plugin.

@ashwanthkumar could we please get an update and some timeframe when you or someone could have a look at this issue?

@croweman
Copy link

@paullewisn @mirogta I believe the alternative is just to set the Default branch on the Github plugin dialog to main rather than leaving it empty.

It you still get an issue with it trying to checkout main you will probably need to change the case of one of the characters in the Repository Url in Go to get it to sort its self out

@conbon
Copy link

conbon commented Nov 28, 2023

an update on this for anyone still using this - setting defaultBranch instead of branch under the plugin options in yaml allows specifying main.

GitConfig getGitConfig(Map<String, String> configuration) {
GitConfig gitConfig = new GitConfig(
configuration.get("url"),
configuration.get("username"),
configuration.get("password"),
StringUtils.trimToNull(configuration.get("defaultBranch")),
true,
Boolean.parseBoolean(configuration.get("shallowClone")));
provider.addConfigData(gitConfig);
return gitConfig;

      my-PR:
        plugin_configuration:
          id: github.pr
          version: 1
        options:
          url: [email protected]:my-org/my-repo.git
          defaultBranch: main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants