scala-steward icon indicating copy to clipboard operation
scala-steward copied to clipboard

Clarification of "updatePullRequests" for grouped PRs

Open bcarter97 opened this issue 1 year ago • 4 comments

When using updatePullRequests = "always", if Scala Steward PRs are up-to-date with the main branch then running Scala Steward will not push commits to these branches. This is what I would expect to happen. However, for the minor updates PR, Scala Steward will re-commit the changes regardless of already being up-to-date with the main branch.

Firstly, is it expected that using an updatePullRequests strategy of "always" should not update PRs that are up-to-date with main?

Secondly, if the above is true, should the grouped PRs follow this same convention? And if not, should there be a way to separately configure the updatePullRequests strategy of grouped dependencies?

The only reference I can find to something similar is this comment - https://github.com/scala-steward-org/scala-steward/issues/3051#issuecomment-1547627278

This seems to suggest that the commits should be applied again. However the behaviour may have changed since then that I can't find any documentation of.

bcarter97 avatar Mar 18 '24 10:03 bcarter97

so from digging around it looks like the observed behaviour doesn't match the intention of the "always" strategy.

https://github.com/scala-steward-org/scala-steward/blob/996af6a8b62b210637ba5fccc37d073f7131f6e2/modules/core/src/main/scala/org/scalasteward/core/nurture/NurtureAlg.scala#L275-L292

This code suggests if the strategy is always it will update regardless of already being up to date, whereas we see updates only if the branch is out of date (except for the grouped PR branch which always updates).

This makes me wonder if there should be an update strategy for when you want ScalaSteward to always update if it's out of date with the main branch, and if its up to date skip, e.g. if-stale - thoughts?

bcarter97 avatar Apr 26 '24 19:04 bcarter97

Hi, are you seeing this on a repo on Github.com ? It could be related to not propperly caching the workspace: https://github.com/scala-steward-org/scala-steward/blob/main/docs/faq.md#why-doesnt-self-hosted-scala-steward-close-obsolete-prs Then Scala Steward wouldn't know what is the sate of an existing pull-request.

For grouped updates the rules are slightly different.

mzuehlke avatar Apr 30 '24 14:04 mzuehlke

Yes, this is running on Github.com. The workspace is persistent between runs, ScalaSteward closes old PRs.

For grouped updates the rules are slightly different

In what way?

bcarter97 avatar Apr 30 '24 16:04 bcarter97

thanks I don't know the logic. I will try to understand and come back...

mzuehlke avatar Apr 30 '24 16:04 mzuehlke