Skip to content
This repository was archived by the owner on Feb 12, 2019. It is now read-only.

Conversation

@pauldotknopf
Copy link

No description provided.

@stack72
Copy link
Owner

stack72 commented Nov 10, 2013

Hey @theonlylawislove, thats for the PR, can you show my a sample implementation for this and what you would expect to get back from the TeamCity API for it? I want to be able to make sure I understand what you are trying to achieve

Thanks

Paul

@pauldotknopf
Copy link
Author

I needed this to get a list of all the branches currently available for a build. I added an integration test to demonstrate that it works.

I needed this in my app because I don't just display all recent builds, I show each branch, and then the builds in each branch. I know TeamCity supports as a branch name, but there could be a change a branch hasn't been built in a while. Also, this is the only way to find out what branch is the "Default" branch.

@stack72
Copy link
Owner

stack72 commented Nov 11, 2013

Hi Paul,

I have looked at said test,

[Test]

  •    public void it_returns_all_branches()
    
  •    {
    
  •        var branches = _client.Branches.ByBuildLocator(BuildTypeLocator.WithId("bt787" /*git-tfs*/));
    
  •        Assert.That(branches.Any(), "Could not get any branches from the tfs-git project.");
    
  •    }
    

This specific test said that it couldn’t get any branches back for that project. What would a successful call to the API return?

Paul

On Sunday, 10 November 2013 at 22:19, Paul Knopf wrote:

I needed this to get a list of all the branches currently available for a build. I added an integration test to demonstrate that it works.
I needed this in my app because I don't just display all recent builds, I show each branch, and then the builds in each branch. I know TeamCity supports as a branch name, but there could be a change a branch hasn't been built in a while. Also, this is the only way to find out what branch is the "Default" branch.


Reply to this email directly or view it on GitHub (#56 (comment)).

@pauldotknopf
Copy link
Author

Currently, the API is returning:

branches[0]
{TeamCitySharp.DomainEntities.Branch}
    Default: true
    Name: "refs/heads/master"
branches[1]
{TeamCitySharp.DomainEntities.Branch}
    Default: false
    Name: "481"

The actual JSON returned is:

{
   "branch":[
      {
         "name":"refs/heads/master",
         "default":true
      },
      {
         "name":"481"
      }
   ]
}

I just did the query to get these results. What are you seeing?

@pauldotknopf
Copy link
Author

Hey, I also added support for querying a single build. Previously, there was only support for getting a list of builds which only had a subset of the information that is available when querying a single build.

@pauldotknopf
Copy link
Author

Is there anything you want me to change to get this merged in?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants