#2178 frontend: builds after resubmit have different built packages
Merged 3 years ago by praiskup. Opened 3 years ago by schlupov.
copr/ schlupov/copr fix_build_resubmit  into  main

@@ -731,7 +731,7 @@ 

              something_added = True

              additional_args = {}

              if git_hashes:

-                 additional_args["git_hash"] = git_hashes.get(chroot)

+                 additional_args["git_hash"] = git_hashes.get(chroot.name)

              if status is None:

                  status = StatusEnum("waiting")

              buildchroot = BuildChrootsLogic.new(

@@ -379,6 +379,14 @@ 

          with pytest.raises(NoResultFound):

              BuildsLogic.get(self.b4.id).one()

  

+     @pytest.mark.usefixtures("f_users", "f_coprs", "f_mock_chroots", "f_builds")

+     def test_resubmit_build_inherit_git_hash(self):

+         orig_git_hash = self.b1.build_chroots[0].git_hash

+         self.b1.source_type = 2  # builds from upload should inherit the git hash

+         new_build = BuildsLogic.create_new_from_other_build(self.u1, self.c1, self.b1)

+         new_git_hash = new_build.build_chroots[0].git_hash

+         assert orig_git_hash == new_git_hash

+ 

      def test_mark_as_failed(self, f_users, f_coprs, f_mock_chroots, f_builds):

          self.b1.source_status = StatusEnum("succeeded")

          self.db.session.commit()

Build succeeded.

I broke it here: a5fe445

Can you please refer to that commit in commit message, and add a simple unit-test exposing the bug?

rebased onto a15039c64acc0a64fb4e23393eb06c16200bbd91

3 years ago

rebased onto 925caa7

3 years ago

Build succeeded.

Pull-Request has been merged by praiskup

3 years ago