SurveyMonkey / pyteamcity

Use the TeamCity REST API from Python
51 stars 50 forks source link

Add `get_builds`: filter by `build_type` or `branch` #6

Closed msabramo closed 9 years ago

msabramo commented 9 years ago

Add get_builds: filter by build_type or branch

This is a smart wrapper for the existing get_all_builds and get_all_builds_by_build_type_id methods.

    def get_builds(self, build_type_id='', branch='',
                   start=0, count=100, **kwargs):

Cc: @aconrad, @sudarkoff

aconrad commented 9 years ago

Wouldn't you want a test where the branch is actually set?

aconrad commented 9 years ago

And should &locator=branch:{branch} be set if there are no locator-related arguments?

msabramo commented 9 years ago

It's ok to have &locator=branch:{branch} even when branch is blank. TC accepts this and treats it as any branch is ok.

I do need to add more tests.

msabramo commented 9 years ago

I changed this pretty heavily.

There is a new smart wrapper for the existing get_all_builds and get_all_builds_by_build_type_id methods, as it was kind of annoying to have 2 different methods for very similar functionality.

    def get_builds(self, build_type_id='', branch='',
                   start=0, count=100, **kwargs):