Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jira OnDemand #28

Open
jnus opened this issue Jul 28, 2014 · 8 comments
Open

Jira OnDemand #28

jnus opened this issue Jul 28, 2014 · 8 comments

Comments

@jnus
Copy link

jnus commented Jul 28, 2014

Downloaded this tool a couple of times before and never really got it working with our Jira Ondemand solution. Will this work with Jira Ondemand? I've tried with the following syntax:

.\TeamCityBuildChanges.exe generate --from=2014.27.0.0 --to=2014.30.0.0 -tat=6319130... -o c:\temp\releasenotes.txt --project=MS --buildName='trunk - CI' --server=http://teamcity.domain.dk --jiraurl=https://someuser:somepassword@someondemandaccount.atlassian.net

I get the following when executing:

Unhandled Exception: System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.Where[TSource](IEnumerable1 source, Func2 predicate)
at TeamCityBuildChanges.ExternalApi.TeamCity.TeamCityApi.<>c__DisplayClass17.>b__15(String query) in >c:\Users\jmn\Documents\TeamCityBuildChanges\TeamCityBuildChanges\ExternalApi\Tea>mCity\TeamCityApi.cs:line 193

Any help is appreciated :)
/J.

@BenPhegan
Copy link
Owner

Hi Jasper,

Sorry to hear that it has not worked for. It does look like the issue is the connection to the TeamCity server though. It looks like it is failing on this line:

return response.Data.Where(b => b.ProjectName.Equals(project, StringComparison.InvariantCultureIgnoreCase) && b.Name.Equals(buildName, StringComparison.InvariantCultureIgnoreCase));

This points at probably an empty set of builds coming back from TeamCity. Can you test this endpoint on the REST API?
http://{servername}/app/rest/buildTypes

@jnus
Copy link
Author

jnus commented Jul 30, 2014

Hi Ben

I've testes the endpoint and I do indeed get builds matching my query.
However I'm not quite sure if I should specify buildType (which is what exactly) and/or project/buildname. When I do specify a buildType (even one that doesn't exist), I can see that I get a 401 from teamcity - that's definitely a problem - I should use the Super user authentication token right?. Giving the screenshot, what paramteres would you specify?
image

Thanks for helping out.

@BenPhegan
Copy link
Owner

I would start with something more like this:

.\TeamCityBuildChanges.exe generate --from=2014.27.0.0 --to=2014.30.0.0 -tat=6319130... -o c:\temp\releasenotes.txt --project=Dms --buildName="trunk - CI" --server=http://teamcity.domain.dk

This will hopefully just test the TeamCity component, and provide you some output. If that works, lets move on to the Jira component. The change is the Project name. You can try without, but if you have multiple builds called "trunk - CI" (which I assume you do) it will fail to correctly identify the right one. Let me know if this helps. A Fiddler trace would also be useful...but lets see if the above fails first.

@jnus
Copy link
Author

jnus commented Jul 30, 2014

Well, fiddler returns a 401 - so authorization is definitely a problem Iøm using the super user authentication token from the teamcity-server.log - shouldn't that work?

@BenPhegan
Copy link
Owner

Ok, if it is publicly accessible and secured, you will need to send auth. The authtoken is just a HTTPAuth token (not a TeamCity specific auth token from logs), but you can drop that and just use the username/password in the URL of the server like so:

.\TeamCityBuildChanges.exe generate --from=2014.27.0.0 --to=2014.30.0.0  -o c:\temp\releasenotes.txt --project=Dms --buildName="trunk - CI" --server=http://username:password@teamcity.domain.dk

So this will just use the URL http://username:password@server/ and generate the simple HTTP Auth token required by TeamCity on the fly, rather than you specifying it on command line.

@jnus
Copy link
Author

jnus commented Jul 30, 2014

Ok, using the inline style with username and password worked. Next problem is the BuildNumberComparitor does seem to like our versioning format. No builds added to the result in the GetByBuildTypeAndBuildRange method. The format is #year.#week.#patch.#buildnumber. I can look into this myself.

Thanks

@BenPhegan
Copy link
Owner

Great, let me know if you have any other issues. I assumed that the BuildNumberComparitor would work as you have numerically small to large from->to. Interested to know if you have problems...

@jnus
Copy link
Author

jnus commented Aug 1, 2014

So my assumption was that the to and from arguments, were ranges and not absolut values,in which the logic uses to mark the begining and end og the builds to include. I've implemented a BuildNumberRangeComparitor which can be used as a range on an integer or version build number representation. I'll create a pull request, if you like.

I've still got Jira issues, when specifying the jira credentials. I've got TeamCity and Jira integrated, but when I look in the BuildDetails object, I get no related Issues in the GetIssuesFromBuild method. What am I missing here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants