nephila / python-taiga

:evergreen_tree: Python module for communicating with the Taiga API
https://python-taiga.readthedocs.io
MIT License
94 stars 41 forks source link

Add support for swimlanes (#162) #164

Closed psybers closed 6 months ago

psybers commented 6 months ago

Description

Adds support for swimlanes. This adds two new models: SwimLane and SwimLanes. It updates the API client to support client.swimlanes.list() and adds a project.swimlanes attribute. You can add new swimlanes via project.add_swimlane('name').

References

Fixes #162

Checklist

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (e175d86) 96.51% compared to head (ddb862f) 96.57%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #164 +/- ## ========================================== + Coverage 96.51% 96.57% +0.05% ========================================== Files 8 8 Lines 918 933 +15 Branches 69 69 ========================================== + Hits 886 901 +15 Misses 19 19 Partials 13 13 ``` | [Flag](https://app.codecov.io/gh/nephila/python-taiga/pull/164/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nephila) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/nephila/python-taiga/pull/164/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nephila) | `96.57% <100.00%> (+0.05%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nephila#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

coveralls commented 6 months ago

Coverage Status

coverage: 97.964% (+0.03%) from 97.93% when pulling ddb862face4451f23c3d867a2e07055a907add8a on psybers:feature/162-add-swimlanes into e175d8624117f4882866bbb5a653807c3ed67605 on nephila:master.

yakky commented 6 months ago

awesome @psybers thanks a lot

psybers commented 6 months ago

Wait, I think I forgot one thing: setting the default swimlane on a project.

protoroto commented 6 months ago

@psybers I'm not very familiar with swimlanes, so I don't really understand the problems of not setting the default swimlane on a project. Will you open another pr to address this, or should we release a new version without it?

psybers commented 6 months ago

I think it is a super small change. There just needs to be one method in Project to set the default swimlane. The API calls /projects/# with a PATCH and sets a single value, default_swimlane. This was the hack I put in to get it working on my side (without this PR):

def set_default_swimlane(self, id, **attrs):
    attrs.update({"default_swimlane": id})
    response = self.requester.patch("/projects/" + str(self.id), payload=attrs)
    return response.json()

I can get another PR in later today.

psybers commented 6 months ago

I added PR #167 (referencing issue #166) to fix this issue.

@protoroto Note that it is not a huge problem, if you release without this additional PR they can still read/write/update swimlanes, they just can't set the default. I'm not sure what Taiga does with no default set, but I suspect the UI would just default to the 'first' (based on order) when adding a new user story.