From 32f53350a3a3d701e9a1474e670a8454342adc40 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 19 Oct 2020 16:57:32 -0400 Subject: Devalloc informational website This includes deployment and implementation. As part of sprint-49, here are the startup progress questions: - Are you on track? - Yes? I'm making progress toward a proper launch. - Are you launched? - No - How many weeks to launch? - I would say 4 but it's probably more like 8 - How many (prospective) users have you talked to in the last week? - 2, Kyle and his manager, see below - What have you learned from them? - Kyle thought the metrics were interesting. - His manager thought the metrics were kinda useful but didn't think they really helped people ship higher quality code faster. So that's the rub: I have to show how this can make devs ship higher quality code faster; or, develop a set of features that improve those things. - Kyle pointed out that the clustering feature of devalloc will find optimal pairings *and* identify team silos that could be improved, so that's important to remember and might be a good angle in the future. - On a scale of 1-10, what is your morale? - 6 maybe - What most improved your primary metric? - Well I was able to deploy something within in the week, whereas before I had zero deploys per week. So that's an improvement. - What is your biggest obstacle? - Finding customers to talk to. - Also the thing isn't really built yet, I just have a python script. I need to build the real SaaS product - What are your top 1-3 goals for next week? - Find a single customer I can work with on an ongoing basis - I should ask around my network to see if I have any second-order connections that would be willing to work with me (Asher, Chad, previous bosses, etc) - Build out the front-end of the website (it's very simple, would just need a basic miso module and deployment) - Figure out how to connect/auth to the Github API so I can start building the SaaS version of the product Some user feedback from my friend Kyle. This comes from his engineering manager: > "Looks neat. If it were priced low enough I could see using it to run reports > as part of an overall package. A lot of those metrics don't matter too much to > me as a manager though A lot of these code quality tools are handy info but I > don't feel like they make people ship code any faster or any higher quality > Things like CodeClimate work well for Jrs though to avoid obvious static type > mistakes" Kyle provided some additional comments: > he might have been an unusual case. Jared's not big into metrics, Pivotal > Tracker point estimates, or things like that... He's far more into qualitative > feedback, like retrospectives and 1:1s > > I think it's definitely neat data! I certainly like the collaboration analysis > > It's interesting, we recently had a pair where two devs didn't work well > together, that could be represented here. Though, we didn't want to avoid > having them work together, we wanted them to find a work style that worked for > both of them And that's a good point: devalloc will find optimal pairings *and* points where you could improve team cohesiveness. --- Devalloc/Host.hs | 121 ++++++++++++++++++++++++++++++++++++++++++++++++ Devalloc/Host.nix | 46 ++++++++++++++++++ Devalloc/Page/Home.hs | 95 +++++++++++++++++++++++++++++++++++++ Devalloc/Page/Signup.hs | 46 ++++++++++++++++++ Devalloc/pitch.md | 12 ++--- 5 files changed, 313 insertions(+), 7 deletions(-) create mode 100644 Devalloc/Host.hs create mode 100644 Devalloc/Host.nix create mode 100644 Devalloc/Page/Home.hs create mode 100644 Devalloc/Page/Signup.hs (limited to 'Devalloc') diff --git a/Devalloc/Host.hs b/Devalloc/Host.hs new file mode 100644 index 0000000..6d66f32 --- /dev/null +++ b/Devalloc/Host.hs @@ -0,0 +1,121 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TypeApplications #-} +{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE NoImplicitPrelude #-} +{-# OPTIONS_GHC -fno-warn-orphans #-} + +-- Developer allocation +-- +-- : out devalloc-host +-- : dep clay +-- : dep cmark +-- : sys cmark +-- : dep envy +-- : dep lucid +-- : dep miso +-- : dep protolude +-- : dep servant +-- : dep servant-server +-- : dep warp +module Devalloc.Host + ( main, + ) +where + +import Alpha +import Biz.App (CSS (..), HtmlApp (..)) +import qualified Biz.Look +-- import qualified CMark as Cmark +import qualified Clay +import qualified Control.Exception as Exception +import qualified Devalloc.Page.Home as Home +import qualified Devalloc.Page.Signup as Signup +import qualified Lucid +import qualified Lucid.Base as Lucid +import Miso hiding (node) +import qualified Network.Wai as Wai +import qualified Network.Wai.Handler.Warp as Warp +import Network.Wai.Middleware.RequestLogger (logStdout) +import Servant +import qualified System.Envy as Envy + +main :: IO () +main = Exception.bracket startup shutdown run + where + startup = + Envy.decodeWithDefaults Envy.defConfig >>= \cfg -> do + -- pitchText <- readFile <| pitches cfg + -- let pitch = Cmark.commonmarkToHtml [] pitchText + putText "@" + putText "devalloc" + putText <| "port: " <> (show <| port cfg) + return (cfg, serve (Proxy @AllRoutes) <| serverHandlers) + shutdown :: (Config, Application) -> IO () + shutdown _ = pure () + run :: (Config, Wai.Application) -> IO () + run (cfg, app) = Warp.run (port cfg) (logStdout app) + +type HomeServer = ToServerRoutes Home.Path HtmlApp Home.Move + +type SignupServer = ToServerRoutes Signup.Path HtmlApp Signup.Move + +type AllRoutes = HomeServer :<|> SignupServer :<|> CssRoute + +type CssRoute = "css" :> "main.css" :> Get '[CSS] Text + +cssHandlers :: Server CssRoute +cssHandlers = return . toStrict <| Clay.render look + +instance Lucid.ToHtml a => Lucid.ToHtml (HtmlApp a) where + toHtmlRaw = Lucid.toHtml + toHtml (HtmlApp x) = + Lucid.doctypehtml_ <| do + Lucid.head_ <| do + Lucid.meta_ [Lucid.charset_ "utf-8"] + jsRef "/static/all.js" + jsRef "//unpkg.com/turbolinks@5.2.0/dist/turbolinks.js" + cssRef "/css/main.css" + Lucid.body_ (Lucid.toHtml x) + where + jsRef _href = + Lucid.with + (Lucid.script_ mempty) + [ Lucid.makeAttribute "src" _href, + Lucid.makeAttribute "async" mempty, + Lucid.makeAttribute "defer" mempty + ] + cssRef _href = + Lucid.with + (Lucid.link_ mempty) + [ Lucid.rel_ "stylesheet", + Lucid.type_ "text/css", + Lucid.href_ _href + ] + +data Config = Config + { port :: Warp.Port, + -- | A yaml file of pitches + pitches :: FilePath, + node :: FilePath + } + deriving (Generic, Show) + +instance Envy.DefConfig Config where + defConfig = + Config + { port = 3000, + pitches = "./Devalloc/pitch.md", + node = "_/bild/dev/Devalloc.Node/static" + } + +instance Envy.FromEnv Config + +serverHandlers :: Server AllRoutes +serverHandlers = Home.host :<|> Signup.host :<|> cssHandlers + +look :: Clay.Css +look = do + Biz.Look.fuckingStyle + "body" Clay.? Biz.Look.fontStack diff --git a/Devalloc/Host.nix b/Devalloc/Host.nix new file mode 100644 index 0000000..51aa85d --- /dev/null +++ b/Devalloc/Host.nix @@ -0,0 +1,46 @@ +{ options +, lib +, config +, pkgs +, modulesPath +}: + +let + cfg = config.services.devalloc-host; +in +{ + options.services.devalloc-host = { + enable = lib.mkEnableOption "Enable the devalloc-host service"; + port = lib.mkOption { + type = lib.types.int; + default = 3000; + description = '' + The port on which devalloc-host will listen for + incoming HTTP traffic. + ''; + }; + package = lib.mkOption { + type = lib.types.package; + description = "devalloc-host package to use"; + }; + }; + config = lib.mkIf cfg.enable { + systemd.services.devalloc-host = { + path = [ cfg.package ]; + wantedBy = [ "multi-user.target" ]; + script = '' + ${cfg.package}/bin/devalloc-host + ''; + description = '' + Devalloc.Host + ''; + serviceConfig = { + Environment = ["PORT=${toString cfg.port}"]; + KillSignal = "INT"; + Type = "simple"; + Restart = "on-abort"; + RestartSec = "1"; + }; + }; + }; +} diff --git a/Devalloc/Page/Home.hs b/Devalloc/Page/Home.hs new file mode 100644 index 0000000..f183881 --- /dev/null +++ b/Devalloc/Page/Home.hs @@ -0,0 +1,95 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE NoImplicitPrelude #-} + +module Devalloc.Page.Home + ( Move (..), + Path, + Form (..), + path, + view, + host, + ) +where + +import Alpha +import Biz.App (HtmlApp (..)) +import Miso +import Miso.String +import Servant.API +import Servant.Links +import Servant.Server (Handler) + +data Move = NoMove + +type Path = View Move + +newtype Form = Form + { uri :: URI + } + +path :: URI +path = linkURI <| safeLink (Proxy :: Proxy Path) (Proxy :: Proxy Path) + +host :: Handler (HtmlApp (View Move)) +host = + Form {uri = path} + |> view + |> HtmlApp + |> pure + +signup :: View Move +signup = + p_ + [] + [ a_ + [href_ "mailto:ben@bsima.me?subject=Devalloc+signup"] + [text "Request access via email"] + ] + +view :: Form -> View Move +view _ = + div_ + [] + [ h1_ [] [text "Devalloc"], + p_ + [] + [ text + "Devalloc analyzes your codebase trends, finds patterns \ + \ in how your developers work, and protects against tech debt." + ], + p_ [] [text "Just hook it up to your CI system - it will warn you when it finds a problem."], + signup, + h2_ [] [text "Identify blackholes in your codebase"], + p_ + [] + [ text + <| Miso.String.intercalate + " " + [ "What if none of your active employees have touched some part of the codebase?", + "This happens too often with legacy code, and then it turns into a huge source of tech debt.", + "Devalloc finds these \"blackholes\" and warns you about them so you can be proactive in eliminating tech debt." + ] + ], + h2_ + [] + [text "Protect against lost knowledge"], + p_ + [] + [text "Not everyone can know every part of a codebase. By finding pieces of code that only 1 or 2 people have touched, devalloc identifes siloed knowledge. This allows you to protect against the risk of this knowledge leaving the company if an employee leaves."], + h2_ + [] + [text "Don't just measure code coverage - also know your dev coverage"], + p_ + [] + [text "No matter how smart your employees are, if you are under- or over-utilizing your developers then you will never get optimal performance from your team."], + ul_ + [] + [ li_ [] [text "Find developer hot spots in your code: which pieces of code get continually rewritten, taking up valuable dev time?"], + li_ [] [text "Know how your devs work best: which ones have depth of knowledge, and which ones have breadth?"] + ], + p_ [] [text "(Paid only)"], + h2_ [] [text "See how your teams *actually* organize themselves with cluster analysis"], + p_ [] [text "Does your team feel splintered or not cohesive? Which developers work best together? Devalloc analyzes the collaboration patterns between devs and helps you form optimal pairings and teams based on shared code and mindspace."], + p_ [] [text "(Paid only)"], + signup + ] diff --git a/Devalloc/Page/Signup.hs b/Devalloc/Page/Signup.hs new file mode 100644 index 0000000..4bcdeec --- /dev/null +++ b/Devalloc/Page/Signup.hs @@ -0,0 +1,46 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE NoImplicitPrelude #-} + +module Devalloc.Page.Signup + ( Move (..), + Path, + Form (..), + path, + view, + host, + ) +where + +import Alpha +import Biz.App (HtmlApp (..)) +import Miso +import Miso.String +import Servant.API +import Servant.Links +import Servant.Server (Handler) + +data Move = NoMove + +type Path = View Move + +newtype Form = Form + { uri :: URI + } + +path :: URI +path = linkURI <| safeLink (Proxy :: Proxy Path) (Proxy :: Proxy Path) + +host :: Handler (HtmlApp (View Move)) +host = + Form {uri = path} + |> view + |> HtmlApp + |> pure + +view :: Form -> View Move +view _ = + div_ + [] + [ h1_ [] [text "Signup coming soon"], + p_ [] [a_ [href_ "/"] [text "Go back home"]] + ] diff --git a/Devalloc/pitch.md b/Devalloc/pitch.md index 3d122b4..cfc0b23 100644 --- a/Devalloc/pitch.md +++ b/Devalloc/pitch.md @@ -1,11 +1,9 @@ # Devalloc -Devalloc is a service that analyzes your codebase trends, finds patterns in how -your developers work, and protects against tech debt. +Devalloc analyzes your codebase trends, finds patterns in how your developers +work, and protects against tech debt. -This pre-release prototype is a script you can download and freely run on your -git repo (requires Python >=3.6). The next, paid version of Devalloc will have -an API, easy connectors to common CI systems, and automated reporting. +Just hook it up to your CI system - it will warn you when it finds a problem. ## Identify blackholes in your codebase @@ -31,7 +29,7 @@ developers then you will never get optimal performance from your team. - Know how your devs work best: which ones have depth of knowledge, and which ones have breadth? -(Available in future paid service) +(Paid only) ## See how your teams *actually* organize themselves with cluster analysis @@ -39,4 +37,4 @@ Does your team feel splintered or not cohesive? Which developers work best together? Devalloc analyzes the collaboration patterns between devs and helps you form optimal pairings and teams based on shared code and mindspace. -(Available in future paid service) +(Paid only) -- cgit v1.2.3