Skip to content

Commit 04116c0

Browse files
authored
Merge pull request #222 from corporate-gadfly/feature/fail-build-for-ring-core-bump
add version check for ring-core
2 parents 35d8b50 + 035e253 commit 04116c0

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

project.clj

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
(def i18n-version "1.0.3")
1818
(def logback-version "1.3.16")
1919
(def jackson-version "2.21.1")
20+
;; DO NOT UPGRADE PAST 1.14+! In 1.15.x, Content-Length is added to the
21+
;; response headers automatically rather than transferring it chunked,
22+
;; and also string flushing behavior is changed, and some part of the system
23+
;; does not handle one or both of these correctly. We need to debug this and
24+
;; fix it before upgrading.
25+
(def ring-core-version "1.14.2")
2026

2127
(require '[clojure.string :as str]
2228
'[leiningen.core.main :as main])
@@ -32,6 +38,18 @@
3238

3339
(fail-if-logback->1-3! logback-version)
3440

41+
(defn fail-if-ring-core->1-14!
42+
"Fails the build if ring-core version is > 1.14.x."
43+
[ring-core-version]
44+
(let [[x y] (->> (str/split (str ring-core-version) #"\.")
45+
(take 2) ;; keep major and minor versions
46+
(map #(Integer/parseInt %)))]
47+
(when (or (> x 1) ;; major version is greater than 1
48+
(and (= x 1) (> y 14))) ;; major version is 1 and minor version is greater than 14
49+
(main/abort (format "ring-core version %s is not supported. Must be 1.14.x until performance regression is fixed (#197)." ring-core-version)))))
50+
51+
(fail-if-ring-core->1-14! ring-core-version)
52+
3553
;; If you modify the version manually, run scripts/sync_ezbake_dep.rb to keep
3654
;; the ezbake dependency in sync.
3755
(defproject org.openvoxproject/puppetserver "8.13.0-SNAPSHOT"
@@ -106,12 +124,7 @@
106124
[prismatic/schema "1.4.1"]
107125
[ring-basic-authentication "1.2.0"]
108126
[ring/ring-codec "1.3.0"]
109-
;; DO NOT UPGRADE PAST 1.14+! In 1.15.x, Content-Length is added to the
110-
;; response headers automatically rather than transferring it chunked,
111-
;; and also string flushing behavior is changed, and some part of the system
112-
;; does not handle one or both of these correctly. We need to debug this and
113-
;; fix it before upgrading.
114-
[ring/ring-core "1.14.2"]
127+
[ring/ring-core ~ring-core-version]
115128
[ring/ring-mock "0.6.2"]
116129
[slingshot "0.12.2"]]
117130

0 commit comments

Comments
 (0)