anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: codeforboston/police-data-trust
Issue: [BUG] Logging in doesn't work in dev environment.

**Describe the bug**
Logging in doesn't work in dev environment.

**To Reproduce**
1. <code>docker-compose up --build</code>
2. Log in.
3. request to /login is ok but /whoami fails CORS.

**Expected behavior**
Should be able to log in and access pages.

 - OS: Windows 10
 - Browser: Chrome
 - Version: 104.0.5112.101

Changed files:
backend/routes/auth.py

diff --git a/backend/routes/auth.py b/backend/routes/auth.py
index b153d28..6659ac6 100644
--- a/backend/routes/auth.py
+++ b/backend/routes/auth.py
@@ -136,10 +136,10 @@ def logout():
 
 
 @bp.route("/whoami", methods=["GET"])
+@cross_origin()
 @jwt_required()
 @min_role_required(UserRole.PUBLIC)
 @validate()
-@cross_origin()
 def test_auth():
     """Returns the currently-authenticated user."""
     current_identity = get_jwt_identity()
Repository: packit/packit-service
Issue: Testing errors are not displayed

Seems errors do not get to test result description as displayed by Packit. The status stays in `Pending — Tests are running ...`.

Currently this can be seen here:
https://github.com/oamg/convert2rhel/pull/11

Or here:
https://github.com/psss/tmt/pull/26

Changed files:
packit_service/worker/parser.py

diff --git a/packit_service/worker/parser.py b/packit_service/worker/parser.py
index be5a56df..33d92497 100644
--- a/packit_service/worker/parser.py
+++ b/packit_service/worker/parser.py
@@ -400,7 +400,7 @@ class Parser:
                 result=TestingFarmResult(raw_test["result"]),
                 log_url=raw_test.get("log"),
             )
-            for raw_test in event.get("tests")
+            for raw_test in event.get("tests", [])
         ]
 
         logger.info(f"Results from Testing farm event. Pipeline ID: {pipeline_id}")
Repository: packit/packit-service
Issue: Build not run when test configured for trigger and build for different trigger

Example PR: https://github.com/psss/fmf/pull/88

As @lbarcziova has proposed, we should check that we don't skip build in that case.

Changed files:
packit_service/worker/handlers/github_handlers.py, tests/integration/test_handler.py

diff --git a/packit_service/worker/handlers/github_handlers.py b/packit_service/worker/handlers/github_handlers.py
index 51d11449..f726d63d 100644
--- a/packit_service/worker/handlers/github_handlers.py
+++ b/packit_service/worker/handlers/github_handlers.py
@@ -264,13 +264,15 @@ class AbstractCoprBuildHandler(JobHandler):
     def pre_check(self) -> bool:
         is_copr_build: Callable[[JobConfig], bool] = (
             lambda job: job.type == JobType.copr_build
+            and job.trigger == self.job_config.trigger
         )
 
         if self.job_config.type == JobType.tests and any(
             filter(is_copr_build, self.package_config.jobs)
         ):
             logger.info(
-                "Skipping build for testing. The COPR build is defined in the config."
+                "Skipping build for testing. The COPR build is defined "
+                "in the config with the same trigger."
             )
             return False
         return True
diff --git a/tests/integration/test_handler.py b/tests/integration/test_handler.py
index 265691c6..f26a5b94 100644
--- a/tests/integration/test_handler.py
+++ b/tests/integration/test_handler.py
@@ -111,3 +111,26 @@ def test_precheck_skip_tests_when_build_defined(github_pr_event):
         data=EventData.from_event_dict(github_pr_event.get_dict()),
     )
     assert not copr_build_handler.pre_check()
+
+
+def test_precheck_tests_and_build_with_different_trigger(github_pr_event):
+    copr_build_handler = AbstractCoprBuildHandler(
+        package_config=PackageConfig(
+            jobs=[
+                JobConfig(
+                    type=JobType.copr_build,
+                    trigger=JobConfigTriggerType.commit,
+                ),
+                JobConfig(
+                    type=JobType.tests,
+                    trigger=JobConfigTriggerType.pull_request,
+                ),
+            ]
+        ),
+        job_config=JobConfig(
+            type=JobType.tests,
+            trigger=JobConfigTriggerType.pull_request,
+        ),
+        data=EventData.from_event_dict(github_pr_event.get_dict()),
+    )
+    assert copr_build_handler.pre_check()
Repository: packit/packit-service
Issue: KeyError: 'msg'

Sentry Issue: [RED-HAT-0P-2JF](https://sentry.io/organizations/red-hat-0p/issues/1674908732/?referrer=github_integration)

```python
        task_results = {"jobs": jobs_results, "event": event_object.get_dict()}
        for v in jobs_results.values():
            if not (v and v["success"]):
                logger.warning(task_results)
                logger.error(v["details"]["msg"])
        return task_results
```

```python
KeyError: 'msg'
  File "packit_service/worker/tasks.py", line 57, in process_message
    event=event, topic=topic, source=source
  File "packit_service/worker/jobs.py", line 477, in process_message
    logger.error(v["details"]["msg"])
```

Affected PR: https://github.com/oamg/convert2rhel/pull/82

Changed files:
packit_service/worker/build/copr_build.py

diff --git a/packit_service/worker/build/copr_build.py b/packit_service/worker/build/copr_build.py
index 16583e6e..b38ccce0 100644
--- a/packit_service/worker/build/copr_build.py
+++ b/packit_service/worker/build/copr_build.py
@@ -183,7 +183,10 @@ class CoprBuildJobHelper(BaseBuildJobHelper):
                 state=CommitStatus.error,
                 description=f"Submit of the build failed: {ex}",
             )
-            return TaskResults(success=False, details={"error": str(ex)})
+            return TaskResults(
+                success=False,
+                details={"msg": "Submit of the Copr build failed.", "error": str(ex)},
+            )
 
         for chroot in self.build_targets:
             copr_build = CoprBuildModel.get_or_create(
Repository: packit/packit-service
Issue: 'unmarshalresult' object has no attribute 'server_name'

worker @ `stg` fails to start:

```
Unable to load celery application.
'unmarshalresult' object has no attribute 'server_name'
```

Changed files:
packit_service/config.py

diff --git a/packit_service/config.py b/packit_service/config.py
index 3c1c6edd..dd01b5e8 100644
--- a/packit_service/config.py
+++ b/packit_service/config.py
@@ -112,7 +112,7 @@ class ServiceConfig(Config):
         # required to avoid circular imports
         from packit_service.schema import ServiceConfigSchema
 
-        config = ServiceConfigSchema().load(raw_dict)
+        config = ServiceConfigSchema().load_config(raw_dict)
 
         config.server_name = raw_dict.get("server_name", "localhost:5000")
Repository: packit/packit-service
Issue: "/packit test" does not trigger builds if there were none before

Pull request https://github.com/psss/tmt/pull/187 has been created by @FrNecas who is not a contributor of `tmt`, so tests were not scheduled. I manually asked packit to run tests using `/packit test` but tests [failed](https://console-testing-farm.apps.ci.centos.org/pipeline/2a8f5dfd-c28f-472b-ba32-4f849d963e1f) because the copr build has not been created.

Changed files:
packit_service/models.py, tests_requre/database/test_models.py, packit_service/worker/jobs.py

diff --git a/packit_service/models.py b/packit_service/models.py
index fe3650fd..5f0789ad 100644
--- a/packit_service/models.py
+++ b/packit_service/models.py
@@ -186,6 +186,11 @@ class PullRequestModel(Base):
                 session.add(pr)
             return pr
 
+    def get_copr_builds(self):
+        return JobTriggerModel.get_or_create(
+            type=JobTriggerModelType.pull_request, trigger_id=self.id
+        ).copr_builds
+
     def __repr__(self):
         return f"PullRequestModel(id={self.pr_id}, project={self.project})"
 
diff --git a/packit_service/worker/jobs.py b/packit_service/worker/jobs.py
index cb59968c..495bff15 100644
--- a/packit_service/worker/jobs.py
+++ b/packit_service/worker/jobs.py
@@ -28,6 +28,7 @@ from typing import Optional, Dict, Union, Type, Set
 
 from packit.config import JobType, PackageConfig, JobConfig
 from packit_service.config import ServiceConfig
+from packit_service.models import PullRequestModel
 from packit_service.log_versions import log_job_versions
 from packit_service.service.events import (
     PullRequestCommentGithubEvent,
@@ -245,6 +246,13 @@ class SteveJobs:
                     "msg": f"{msg} does not contain a valid packit-service command."
                 },
             )
