#800 [rpmbuild] drop SCM parameters from copr-rpmbuild
Merged 4 years ago by msuchy. Opened 4 years ago by frostyx.

file modified
-35
@@ -85,34 +85,10 @@ 

      base_parser.add_argument("--task-url", help="Full URL to a json task definition")

      base_parser.add_argument("--task-file", help="Path to a local json file with task definition")

  

-     subparsers = base_parser.add_subparsers(title="submodes", dest="submode")

-     scm_parser = subparsers.add_parser("scm", parents=[shared_parser],

-                                        help="Build from an SCM repository.")

- 

-     scm_parser.add_argument("--clone-url", required=True,

-                             help="clone url to a project versioned by Git or SVN, required")

-     scm_parser.add_argument("--commit", dest="committish", default="",

-                             help="branch name, tag name, or git hash to be built")

-     scm_parser.add_argument("--subdir", dest="subdirectory", default="",

-                             help="relative path from the repo root to the package content")

-     scm_parser.add_argument("--spec", default="",

-                             help="relative path from the subdirectory to the .spec file")

-     scm_parser.add_argument("--type", dest="type", choices=["git", "svn"], default="git",

-                             help="Specify versioning tool. Default is 'git'.")

-     scm_parser.add_argument("--method", dest="srpm_build_method", default="rpkg",

-                             choices=["rpkg", "tito", "tito_test", "make_srpm"],

-                             help="Srpm build method. Default is 'rpkg'.")

- 

-     subparsers.add_parser("default") # python 2.7 hack

- 

      return base_parser

  

  

  def main():

-     # hack for 2.7;  optional sub-parsers are supported since python 3.4?

-     if 'scm' not in sys.argv:

-         sys.argv.append('default')

- 

      parser = get_parser()

      args = parser.parse_args()

      config = read_config(args.config)
@@ -208,17 +184,6 @@ 

      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({

-             'clone_url': args.clone_url,

-             'committish': args.committish,

-             'subdirectory': args.subdirectory,

-             'spec': args.spec,

-             'type': args.type,

-             'srpm_build_method': args.srpm_build_method,

-         })

- 

      return task

  

  

  • It allowed building packages without needing a task definition.
    This sounds positive, but as a consequence, the task definition
    needed to be artificially constructed inside the copr-rpmbuild

  • It was not used within Copr infrastructure and therefore violated
    the main purpose of copr-rpmbuild, which is reproducing Copr build
    the same way it was done in Copr

  • To some extent, it just duplicated what rpkg does

Since supposedly there are users of this feature, I wrote a blog post explaining the reasoning behind dropping the feature and also what to use instead. Please see

https://github.com/FrostyX/frostyx.github.io/blob/master/_drafts/dropping-copr-rpmbuild-scm-support.md

In the GitHub preview, there is not properly showed code from a gist snippet, you can find it here

https://gist.github.com/FrostyX/ba098eb74147842174aff59017f1af43

I've intentionally put it as an example snippet instead of putting it in our codebase because I don't want us to be responsible for maintaing it.

rebased onto 0fc7690028aa34c562f4830d8177daeaaadedbde

4 years ago

rebased onto bb7815f

4 years ago

Pull-Request has been merged by msuchy

4 years ago