#42 Load koji config without module name
Closed 6 years ago by lsedlar. Opened 7 years ago by lsedlar.

file modified
+1 -3
@@ -87,9 +87,7 @@ 

  

          # We have to allow this to work, even if we don't have a package

          # we're working on, for things like gitbuildhash.

-         try:

-             null = self.module_name

-         except:

+         if self._module_name is None:

              self._kojiconfig = self._orig_kojiconfig

              return

          for arch in self.secondary_arch.keys():

We can't unconditionally access self.module_name, as it might lead to
infinite recursion.

Replication steps:

fedpkg clone fedpkg
cd fedpkg
git remote remove origin
fedpkg --dist master verrel

rebased

7 years ago

@lsedlar I got these by running above commands

$ fedpkg clone fedpkg
Cloning into 'fedpkg'...
remote: Counting objects: 199, done.
remote: Compressing objects: 100% (196/196), done.
remote: Total 199 (delta 75), reused 0 (delta 0)
Receiving objects: 100% (199/199), 28.94 KiB | 0 bytes/s, done.
Resolving deltas: 100% (75/75), done.
Checking connectivity... done.
$ cd fedpkg
$ git remote remove fedpkg
error: Could not remove config section 'remote.fedpkg'
$ fedpkg --dist master verrel
fedpkg-1.25-1.fc26

Is there any other steps needed to reproduce?

Sorry, that's my mistake: it should remove remote origin:

git remote remove origin

Each time when call this method, self._module_name will always be None, and subsequent code will not run.

Before this change, output is

Failed to get module name from Git url or pushurl
Failed to get module name from Git url or pushurl
...
Failed to get module name from Git url or pushurl
Failed to get module name from Git url or pushurl
Exception RuntimeError: RuntimeError('maximum recursion depth exceeded in __instancecheck__',) in <module 'threading' from '/usr/lib64/python2.7/threading.pyc'> ignored
Exception RuntimeError: RuntimeError('maximum recursion depth exceeded in __instancecheck__',) in <module 'threading' from '/usr/lib64/python2.7/threading.pyc'> ignored
Exception RuntimeError: RuntimeError('maximum recursion depth exceeded in __instancecheck__',) in <module 'threading' from '/usr/lib64/python2.7/threading.pyc'> ignored
Failed to get module name from Git url or pushurl
/etc/koji/s390-config
/etc/koji/s390-config
...
/etc/koji/s390-config
/etc/koji/s390-config
libica-2.6.2-1.fc26

With this patch, for example,

fedpkg clone libica
cd libica 
git remote remove origin
fedpkg --dist master verrel

output is

Failed to get module name from Git url or pushurl
libica-2.6.2-1.fc26

rebased

7 years ago

Sorry, I'm not sure from your last comment if you would like to see some changes.

I guess this is not valid anymore, I can't replicate the issue with current fedpkg.

Pull-Request has been closed by lsedlar

6 years ago