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

Seems it does not work for Release with GIT in Bitbucket #1003

Open
irriss opened this issue May 6, 2021 · 7 comments
Open

Seems it does not work for Release with GIT in Bitbucket #1003

irriss opened this issue May 6, 2021 · 7 comments

Comments

@irriss
Copy link

irriss commented May 6, 2021

Azure DevOps Extensions

Generate Release Notes (Cross Platform Node)

Platform

Azure DevOps Services

Azure DevOps Server (TFS) Version

No response

Extension Version

3.51.2

Describe the bug

I have Azure DevOps build and release pipelines for source code in Bitbucket. I could not make ReleseNotes generator working. So I started investigation and debugging and found out that it works for the build, but doesnt work for Release with comparison with the latest deployment.

I used the tool to narrow down the problem. Method 

// Fall back to original behavior
commits = await buildApi.getChangesBetweenBuilds(artifactInThisRelease.sourceId, parseInt(artifactInMostRecentRelease.buildId),  parseInt(artifactInThisRelease.buildId), 5000);

always returns 0 commits.

Repo Steps

I found a two releases with difference in a few commits.
Then I run the tool in debug mode using 'overrideBuildReleaseId' parameter. In debug mode I could confirm that parameters artifactInMostRecentRelease.buildId and artifactInThisRelease.buildId are correct ones. This is two lines from console:

Checking what commits and workitems have changed from [20210505.5][ID 9607] => [20210506.1] [ID 9637] 
Using workaround for build API limitation (see issue #349)

I played with Fix349 parameter but it did not help. Seems that the issue is in buildApi.getChangesBetweenBuilds method.

Expected Behavior

Method should return a collection of changesets but returns empty collection

Logging Information

No response

@rfennell
Copy link
Owner

rfennell commented May 6, 2021

Given the version number I think you are using the cross platform node based version of my Release Notes.

I will have to spin up a Bitbucket instance to retest this, but my initial questions are

  • Is the bitbucket instance cloud hosted or locally hosted?
  • Is the bitbucket project public or private?

@irriss
Copy link
Author

irriss commented May 6, 2021

Thanks for prompt reply, Richard!

Given the version number I think you are using the cross platform node based version of my Release Notes.
that's correct

Is the bitbucket instance cloud hosted or locally hosted?

cloud

Is the bitbucket project public or private?

private

@rfennell
Copy link
Owner

rfennell commented May 6, 2021

I have re-tested and agree that when the source repository is Bitbucket that there is an issue

Usage API call Result
Classic Build getBuildChanges - Get the changes associated with the build since the last successful build Works
Single-stage YAML build getBuildChanges - Get the changes associated with the build since the last successful build Works
Classic Release first run getBuildChanges - Get the changes associated with the build since the last successful build Works
Multi-Stage YAML Build first run getBuildChanges - Get the changes associated with the build since the last successful build Works
Classic Release other runs getChangesBetweenBuilds - Get the changes between two builds Returns Nothing
Multi-Stage YAML Build other runs getChangesBetweenBuilds - Get the changes between two builds Returns Nothing

The issue is with the call 'getChangesBetweenBuilds' in the Microsoft Node SDK. I have checked that the direct REST API call exhibits the same results i.e. nothing returned.

This is a limitation of the Microsoft provided REST API, nothing I can really do here.

I have logged an issue on the Microsoft project repo. Let's see what they come back with if anything. But I suspect it might be by design

@ruslan-oncoshot
Copy link

Hi Richard, apparently it does not work with GitHub either.
getChangesBetweenBuilds and getWorkItemsBetweenBuilds do not return anything

@rfennell
Copy link
Owner

rfennell commented Jun 4, 2021

That makes sense, Azure DevOps only fully support detail when the source is located internally to Azure DevOps. I will update the issue if have raised with Microsoft

@ruslan-oncoshot
Copy link

As far as I understand we can get edge commits from AzureDevOps builds and then use GitHub API to get the difference between them?
https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/GitHubReleaseV0/operations/ChangeLog.ts

@rfennell
Copy link
Owner

rfennell commented Jun 4, 2021

Yes a potential solution, but something I would like to avoid if I can.

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

No branches or pull requests

3 participants