#1008 Allow module components to use a git ref outside of the master branch
Merged 2 years ago by mprahl. Opened 2 years ago by mprahl.

@@ -477,7 +477,8 @@ 


              scm = module_build_service.scm.SCM(url, branch, conf.scmurls, allow_local_url)


-         scm.verify()

+         if not whitelist_url:

+             scm.verify()

          cofn = scm.get_module_yaml()

          mmd = load_mmd(cofn, is_file=True)


In record_component_builds, a call is made to _fetch_mmd which is supposed to fetch the modulemd of the module component. As part of this call, scm.verify() runs as an attempt to verify the git ref you requested is from the branch you're building from. If you provide a git ref outside the master branch, this fails because the branch is not known, so therefore, scm.branch defaults to master.

scm.verify should only apply to the call to _fetch_mmd in submit_module_build_from_scm, where the branch of the module is known. When fetching the modulemd of the module component, we only know the supplied ref, so this PR skips that check and allows us to use refs not in the master branch.

:+1: (Jan's on PTO until Monday.)

Pull-Request has been merged by mprahl

2 years ago