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

Add the option to scan for all commits when matching PRs #2076

Closed

Conversation

rfennell
Copy link
Owner

What problem does this PR address?

  • Cross Platform Release Notes
  • This PR provides as extra way of trying to match PR to pipeline runs during the generation of release notes

Is there a related Issue?

@rfennell
Copy link
Owner Author

The concern with this PR is that it makes the scan for associated PRs very slow.

  • Using the old MergeCommit behaviours (still the default) the process was
    1. Find the commits associated with the pipeline run (usually a small number)
    2. Find all the PRs in scope (this could be slow as there could 1000s)
    3. Using the list of commits form step 1, scan all the PRs to see if they matched the PR MergeCommit ID
    4. Enrich the matched PRs to find all their details ( step 2 only gets their summarises)
  • The new process is
    1. Find the commits associated with the pipeline run (usually a small number)
    2. Find all the PRs in scope (this could be slow as there could 1000s)
    3. Enrich ALL the in scope PRs to find all their details ( step 2 only gets their summarises) - THI SIS VERY SLOW AS MANY API CALLS ARE MADE
    4. Using the list of PR check to see if any commits referenced match commit ID from step 1

Basically the issue is the enrichment of the PR has to be done for all PR, as opposed to just the few that match the Merge Commit ID

@rfennell
Copy link
Owner Author

This PR was created due to a misunderstanding of the root cause for the issue #2075.

It turned out that the issue was not the way PR were matched to commits. The PRs were being matched correctly, but the problem was where to find any WI linked via a PR. Specifically the PR associated WI can only be found via the PR, they are not in the list of WI directly linked to the pipeline run. You need to use the template

# Notes for build 
**Build Number**: {{buildDetails.id}}
**Build Trigger PR Number**: {{lookup buildDetails.triggerInfo 'pr.number'}} 

{{#forEach pullRequests}}
{{#if isFirst}}### Associated Pull Requests{{/if}}
*  **PR {{this.id}}**  {{this.title}}
{{#forEach this.associatedWorkitems}}
  - **Related work items:** {{this.id}}
{{/forEach}}
{{/forEach}}

Given this PR address a problem nobody has actually reported, I have decided not to merge this PR, this is because

  • It is slow to run
  • It add many, many extra API calls, so throttling is an potential issue
  • Make adoption more confusing

@rfennell rfennell closed this Feb 15, 2025
@rfennell rfennell deleted the issue2075-xplat-releasenotes-improve-pr-handling branch February 15, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How can we get the WorkItems triggered from different repos(same project) details when associated with PR
1 participant