Repository: packit/packit-service
Issue: Utilise `srpm_build_deps` defined on job level

If the `srpm_build_deps` key is configured on the job level, it is ignored.

TODO:
- [ ] make sure job overriding works for `srpm_build_deps`
- [ ] access `srpm_build_deps` from job_config (e.g.[here](https://github.com/packit/packit-service/blob/d2fe54a117da05849eeef893b4ca20b7cc01d3a9/packit_service/worker/helpers/build/copr_build.py#L574))

Changed files:
packit_service/worker/handlers/copr.py, tests/unit/test_copr_build.py, packit_service/worker/helpers/build/copr_build.py

diff --git a/packit_service/worker/handlers/copr.py b/packit_service/worker/handlers/copr.py
index 98f5c39e..b1aae7d0 100644
--- a/packit_service/worker/handlers/copr.py
+++ b/packit_service/worker/handlers/copr.py
@@ -122,7 +122,7 @@ class CoprBuildHandler(RetriableJobHandler, GetCoprBuildJobHelperMixin):
         installed_at = self.get_packit_github_installation_time()
         if installed_at:
             installed_at = get_timezone_aware_datetime(installed_at)
-        if self.package_config.srpm_build_deps is not None or (
+        if self.job_config.srpm_build_deps is not None or (
             installed_at and installed_at > DATE_OF_DEFAULT_SRPM_BUILD_IN_COPR
         ):
             return self.copr_build_helper.run_copr_build_from_source_script()
diff --git a/packit_service/worker/helpers/build/copr_build.py b/packit_service/worker/helpers/build/copr_build.py
index 3eeabec5..e334604f 100644
--- a/packit_service/worker/helpers/build/copr_build.py
+++ b/packit_service/worker/helpers/build/copr_build.py
@@ -538,7 +538,7 @@ class CoprBuildJobHelper(BaseBuildJobHelper):
                     # use the latest stable chroot
                     script_chroot=self.get_latest_fedora_stable_chroot(),
                     script_builddeps=self.get_packit_copr_download_urls()
-                    + (self.package_config.srpm_build_deps or []),
+                    + (self.job_config.srpm_build_deps or []),
                     buildopts=buildopts,
                 )
             else:
diff --git a/tests/unit/test_copr_build.py b/tests/unit/test_copr_build.py
index fb662a35..d9f5516a 100644
--- a/tests/unit/test_copr_build.py
+++ b/tests/unit/test_copr_build.py
@@ -2296,7 +2296,7 @@ def test_run_copr_build_from_source_script(
             job_trigger_model_type=JobTriggerModelType.pull_request,
         ),
     )
-    helper.package_config.srpm_build_deps = srpm_build_deps
+    helper.job_config.srpm_build_deps = srpm_build_deps
     flexmock(JobTriggerModel).should_receive("get_or_create").with_args(
         type=JobTriggerModelType.pull_request, trigger_id=123
     ).and_return(flexmock(id=2, type=JobTriggerModelType.pull_request))
@@ -2392,7 +2392,7 @@ def test_run_copr_build_from_source_script_github_outage_retry(
         ),
         task=CeleryTask(flexmock(request=flexmock(retries=retry_number))),
     )
-    helper.package_config.srpm_build_deps = ["make", "findutils"]
+    helper.job_config.srpm_build_deps = ["make", "findutils"]
     flexmock(JobTriggerModel).should_receive("get_or_create").with_args(
         type=JobTriggerModelType.pull_request, trigger_id=123
     ).and_return(flexmock(id=2, type=JobTriggerModelType.pull_request))