packit: Unable to push to remote fork 'fork' using branch 'rawhide' on src.stg.fedoraproject.org

I’m trying to continue work on the packit integration in the-new-hotness, but I found out I’m unable to push to my fork in the implementation I have.

Here is the minimal reproducer for the issue:

from packit.config import Config, PackageConfig
from packit.distgit import DistGit
from packit.utils import run_command


dist_git_url = "https://src.stg.fedoraproject.org/"
pagure_user_token = ****
fas_user = "zlopez"
raw_packit_config = {
    "authentication": {
        "pagure": {
            "token": pagure_user_token,
            "instance_url": dist_git_url,
        }
    }
}
config = Config(fas_user=fas_user, **raw_packit_config)

package_config = PackageConfig(
       downstream_package_name="0ad", dist_git_base_url=dist_git_url
)

dist_git = DistGit(config, package_config)

# Use master branch
branch = "rawhide"

dist_git.update_branch(branch)

cmd = ["rpmdev-bumpspec", "--new", "1.0", str(dist_git.absolute_specfile_path)]
run_command(cmd)

dist_git.commit("Test commit", "", prefix="[the-new-hotness]")
dist_git.push_to_fork(branch)

The token used for staging has following ACLs:

  • Commit to a git repository via http(s)
  • Fork a project
  • Open a new pull-request

From what I tried to debug, the fork is created without issue.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 42 (42 by maintainers)

Commits related to this issue

Most upvoted comments

I was able to create the PR with the-new-hotness, still struggling with closing, the pull_request_close was added to user token on staging for now, so it should be possible to close them. But we are hitting issues inside the pagure API.

Nonetheless I’m closing this ticket, because the push and creation of PR using packit works now. Thanks for help.

Thanks, it didn’t struck me to look at the DistGit.clone implementation.

You should be able to copy the way DistGit.clone does it:

https://github.com/packit/packit/blob/9de2ea51189716ba3187795c39f4dd5cc2cd4582/packit/distgit.py#L104-L127

Or we can “fix” that method by taking stg argument into the account

@TomasTomecek Thanks for the advice, I will try it today.

The ticket was now solved and I’m able to push to fork on staging without issue. So I’m closing this ticket.

It looks like the staging dist-git doesn’t allow push to fork, I created a ticket on infra tracker to enable it.

I created an issue on fedora-infra tracker to be added to packager group on staging.

I will try it again once I’m added to the group.