Conversation
8eb02be to
982bf8f
Compare
|
Weirdly, although the test run was mostly successful, it did do one weird thing - open 1 of the 8 PRs it raised as non-draft:
I can not see why this would have happened...! |
…erging with local config See: * guardian/scala-steward-public-repos#102 (comment)
I've figured out why that 1 repository got a non-draft PR - it exposed a Scala Steward bug which I'm now fixing with this PR: ...basically that repo had a ...due to the bug, for |
…mbined with _unset_ config This fixes a bug that came in with the initial introduction of the `pullRequests.draft` config setting with this PR: * #3628 The bug was that when combining global & local repo config, the result of combining `pullRequests.draft = true` with a config with _no_ setting for `pullRequests.draft` would be that `pullRequests.draft` was _unset_ (ie given the value `None`, rather than `Some(true)`. This is because of the behaviour of `.mapN()`, which I hadn't really thought through: https://github.com/scala-steward-org/scala-steward/blob/373d5a70533a024389bb93f5028d0fee81a6cbd6/modules/core/src/main/scala/org/scalasteward/core/repoconfig/PullRequestsConfig.scala#L66 ...in retrospect, it's not too surprising that `.mapN()` on two `Option`s only produces a populated `Some` if _both_ the inputs are `Some` - which is not the behaviour we want here. For us, if only _one_ of the configs has a value set, we definitely want to use that value. In the end, the neatest way I could find to get the desired behaviour was to remove the thing stopping us from having a `Monoid[Option[Boolean]]` - ie that there is no _general_ `Monoid[Boolean]` (there is no _one_ correct way to combine two `Boolean`s). We can create a specific one for this case, that says `Boolean`s should be combined with logical-`OR` (rather than `AND`, for instance) - and only expose it in the very narrow scope of where we want to use it. * guardian/scala-steward-public-repos#102 (comment)
|
The config generated here (for an sbt plugin...) looks incorrect - why is there still a Scala version in the artifact name ( |
…mbined with _unset_ config This fixes a bug that came in with the initial introduction of the `pullRequests.draft` config setting with this PR: * #3628 The bug was that when combining global & local repo config, the result of combining `pullRequests.draft = true` with a config with _no_ setting for `pullRequests.draft` would be that `pullRequests.draft` was _unset_ (ie given the value `None`, rather than `Some(true)`. This is because of the behaviour of `.mapN()`, which I hadn't really thought through: https://github.com/scala-steward-org/scala-steward/blob/373d5a70533a024389bb93f5028d0fee81a6cbd6/modules/core/src/main/scala/org/scalasteward/core/repoconfig/PullRequestsConfig.scala#L66 ...in retrospect, it's not too surprising that `.mapN()` on two `Option`s only produces a populated `Some` if _both_ the inputs are `Some` - which is not the behaviour we want here. For us, if only _one_ of the configs has a value set, we definitely want to use that value. In the end, the neatest way I could find to get the desired behaviour was to remove the thing stopping us from having a `Monoid[Option[Boolean]]` - ie that there is no _general_ `Monoid[Boolean]` (there is no _one_ correct way to combine two `Boolean`s). We can create a specific one for this case, that says `Boolean`s should be combined with logical-`OR` (rather than `AND`, for instance) - and only expose it in the very narrow scope of where we want to use it. * guardian/scala-steward-public-repos#102 (comment)
c42c15c to
ce48ba0
Compare
Give a warning when we can't generate config - probably because no preview is available
8c6dfc2 to
b656f1b
Compare

Here we're continuing work on:
...but switching from using
bashto Scala instead.Testing
I've made several runs using this updated script, and it's now working well.
Preventing 'unconfigured' runs of Scala Steward
Workflow Run 13 did not go as expected - when given a PR that had not generated a preview release, the script silently failed to generate a
targeted-scala-steward.conf- but nothing prevented the next step from occurring, which was running Scala Steward. Consequently Scala Steward ran without any global config (including our normal config, that limits the number of PRs Scala Steward raises & groups the PRs), and raised about 20 individual PRs that it normally would not have.In order to prevent this happening again, I've ensured that the script will return a non-zero exit code if no-config is generated, which then correctly terminates the workflow without running Scala Steward.
Blockers
play-git-hub- this needs the following PRs to be merged:com.gu.etag-caching, adopt Cats Effect (IO) rtyley/play-git-hub#18ExecutionContexts forfetchingvsparsingetag-caching#111