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

report pr status messages as appropriate #11757

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

brettfo
Copy link
Contributor

@brettfo brettfo commented Mar 6, 2025

Changes are for the new end-to-end updater and are not live.

This PR adds the final bits of PR handling messages and will report things like update_pull_request, pull_request_exists_for_latest_version, security_update_not_needed, etc.

The bulk of the tests were copied from the existing Ruby implementation and slightly tweaked to better represent the NuGet ecosystem.

This also required more strongly typed values for existing pull requests. In the JSON they're represented as an array of array of dependencies and that's what the old model represented, but now they're more strongly typed. Consider the following example that better shows the structure:

{
  "job": {
    // ...
    "existing-pull-requests": [
      // pull request 1
      [
        {
          "dependency-name": "Some.Dependency",
          "dependency-version": "1.2.3"
        }
      ],
      // pull request 2
      [
        {
          "dependency-name": "Some.Other.Dependency",
          "dependency-version": "4.5.6",
        }
      ]
    ]
    // ...
  }
}

@github-actions github-actions bot added the L: dotnet:nuget NuGet packages via nuget or dotnet label Mar 6, 2025

foreach (var updateOperation in allowedUpdateOperations)
foreach (var updateOperation in updateOperations)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This main loop is a bit more complicated now because we need to report certain types of PR messages immediately and other types later once we've done some update analysis. In either case we need to track that we've already reported on that PR so we don't report on it again at the end, where we need to report on anything not reported on yet.

@brettfo brettfo force-pushed the dev/brettfo/nuget-update-or-close-pr branch from bf20151 to eeb6772 Compare March 6, 2025 23:38
@brettfo brettfo marked this pull request as ready for review March 7, 2025 00:04
@brettfo brettfo requested a review from a team as a code owner March 7, 2025 00:04
@randhircs randhircs force-pushed the dev/brettfo/nuget-update-or-close-pr branch from eeb6772 to c31ee2e Compare March 7, 2025 18:19
@randhircs randhircs merged commit 72551e7 into main Mar 7, 2025
98 of 100 checks passed
@randhircs randhircs deleted the dev/brettfo/nuget-update-or-close-pr branch March 7, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: dotnet:nuget NuGet packages via nuget or dotnet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants