QualiSystems / FluentTc

:ocean: :two_men_holding_hands: :office: Integrate with TeamCity fluently
https://www.nuget.org/packages/fluenttc
Apache License 2.0
44 stars 36 forks source link

Add Branchname to IBuild #113

Open MortenRickiRasmussen opened 6 years ago

MortenRickiRasmussen commented 6 years ago

Bug/Feature Request

I really like this package a lot. The only way to make it better though would be to add branch name support on the IBuild object. We retrieve a lot of information from team city and compares it to github branches but that is not possible since the branch name isn't present

borismod commented 6 years ago

Hi Morten

I am glad to hear that. Do you mean to retrieve builds by branch name or to have a branch property on the returned branch object?

On Thu, Jun 21, 2018, 11:25 Morten Ricki Rasmussen notifications@github.com wrote:

Bug/Feature Request

I really like this package a lot. The only way to make it better though would be to add branch name support on the IBuild object. We retrieve a lot of information from team city and compares it to github branches but that is not possible since the branch name isn't present

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/QualiSystems/FluentTc/issues/113, or mute the thread https://github.com/notifications/unsubscribe-auth/AAM0M3I5xbGDaYCtK9hGiHuDT9fW0Ukbks5t-1hdgaJpZM4UxnIq .

MortenRickiRasmussen commented 6 years ago

I mean to have the branch name on GetBuilds

borismod commented 6 years ago

That's a good idea. There is a node on the returned payload. Can you add a List Revisions property to the IBuild and Build and submit a Pull Request?

On Jun 21, 2018 15:00, "Morten Ricki Rasmussen" notifications@github.com wrote:

I mean to have the branch name on GetBuilds

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/QualiSystems/FluentTc/issues/113#issuecomment-399079146, or mute the thread https://github.com/notifications/unsubscribe-auth/AAM0M8dULsfpKJWlZyeRNrmOMg73QZTLks5t-4rigaJpZM4UxnIq .

MortenRickiRasmussen commented 6 years ago

I find that there already exists an RevisionList class and also a Change property. Should i use these(Or what do the represent?) or create some completely new entities.

borismod commented 6 years ago

You are right, branch is a property of a revision. See the below XML that is returned from as a result to API request:

https://teamcity.jetbrains.com/app/rest/builds/1032388


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<build id="1032388" buildTypeId="bt33" number="582" status="SUCCESS" state="finished" href="/app/rest/builds/id:1032388" webUrl="https://teamcity.jetbrains.com/viewLog.html?buildId=1032388&amp;buildTypeId=bt33">
    <statusText>Success</statusText>
    <buildType id="bt33" name="JMock 2" projectName="Open-source projects / JMock 2" projectId="JMock2" href="/app/rest/buildTypes/id:bt33" webUrl="https://teamcity.jetbrains.com/viewType.html?buildTypeId=bt33"/>
    <queuedDate>20170404T233038+0000</queuedDate>
    <startDate>20170404T233117+0000</startDate>
    <finishDate>20170404T233638+0000</finishDate>
    <triggered type="vcs" details="jetbrains.git" date="20170404T233038+0000"/>
    <lastChanges count="1">
        <change id="3538358" version="d42fef10966926b332a8ef0574cfc4f2585339aa" username="olibye" date="20170404T231253+0000" href="/app/rest/changes/id:3538358" webUrl="https://teamcity.jetbrains.com/viewModification.html?modId=3538358&amp;personal=false"/>
    </lastChanges>
    <changes href="/app/rest/changes?locator=build:(id:1032388)"/>
    <revisions count="1">
        <revision version="d42fef10966926b332a8ef0574cfc4f2585339aa" vcsBranchName="refs/heads/jmock2">
            <vcs-root-instance id="3049" vcs-root-id="JMock2_HttpsGithubComJmockDevelopersJmockLibraryGit" name="https://github.com/jmock-developers/jmock-library.git" href="/app/rest/vcs-root-instances/id:3049"/>
        </revision>
    </revisions>
    <agent name="win2008-v8-i-054af88cdc466c02f" typeId="160" webUrl="https://teamcity.jetbrains.com/agentDetails.html?agentTypeId=160&amp;realAgentName=win2008-v8-i-054af88cdc466c02f"/>
    <artifacts count="0" href="/app/rest/builds/id:1032388/artifacts/children/"/>
    <relatedIssues href="/app/rest/builds/id:1032388/relatedIssues"/>
    <statistics href="/app/rest/builds/id:1032388/statistics"/>
</build>
MortenRickiRasmussen commented 6 years ago

Teamcity often includes the stripped branch name on the build itself, wouldn't it be an idea to fetch it there and also include the revisions?

MortenRickiRasmussen commented 6 years ago

@borismod There you go #114

sorenhansendk commented 6 years ago

@borismod We really need this changes from Morten in the package. Can you please merge it and release a new package?