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

build.get_revision_branch() raising exception as get_scm_type() is returning None #860

Open
krutcha opened this issue Jun 19, 2024 · 1 comment

Comments

@krutcha
Copy link

krutcha commented Jun 19, 2024

ISSUE TYPE

Bug Report

Jenkinsapi VERSION

0.3.13

Jenkins VERSION

2.440.3

SUMMARY

on Build class, get_revision() works, however get_revision_branch() fails in get_revision_type() with jenkinsapi.custom_exceptions.NotSupportSCM: SCM class "None" not supported by API

EXPECTED RESULTS

get_scm__branch returns a branch name from github

ACTUAL RESULTS

jenkinsapi.custom_exceptions.NotSupportSCM: SCM class "None" not supported by API

USEFUL INFORMATION

pipeline type is 'pipeline script from SCM'
SCM:git (a gitub instance)

@krutcha
Copy link
Author

krutcha commented Jul 11, 2024

just incase it helps, I am able to get the branch name as follows w/o throwing an exception:

            element_tree = job._get_config_element_tree()
            #ET.dump(element_tree)
            for property in element_tree.iter():
                if property.tag == "hudson.plugins.git.BranchSpec":
                    branch = property.find("name").text

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

1 participant