-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add Forgejo Issues support #896
base: main
Are you sure you want to change the base?
Conversation
Build failed. ❌ pre-commit FAILURE in 2m 49s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC the docs are inherited from the abstract classes, so we're left with just the pagination and tests
raise IssueTrackerDisabled | ||
|
||
parameters: dict[str, Union[str, list[str], bool]] = { | ||
"state": status if status != IssueStatus.open else "open", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure if this produces what you think it does… looking at the definition of IssueStatus
, it is an IntEnum
, I think you'll find out when you start testing it.
ogr/services/forgejo/issue.py
Outdated
issues = project.service.api.issue.list_issues( | ||
owner=project.namespace, repo=project.repo, **parameters, | ||
) | ||
return [ForgejoIssue(issue, project) for issue in issues] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part here is a bit tricky… See packit/packit#2543 (comment) and related notes…
- You don't get a full list, cause it is paginated
- Once you start fetching everything page-by-page, don't construct a list, implement this as an iterator (I'll be committing similar code for
ForgejoProject
today, so you should be able to see basic outline of how it looks like)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally missed it, will do the changes
) | ||
return ForgejoIssueComment(self, comment) | ||
|
||
def _get_all_comments(self) -> list[IssueComment]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here with the pagination
So, I wrote all the tests for Forgejo Issues from the Gitlab ones. What's left is to handle pagination, regex tests are not being tested without a pattern for now, will fix later and add docstrings. |
Build failed. ❌ pre-commit FAILURE in 2m 45s |
Build failed. ❌ pre-commit FAILURE in 2m 49s |
my bad cleaning this up, rebasing |
Build failed. ❌ pre-commit FAILURE in 3m 47s |
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
Build failed. ❌ pre-commit FAILURE in 3m 57s |
# Conflicts: # ogr/services/forgejo/comments.py # ogr/services/forgejo/issue.py # ogr/services/forgejo/project.py
for more information, see https://pre-commit.ci
and write tests
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Build failed. ❌ pre-commit FAILURE in 3m 45s |
Hi, I've pulled in some changes from #893, could you please rebase and see what happens (with the CI)? :) Also, I've added some utility functions related to the workaround for repeated
|
I will implement them as iterators. Thanks for the suggestions; they were much needed. |
TODO:
packit/packit.dev
.Fixes #880
RELEASE NOTES BEGIN
ogr now supports Forgejo Issues
RELEASE NOTES END