| |
@@ -24,8 +24,7 @@
|
| |
from copr_rpmbuild import providers
|
| |
from copr_rpmbuild.builders.mock import MockBuilder
|
| |
from copr_rpmbuild.helpers import read_config, extract_srpm, locate_srpm, \
|
| |
- SourceType, parse_copr_name, get_additional_repo_configs, \
|
| |
- copr_chroot_to_task_id, dump_live_log
|
| |
+ SourceType, parse_copr_name, dump_live_log, copr_chroot_to_task_id
|
| |
|
| |
try:
|
| |
from urllib.parse import urlparse, urljoin
|
| |
@@ -203,6 +202,9 @@
|
| |
if args.chroot:
|
| |
task['chroot'] = args.chroot
|
| |
|
| |
+ if args.copr:
|
| |
+ task['task_id'] = copr_chroot_to_task_id(args.copr, args.chroot)
|
| |
+
|
| |
if args.submode == 'scm':
|
| |
task['source_type'] = SourceType.SCM
|
| |
task['source_json'].update({
|
| |
@@ -214,11 +216,6 @@
|
| |
'srpm_build_method': args.srpm_build_method,
|
| |
})
|
| |
|
| |
- # temporary due to transition to using api3 instead of /backend/ interface
|
| |
- if not task.get('repos') and task.get('additional_repos'):
|
| |
- task['repos'] = get_additional_repo_configs(
|
| |
- task['additional_repos'], args.chroot, config.get('main', 'backend_url'))
|
| |
-
|
| |
return task
|
| |
|
| |
|
| |
@@ -255,11 +252,13 @@
|
| |
if not args.chroot:
|
| |
raise RuntimeError("Missing --chroot parameter")
|
| |
|
| |
+ task_id = None
|
| |
+ build_config_url_path = None
|
| |
+
|
| |
if args.build_id:
|
| |
task_id = "-".join([args.build_id, args.chroot])
|
| |
build_config_url_path = urljoin("/backend/get-build-task/", task_id)
|
| |
elif args.copr:
|
| |
- task_id = copr_chroot_to_task_id(args.copr, args.chroot)
|
| |
ownername, projectname = parse_copr_name(args.copr)
|
| |
get_params = {
|
| |
'ownername': ownername,
|
| |
@@ -268,9 +267,6 @@
|
| |
}
|
| |
build_config_url_path = ("/api_3/project-chroot/build-config?"
|
| |
+ urlencode(get_params))
|
| |
- else:
|
| |
- task_id = None
|
| |
- build_config_url_path = None
|
| |
|
| |
task = get_task(args, config, build_config_url_path, task_id)
|
| |
log_task(task)
|
| |
@@ -296,11 +292,13 @@
|
| |
if not args.chroot:
|
| |
raise RuntimeError("Missing --chroot parameter")
|
| |
|
| |
+ task_id = None
|
| |
+ build_config_url_path = None
|
| |
+
|
| |
if args.build_id:
|
| |
task_id = "-".join([args.build_id, args.chroot])
|
| |
build_config_url_path = urljoin("/backend/get-build-task/", task_id)
|
| |
elif args.copr:
|
| |
- task_id = copr_chroot_to_task_id(args.copr, args.chroot)
|
| |
ownername, projectname = parse_copr_name(args.copr)
|
| |
get_params = {
|
| |
'ownername': ownername,
|
| |
@@ -309,9 +307,6 @@
|
| |
}
|
| |
build_config_url_path = ("/api_3/project-chroot/build-config?"
|
| |
+ urlencode(get_params))
|
| |
- else:
|
| |
- task_id = None
|
| |
- build_config_url_path = None
|
| |
|
| |
task = get_task(args, config, build_config_url_path, task_id)
|
| |
log_task(task)
|
| |
This PR is an alternative solution for #427.
The previous implementation is introduced in PR#435.
The issue is in depth explained in 405#comment-65090.
Although the
build_config
API structure needs to be a bit more complicated, there are several benefits of preprocessing repo URLs on frontend.backend_url