Skip to content

ForgejoProject.get_files() not working properly #907

@mfocko

Description

@mfocko

Current Forgejo API spec declares that querying for filepaths returns a singular ContentsResponse (i.e., one file), but a comment next to the API call claims it can also return a list of ContentsResponse (and it actually does).

However the generated OpenAPI spec allows only for the singular ContentsResponse which, in turn, makes the pydantic validation (in pyforgejo) fail…

This issue can be “patched” by adjusting the return type in the pyforgejo, even proposed in the PR linked below, but at the same time it implies manual work to be involved with each regeneration of the API via fern for pyforgejo.

TODO

Once this issue gets unblocked:

  • Remove the warning from the ForgejoProject.get_files()
  • Do not skip the test for ForgejoProject.get_files()
  • As for the upstream fix:
    • Implement any additional changes, if the API spec gets patched, or
    • Open a follow-up issue once the fix (that involves breaking changes) gets to stable

Links

Blockers

Tip

Unblocked for Fedora 43, cannot be unblocked for F42 as it requires next major version of Poetry that's included only in the F43 (aka rawhide as of writing this comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/forgejoForgejo-forge relatedcomplexity/single-taskRegular task; should be done within dayskind/bugAn unexpected problem or behavior

    Type

    Projects

    Status

    backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions