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

How to fetch the details of release note from Release Info section? #895

Closed
sahildavawala opened this issue Dec 2, 2020 · 10 comments
Closed

Comments

@sahildavawala
Copy link

Describe the bug
How to fetch the details of release note from Release Info section?
I want to fetch the information from the Work Items into a Release where I am using the task 'Generate Release Notes for Pipeline Builds or Releases' for generating the release notes.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any Work Item
  2. Add some data in the Release Note section under the tab Release Info
  3. Go to Azure DevOps Release
  4. Add a task "Generate Release Notes for Pipeline Builds or Releases" in the release.
  5. Try to execute the same and it will not fetch the data for tags like $($widetails.fields.'System.AddtoReleasenotes') & $($widetail.fields.'System.DetailsforReleaseNote')

Expected behavior
Need the exact tag for fetching the details from Work Items.

Screenshots
Attached a couple of screenshots for the same.
image
image

What is the issue see:

  • Azure DevOps Services

Additional context
Add any other context about the problem here.

@rfennell
Copy link
Owner

rfennell commented Dec 2, 2020

The tags are not stored in named fields, but as a comma separated list in the field $($widetails.fields.'System.Tags').

IMPORTANT NOTE

This PowerShell based task was the first Release Notes Extension I built. It was designed to run only on Windows based Agents and in Builds, as this was all there was at the time. It has since been enhanced, with my own logic to work out associated work items and changesets/commits, to work within releases.

Since creating this extension I have also built a Node based Release Notes Generator that can run on any agent platform and uses standard Microsoft API calls to work out the associated work items and commits/changeset. Since December 2019 this newer extension supports both Releases and Builds

I STRONGLY RECOMMEND that if you are starting now that you should consider using my newer Node based Release Notes over this extension. This is because of

  • cross platform support
  • use of the same means to find the associated items as the Microsoft UI
  • enhanced workitem filtering

Note: I have no plans to further enhance this extension, and plan to deprecate it at some point in the future to focus on the Node based Release Notes extension, which is more flexible and feature rich.

@sahildavawala
Copy link
Author

@rfennell ,
Thanks for the updates on Release Notes Extension. I got the point that the existing one will get deprecated sometime in future and the new one which you have shared will be in working state.

But my concern is whether is there a way or possibility in which I get to fetch the details or data from Work Items >> Release Info tab where my actual Release Notes related information is available? Is there a tag which can help me here?

As per the current setup I am getting the list of Work Items, Title of the WI, Description, ID, etc. but I am more interested towards the details of Release Note to get auto fetched from the WI itself.

Kindly let me know if you are familiar with such tags then it can help me in achieving my task.

@rfennell
Copy link
Owner

rfennell commented Dec 2, 2020

I don't think those fields are available as part of the release or work item objects. There is no quick way to check with the PowerShell based task. However if you use the Node based one you can dump the contents of any of the returned objects to see what fields are available. You have a number of of options to help here

  • Inside a template use {{json builddetails}} (or any other object name) to dump the contents of the object
  • Set the task parameter dumpPayloadToConsole=false - the payload is logged out to the build log - but this can make the UI slow to respond, so I don't use this much
  • Set the task parameters dumpPayloadToFile=true and dumpPayloadFileName=payload.json - remember you do need to include in a folder path in the filename to a location you have access to, maybe make the dump part of the build artefacts?

So I would dump the object out and look for the field that contains the information you are after. Hopefully it is present

@sahildavawala
Copy link
Author

@rfennell ,

Thanks for the updates. I migrated to this new plugin "Generate Release Notes (Crossplatform)" and did some modifications in my Azure release pipeline.
Unfortunately I am unable to get any data by using the Handlebar template provided in https://marketplace.visualstudio.com/items?itemName=richardfennellBM.BM-VSTS-XplatGenerateReleaseNotes&ssr=false#overview

I am not sure what is wrong here but it doesn't fetch any data in my .md or .htm file which is set as the output.

Looking forward for some suggestions or help, appreciate it!

@rfennell
Copy link
Owner

rfennell commented Dec 3, 2020

A few things...

  • There are sample templates here
  • If you run your pipeline with diagnostics enabled, the check box on the run pipeline dialog, or set the variable system.debug=true you can see all the steps the task has taken. This will show the artifact discovery
  • If you want to test a template outside of the pipeline, have a look here

If you still have issue upload the log file and I will have a look

@sahildavawala
Copy link
Author

@rfennell ,

It is still not working. I am attaching the log file for your reference.
Generate_RS_logs.txt

@rfennell
Copy link
Owner

rfennell commented Dec 3, 2020

The log shows that the task has found the build, but there have been no changes e.g. WI, CS or PRs since the last successful build

2020-12-03T12:17:45.3261466Z Total Builds: [1]
2020-12-03T12:17:45.3318064Z Total Commits: [0]
2020-12-03T12:17:45.3319042Z Total Workitems: [0]
2020-12-03T12:17:45.3321734Z Total Related Workitems (Parent/Children): [0]
2020-12-03T12:17:45.3349184Z Total Release Tests: [0]
2020-12-03T12:17:45.3366382Z Total Tests: [0]
2020-12-03T12:17:45.3373898Z Total Pull Requests: [0]
2020-12-03T12:17:45.3378526Z Total Indirect Pull Requests: [0]

This is by design. The release notes are what has changed since the last successful build to that branch/stage.

As the WIKI details

Option Multi Stage YAML Classic Build/Release
Generate notes for just the current build Requires checkstages=false parameter Run inside the build
Generate notes since the last successful release.
Option 1. Place the task in a stage that is only run when you wish to generate release notes. Usually this will be guarded by branch based filters or manual approvals.
Requires checkstages=true parameter Run inside the release. Supported and you can override the stage name used for comparison using the overrideStageName parameter
Generate notes since the last successful release.
Option 2. Set the task to look back for the last successful build that has a given tag
Requires checkstages=true and the tags parameters Not supported
Generate notes since the last successful release.
Option 3. Override the build that the task uses for comparison with a fixed value
Requires checkstages=true and the overrideBuildReleaseId parameters Run inside the release. Requires the overrideBuildReleaseId parameter

So if you want to generate changes since some fixed release you can use the overrideBuildReleaseId option

@sahildavawala
Copy link
Author

I think that's not the case because the same logic which is part of https://marketplace.visualstudio.com/items?itemName=richardfennellBM.BM-VSTS-GenerateReleaseNotes-Task&ssr=false#overview gives the output and details of all the work items.

Anyways this might not help us in achieving the exact requirement of release note details so will think some other way.

Thanks for all the support and assistance.

@rfennell
Copy link
Owner

rfennell commented Dec 3, 2020

The old PowerShell version does not make use of the current standard Microsoft APIs to find associated items. It predates the API and uses some very 'interesting' home grown logic - this is why it going to be deprecated. It's behaviour is confusing

The Node based task should list the same associated items as the Microsoft UI

@github-actions
Copy link

github-actions bot commented Jan 3, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

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

No branches or pull requests

2 participants