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

Adding workflow to update dependencies weekly #7944

Merged
merged 5 commits into from
Mar 15, 2025

Conversation

joperezr
Copy link
Member

@joperezr joperezr commented Mar 6, 2025

Description

This adds a workflow which runs weekly and updates the NuGet package dependencies in the project.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • No
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No

Sorry, something went wrong.

@Copilot Copilot bot review requested due to automatic review settings March 6, 2025 23:37
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR introduces a GitHub workflow that automatically updates NuGet package dependencies on a weekly basis by scheduling a dependency update process and opening a pull request with any detected changes.

  • Adds a workflow triggered by a cron schedule and manual dispatch.
  • Uses the dotnet-outdated tool to update NuGet packages and automatically creates a PR with the updated dependencies.
  • Reverts unintended changes while preserving updates to Directory.Packages.props.

Reviewed Changes

File Description
.github/workflows/update-dependencies.yml Implements a new workflow to update NuGet dependencies and open a PR with the updates.

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

@joperezr joperezr requested a review from danmoseley March 6, 2025 23:38
branch: update-dependencies
commit-message: "[Automated] Updating package dependencies"
title: "[Automated] Update dependencies"
body: "Auto-generated update to the package dependencies. In order for this PR to be green, it will require all of the new dependencies to be mirrored to our AzDO NuGet feeds. Any updates made outside of the first itemgroup in Directory.Packages.props should be reverted as those are packages that get updated through arcade's dependency flow."
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way for us to ensure that dotnet outdated doesn't update outside of the first itemgroup?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think there is other than manually adding either an include or exclude list with the packages that are updateable. We could potentially calculate that include list dynamically as part of the action in a previous step, but not sure if that is overkill (given we will need to review these updates anyway manually)

Copy link
Member

Choose a reason for hiding this comment

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

I guess we will see how annoying this gets. Maybe we will add an exclude list in the future so it doesn't mess with the dependencies to aspnetcore and runtime.

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

I assume we are going to turn off dependabot so we don't get duplicated PRs? Should we just do that at the same time?

@joperezr
Copy link
Member Author

joperezr commented Mar 7, 2025

I assume we are going to turn off dependabot so we don't get duplicated PRs? Should we just do that at the same time?

Yup, I can take care of that when this is merged.

@eerhardt
Copy link
Member

eerhardt commented Mar 8, 2025

Yup, I can take care of that when this is merged.

Why not at the same time?

@joperezr
Copy link
Member Author

joperezr commented Mar 8, 2025

Yup, I can take care of that when this is merged.

Why not at the same time?

I was under the impression that that was configured via Settings of the GH repo, but I now understand that that is only the dependabot security updates, so I will include in this change the removal of the dependabot yml configuration file.

@danmoseley
Copy link
Member

danmoseley commented Mar 8, 2025

Dependabot also updates global tools and maybe other stuff we want to keep not just package references (?)

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 10, 2025
@eerhardt
Copy link
Member

Dependabot also updates global tools and maybe other stuff we want to keep not just package references (?)

Agreed. We can just turn off dependabot for nuget references.

@sebastienros
Copy link
Member

Here is what I had done for Orchard with dotnet outdated. Maybe one thing to take is the major version lock arguments and the fact it won't try to create a PR if there are no updates detected (but probably the PR actions takes care of it)

OrchardCMS/OrchardCore@main...sebros/outdated

Since this Orchard has been using Renovate which handles everything with all the rules we want.

@joperezr
Copy link
Member Author

Here is what I had done for Orchard with dotnet outdated. Maybe one thing to take is the major version lock arguments and the fact it won't try to create a PR if there are no updates detected (but probably the PR actions takes care of it)

OrchardCMS/[email protected]/outdated

Since this Orchard has been using Renovate which handles everything with all the rules we want.

Thanks for sharing! I specifically decided not to use version lock on major, because we've said that, with our third party dependencies, we are okay with bumping them even across major versions. This is the current policy we use for our dependencies.

@danmoseley danmoseley added area-engineering-systems infrastructure helix infra engineering repo stuff and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Mar 11, 2025
@joperezr
Copy link
Member Author

This should be good to go now.

@joperezr joperezr merged commit 80774a3 into dotnet:main Mar 15, 2025
162 checks passed
@davidfowl
Copy link
Member

image

Broke the build.

@joperezr
Copy link
Member Author

Taking a peek

@joperezr
Copy link
Member Author

I have #8093 fixing this. FWIW, it only broke the dependabot leg, not the actual build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-engineering-systems infrastructure helix infra engineering repo stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants