anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: packit/packit
Issue: `packit status` shows outdated versions in distgit

```
[root@d89e68a897ca /]# packit status https://github.com/TomasTomecek/sen
Packit 0.8.1 is being used.
Input is a URL to a git repo: https://github.com/TomasTomecek/sen
Input directory is an upstream repository.
won't be doing kinit, no credentials provided
ERROR    Failed when getting Copr builds: There is no config file: /root/.config/copr

No downstream PRs found.

Dist-git versions:
f23: 0.4.0
f24: 0.4.0
f25: 0.4.0
f26: 0.4.0
f27: 0.4.0
f28: 0.4.0
f29: 0.4.0
f30: 0.4.0
f31: 0.4.0
master: 0.4.0

Upstream releases:
0.6.1
0.6.0
0.5.1
0.5.0
0.4.0

Latest Bodhi updates:
Update              Karma  status
----------------  -------  --------
sen-0.6.1-4.fc32        0  stable
sen-0.6.1-1.fc30        0  stable
sen-0.6.0-1.fc28        0  stable

Latest Koji builds:
fc30: sen-0.6.1-1.fc30
fc31: sen-0.6.1-2.fc31
fc32: sen-0.6.1-4.fc32
```

As you can see, bodhi and koji builds have 0.6.1 while all dist-git branches have 0.4 displayed. Which is wrong. I just checked and rawhide indeed has 0.6.1. Something's wrong.


Changed files:
packit/status.py

diff --git a/packit/status.py b/packit/status.py
index ef9c3543..a09a187c 100644
--- a/packit/status.py
+++ b/packit/status.py
@@ -84,6 +84,7 @@ class Status:
                     branch, base=f"remotes/origin/{branch}", setup_tracking=False
                 )
                 self.dg.checkout_branch(branch)
+                self.dg.specfile.update_spec()
             except Exception as ex:
                 logger.debug(f"Branch {branch} is not present: {ex}")
                 continue
Repository: packit/packit
Issue: Config.get_user_config() debug logs never shown

I was trying to discover where packit actually loads my user config from and realized that the debug messages in [Config.get_user_config()](https://github.com/packit-service/packit/blob/master/packit/config.py#L109) are never shown even when running `packit -d`.
The reason is probably that the [logging level is set](https://github.com/packit-service/packit/blob/master/packit/cli/packit_base.py#L65) after the function being already called.

Changed files:
packit/cli/packit_base.py, packit/utils.py

diff --git a/packit/cli/packit_base.py b/packit/cli/packit_base.py
index 87775b89..14f6e361 100644
--- a/packit/cli/packit_base.py
+++ b/packit/cli/packit_base.py
@@ -55,8 +55,9 @@ logger = logging.getLogger("packit")
 @click.pass_context
 def packit_base(ctx, debug, fas_user, keytab, dry_run):
     """Integrate upstream open source projects into Fedora operating system."""
-    packit_version = get_distribution("packitos").version
-    logger.info(f"Packit {packit_version} is being used.")
+    if debug:
+        # to be able to logger.debug() also in get_user_config()
+        set_logging(level=logging.DEBUG)
 
     c = Config.get_user_config()
     c.debug = debug or c.debug
@@ -64,13 +65,15 @@ def packit_base(ctx, debug, fas_user, keytab, dry_run):
     c.fas_user = fas_user or c.fas_user
     c.keytab_path = keytab or c.keytab_path
     ctx.obj = c
+
     if ctx.obj.debug:
         set_logging(level=logging.DEBUG)
         set_logging(logger_name="sandcastle", level=logging.DEBUG)
-        logger.debug("logging set to DEBUG")
     else:
         set_logging(level=logging.INFO)
-        logger.debug("logging set to INFO")
+
+    packit_version = get_distribution("packitos").version
+    logger.info(f"Packit {packit_version} is being used.")
 
 
 packit_base.add_command(update)
diff --git a/packit/utils.py b/packit/utils.py
index 76a15c35..30e89b12 100644
--- a/packit/utils.py
+++ b/packit/utils.py
@@ -144,6 +144,7 @@ def set_logging(
     if level != logging.NOTSET:
         logger = logging.getLogger(logger_name)
         logger.setLevel(level)
+        logger.debug(f"logging set to {logging.getLevelName(level)}")
 
         # do not readd handlers if they are already present
         if not [x for x in logger.handlers if isinstance(x, handler_class)]:
Repository: packit/packit
Issue: packit sync-from-downstream: do not create a new branch when --no-pr

The branch is not needed when a PR is not being created.

Changed files:
packit/api.py

diff --git a/packit/api.py b/packit/api.py
index 5377f955..4ce2f84e 100644
--- a/packit/api.py
+++ b/packit/api.py
@@ -301,11 +301,14 @@ class PackitAPI:
         self.dg.update_branch(dist_git_branch)
         self.dg.checkout_branch(dist_git_branch)
 
-        local_pr_branch = f"{dist_git_branch}-downstream-sync"
         logger.info(f'using "{dist_git_branch}" dist-git branch')
 
-        self.up.create_branch(local_pr_branch)
-        self.up.checkout_branch(local_pr_branch)
+        if no_pr:
+            self.up.checkout_branch(upstream_branch)
+        else:
+            local_pr_branch = f"{dist_git_branch}-downstream-sync"
+            self.up.create_branch(local_pr_branch)
+            self.up.checkout_branch(local_pr_branch)
 
         raw_sync_files = self.package_config.synced_files.get_raw_files_to_sync(
             dest_dir=Path(self.dg.local_project.working_dir),
Repository: packit/packit
Issue: comment in `.packit.yaml` generated by packit is ambiguous

We came to the problem during our Flock workshop [this comment](https://github.com/packit-service/packit/blob/daad3f859762cd8bdf89d32365bae118ca32c31b/packit/constants.py#L70) is confusing for users.
```
# change these lines if upstream project name is not the same as downstream
```

 It might indicate that these options could be deleted completely when the downstream name equals to the upstream.

Changed files:
packit/constants.py

diff --git a/packit/constants.py b/packit/constants.py
index b4796ad0..d1a08753 100644
--- a/packit/constants.py
+++ b/packit/constants.py
@@ -67,8 +67,9 @@ synced_files:
     - {downstream_package_name}.spec
     - .packit.yaml
 
-# change these lines if upstream project name is not the same as downstream
+# name in upstream package repository/registry (e.g. in PyPI)
 upstream_project_name: {upstream_project_name}
+# downstream (Fedora) RPM package name
 downstream_package_name: {downstream_package_name}
 """
Repository: packit/packit
Issue: Signed-off-by: Packit <hello@packit.dev> -- what is the purpose and meaning?

### What happened? What is the problem?

I see the commits in Fedora dist-git by packit have `Signed-off-by: Packit <hello@packit.dev>` in the commit messages.

 - This is not required in Fedora, EPEL, RHEL, CentOS Stream. There is nothing to sign off.
 - How can a robot/program legally sign anything off? What does this even mean?

### What did you expect to happen?

No `Signed-off-by: Packit <hello@packit.dev>`.

### Example URL(s)

_No response_

### Steps to reproduce

_No response_

### Workaround

- [ ] There is an existing workaround that can be used until this issue is fixed.

### Participation

- [ ] I am willing to submit a pull request for this issue. (Packit team is happy to help!)

Changed files:
packit/base_git.py

diff --git a/packit/base_git.py b/packit/base_git.py
index 11b36e3b..cdd6166f 100644
--- a/packit/base_git.py
+++ b/packit/base_git.py
@@ -177,8 +177,7 @@ class PackitRepositoryBase:
         self.local_project.git_repo.index.write()
 
         with commit_message_file(main_msg, msg, trailers) as commit_message:
-            # TODO: make -s configurable
-            commit_args = ["-s", "-F", commit_message]
+            commit_args = ["-F", commit_message]
             self.local_project.git_repo.git.commit(*commit_args)
 
     def run_action(self, actions: ActionName, method: Callable = None, *args, **kwargs):
Repository: packit/packit
Issue: fedora-latest points to F37 when it should point to F38

https://github.com/rhinstaller/anaconda/pull/4574#issuecomment-1439914245

something's not right

Changed files:
packit/config/aliases.py

diff --git a/packit/config/aliases.py b/packit/config/aliases.py
index 7d6bebe8..d3340479 100644
--- a/packit/config/aliases.py
+++ b/packit/config/aliases.py
@@ -13,12 +13,12 @@ from packit.utils.commands import run_command
 from packit.utils.decorators import fallback_return_value
 
 ALIASES: Dict[str, List[str]] = {
-    "fedora-all": ["fedora-35", "fedora-36", "fedora-37", "fedora-rawhide"],
-    "fedora-stable": ["fedora-35", "fedora-36"],
-    "fedora-development": ["fedora-rawhide", "fedora-37"],
-    "fedora-latest": ["fedora-37"],
-    "fedora-latest-stable": ["fedora-36"],
-    "fedora-branched": ["fedora-35", "fedora-36", "fedora-37"],
+    "fedora-all": ["fedora-36", "fedora-37", "fedora-38", "fedora-rawhide"],
+    "fedora-stable": ["fedora-36", "fedora-37"],
+    "fedora-development": ["fedora-rawhide", "fedora-38"],
+    "fedora-latest": ["fedora-38"],
+    "fedora-latest-stable": ["fedora-37"],
+    "fedora-branched": ["fedora-36", "fedora-37", "fedora-38"],
     "epel-all": ["epel-7", "epel-8", "epel-9"],
 }
Repository: packit/packit
Issue: rsync in service constructs dist-git path incorrectly

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

```
PackitCommandFailedError: Command 'rsync --archive --ignore-missing-args /tmp/sandcastle/packaging/fedora/sscg.spec /tmp/packit-dist-gityplt7ctf/packaging/fedora/sscg.spec' failed.
(2 additional frame(s) were not displayed)
...
  File "packit_service/worker/handlers/distgit.py", line 126, in sync_branch
    self.api.sync_release(dist_git_branch=branch, tag=self.data.tag_name)
  File "packit/api.py", line 336, in sync_release
    self.update_dist_git(
  File "packit/api.py", line 189, in update_dist_git
    sync_files(synced_files)
  File "packit/sync.py", line 203, in sync_files
    run_command(command, print_live=True)
  File "packit/utils/commands.py", line 97, in run_command
    raise PackitCommandFailedError(
```

The dist-git path should be `/tmp/packit-dist-gityplt7ctf/sscg.spec`

Changed files:
tests/unit/test_package_config.py, packit/config/common_package_config.py

diff --git a/packit/config/common_package_config.py b/packit/config/common_package_config.py
index 0e33c48d..c64a4e61 100644
--- a/packit/config/common_package_config.py
+++ b/packit/config/common_package_config.py
@@ -5,6 +5,7 @@
 Common package config attributes so they can be imported both in PackageConfig and JobConfig
 """
 from os import getenv
+from os.path import basename
 from typing import Dict, List, Optional, Union
 
 from packit.actions import ActionName
@@ -136,7 +137,7 @@ class CommonPackageConfig:
         downstream_specfile_path = (
             f"{self.downstream_package_name}.spec"
             if self.downstream_package_name
-            else self.specfile_path
+            else basename(upstream_specfile_path)
         )
         return SyncFilesItem(
             src=[
diff --git a/tests/unit/test_package_config.py b/tests/unit/test_package_config.py
index 4f0560ca..8b8bf1b7 100644
--- a/tests/unit/test_package_config.py
+++ b/tests/unit/test_package_config.py
@@ -1236,6 +1236,19 @@ def test_get_specfile_sync_files_item():
     )
 
 
+def test_get_specfile_sync_files_nodownstreamname_item():
+    pc = PackageConfig(specfile_path="fedora/python-ogr.spec")
+    upstream_specfile_path = "fedora/python-ogr.spec"
+    downstream_specfile_path = "python-ogr.spec"
+
+    assert pc.get_specfile_sync_files_item() == SyncFilesItem(
+        src=[upstream_specfile_path], dest=downstream_specfile_path
+    )
+    assert pc.get_specfile_sync_files_item(from_downstream=True) == SyncFilesItem(
+        src=[downstream_specfile_path], dest=upstream_specfile_path
+    )
+
+
 @pytest.mark.parametrize(
     "raw",
     [
@@ -1259,7 +1272,7 @@ def test_get_specfile_sync_files_item():
         },
     ],
 )
-def test_package_config_specilfe_not_present_raise(raw):
+def test_package_config_specfile_not_present_raise(raw):
     with pytest.raises(PackitConfigException):
         PackageConfig.get_from_dict(raw_dict=raw)