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

Add custom PostUpdateHook for sbt-typelevel #2492

Merged
merged 3 commits into from
Jan 31, 2022

Conversation

armanbilge
Copy link
Contributor

This adds a custom PostUpdateHook for sbt-typelevel, which calls a tlPrePrBotHook command alias. The idea is that:

  1. Since sbt-typelevel subsumes several other plugins, it may require multiple post-update steps to be run.
  2. We can easily update the command in sbt-typelevel without needing to change Scala Steward.
  3. Downstream plugins can update the alias with their own custom steps, without needing to add their own PostUpdateHook to Steward.

Additional background in:

Let me know what you think. Thanks in advance! :)

@@ -72,11 +72,14 @@ object HookExecutor {
(GroupId("com.codecommit"), ArtifactId("sbt-spiewak-bintray")),
(GroupId("io.github.nafg.mergify"), ArtifactId("sbt-mergify-github-actions")),
(GroupId("io.chrisdavenport"), ArtifactId("sbt-davenverse")),
(GroupId("org.http4s"), ArtifactId("sbt-http4s-org")),
(GroupId("org.typelevel"), ArtifactId("sbt-typelevel")),
(GroupId("org.typelevel"), ArtifactId("sbt-typelevel-ci-release"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sbt-typelevel-ci-release is a lower-level plugin which only needs the sbt-github-actions post-update step.

@codecov
Copy link

codecov bot commented Jan 30, 2022

Codecov Report

Merging #2492 (c82d7d2) into main (510db32) will decrease coverage by 0.05%.
The diff coverage is 72.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2492      +/-   ##
==========================================
- Coverage   81.19%   81.14%   -0.06%     
==========================================
  Files         142      142              
  Lines        2489     2498       +9     
  Branches       55       44      -11     
==========================================
+ Hits         2021     2027       +6     
- Misses        468      471       +3     
Impacted Files Coverage Δ
...rg/scalasteward/core/edit/hooks/HookExecutor.scala 89.65% <72.72%> (-4.23%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 510db32...c82d7d2. Read the comment docs.

Copy link
Member

@fthomas fthomas left a comment

Choose a reason for hiding this comment

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

LGTM

@mzuehlke
Copy link
Member

mzuehlke commented Jan 31, 2022

@armanbilge In case you didn't know since #2434 Scala Steward can have repo specific post update hooks.
But each user of the sbt-typelevel plugin would have to add them herself/himself.

See: https://github.com/scala-steward-org/scala-steward/blob/main/docs/repo-specific-configuration.md

@armanbilge
Copy link
Contributor Author

@mzuehlke thanks, that config works well for single repositories but is difficult to maintain across orgs.

For example, sbt-http4s-org extends sbt-typelevel and would like to add its own customized post-update hooks for all the repositories in http4s org. With these changes, all it needs to do is update the tlPrePrBotHook command alias with its own commands.

@fthomas fthomas merged commit 21a5e1a into scala-steward-org:main Jan 31, 2022
@fthomas fthomas added this to the 0.15.0 milestone Jan 31, 2022
@fthomas fthomas added the enhancement New feature or request label Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants