chocolatey / choco

Chocolatey - the package manager for Windows
https://chocolatey.org
Other
10.32k stars 904 forks source link

Set up TC codebetter build #20

Closed ferventcoder closed 9 years ago

gep13 commented 9 years ago

Can you give me access to TC? Happy to take a look at this.

ferventcoder commented 9 years ago

That would be Hadi or Maarten that could give you access.

On Sunday, January 18, 2015, Gary Ewan Park notifications@github.com wrote:

Can you give me access to TC? Happy to take a look at this.

— Reply to this email directly or view it on GitHub https://github.com/chocolatey/choco/issues/20#issuecomment-70406124.

Rob "Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds http://ferventcoder.com http://twitter.com/ferventcoder

gep13 commented 9 years ago

@hhariri or @maartenba can you hook me up with access to the Chocolatey Project on the TeamCity Codebetter instance? My username is the same as it is for GitHub. Thanks!

maartenba commented 9 years ago

@gep13 made you a project admin for Chocolatey.

gep13 commented 9 years ago

@maartenba nice one, thank you very much! :smile_cat:

ferventcoder commented 9 years ago

Thank you @maartenba !

ferventcoder commented 9 years ago

If you can look at http://teamcity.codebetter.com/project.html?projectId=ChuckNorris&tab=projectOverview (roundhouse), it will give you an idea of how I want it. :)

Keep in mind that the RH build is probably outdated compared to what this is going to have.

gep13 commented 9 years ago

Have started to implement this. Just dropped you an email with some questions. Will follow up based on your responses.

ferventcoder commented 9 years ago

Not sure if I set it completely up correctly. Still waiting to see it update the status on a PR I synchronized.

gep13 commented 9 years ago

Yeah, still doesn't seem to be working :-(

What permissions did you give to the token that you assigned?

Can I get a screenshot? I will put it past Maarten to see if it has everything that is required.

maartenba commented 9 years ago

I did notice some AppVeyor status info. Not sure if GitHub allows overwriting it?

gep13 commented 9 years ago

@maartenba I was going by this:

https://github.com/blog/1935-see-results-from-all-pull-request-status-checks

Could it be that there is something in either the AppVeyor or TeamCity side of things needs to change so that they are live in harmony? Or am I missing the intent of the multiple build status API?

ferventcoder commented 9 years ago

So appveyor supports and uses the multiple build status, so it wouldn't overwrite anything. Take a look at https://github.com/puppetlabs/cfacter/pull/224 for an example of the multiple status.

image

ferventcoder commented 9 years ago

Github Auth Token

I put in the same permissions that were requested, however I noticed that when you select repo it removes repo_status and public_repo. image

I removed repo and specifically selected repo_status and public_repo and it didn't remove them this time. I should note that the account that is set up for this is https://github.com/choco-bot which has read access to the repository.

image

Team City Settings

Since the last time I checked, I noticed the url has changed (to removeapi/v3):

image

gep13 commented 9 years ago

@ferventcoder I didn't change the URL, but I did change the Context to be:

continuousintegration/teamcity

But I see that this has changed to teamcity. Was that by you?

maartenba commented 9 years ago

I changes the URL and context to see if it helped.

ferventcoder commented 9 years ago

sweet! I will push up some changes and see if it picks it up.

ferventcoder commented 9 years ago

Pushed, nothing yet https://github.com/chocolatey/choco/pull/30#issuecomment-70512813

ferventcoder commented 9 years ago

But already picked up as pending by TC. image

maartenba commented 9 years ago

Seeing a 404 in the server log, which according to GitHub means that auth failed. Just as a test, could you try with your full credentials configured?

ferventcoder commented 9 years ago

Weird part is appveyor is not reporting status now either. image

ferventcoder commented 9 years ago

@maartenba keys updated. That user is set to full access to the token. This is how it allows items (I removed repo and user): image

ferventcoder commented 9 years ago

What i think you need is a webhook created, maybe? image

Actually strike that, you get the notifications through VCS polling.

maartenba commented 9 years ago

Nope, TeamCity should be able to do it without the webhook. On the TC side, could you try your credentials instead of a token? (just for testing)

ferventcoder commented 9 years ago

Changed and pushed.

ferventcoder commented 9 years ago

It doesn't know about it yet. Have you thought about adding the push from github webhooks to kick off builds?

gep13 commented 9 years ago

In a separate conversation I asked @maartenba if this;

http://tcplugins.sourceforge.net/info/tcWebHooks

Could be added to the CodeBetter TeamCity instance. This was to allow integration into Gitter Chat, but sounds like it could be used for other things as well.

ferventcoder commented 9 years ago

Okay, so it has noticed the pending changes, but still no status update.

gep13 commented 9 years ago

Okay, so it has noticed the pending changes, but still no status update.

Strangely again though, the AppVeyor status is working again.

ferventcoder commented 9 years ago

image It works, it should probably update the status when it goes PENDING, not when it kicks of the build.

ferventcoder commented 9 years ago

So now that we've determined it is a permissions issue, I think we need to have @maartenba tell us what those permissions should be. ;)

gep13 commented 9 years ago

Woot! :smile_cat:

For the sake of consistency, otherwise it will bug the crap out of me, can we make the context continuous-integation/teamcity, rather than just teamcity?

ferventcoder commented 9 years ago

Done. Switched to the choco-bot user. I'll do another push and see if that works.

maartenba commented 9 years ago

Perhaps @jonnyzzz knows which permissions should be given to the token?

ferventcoder commented 9 years ago

@maartenba @jonnyzzz Would you agree that something can sit in pending status for awhile? TravisCI and AppVeyor are both subject to this - so they push a status update of pending until they are ready to kick off.

Still queued...

ferventcoder commented 9 years ago

When I switched over to the choco-bot user (not back to the auth token yet) that has read access to the repository (and has read status on commits), there was no status update on that PR, even though the build went through.

image

ferventcoder commented 9 years ago

I think there is a missing permission here somewhere - we'll need it locked down so we are happy to try out a few things with you guys. Now that we've determined it is a permissions issue, can we start determining what it is that is necessary? Perhaps there is something in the plugin that is attempting to request too much permission?

ferventcoder commented 9 years ago

I'm guessing the code for this is at https://github.com/JetBrains/commit-status-publisher but I haven't looked too deeply into it.

maartenba commented 9 years ago

https://github.com/jonnyzzz/TeamCity.GitHub

ferventcoder commented 9 years ago

Sweet, I created https://github.com/jonnyzzz/TeamCity.GitHub/issues/73

ferventcoder commented 9 years ago

As a reference, this is what AppVeyor asks for:

image

ferventcoder commented 9 years ago

Actually this may just be an issue with that user. I'm going to set up an access token under my account.

ferventcoder commented 9 years ago

I put this comment on https://github.com/jonnyzzz/TeamCity.GitHub/issues/73#issuecomment-70657149, but I thought I would share here as well:

It comes down to permissions, but not permissions you can change. GitHub doesn't have the ability to give a github user permission to write status updates but nothing else.

Once you switch over to a user with write access (and in this case add an authorization token), it works appropriately:

image

ferventcoder commented 9 years ago

I'm good with considering this closed for now.

gep13 commented 9 years ago

Cool. I have just corrected the TeamCity settings to put a c at the start on continuous, as per screen shot above :smile_cat:

ferventcoder commented 9 years ago

@gep13 thanks, copy pasta error.

gep13 commented 9 years ago

@gep13 thanks, copy pasta error.

No worries, things like that just sort of jump out at me :-D