nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: packit-service/packit
Pull request #517 (2019-09-09 15:44:05)

Allow slash in git_url
Fixes following issue:
After running:
```
git clone https://github.com/containerbuildsystem/atomic-reactor/
cd atomic-reactor
packit generate
```
the packit.yml was weird
```
# See the documentation for more information:
# https://packit.dev/docs/configuration/

specfile_path: .spec

# add or remove files that should be synced
synced_files:
    - .spec
    - .packit.yaml

# name in upstream package repository/registry (e.g. in PyPI)
upstream_project_name:
# downstream (Fedora) RPM package name
downstream_package_name:
```


Patch:
diff --git a/packit/utils.py b/packit/utils.py
index 194ffbba..9e4304ae 100644
--- a/packit/utils.py
+++ b/packit/utils.py
@@ -179,6 +179,7 @@ def get_repo(url: str, directory: str = None) -> git.Repo:
 
 
 def get_namespace_and_repo_name(url: str) -> Tuple[str, str]:
+    url = url.strip("/")
     try:
         if url.endswith(".git"):
             url = url[:-4]


Test patch:
diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py
index b2fd8e61..b7e13e87 100644
--- a/tests/unit/test_utils.py
+++ b/tests/unit/test_utils.py
@@ -30,6 +30,7 @@ from packit.utils import get_namespace_and_repo_name, is_str_url
     "url,namespace,repo_name",
     [
         ("https://github.com/org/name", "org", "name"),
+        ("https://github.com/org/name/", "org", "name"),
         ("https://github.com/org/name.git", "org", "name"),
         ("git@github.com:org/name", "org", "name"),
         ("git@github.com:org/name.git", "org", "name"),
Repository: packit-service/packit
Pull request #676 (2020-01-21 09:45:43)

Use lists for default job targets
Fixes: https://sentry.io/organizations/red-hat-0p/issues/1458585589/?project=1767823


Patch:
diff --git a/packit/config/job_config.py b/packit/config/job_config.py
index 9c1c0831..d819337e 100644
--- a/packit/config/job_config.py
+++ b/packit/config/job_config.py
@@ -23,7 +23,6 @@
 import logging
 from enum import Enum
 
-from packit.config.aliases import get_build_targets, get_branches
 from packit.exceptions import PackitConfigException
 
 logger = logging.getLogger(__name__)
@@ -86,11 +85,11 @@ default_jobs = [
     JobConfig(
         job=JobType.copr_build,
         trigger=JobTriggerType.pull_request,
-        metadata={"targets": get_build_targets("fedora-stable")},
+        metadata={"targets": ["fedora-stable"]},
     ),
     JobConfig(
         job=JobType.propose_downstream,
         trigger=JobTriggerType.release,
-        metadata={"dist-git-branch": get_branches("fedora-all")},
+        metadata={"dist-git-branch": ["fedora-all"]},
     ),
 ]


Test patch:
diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py
index 688dca0a..4f64b9aa 100644
--- a/tests/unit/test_config.py
+++ b/tests/unit/test_config.py
@@ -24,9 +24,9 @@ import os
 from pathlib import Path
 
 import pytest
-from flexmock import flexmock
 from marshmallow import ValidationError
 
+from flexmock import flexmock
 from ogr import GithubService, PagureService
 from ogr.abstract import GitProject, GitService
 from packit.actions import ActionName
@@ -40,7 +40,6 @@ from packit.config import (
     SyncFilesConfig,
     SyncFilesItem,
 )
-from packit.config.aliases import get_build_targets, get_branches
 
 
 def get_job_config_dict_simple():
@@ -72,12 +71,12 @@ def get_default_job_config():
         JobConfig(
             job=JobType.copr_build,
             trigger=JobTriggerType.pull_request,
-            metadata={"targets": get_build_targets("fedora-stable")},
+            metadata={"targets": ["fedora-stable"]},
         ),
         JobConfig(
             job=JobType.propose_downstream,
             trigger=JobTriggerType.release,
-            metadata={"dist-git-branch": get_branches("fedora-all")},
+            metadata={"dist-git-branch": ["fedora-all"]},
         ),
     ]