Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

AD: Support custom limit on number of open pull requests #1043

Merged

Conversation

CrispyDrone
Copy link
Contributor

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Feature.

⤵️ What is the current behavior?

NuKeeper only creates a single pull request, unless the ordering of selected updates changes due to for example a newer, more important package being released, or some parameter that affects how NuKeeper prioritizes updates changing.

🆕 What is the new behavior (if this is a feature change)?

Now, it is possible to set a limit on the number of open pull requests for Azure Devops/TFS. Nukeeper will now not stop after having tried to apply one set of updates. Instead, it will try to apply updates until it has reached the threshold of the max number of concurrent open pull requests in the repository.

Unfortunately, determining the number of open pull requests is not that straightforward for Azure Devops Server, especially when only having a PAT with Code (Read & Write). The strategies used are explained in the website's configuration page.

💥 Does this PR introduce a breaking change?

No.

🐛 Recommendations for testing

I have only been able to verify the behavior for Azure Devops Server 2019. I cannot make any guarantees for Azure Devops Services (cloud), or older versions of TFS.

📝 Links to relevant issues/docs

?

🤔 Checklist before submitting

  • All projects build
  • Relevant documentation was updated

@CrispyDrone
Copy link
Contributor Author

The build on windows is failing because of the revert of the libgit2sharp package upgrade. I can remove this revert commit, but it introduced a regression on my Azure Devops Server: "too many redirects or authentication replays".

@CrispyDrone
Copy link
Contributor Author

I rebased to accommodate new changes, and also decided to remove the revert commit for LibGit2Sharp.

@CrispyDrone
Copy link
Contributor Author

Fixed broken test due to a null reference exception because of the new auto merge behavior.

Before, NuKeeper would only generate a single pull request as it would
reselect the same updateset every single time, unless some outside
factors would influence the result of its prioritization algorithm.

Now, you can specify the max number of open pull requests on a
per-repository basis. This is currently only supported for Azure
Devops/TFS, however only Azure Devops Server has been tested.

Since there are no straightforward APIs for figuring out the number of
open pull requests, especially when using a PAT with `Code (Read &
Write)`, heuristics are used to figure out the number of open pull
requests as best as possible.

First, the current user is fetched. If this fails, a user by the name of
`nukeeper@bot.com` will be fetched. If this fails, all pull requests in
the repository will be considered that have the label `nukeeper`. If
none of these things were possible, it's assumed that there are 0 open
pull requests.

When the parameter `--consolidate` is specified, the default value for
`--maxopenpullrequests` is 1, otherwise it is `maxpackageupdates`.
@CrispyDrone
Copy link
Contributor Author

Rebased to accommodate new changes.

@MarcBruins
Copy link
Member

This looks good

@MarcBruins MarcBruins merged commit 18d6cdb into NuKeeperDotNet:master Jan 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants