Bug 1373021

Summary: Git repository url not recognized properly
Product: [Community] Copr Reporter: Andy Mender <andymenderunix>
Component: frontendAssignee: clime
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: clime
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-05 09:44:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Andy Mender 2016-09-04 20:30:19 UTC
Description of problem:
When attempting to build an .rpm package via COPR, using a git repo as a url source of the srpm (.src.rpm) results in a set of Python import errors on COPR. The .src.rpm package is not recognized as a proper srpm. Uploading the srpm directly (from local hard drive) leads to a successful build. 

Version-Release number of selected component (if applicable):
N/A

How reproducible:
Happens every time, regardless of .src.rpm.

Steps to Reproduce:
1.Upload a .src.rpm to a git repository.
2.Link file via url to COPR.
3.Launch build.

Actual results:
The error output below:
2. Task: 449407-f24, importing the package: https://github.com/AndyMender/fedora_packages/blob/master/catcodec-1.0.5-1.src.rpm
downloading package https://github.com/AndyMender/fedora_packages/blob/master/catcodec-1.0.5-1.src.rpm
Verifying packagage, getting  name and version.
Exception raised during srpm import:
Traceback (most recent call last):
  File "/usr/share/copr/dist_git/dist_git_importer.py", line 539, in do_import
    task.package_name, task.package_version = self.pkg_name_evr(fetched_srpm_path)
  File "/usr/share/copr/dist_git/dist_git_importer.py", line 484, in pkg_name_evr
    raise SrpmQueryException('Error querying srpm: %s' % error)
SrpmQueryException: Error querying srpm: error: /tmp/tmpA1RW7n/package.src.rpm: not an rpm package (or package manifest)

Sending back: 
{"task_id": "449407-f24", "error": "srpm_query_failed"}

Expected results:
A successful package build.

Additional info:
N/A

Comment 1 clime 2016-09-05 09:44:23 UTC
Hello, you need to use direct links to the src.rpm file. Not the links to github previews of the file.

E.g. https://github.com/AndyMender/fedora_packages/raw/master/catcodec-1.0.5-1.src.rpm is correct (the "Raw" variant)