Skip to content

Commit 5690d74

Browse files
authored
freckle-stats, freckle-ecs (#226)
1 parent 8c1cdbe commit 5690d74

File tree

23 files changed

+362
-31
lines changed

23 files changed

+362
-31
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ jobs:
1212
matrix:
1313
package:
1414
- freckle-app
15+
- freckle-ecs
1516
- freckle-env
1617
- freckle-exception
1718
- freckle-kafka
1819
- freckle-http
1920
- freckle-memcached
2021
- freckle-otel
2122
- freckle-prelude
23+
- freckle-stats
2224

2325
steps:
2426
- uses: actions/checkout@v4
@@ -39,13 +41,15 @@ jobs:
3941
matrix:
4042
package:
4143
- freckle-app
44+
- freckle-ecs
4245
- freckle-env
4346
- freckle-exception
4447
- freckle-kafka
4548
- freckle-http
4649
- freckle-memcached
4750
- freckle-otel
4851
- freckle-prelude
52+
- freckle-stats
4953

5054
env:
5155
HACKAGE_KEY: ${{ secrets.HACKAGE_UPLOAD_API_KEY }}
@@ -62,7 +66,7 @@ jobs:
6266

6367
# Upload using our oldest, tested resolver, to set the lowest lower bounds
6468
- name: "Release to Hackage"
65-
run: stack --stack-yaml stack-lts-20.26.yaml upload --pvp-bounds lower ${{ matrix.package }}
69+
run: stack --stack-yaml stack-lts20.yaml upload --pvp-bounds lower ${{ matrix.package }}
6670

6771
- name: "Upload documentation"
6872
run: stack upload --documentation ${{ matrix.package }}

freckle-app/CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
## [_Unreleased_](https://github.com/freckle/freckle-app/compare/freckle-app-v1.21.0.0...main)
1+
## [_Unreleased_](https://github.com/freckle/freckle-app/compare/freckle-app-v1.22.0.0...main)
2+
3+
## [v1.22.0.0](https://github.com/freckle/freckle-app/compare/freckle-app-v1.21.0.0...freckle-app-v1.22.0.0)
4+
5+
`Freckle.App.Stats` has moved to a separate package `freckle-stats`.
6+
7+
When migrating to `freckle-stats`, note that the instance
8+
9+
```hs
10+
instance HasStatsClient site => HasStatsClient (HandlerData child site) where
11+
statsClientL = envL . siteL . statsClientL
12+
```
13+
14+
has been removed. If you are using Yesod, you may need to copy this definition
15+
into your own code.
16+
17+
`Freckle.App.Ecs` has moved to a separate package `freckle-ecs`.
218

319
## [v1.21.0.0](https://github.com/freckle/freckle-app/compare/freckle-app-v1.20.3.0...freckle-app-v1.21.0.0)
420

freckle-app/freckle-app.cabal

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
cabal-version: 1.22
22

3-
-- This file has been generated from package.yaml by hpack version 0.36.0.
3+
-- This file has been generated from package.yaml by hpack version 0.37.0.
44
--
55
-- see: https://github.com/sol/hpack
66

77
name: freckle-app
8-
version: 1.21.0.0
8+
version: 1.22.0.0
99
synopsis: Haskell application toolkit used at Freckle
1010
description: Please see README.md
1111
category: Utils
@@ -35,15 +35,12 @@ library
3535
Freckle.App.Bugsnag.SqlError
3636
Freckle.App.Csv
3737
Freckle.App.Database
38-
Freckle.App.Ecs
3938
Freckle.App.Faktory.ProducerPool
4039
Freckle.App.Ghci
4140
Freckle.App.GlobalCache
4241
Freckle.App.Json.Empty
4342
Freckle.App.Random
4443
Freckle.App.Scientist
45-
Freckle.App.Stats
46-
Freckle.App.Stats.Rts
4744
Freckle.App.Test
4845
Freckle.App.Test.DocTest
4946
Freckle.App.Test.Hspec.AnnotatedException
@@ -116,17 +113,15 @@ library
116113
, conduit-extra
117114
, containers
118115
, cookie
119-
, datadog
120116
, doctest
121-
, ekg-core
122117
, exceptions
123-
, extra
124118
, faktory
125119
, freckle-env
126120
, freckle-exception
127121
, freckle-http
128122
, freckle-otel
129123
, freckle-prelude
124+
, freckle-stats
130125
, hs-opentelemetry-api
131126
, hs-opentelemetry-instrumentation-persistent
132127
, hs-opentelemetry-instrumentation-wai
@@ -157,7 +152,6 @@ library
157152
, servant-server
158153
, template-haskell
159154
, text
160-
, time
161155
, transformers
162156
, transformers-base
163157
, typed-process
@@ -245,6 +239,7 @@ test-suite spec
245239
, cassava
246240
, conduit
247241
, freckle-app
242+
, freckle-stats
248243
, hs-opentelemetry-api
249244
, hspec
250245
, http-types

freckle-app/library/Freckle/App/Yesod.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,20 @@ import Freckle.App.Stats qualified as Stats
2020
import Network.HTTP.Types (ResponseHeaders, status503)
2121
import Network.Wai qualified as W
2222
import Yesod.Core.Handler (HandlerFor, sendWaiResponse)
23-
import Yesod.Core.Types (HandlerContents)
23+
import Yesod.Core.Types (HandlerContents, HandlerData)
2424

2525
-- | Catch 'SqlError' when queries are canceled due to timeout and respond 503
2626
--
2727
-- Also logs and increments a metric.
2828
respondQueryCanceled
29-
:: HasStatsClient site => HandlerFor site res -> HandlerFor site res
29+
:: HasStatsClient (HandlerData site site)
30+
=> HandlerFor site res
31+
-> HandlerFor site res
3032
respondQueryCanceled = respondQueryCanceledHeaders []
3133

3234
-- | 'respondQueryCanceledHeaders' but adding headers to the 503 response
3335
respondQueryCanceledHeaders
34-
:: HasStatsClient site
36+
:: HasStatsClient (HandlerData site site)
3537
=> ResponseHeaders
3638
-> HandlerFor site res
3739
-> HandlerFor site res

freckle-app/package.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: freckle-app
2-
version: 1.21.0.0
2+
version: 1.22.0.0
33

44
maintainer: Freckle Education
55
category: Utils
@@ -94,17 +94,15 @@ library:
9494
- conduit-extra
9595
- containers
9696
- cookie
97-
- datadog
9897
- doctest
99-
- ekg-core
10098
- exceptions
101-
- extra
10299
- faktory
103100
- freckle-env
104101
- freckle-exception
105102
- freckle-http
106103
- freckle-otel
107104
- freckle-prelude
105+
- freckle-stats
108106
- hs-opentelemetry-api
109107
- hs-opentelemetry-instrumentation-persistent
110108
- hs-opentelemetry-instrumentation-wai
@@ -135,7 +133,6 @@ library:
135133
- semigroupoids
136134
- template-haskell
137135
- text
138-
- time
139136
- transformers
140137
- transformers-base
141138
- typed-process
@@ -165,6 +162,7 @@ tests:
165162
- cassava
166163
- conduit
167164
- freckle-app
165+
- freckle-stats
168166
- hs-opentelemetry-api
169167
- hspec
170168
- http-types

freckle-ecs/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## [_Unreleased_](https://github.com/freckle/freckle-app/compare/freckle-ecs-v0.0.0.0...main)
2+
3+
## [v0.0.0.0](https://github.com/freckle/freckle-app/tree/freckle-ecs-v0.0.0.0/freckle-ecs)
4+
5+
First release, sprouted from `freckle-app-1.21.0.0`.

freckle-ecs/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2021-2024 Renaissance Learning Inc
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

freckle-ecs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# freckle-ecs
2+
3+
Small utility for Amazon Elastic Container Service

freckle-ecs/freckle-ecs.cabal

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
cabal-version: 1.18
2+
3+
-- This file has been generated from package.yaml by hpack version 0.37.0.
4+
--
5+
-- see: https://github.com/sol/hpack
6+
7+
name: freckle-ecs
8+
version: 0.0.0.0
9+
synopsis: Small utility for Amazon Elastic Container Service
10+
description: Please see README.md
11+
category: Prelude
12+
homepage: https://github.com/freckle/freckle-app#readme
13+
bug-reports: https://github.com/freckle/freckle-app/issues
14+
maintainer: Freckle Education
15+
license: MIT
16+
license-file: LICENSE
17+
build-type: Simple
18+
extra-source-files:
19+
package.yaml
20+
extra-doc-files:
21+
README.md
22+
CHANGELOG.md
23+
24+
source-repository head
25+
type: git
26+
location: https://github.com/freckle/freckle-app
27+
28+
library
29+
exposed-modules:
30+
Freckle.App.Ecs
31+
other-modules:
32+
Paths_freckle_ecs
33+
hs-source-dirs:
34+
library
35+
default-extensions:
36+
DataKinds
37+
DeriveAnyClass
38+
DerivingVia
39+
DerivingStrategies
40+
GADTs
41+
LambdaCase
42+
NoImplicitPrelude
43+
NoMonomorphismRestriction
44+
OverloadedStrings
45+
TypeFamilies
46+
ghc-options: -fignore-optim-changes -fwrite-ide-info -Weverything -Wno-all-missed-specialisations -Wno-missing-exported-signatures -Wno-missing-import-lists -Wno-missing-kind-signatures -Wno-missing-local-signatures -Wno-missing-safe-haskell-mode -Wno-monomorphism-restriction -Wno-prepositive-qualified-module -Wno-safe -Wno-unsafe
47+
build-depends:
48+
aeson
49+
, base <5
50+
, extra
51+
, freckle-http
52+
, freckle-prelude
53+
, mtl
54+
default-language: GHC2021
55+
if impl(ghc >= 9.8)
56+
ghc-options: -Wno-missing-role-annotations -Wno-missing-poly-kind-signatures

0 commit comments

Comments
 (0)