#1990 allow debuginfo for sidetag repos
Merged 4 years ago by tkopecek. Opened 4 years ago by tkopecek.
tkopecek/koji issue540  into  master

file modified
+2 -1
@@ -5323,7 +5323,8 @@ 

              kwargs['with_src'] = True

          if separate_src:

              kwargs['with_separate_src'] = True

-         if debuginfo:

+         # generate debuginfo repo if requested or if specified in sidetag's extra

+         if debuginfo or tinfo['extra'].get('with_debuginfo'):

              kwargs['with_debuginfo'] = True

          repo_id, event_id = self.session.host.repoInit(tinfo['id'], **kwargs)

          path = koji.pathinfo.repo(repo_id, tinfo['name'])

file modified
+5 -1
@@ -30,12 +30,16 @@ 

      parser.add_argument(

          "-w", "--wait", action="store_true", help=_("Wait until repo is ready.")

      )

+     parser.add_argument(

+         "--debuginfo", action="store_true", help=_("Buildroot repo will contain debuginfos")

+     )

+ 

      opts = parser.parse_args(args)

  

      activate_session(session, options)

  

      try:

-         tag = session.createSideTag(opts.basetag)

+         tag = session.createSideTag(opts.basetag, debuginfo=opts.debuginfo)

      except koji.ActionNotAllowed:

          parser.error(_("Policy violation"))

  

file modified
+12 -6
@@ -25,11 +25,14 @@ 

  

  

  @export

- def createSideTag(basetag):

+ def createSideTag(basetag, debuginfo=False):

      """Create a side tag.

  

      :param basetag: name or ID of base tag

      :type basetag: str or int

+ 

+     :param debuginfo: should buildroot repos contain debuginfo?

+     :type debuginfo: bool

      """

  

      # Any logged-in user is able to request creation of side tags,
@@ -61,15 +64,18 @@ 

      # id assigned by _create_tag

      tag_id = nextval("tag_id_seq") + 1

      sidetag_name = "%s-side-%s" % (basetag["name"], tag_id)

+     extra = {

+         "sidetag": True,

+         "sidetag_user": user["name"],

+         "sidetag_user_id": user["id"],

+     }

+     if debuginfo:

+         extra['with_debuginfo'] = True

      sidetag_id = _create_tag(

          sidetag_name,

          parent=basetag["id"],

          arches=basetag["arches"],

-         extra={

-             "sidetag": True,

-             "sidetag_user": user["name"],

-             "sidetag_user_id": user["id"],

-         },

+         extra=extra,

      )

      _create_build_target(sidetag_name, sidetag_id, sidetag_id)

  

Branched from PR #1956 (needs to be merged first).

Fixes: https://pagure.io/koji/issue/540

I see that it is not possible to turn debuginfo after sidetag was created, can we make this option per tag so that edit-tag can be used to enable debuginfo? ofc it should be disabled by default for all non-side tags.

Ah, that makes sense. I'll do that. It will be also independent on inclusion of sidetag plugin.

rebased onto 299db846cf8aae85d5e5f77f4901db2061dfe04a

4 years ago

rebased onto b63795dffa1cdd0210a9fbbb7be202d80bceaec8

4 years ago

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

4 years ago

pretty please pagure-ci rebuild

4 years ago

rebased onto c35069f

4 years ago

1 new commit added

  • fix typo
4 years ago

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

4 years ago

Commit ee615ed fixes this pull-request

Pull-Request has been merged by tkopecek

4 years ago