FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GroupEpic uses "iid" as ID attribute but should use "id"? · Issue #3261 · python-gitlab/python-gitlab · GitHub

Repository navigation

GroupEpic uses "iid" as ID attribute but should use "id"? #3261

Description

Description of the problem, including code/CLI snippet

objects.epics.GroupEpic uses iid (group local ID) as ID attribute / encoded_id instead of the global id like, for example, objects.issues.ProjectIssue does. This leads to an erroneous behavior when updating an epic, i.e., the wrong epic is being updated.

Expected Behavior

  • I retrieve an epic: epic = top_level_group.epics.list(...)[0]
  • I manipulate the epic labels: epic.labels.extend([...]) <-- epic from a sub group
  • I save the epic: epic.save()
  • The new labels are saved for exactly this epic, identified by epic.id.

Actual Behavior

  • The labels are saved for the first epic with epic.iid, which is not necessarily the one that I intended to update.

Discussion

The class GroupEpic explicitly sets iid as _id_attr. When updating the epic, the request is sent to epic.manager.path/{epic_iid}, but since epic.manager.path is the path to the top level group, the epic with id 3 in this top level group is updated instead of the one from the nested group.

So maybe it's not just using id instead of iid but fixing the manager (path) so that is uses the path of the actual group that the epic belongs to and not the path of the group that was used to retrieve all epics.

Specifications

Activity

  1. sscherfke commented on Sep 9, 2025

    Author

    My workaround for now:

    def get_open_epics(group: Group) -> list[GroupEpic]:
        """
        Get all open epics of a group.
        """
        epics = cast(list[GroupEpic], group.epics.list(get_all=True, state="opened"))
        # https://github.com/python-gitlab/python-gitlab/issues/3261
        epics = [get_group(epic.group_id).epics.get(epic.iid) for epic in epics]
        return epics
  2. added 9 commits that reference this issue on Oct 18, 2025
    d9b8a55
    0f7065d
    3e75d60
    3993fe7
    3e855f3
    27bd80c
    dcc9847
    f420862
    a9638ee
  3. JohnVillalovos commented on Oct 22, 2025

    Member

    @sscherfke would you like to try out #3279 ?

  4. sscherfke commented on Nov 8, 2025

    Author

    Hi @JohnVillalovos , sorry for the late reply.

    Tried to reproduce the problem with your fixes applied and could not reproduce it. So I think this should work. Thank you very much. :-)

  5. added a commit that references this issue on Nov 10, 2025
    fb4f902
  6. added a commit that references this issue on Dec 6, 2025
    8397bd0
  7. JohnVillalovos commented on Dec 6, 2025

    Member

    Hi @JohnVillalovos , sorry for the late reply.

    Tried to reproduce the problem with your fixes applied and could not reproduce it. So I think this should work. Thank you very much. :-)

    Thanks!

  8. added a commit that references this issue on Dec 11, 2025
    45a8599
  9. added 2 commits that reference this issue on Dec 24, 2025
    0dd6ab1
    ce876ef
  10. added a commit that references this issue on Jan 19, 2026
    0f029e9
  11. added 7 commits that reference this issue on Apr 18, 2026
    0d1c13a
    d273bc5
    83feda8
    cfe29a4
    f187c43
    4702278
    e3d27cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL