#1470 Fix rawhide-to-release
Merged 3 years ago by praiskup. Opened 3 years ago by praiskup.
Unknown source fix-rawhide-to-release-2  into  master

@@ -104,10 +104,11 @@

                  # forked chroot may already exists, e.g. from prevoius

                  # 'rawhide-to-release-run'

                  dest_build_chroot = builds_logic.BuildChrootsLogic.new(

-                     copr=copr,

                      build=rbc.build,

                      mock_chroot=mock_chroot,

-                     **rbc.to_dict(),

+                     **rbc.to_dict({

+                         "__columns_except__": ["id"],

+                     }),

                  )

                  dest_build_chroot.status = StatusEnum("forked")

                  db.session.add(dest_build_chroot)

@@ -342,7 +342,7 @@

          fbuild.result_dir = '{:08}'.format(fbuild.id)

          fbuild.build_chroots = [

              self.create_object(models.BuildChroot, c,

-                                exclude=["id_", "build_id", "result_dir",

+                                exclude=["id", "build_id", "result_dir",

                                          "copr_chroot_id"])

              for c in build_chroots

          ]

@@ -1411,7 +1411,7 @@

      which means that there's only one configuration at any time.

      """

  

-     id_ = db.Column('id', db.Integer, primary_key=True)

+     id = db.Column('id', db.Integer, primary_key=True)

  

      __table_args__ = (

          # For now we don't allow adding multiple CoprChroots having the same
@@ -1524,7 +1524,7 @@

                              name="build_chroot_mock_chroot_id_build_id_uniq"),

      )

  

-     id_ = db.Column('id', db.Integer, primary_key=True)

+     id = db.Column('id', db.Integer, primary_key=True)

  

      # The copr_chrot field needs to be nullable because we don't remove

      # BuildChroot when we delete CoprChroot.

@@ -207,7 +207,7 @@

          assert len(self.c2.copr_chroots) == 2

          assert self.mc3 in self.c2.mock_chroots

          old_copr_chroot = self.c2.copr_chroots[1]

-         old_bch_ids = [bch.id_ for bch in old_copr_chroot.build_chroots]

+         old_bch_ids = [bch.id for bch in old_copr_chroot.build_chroots]

          CoprChrootsLogic.update_from_names(self.c2.user, self.c2, ["fedora-17-x86_64"])

          assert len(self.c2.copr_chroots) == 1

          assert self.mc3 not in self.c2.mock_chroots
@@ -218,7 +218,7 @@

  

          new_copr_chroot = self.c2.copr_chroots[1]

          assert old_copr_chroot != new_copr_chroot

-         assert old_bch_ids == [bch.id_ for bch in new_copr_chroot.build_chroots]

+         assert old_bch_ids == [bch.id for bch in new_copr_chroot.build_chroots]

  

  

  class TestPinnedCoprsLogic(CoprsTestCase):

file modified
+1 -1
@@ -84,7 +84,7 @@

  inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$

  

  # Regular expression which should only match correct class sttribute names

- class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,42}|(__.*__))$

+ class-attribute-rgx=id|([A-Za-z_][A-Za-z0-9_]{2,42}|(__.*__))$

  

  # Good variable names which should always be accepted, separated by a comma

  good-names=i,j,k,ex,Run,_

I don't want to merge this right now, I want to add an unit test first ... but I'd like to
get +1 for hot-fixing this so I can run the comand for adding the F33 chroot.

LGTM but the unit test will be appreciated.

Metadata Update from @praiskup:
- Pull-request tagged with: release-blocker

3 years ago

Pull-Request has been merged by praiskup

3 years ago

LGTM but the unit test will be appreciated.

Merged first, I'm running beaker tests now ... I'll send a separate patch for unit tests later today.