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

Make hardcoded references to Lightbend for ReadinessLevel configurable #17

Closed
mdedetrich opened this issue Mar 10, 2022 · 2 comments · Fixed by #34
Closed

Make hardcoded references to Lightbend for ReadinessLevel configurable #17

mdedetrich opened this issue Mar 10, 2022 · 2 comments · Fixed by #34
Assignees

Comments

@mdedetrich
Copy link
Contributor

mdedetrich commented Mar 10, 2022

I am currently integrating documentation in my project using sbt-paradox and following alpakka's https://doc.akka.io/docs/alpakka/current/index.html documentation as a rough guide and I ended up using sbt-paradox-project-info. When integrating sbt-paradox-project-info when using levels (which is currently a mandatory setting) I noticed that the generated documentation includes hardocded links to lightbends website (i.e. https://developer.lightbend.com/docs/introduction/#community-driven).

Obviously in my case I don't want my project to reference lightbend since it has nothing to do with lightbend but currently that configuration is hardcoded here

trait ReadinessLevel { def name: String }
object ReadinessLevel {
private def glossary(anchor: String, label: String): String =
s"""<a href="https://developer.lightbend.com/docs/introduction/getting-help/support-terminology.html#$anchor" target="_blank" rel="noopener">$label</a>""".stripMargin
case object Supported extends ReadinessLevel {
val name =
s"""${glossary("supported", "Supported")}, <a href="https://www.lightbend.com/lightbend-subscription" target="_blank" rel="noopener">Lightbend Subscription</a> provides support"""
}
case object Certified extends ReadinessLevel {
val name =
s"""${glossary("certified", "Certified")} by <a href="https://www.lightbend.com/" target="_blank">Lightbend</a>"""
}
case object Incubating extends ReadinessLevel {
val name = glossary("incubating", "Incubating")
}
case object CommunityDriven extends ReadinessLevel {
val name = glossary("community-driven", "Community-driven")
}
case object EndOfLife extends ReadinessLevel {
val name =
s"${glossary("eol", "End-of-Life")}, it is not recommended to use this project any more."
}
def fromString(s: String): ReadinessLevel = s match {
case "Supported" => Supported
case "Certified" => Certified
case "Incubating" => Incubating
case "CommunityDriven" => CommunityDriven
case "EndOfLife" => EndOfLife
case other => throw new IllegalArgumentException(s"unknown readiness level: $other")
}
}
.

Ideally the actual values for ReadinessLevel should be configured either in build.sbt or the project/project-info.conf and by default they shouldn't have any reference to lightbend. I guess specifically in lightbend/akkas case you can then create a sbt-lightbend-paradox plugin which includes sbt-paradox-project-info and sets the various lightbend related values there. https://github.com/akka/akka-paradox is another option to use however my impressions is that project is specifically for the praadox theme

@mdedetrich mdedetrich changed the title Remove hardcoded references to Lightbend for ReadinessLevel Make hardcoded references to Lightbend for ReadinessLevel configurable Mar 10, 2022
@ennru
Copy link
Member

ennru commented Mar 10, 2022

Great that you find this structured way to have standardised project information useful.

I guess the simplest solution would be to change the readiness level to optional. That wouldn't change anything for the current use in our Akka projects.

@mdedetrich
Copy link
Contributor Author

@ennru Way ahead of you #18

I still think that design wise it should be configurable but for our use case making it optional would at least unblock us from using sbt-paradox-project-info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants