Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support retrieving an untagged list of repositories in Pagure #1034

Open
alexsaezm opened this issue Feb 9, 2024 · 1 comment
Open

Support retrieving an untagged list of repositories in Pagure #1034

alexsaezm opened this issue Feb 9, 2024 · 1 comment

Comments

@alexsaezm
Copy link

So far, the only way I found to retrieve several repositories from a Pagure instance is by having different sections, for example:

[rpms/golang]
service = pagure
pagure.repo = rpms/golang
pagure.base_url = https://src.fedoraproject.org
pagure.description_template = {{pagureid}}: {{paguretitle}}
pagure.project_template = Fedora

[rpms/delve]
service = pagure
pagure.repo = rpms/delve
pagure.base_url = https://src.fedoraproject.org
pagure.description_template = {{pagureid}}: {{paguretitle}}
pagure.project_template = Fedora

[rpms/golang-x-oauth2]
service = pagure
pagure.repo = rpms/golang-x-oauth2
pagure.base_url = https://src.fedoraproject.org
pagure.description_template = {{pagureid}}: {{paguretitle}}
pagure.project_template = Fedora

The pagure.include_repos behaves differently compared to gitlab.include_repos. In Pagure, it is only available if you use the pagure.tag option, but in GitLab it's the list of repositories to include.

pagure.repo only accepts one item, and having to include several sections in the targets field is a little hard, as we cannot use regexp nor wildcards (as far as I know).

Oddly, if you use the tag function, and the repository doesn't have the issues activated (like it happens on Fedora's instance), bugwarrior fails:

ERROR:bugwarrior.collect:Worker for [Fedora] failed: Failed to talk to 'https://src.fedoraproject.org/api/0/golang/issues' {'error': 'Project not found', 'error_code': 'ENOPROJECT'}
Traceback (most recent call last):
  File "/home/alex/Code/src/github.com/GothenburgBitFactory/bugwarrior/bugwarrior/collect.py", line 36, in _aggregate_issues
    for issue in service.issues():
  File "/home/alex/Code/src/github.com/GothenburgBitFactory/bugwarrior/bugwarrior/services/pagure.py", line 185, in issues
    issues.extend(self.get_issues(repo, ('issues', 'issues')))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alex/Code/src/github.com/GothenburgBitFactory/bugwarrior/bugwarrior/services/pagure.py", line 132, in get_issues
    raise OSError('Failed to talk to %r %r' % (url, error))
OSError: Failed to talk to 'https://src.fedoraproject.org/api/0/golang/issues' {'error': 'Project not found', 'error_code': 'ENOPROJECT'}

Is there a way to create something like this?:

[Fedora]
service = pagure
pagure.include_repos = rpms/golang, rpms/delve, rpms/golang-x-oauth2
pagure.base_url = https://src.fedoraproject.org
pagure.description_template = {{pagureid}}: {{paguretitle}}
pagure.project_template = Fedora

@ryneeverett
Copy link
Collaborator

If I understand correctly, the end goal is probably:

  • either tag or repo is required -> either tag or include_repos is required
  • deprecate repo as redundant

I suspect the reason for this limitation in the first place is limitations in pagure's http api, but there's no reason we couldn't hide that under a more consistent configuration abstraction.

Oddly, if you use the tag function, and the repository doesn't have the issues activated (like it happens on Fedora's instance), bugwarrior fails:

This seems like a bug. Please open a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants