Skip to content

fix(azure): filter pull request queries by Renovate author - #45359

Open
aluqmanj-ni wants to merge 8 commits into
renovatebot:mainfrom
aluqmanj-ni:aluqmanj-ni/filter-fetched-prs-azure
Open

fix(azure): filter pull request queries by Renovate author#45359
aluqmanj-ni wants to merge 8 commits into
renovatebot:mainfrom
aluqmanj-ni:aluqmanj-ni/filter-fetched-prs-azure

Conversation

@aluqmanj-ni

@aluqmanj-ni aluqmanj-ni commented Aug 19, 2026

Copy link
Copy Markdown

Changes

  • Filter Azure DevOps pull requests by the authenticated Renovate identity.
  • Use the repository ID for sourceRepositoryId.
  • Respect the existing ignorePrAuthor option.
  • Preserve cross-author lookups for reconfigure pull requests.
  • Add tests for identity discovery and PR query filtering.

Addresses #45339

Context

Please select one of the following:

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

Use of AI in replying to PR comments

Who answers review comments:

  • @aluqmanj-ni will read and reply directly. Name the account.
  • An agent will draft replies and @username will read them before they are posted. Name the account.
  • Nobody has explicitly committed to replying.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests, but ran on a real repository, or
  • Both unit tests + ran on a real repository

The public repository:

@aluqmanj-ni
aluqmanj-ni marked this pull request as ready for review August 19, 2026 16:03
@github-actions
github-actions Bot requested a review from viceice August 19, 2026 16:03

@jamietanna jamietanna left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to test this against a real repository on Azure DevOps? Doesn't need to be one with many hundreds of thousands of PRs, but enough to get a page or two of PRs would be best to confirm it's working as expected

@aluqmanj-ni

Copy link
Copy Markdown
Author

Would it be possible to test this against a real repository on Azure DevOps? Doesn't need to be one with many hundreds of thousands of PRs, but enough to get a page or two of PRs would be best to confirm it's working as expected

Tested this change on a private Azure Repo with the following results:

Filtered run: 107 PRs
Run with ignorePrAuthor=true: 81,292 PRs

Commit: 3f0756c6f46319f340d4f5287ab71290cd0059a8
Date: 2026-08-20

Details:
- Default author filtering: Retrieved Pull Requests count: 107
- Filtered statistics: total=107, open=4, closed=5, merged=98
- ignorePrAuthor=true control: Retrieved Pull Requests count: 81292
- Control statistics: total=81292, open=1276, closed=8901, merged=71115
- Both repository runs completed with result=done, status=activated

@aluqmanj-ni
aluqmanj-ni requested a review from jamietanna August 20, 2026 21:01
jamietanna
jamietanna previously approved these changes Aug 21, 2026

@jamietanna jamietanna left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like an additional review from @viceice/@zharinov in case there are any additional things we need to be careful about with respect to the repo cache, here

@jamietanna
jamietanna requested a review from zharinov August 21, 2026 08:54
@zharinov

Copy link
Copy Markdown
Collaborator

Hey, I found some inconsistency similar to what we already had and fixed for Github platform. I'm preparing the patch.

@zharinov

Copy link
Copy Markdown
Collaborator

* fix(azure): scope PR filtering to effective credentials

* fix(azure): address authentication review feedback
@aluqmanj-ni

Copy link
Copy Markdown
Author

Retested after the last commit

Commit: b8d0a99811026edb65c053d8cce91f5841a253f4
Date: 2026-08-21

Real Azure DevOps dry runs against private repo:
- Default author filtering: Retrieved Pull Requests count: 108.
- Filtered statistics: total=108, open=4, closed=6, merged=98.
- Independent REST check: 108 PRs, one distinct creator ID, all matched the authenticated user.
- ignorePrAuthor=true control: Retrieved Pull Requests count: 81313.
- Control statistics: total=81313, open=1271, closed=8904, merged=71138.
- Both repository runs completed with result=done, status=activated.
- Neither run logged identity-discovery failures or "No config found for azure".

Comment thread lib/modules/platform/azure/index.ts
Comment thread lib/modules/platform/azure/index.spec.ts Outdated
Comment thread lib/modules/platform/azure/azure-got-wrapper.spec.ts Outdated
Comment thread lib/modules/platform/azure/azure-got-wrapper.ts Outdated
Comment thread lib/modules/platform/azure/index.spec.ts Outdated
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.

4 participants