marceloavf / github-tools-vsts

📦:octocat:🚀 Create and modify GitHub Releases in Azure DevOps Build and Release Management
https://marketplace.visualstudio.com/items?itemName=marcelo-formentao.github-tools
MIT License
24 stars 15 forks source link

Fails if using the new Azure Pipelines based connection endpoint #29

Open clairernovotny opened 5 years ago

clairernovotny commented 5 years ago

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

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. 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

Additional context/Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.

marceloavf commented 5 years ago

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!

clairernovotny commented 5 years ago

Working on getting docs on what needs to change to support that.

marceloavf commented 5 years ago

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

marceloavf commented 5 years ago

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. 😢

clairernovotny commented 5 years ago

I think it needs backend work so the Pipelines app can use its secret to return an access token.

johanneskares commented 5 years ago

Hey, thanks for looking into it, having the same problem!

yacaovsnc commented 5 years ago

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.

yacaovsnc commented 5 years ago

@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.

clairernovotny commented 5 years ago

I always use it in Release, since it's part of a deployment step for me -- "Prod Stage creates release in GitHub"

johanneskares commented 5 years ago

@yacaovsnc Thanks for update. Also using it in a Release pipeline.

yacaovsnc commented 5 years ago

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.

azlam-abdulsalam commented 4 years ago

@yacaovsnc Any updates on this?

ericoporto commented 4 years ago

Hey, I am getting errors on this. It used to work, but I haven't figured yet what's wrong with my pipelines.