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

Feat/forgejo/projects #893

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft

Conversation

mfocko
Copy link
Member

@mfocko mfocko commented Mar 4, 2025

TODO:

  • Write new tests or update the old ones to cover new functionality.
  • Update doc-strings where appropriate.
  • Update or write new documentation in packit/packit.dev.
  • ‹fill in›

Fixes

Related to

Merge before/after

RELEASE NOTES BEGIN

Packit now supports automatic ordering of ☕ after all checks pass.

RELEASE NOTES END

mfocko added 4 commits March 4, 2025 15:47
Signed-off-by: Matej Focko <[email protected]>
There's a specialization in the API when creating new projects that
differentiates between:
• projects being created in the user's namespace
• projects being created in different namespace, i.e., organization

This differentiation, however, disappears when you ‹GET› existing repos…

Therefore handle this consistently with other forges, i.e., when
creating new projects, take in account the possibility of ‹namespace›
being set to ‹None›, but when fetching the repository, expect
the ‹namespace› to be set to the correct value (org or user).

Signed-off-by: Matej Focko <[email protected]>
@mfocko mfocko self-assigned this Mar 4, 2025
@mfocko mfocko marked this pull request as draft March 4, 2025 15:59
Copy link
Contributor

mfocko added 6 commits March 10, 2025 09:58
Signed-off-by: Matej Focko <[email protected]>
• Move reversal of the comments to the method that fetches comments from
  the git-forge API
  · Allows to postpone unnecessary API calls when only few of the first
    comments (from either end of the ordering) need to be fetched
  · Also removes the reversal logic from the filtering itself, which
    should be independant from the filtering
• Accept ‹Union[list[Comment], Iterable[Comment]]› from the related
  methods
• Adjust filtering / search methods to accomodate the aforementioned
  changes
• Fix tests

Signed-off-by: Matej Focko <[email protected]>
Based on the discussion we had during the arch about ogr pagination,
let's start with relaxing the abstract interface to allow returning
iterables instead of full lists.

Signed-off-by: Matej Focko <[email protected]>
Based on the code, it doesn't make much sense to fetch »all« commits to
just take the last one, i.e., the head commit of the PR. Therefore
switch to using the head commit property directly instead of list of all
commits that's not even used.

Signed-off-by: Matej Focko <[email protected]>
Signed-off-by: Matej Focko <[email protected]>
Copy link
Contributor

After running ruff:

    warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`:
      - 'ignore' -> 'lint.ignore'
      - 'select' -> 'lint.select'

Therefore switch to those new options.

Signed-off-by: Matej Focko <[email protected]>
Copy link
Contributor

Copy link
Contributor

@mfocko mfocko force-pushed the feat/forgejo/projects branch from d538c38 to c3ab17a Compare March 12, 2025 07:52
Copy link
Contributor

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

Successfully merging this pull request may close these issues.

1 participant