github-tools-vsts
github-tools-vsts copied to clipboard
Fails if using the new Azure Pipelines based connection endpoint
Bug Report
Azure DevOps has a new way of creating service endpoints - the Azure Pipelines app from the GitHub marketplace. When using that endpoint with the task, I get the following error. I suspect it needs to check for a different field for the access token/PAT?
2018-09-10T19:13:39.7462851Z ##[error]An error occured, log returned:
An error occured, log returned:
Error: missing required options: token
2018-09-10T19:13:39.7474073Z Finish draft release
To repro:
Go the GitHub marketplace and look for the Azure Pipelines app under the CI category. Follow the wizard to connect it to your VSTS account/project. It creates a new service endpoint with the GitHub org name.
Use that endpoint in a build/release pipeline with this task.
Before opening an issue please read this.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
MANDATORY FOR BUGS: Insert debug trace
In order to allow us to quickly reproduce you issue please include a link to a reproduction repository.
Expected behavior
A clear and concise description of what you expected to happen..
Enviroment
- Service: [e.g. VSTS, TFS]
- Agent: [e.g. Hosted, Custom]
- OS: [e.g. OSX 10.13.4, Windows 10]
- Node/npm version: [e.g. Node 8/npm 5]
Additional context/Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.
Hey @onovotny, thanks for the issue feedback!
I'll create some example to debug here and see if I can find any documentation for this new App.
As I can see they launched it today, If you have any docs information or something that can help I would be very grateful.
Thank you!
Working on getting docs on what needs to change to support that.
We need to get the schema
name for this endpoint, so I can integrate it properly, debugging it showing this should return where is it and fix the problem.
https://github.com/marceloavf/github-tools-vsts/blob/25546a6bf3b95f297460adaff70d0c0c57fd96f8/Src/GithubReleasePublish/githubReleasePublish.js#L46-L55
Azure Pipelines connection uses a new pattern:
{
parameters: {
IdToken: '***',
Signature: '***'
},
scheme: 'Token'
}
Tested with both IdToken
and Signature
but neither correspond correctly, returning Bad credentials
from GitHub connection. 😢
I think it needs backend work so the Pipelines app can use its secret to return an access token.
Hey, thanks for looking into it, having the same problem!
Thanks for identifying this issue. We will take a look at the backend and see how to best address this. @marceloavf has already identified the issue, for GitHub App, we must dynamically create an Installation Token from the IdToken before we pass it down.
@onovotny @johanneskares Do you use this task in Build or Release pipeline? I have made the necessary change in Build pipeline. However it looks the Release pipeline change is more involved, and may require a bit more time.
I always use it in Release, since it's part of a deployment step for me -- "Prod Stage creates release in GitHub"
@yacaovsnc Thanks for update. Also using it in a Release pipeline.
Another quick update, sorry still don't have resolution. It's touching some core areas and we want to find the best way to address this. This is actively being designed and worked on. Really appreciate your patience.
@yacaovsnc Any updates on this?
Hey, I am getting errors on this. It used to work, but I haven't figured yet what's wrong with my pipelines.