+
+        if packit_action == CommentAction.test and isinstance(
+            event.db_trigger, PullRequestModel
+        ):
+            if not event.db_trigger.get_copr_builds():
+                packit_action = CommentAction.build
+
         handler_kls: Type[CommentActionHandler] = MAP_COMMENT_ACTION_TO_HANDLER.get(
             packit_action, None
         )
diff --git a/tests_requre/database/test_models.py b/tests_requre/database/test_models.py
index 853d2bb7..acadca20 100644
--- a/tests_requre/database/test_models.py
+++ b/tests_requre/database/test_models.py
@@ -494,3 +494,11 @@ def test_get_installation_by_account(
 ):
     assert InstallationModel.get_by_account_login("teg").sender_login == "teg"
     assert InstallationModel.get_by_account_login("Pac23").sender_login == "Pac23"
+
+
+def test_pr_get_copr_builds(
+    clean_before_and_after, a_copr_build_for_pr, different_pr_model
+):
+    pr_model = a_copr_build_for_pr.job_trigger.get_trigger_object()
+    assert a_copr_build_for_pr in pr_model.get_copr_builds()
+    assert not different_pr_model.get_copr_builds()
Repository: packit/packit-service
Issue: Fix the handling with testing farm results

When we get the results from testing farm, we do not process them correctly:
`[2020-03-17 16:08:07,532: WARNING/ForkPoolWorker-1] There is no handler for testing_farm_results event.`
`16:08:07.533 jobs.py           DEBUG  All jobs finished!`

Therefore the PR statuses are not updated.

Changed files:
packit_service/trigger_mapping.py, tests/unit/test_jobs.py

diff --git a/packit_service/trigger_mapping.py b/packit_service/trigger_mapping.py
index 9d622339..49bfb622 100644
--- a/packit_service/trigger_mapping.py
+++ b/packit_service/trigger_mapping.py
@@ -36,6 +36,7 @@ MAP_JOB_TRIGGER_TO_JOB_CONFIG_TRIGGER_TYPE: Dict[
     TheJobTriggerType.pr_comment: JobConfigTriggerType.pull_request,
     TheJobTriggerType.copr_start: JobConfigTriggerType.pull_request,
     TheJobTriggerType.copr_end: JobConfigTriggerType.pull_request,
+    TheJobTriggerType.testing_farm_results: JobConfigTriggerType.pull_request,
 }
 
 
diff --git a/tests/unit/test_jobs.py b/tests/unit/test_jobs.py
index 443e7bcb..d67c0bea 100644
--- a/tests/unit/test_jobs.py
+++ b/tests/unit/test_jobs.py
@@ -29,6 +29,7 @@ from packit_service.worker.handlers import (
     ProposeDownstreamHandler,
     CoprBuildStartHandler,
     CoprBuildEndHandler,
+    TestingFarmResultsHandler,
 )
 from packit_service.worker.handlers.github_handlers import (
     PullRequestGithubKojiBuildHandler,
@@ -199,6 +200,35 @@ from packit_service.worker.jobs import get_handlers_for_event
             {CoprBuildEndHandler},
             id="config=tests@trigger=copr_end",
         ),
+        pytest.param(
+            TheJobTriggerType.testing_farm_results,
+            [
+                JobConfig(
+                    type=JobType.tests,
+                    trigger=JobConfigTriggerType.pull_request,
+                    metadata={},
+                )
+            ],
+            {TestingFarmResultsHandler},
+            id="config=tests@trigger=testing_farm_results",
+        ),
+        pytest.param(
+            TheJobTriggerType.testing_farm_results,
+            [
+                JobConfig(
+                    type=JobType.tests,
+                    trigger=JobConfigTriggerType.pull_request,
+                    metadata={},
+                ),
+                JobConfig(
+                    type=JobType.copr_build,
+                    trigger=JobConfigTriggerType.pull_request,
+                    metadata={},
+                ),
+            ],
+            {TestingFarmResultsHandler},
+            id="config=tests_and_copr_build@trigger=testing_farm_results",
+        ),
         pytest.param(
             TheJobTriggerType.pull_request,
             [
Repository: packit/packit-service
Issue: failed propose-update not reported to user

https://github.com/fedora-iot/zezere/issues/2 gets in setry
```
UnknownObjectException
404 {'message': 'Not Found', 'documentation_url': 'https://developer.github.com/v3/repos/releases/#get-the-latest-release'}
```
But there was no info from packit about the error provided back to maintainer.

Changed files:
packit_service/worker/github_handlers.py

diff --git a/packit_service/worker/github_handlers.py b/packit_service/worker/github_handlers.py
index d9343040..dcd80a1c 100644
--- a/packit_service/worker/github_handlers.py
+++ b/packit_service/worker/github_handlers.py
@@ -26,6 +26,8 @@ This file defines classes for job handlers specific for Github hooks
 import logging
 from typing import Union, Any, Optional, List, Callable
 
+from github import UnknownObjectException
+
 from ogr.abstract import GitProject
 from packit.api import PackitAPI
 from packit.config import (
@@ -426,7 +428,7 @@ class GitHubIssueCommentProposeUpdateHandler(
         self.event = event
         self.project = self.event.get_project()
         # Get the latest tag release
-        self.event.tag_name = self.project.get_latest_release().tag_name
+        self.event.tag_name = self.get_tag_name()
         self.package_config: PackageConfig = self.get_package_config_from_repo(
             self.project, self.event.tag_name
         )
@@ -434,6 +436,20 @@ class GitHubIssueCommentProposeUpdateHandler(
             raise ValueError(f"No config file found in {self.project.full_repo_name}")
         self.package_config.upstream_project_url = event.project_url
 
+    def get_tag_name(self) -> Optional[str]:
+        """
+        Get the tag name of the latest upstream release.
+
+        :return: tag name
+        """
+        try:
+            tag_name = self.project.get_latest_release().tag_name
+            logger.debug(f"found the tag name of the latest release: {tag_name}")
+            return tag_name
+        except UnknownObjectException:
+            logger.debug("no upstream release found")
+            return None
+
     @property
     def dist_git_branches_to_sync(self) -> List[str]:
         """
@@ -463,6 +479,16 @@ class GitHubIssueCommentProposeUpdateHandler(
             self.project.issue_comment(self.event.issue_id, msg)
             return HandlerResults(success=True, details={"msg": msg})
 
+        if not self.event.tag_name:
+            msg = (
+                "There was an error while proposing a new update for the Fedora package: "
+                "no upstream release found."
+            )
+            self.project.issue_comment(self.event.issue_id, msg)
+            return HandlerResults(
+                success=False, details={"msg": "Propose update failed"}
+            )
+
         sync_failed = False
         for branch in self.dist_git_branches_to_sync:
             msg = (
Repository: packit/packit-service
Issue: 'JobConfig' object has no attribute 'type'

 - PR - https://github.com/packit-service/systemd-rhel8-flock/pull/9
 - sentry: https://sentry.io/organizations/red-hat-0p/issues/1450345291

Changed files:
packit_service/worker/github_handlers.py

diff --git a/packit_service/worker/github_handlers.py b/packit_service/worker/github_handlers.py
index 0eec6080..56c3b932 100644
--- a/packit_service/worker/github_handlers.py
+++ b/packit_service/worker/github_handlers.py
@@ -313,7 +313,7 @@ class GithubCoprBuildHandler(AbstractGithubJobHandler):
     def run(self) -> HandlerResults:
         is_copr_build: Callable[
             [JobConfig], bool
-        ] = lambda job: job.type == JobType.copr_build
+        ] = lambda job: job.job == JobType.copr_build
 
         if self.job.job == JobType.tests and any(
             filter(is_copr_build, self.package_config.jobs)
Repository: packit/packit-service
Issue: Reply containing "/packit copr-build" triggers new build

As can be seen [here](https://github.com/avocado-framework/avocado/pull/4468#issuecomment-802808629), a reply was made to a "/packit copr-build" line, and even with it being quoted, it triggered another unintentional build.

IMO, only explicit "/packit copr-build" lines should trigger new builds.

Changed files:
tests/integration/test_pr_comment.py, packit_service/worker/jobs.py

diff --git a/packit_service/worker/jobs.py b/packit_service/worker/jobs.py
index 239c19f3..97816e1d 100644
--- a/packit_service/worker/jobs.py
+++ b/packit_service/worker/jobs.py
@@ -119,24 +119,17 @@ def get_packit_commands_from_comment(comment: str) -> List[str]:
         logger.debug("Empty comment, nothing to do.")
         return []
 
-    cmd_start_index = comment.find(REQUESTED_PULL_REQUEST_COMMENT)
+    comment_lines = comment_parts.split("\\n")
 
-    if cmd_start_index == -1:
-        logger.debug(f"comment '{comment}' is not handled by packit-service.")
-        return []
-
-    (packit_mark, *packit_command) = comment[cmd_start_index:].split(maxsplit=3)
-    # packit_command[0] has the first cmd and [1] has the second, if needed.
+    for line in comment_lines:
+        (packit_mark, *packit_command) = line.split(maxsplit=3)
+        # packit_command[0] has the first cmd and [1] has the second, if needed.
 
-    if packit_mark != REQUESTED_PULL_REQUEST_COMMENT:
-        logger.debug(f"comment '{comment}' is not handled by packit-service.")
-        return []
-
-    if not packit_command:
-        logger.debug(f"comment '{comment}' does not contain a packit-service command.")
-        return []
+        if packit_mark == REQUESTED_PULL_REQUEST_COMMENT:
+            if packit_command:
+                return packit_command
 
-    return packit_command
+    return []
 
 
 def get_handlers_for_comment(comment: str) -> Set[Type[JobHandler]]:
diff --git a/tests/integration/test_pr_comment.py b/tests/integration/test_pr_comment.py
index 7ccef00a..3fda64a6 100644
--- a/tests/integration/test_pr_comment.py
+++ b/tests/integration/test_pr_comment.py
@@ -317,6 +317,8 @@ def test_pr_comment_production_build_handler(pr_production_build_comment_event):
         " stuff",
         " \\n ",
         "x ",
+        """comment with embedded /packit build not recognized
+        unless /packit command is on line by itself""",
     ),
 )
 def test_pr_comment_invalid(comment):
@@ -334,7 +336,7 @@ def test_pr_comment_invalid(comment):
         " /packit build ",
         "asd\\n/packit build\\n",
         "asd\\n /packit build \\n",
-        "Should be fixed now, lets /packit build it.",
+        "Should be fixed now, let's\\n /packit build\\n it.",
     ),
 )
 def test_pr_embedded_command_handler(
Repository: packit/packit-service
Issue: Duplicate project entries for GitLab

Duplicate project entries with `.git` suffix. No events are related to the duplicate rows, I suspect handling of the first processed event from the repo, only stage is affected. Going to remove those duplicates and will check here and there, since I cannot see any sources it may be just result of already fixed bug.

```json
[
  {
    "namespace": "lachmanfrantisek",
    "repo_name": "kernel-ark",
    "project_url": "https://gitlab.com/lachmanfrantisek/kernel-ark",
    "prs_handled": 1,
    "branches_handled": 0,
    "releases_handled": 0,
    "issues_handled": 0
  },
  {
    "namespace": "lachmanfrantisek",
    "repo_name": "kernel-ark",
    "project_url": "https://gitlab.com/lachmanfrantisek/kernel-ark.git",
    "prs_handled": 0,
    "branches_handled": 0,
    "releases_handled": 0,
    "issues_handled": 0
  },
]
```

Keeping issue open to not forget about it.

_Edit 1_: two rows on prod too
```
packit=# select * from git_projects where project_url like '%.git';
  id  |    namespace     | repo_name  | https_url |                    project_url                     | instance_url
------+------------------+------------+-----------+----------------------------------------------------+--------------
 3644 | lachmanfrantisek | kernel-ark |           | https://gitlab.com/lachmanfrantisek/kernel-ark.git | gitlab.com
 4968 | TomasTomecek     | qt         |           | https://gitlab.com/TomasTomecek/qt.git             | gitlab.com
(2 rows)
```

Changed files:
packit_service/service/api/webhooks.py

diff --git a/packit_service/service/api/webhooks.py b/packit_service/service/api/webhooks.py
index 6bfe1040..ba70c6bf 100644
--- a/packit_service/service/api/webhooks.py
+++ b/packit_service/service/api/webhooks.py
@@ -169,7 +169,7 @@ class GitlabWebhook(Resource):
     def create_confidential_issue_with_token(self):
         project_data = request.json["project"]
 
-        http_url = project_data["git_http_url"]
+        http_url = project_data["web_url"]
         parsed_url = parse_git_repo(potential_url=http_url)
 
         project_authentication_issue = ProjectAuthenticationIssueModel.get_project(
Repository: packit/packit-service
Issue: service changes mode of files when it differs from default umask

This is how we use [sandcastle](github.com/packit-service/sandcastle) now: it utilizes `oc cp` which is implemented using streaming tarballs and a tar command - tar drops the mode. If only we could use RWX PVs.

Related: https://github.com/packit-service/packit/pull/388

This is a limitation we have right now in our production deployment (and the underlying infrastructure). The best solution is probably to move to different cluster.

Changed files:
tests/unit/test_copr_build.py, tests/unit/test_reporting.py, packit_service/worker/reporting.py

diff --git a/packit_service/worker/reporting.py b/packit_service/worker/reporting.py
index 4c867dd0..5f131606 100644
--- a/packit_service/worker/reporting.py
+++ b/packit_service/worker/reporting.py
@@ -183,6 +183,15 @@ class StatusReporter:
             BaseCommitStatus.failure,
         }
 
+    def _commit_comment_already_added(self, comment: str) -> bool:
+        commit_comments = self.project.get_commit_comments(self.commit_sha)
+        if exists := any(c.comment == comment for c in commit_comments):
+            logger.debug(
+                "The following comment already exists for commit "
+                f"{self.commit_sha}\\n{comment}"
+            )
+        return exists
+
     def _add_commit_comment_with_status(
         self, state: BaseCommitStatus, description: str, check_name: str, url: str = ""
     ):
@@ -196,8 +205,7 @@ class StatusReporter:
             )
             + f"\\n\\n{description}"
         )
-        if not self.is_final_state(state):
-            # To avoid multiple comments for non-final states
+        if not self.is_final_state(state) or self._commit_comment_already_added(body):
             logger.debug(f"Not adding a '{check_name} is {state.name}' comment.")
             return
 
diff --git a/tests/unit/test_copr_build.py b/tests/unit/test_copr_build.py
index fc6ad40e..c3f667cf 100644
--- a/tests/unit/test_copr_build.py
+++ b/tests/unit/test_copr_build.py
@@ -1824,6 +1824,7 @@ def test_copr_build_success_gitlab_comment(gitlab_mr_event):
     exception.__cause__ = gitlab.GitlabError(response_code=403)
     flexmock(pr.source_project).should_receive("set_commit_status").and_raise(exception)
     flexmock(GitlabProject).should_receive("commit_comment").and_return()
+    flexmock(GitlabProject).should_receive("get_commit_comments").and_return([])
     flexmock(SRPMBuildModel).should_receive("create_with_new_run").and_return(
         (
             flexmock(status="success", id=42)
diff --git a/tests/unit/test_reporting.py b/tests/unit/test_reporting.py
index ad18d5b3..fe2701c5 100644
--- a/tests/unit/test_reporting.py
+++ b/tests/unit/test_reporting.py
@@ -312,7 +312,7 @@ def test_commit_comment_instead_of_status(
         )
         + f"\\n\\n{description}",
     )
-
+    project.should_receive("get_commit_comments").and_return([])
     if has_pr_id:
         project.should_receive("get_pr").with_args(pr_id).and_return(pr_object)
Repository: packit/packit-service
Issue: Can't map Epel-6 (from epel-6) to [... CentOS-6 ...]

Sentry Issue: [PACKIT-SERVICE-3N5](https://sentry.io/organizations/red-hat-0p/issues/2636836262/?referrer=github_integration)

```
Can't map Epel-6 (from epel-6) to ['Fedora-32', 'Fedora-32-aarch64', 'Fedora-33', 'Fedora-33-aarch64', 'Fedora-34', 'Fedora-34-aarch64', 'Fedora-35', 'Fedora-35-aarch64', 'Fedora-Rawhide', 'Fedora-Rawhide-aarch64', 'CentOS-6', 'CentOS-7', 'CentOS-7-aarch64', 'CentOS-8', 'CentOS-8-aarch64', 'CentOS-Stream-8', 'CentOS-Stream-8-aarch64', 'CentOS-Stream-9', 'CentOS-Stream-9-aarch64']
```

Testing Farm [has CentOS-6 compose](https://api.dev.testing-farm.io/v0.1/composes) so this should be just about adding it to [the mapping](https://github.com/packit/packit-service/blob/f7101d20e2e09c4940009225f0cd9ccf644f646f/packit_service/worker/testing_farm.py#L216).


Changed files:
packit_service/worker/testing_farm.py, tests/unit/test_testing_farm.py

diff --git a/packit_service/worker/testing_farm.py b/packit_service/worker/testing_farm.py
index cf74e091..ac412fe5 100644
--- a/packit_service/worker/testing_farm.py
+++ b/packit_service/worker/testing_farm.py
@@ -207,16 +207,15 @@ class TestingFarmJobHelper(CoprBuildJobHelper):
         """Get distro and arch from chroot."""
         distro, arch = chroot.rsplit("-", 1)
 
+        epel_mapping = {
+            "epel-6": "centos-6",
+            "epel-7": "centos-7",
+        }
+
         if self.job_config.metadata.use_internal_tf:
-            epel_mapping = {
-                "epel-7": "centos-7",
-                "epel-8": "centos-8",
-            }
+            epel_mapping["epel-8"] = "centos-8"
         else:
-            epel_mapping = {
-                "epel-7": "centos-7",
-                "epel-8": "centos-stream-8",
-            }
+            epel_mapping["epel-8"] = "centos-stream-8"
 
         distro = epel_mapping.get(distro, distro)
         return distro, arch
diff --git a/tests/unit/test_testing_farm.py b/tests/unit/test_testing_farm.py
index 3cd223f5..f6b5a700 100644
--- a/tests/unit/test_testing_farm.py
+++ b/tests/unit/test_testing_farm.py
@@ -148,6 +148,7 @@ def test_testing_farm_response(
         ("fedora-33-x86_64", "fedora-33", "x86_64", False),
         ("fedora-rawhide-aarch64", "fedora-rawhide", "aarch64", False),
         ("centos-stream-x86_64", "centos-stream", "x86_64", False),
+        ("epel-6-x86_64", "centos-6", "x86_64", False),
         ("epel-7-x86_64", "centos-7", "x86_64", False),
         ("epel-8-x86_64", "centos-stream-8", "x86_64", False),
         ("fedora-33-x86_64", "fedora-33", "x86_64", True),
Repository: owid/etl
Issue: Include checksum of walden JSON file in source checksum

## Problem

When the ETL decides whether a dataset is up to date, it bases that decision off of a `source_checksum` of a dependency. For Walden snapshots, we use the `md5` field of the JSON file.

However, if you build everything, then change metadata in the Walden JSON file, it will not be detected and the data will not rebuild

## Expected behaviour

Any change to the metadata in a Walden file should trigger a rebuild of any downstream datasets.

## Proposes solution

Checksum the JSON file itself as a dependency, not just the data file it references.

Changed files:
etl/steps/__init__.py

diff --git a/etl/steps/__init__.py b/etl/steps/__init__.py
index 581f71277..43c6ae08f 100644
--- a/etl/steps/__init__.py
+++ b/etl/steps/__init__.py
@@ -391,11 +391,18 @@ class WaldenStep(Step):
         return True
 
     def checksum_output(self) -> str:
-        checksum: str = cast(str, self._walden_dataset.md5)
-        if not checksum:
-            raise Exception(
-                f"no md5 checksum available for walden dataset: {self.path}"
-            )
+        if not self._walden_dataset.md5:
+            raise Exception(f"walden dataset is missing checksum: {self}")
+
+        inputs = [
+            # the contents of the dataset
+            self._walden_dataset.md5,
+            # the metadata describing the dataset
+            files.checksum_file(self._walden_dataset.index_path),
+        ]
+
+        checksum = hashlib.md5(",".join(inputs).encode("utf8")).hexdigest()
+
         return checksum
 
     @property
Repository: owid/etl
Issue: SDG grapher step generates a non-deterministic short-name

## Problem

As part of a comparison of Pandas 1.5.1 and 1.5.2 output for the ETL, it appears that many tables in the `data/grapher/un_sdg/2022-07-07/un_sdg` dataset get minor renames like below.

Before: `data/grapher/un_sdg/2022-07-07/un_sdg/_10_3_1__vc_vov_gdsd__no_breakdown_by_disability__age__all_areas__both_sexes.feather`

After: `data/grapher/un_sdg/2022-07-07/un_sdg/_10_3_1__vc_vov_gdsd__all_areas__no_breakdown_by_disability__age__both_sexes.feather`

My interpretation is that the table names are being generated by exploding dimensions, but the explosion is not done in a deterministic order.

## Impact

It's not a big deal for our usage in Grapher, but it makes QA on them more difficult, and it means the short names aren't stable handles for these variables at the moment.

Changed files:
etl/steps/data/grapher/un_sdg/2022-07-07/un_sdg.py

diff --git a/etl/steps/data/grapher/un_sdg/2022-07-07/un_sdg.py b/etl/steps/data/grapher/un_sdg/2022-07-07/un_sdg.py
index 657fffdbd..12b0d7095 100644
--- a/etl/steps/data/grapher/un_sdg/2022-07-07/un_sdg.py
+++ b/etl/steps/data/grapher/un_sdg/2022-07-07/un_sdg.py
@@ -130,7 +130,7 @@ def create_dataframe_with_variable_name(dataset: Dataset, tab: str) -> pd.DataFr
     cols_meta = ["indicator", "seriesdescription", "seriescode"]
     cols = ["indicator", "seriescode"]
     if tab_df.shape[1] > 11:
-        col_list = tab_df.columns.to_list()
+        col_list = sorted(tab_df.columns.to_list())
         drop_cols = [
             "country",
             "year",