-
Bug
-
Resolution: Done
-
Normal
-
None
-
4.13.0
-
None
-
Low
-
No
-
Pipeline Integrations #238, Pipeline Integrations #239, Pipeline Integrations #240, Pipeline Integrations #241, Pipeline Integrations #242, Pipeline Integrations #243
-
6
-
False
-
Description of problem:
I created a BuildConfig for a repo that uses "main" as the branch name. My config looked like this: source: type: Git git: uri: 'https://github.com/openshift-eng/ci-test-mapping' triggers: - type: ConfigChange - type: GitHub github: secretReference: name: github-webhook-secret The GitHub webhooks were not triggering builds, and after digging in, I had to specify ref in the source: source: type: Git git: uri: 'https://github.com/openshift-eng/ci-test-mapping' ref: main Would it be possible to make this easier for a user? It's possible to determine the default branch after cloning so perhaps this could be stored in the BuildConfig status. It wasn't clear to me the "ref" was used in the webhook payload, but GitHub sends something like this: { "action" : "push", "pusher" : { "email" : "my@email.com" }, "ref" : "refs/heads/main" }
Version-Release number of selected component (if applicable):
How reproducible:
Steps to Reproduce:
1. Create a BuildConfig for a git repo without a master default branch, and add a GitHub trigger 2. Leave off the ref in the source 3. Push to GitHub
Actual results:
No build gets triggered
Expected results:
Build gets triggered
Additional info:
If the behavior can't be changed perhaps just the docs could be updated? https://docs.openshift.com/container-platform/4.13/cicd/builds/creating-build-inputs.html#builds-source-code_creating-build-inputs says "Optionally, specify the ref field to check out a specific Git reference." Perhaps it should mention it's only optional if the default branch is master. And https://docs.openshift.com/container-platform/4.13/cicd/builds/triggering-builds-build-hooks.html#builds-using-github-webhooks_triggering-builds-build-hooks should show an example of the payload GitHub sends, and mention the ref field is relevant. i.e., the build will only be triggered in the ref from the github webhook event matches the ref in the git source
- depends on
-
OCPBUGS-15206 Mark `ref` option as mandatory if branch is not "master"
- Closed