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

Expunge bloop and add an sbt welcome message #54

Merged
merged 8 commits into from
Jan 27, 2021

Conversation

jisantuc
Copy link
Contributor

@jisantuc jisantuc commented Jan 21, 2021

Overview

Consistent feedback in the state of scala survey (other than "why is this survey so long") was that sbt is hard. This PR adds
the sbt-welcome-message plugin so that on project startup users will see a nice list of available commands. This should at
least remove friction for the most commonly executed tasks.

This PR also removes the bloop invocations from setup and CI (well not CI yet but soon).

Notes

I didn't include the sbt helper script here after all since escaping the $s was causing a lot of problems.

Testing

  • cd to one level above this repo
  • sbt new "file://$(pwd)/azavea.g8"
  • accept all the defaults
  • cd to quickstart
  • launch an sbt shell with ./sbt (you can borrow it from Franklin or just use sbt if it's on your path) and check out the beautiful welcome message full of useful things you can do
  • but that's not all! to verify that removal of bloop worked, run ./scripts/update, then ./scripts/server. your server should come up successfully.

Closes #9

@rbreslow rbreslow self-requested a review January 22, 2021 15:45
@jisantuc jisantuc changed the title Add a welcome message Expunge bloop and add an sbt welcome message Jan 25, 2021
Copy link

@rbreslow rbreslow left a comment

Choose a reason for hiding this comment

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

I was able to follow your testing instructions. Also, I think these are all good improvements. 👍

One interesting thing is that migrations and the application server seem to be using the error logger:

[info] running (fork) com.azavea.quickstart.api.Server migrate
[error] [ioapp-compute-4] INFO org.flywaydb.core.internal.license.VersionPrinter - Flyway Community Edition 6.5.0 by Redgate
[error] [ioapp-compute-4] INFO org.flywaydb.core.internal.database.DatabaseFactory - Database: jdbc:postgresql://localhost:5432/quickstart (PostgreSQL 12.4)
[error] [ioapp-compute-4] INFO org.flywaydb.core.internal.command.DbValidate - Successfully validated 1 migration (execution time 00:00.020s)
[error] [ioapp-compute-4] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory - Creating Schema History table "public"."flyway_schema_history" ...
[error] [ioapp-compute-4] INFO org.flywaydb.core.internal.command.DbMigrate - Current version of schema "public": << Empty Schema >>
[error] [ioapp-compute-4] INFO org.flywaydb.core.internal.command.DbMigrate - Migrating schema "public" to version 1 - Add PostGIS and Users
[error] [ioapp-compute-4] INFO org.flywaydb.core.internal.command.DbMigrate - Successfully applied 1 migration to schema "public" (execution time 00:01.286s)
[success] Total time: 27 s, completed Jan 26, 2021 4:58:09 PM
. . .
[error] [ioapp-compute-4] INFO org.http4s.blaze.channel.nio1.NIO1SocketServerGroup - Service bound to address /0:0:0:0:0:0:0:0:8080
[error] [ioapp-compute-4] INFO org.http4s.server.blaze.BlazeServerBuilder -
[error]   _   _   _        _ _
[error]  | |_| |_| |_ _ __| | | ___
[error]  | ' \  _|  _| '_ \_  _(_-<
[error]  |_||_\__|\__| .__/ |_|/__/
[error]              |_|
[error] [ioapp-compute-4] INFO org.http4s.server.blaze.BlazeServerBuilder - http4s v0.21.5 on blaze v0.14.12 started at http://[::]:8080/
[error] [blaze-selector-1] INFO org.http4s.blaze.channel.nio1.NIO1SocketServerGroup - Accepted connection from /0:0:0:0:0:0:0:1:50892

Also, when you run server, the azavea.g8 help message is displayed. I'd expect that to only be displayed when invoking sbt without a valid command. Just a nit.

@jisantuc
Copy link
Contributor Author

I think I can come up with a trick to suppress the welcome message except when starting the sbt shell. I don't know what to do about the logger thing just yet... it's ringing some bells, but they're faint. I'll take a stab at it though.

This commit:

- removes the onload hook to switch to application
- adds the command to switch to application to the
  root welcome message
- moves the big welcome message with the noisy logo to the
  application subproject
@jisantuc
Copy link
Contributor Author

I wasn't able to fully kill the welcome message in the root project, but it's a lot less obnoxious now as of 75d57da

@jisantuc
Copy link
Contributor Author

The error-level logging is also an issue on master. Here are some logs from a setup I did a second ago:

[E] [ioapp-compute-12] INFO org.http4s.blaze.channel.nio1.NIO1SocketServerGroup - Service bound to address /0:0:0:0:0:0:0:0:8080
[E] [ioapp-compute-12] INFO org.http4s.server.blaze.BlazeServerBuilder - 
[E]   _   _   _        _ _
[E]  | |_| |_| |_ _ __| | | ___
[E]  | ' \  _|  _| '_ \_  _(_-<
[E]  |_||_\__|\__| .__/ |_|/__/
[E]              |_|
[E] [ioapp-compute-12] INFO org.http4s.server.blaze.BlazeServerBuilder - http4s v0.21.5 on blaze v0.14.12 started at http://[::]:8080/

It's not clear to me where this log level is coming from. I'm going to open a follow-up issue

@jisantuc jisantuc merged commit dd61a8c into master Jan 27, 2021
@jisantuc jisantuc deleted the feature/js/add-welcome-message branch January 27, 2021 16:22
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 this pull request may close these issues.

add sbt welcome message
2 participants