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

No way to reset cache to 'reset' Scala Steward

Open milanvdm opened this issue 3 years ago • 5 comments

Due to https://github.com/scala-steward-org/scala-steward-action/pull/316, its now not possible to clear the cache of the action.

Currently, I would like to reset Scala Steward to reopen manually closed PRs.

Im not sure what the middle ground is between https://github.com/scala-steward-org/scala-steward-action/pull/316 and this missing feature.

milanvdm avatar Feb 08 '22 19:02 milanvdm

Will it help to add a "special" case that under some condition (like the presence of an environment variable) completely disables the cache?

alejandrohdezma avatar Feb 09 '22 10:02 alejandrohdezma

@alejandrohdezma Yea, it is indeed an edge case in case you want to rerun scala-steward from scratch ignoring manually closed PRs from the past.

So an environment variable makes total sense to me.

Extra context:

  1. I ran scala-steward with a personal Github token
  2. It opened a lot of PRs under my name causing a flood of email notifications
  3. I manually closed those PRs
  4. Switched to a Github App token
  5. Want to reopen all PRs under the new App token

So step 5 is currently not possible as it keeps ignoring the previously opened PRs under my own name.

milanvdm avatar Feb 09 '22 10:02 milanvdm

Removing the cache does not imply that Scala Steward creates new PRs for updates whose PRs were previously closed. It queries the GitHub API for already existing PRs with the same branch name and won't open a new PR if it finds any: https://github.com/scala-steward-org/scala-steward/blob/19909281fa163dd689ed2597dafd26302c279269/modules/core/src/main/scala/org/scalasteward/core/nurture/NurtureAlg.scala#L90-L94

fthomas avatar Feb 09 '22 11:02 fthomas

Mmm, so that would mean a change in scala-steward itself to make this possible since there is no flag atm to control this behavior? Does this make sense to be added?

milanvdm avatar Feb 09 '22 11:02 milanvdm

@fthomas does it make sense to have this added in scala-steward? It could be a new flag like --ignore-old-prs.

alejandrohdezma avatar Mar 09 '22 15:03 alejandrohdezma