Skip to content

Commit 503fd4b

Browse files
committed
[api] Include desription in release-feed
Fixes #898.
1 parent b4ce500 commit 503fd4b

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

src/clojars/db.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@
605605

606606
(defn- version-feed*
607607
[db ^Instant from-inst limit]
608-
(q db {:select [:group_name :jar_name :version :created]
608+
(q db {:select [:created :description :group_name :jar_name :version]
609609
:from :jars
610610
;; This uses the jars_idx_created index
611611
:where [:> :created (Timestamp/from from-inst)]

src/clojars/routes/api.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@
4545
;; Note: :next is deprecated, and may be removed at some point
4646
{:next (format "/api/release-feed?from=%s" next-inst)
4747
:next_from (str next-inst)
48-
:releases (mapv (fn [{:keys [created group_name jar_name version]}]
48+
:releases (mapv (fn [{:keys [created description group_name jar_name version]}]
4949
{:artifact_id jar_name
50+
:description description
5051
:group_id group_name
5152
:released_at created
5253
:version version})

test/clojars/integration/api_test.clj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,22 @@
165165
{:next_from (str (Instant/ofEpochMilli @curr-time))
166166
:releases
167167
[{:artifact_id "test"
168+
:description nil
168169
:group_id "org.clojars.dantheman"
169170
:released_at date-string-with-ms?
170171
:version "0.0.1"}
171172
{:artifact_id "test"
173+
:description nil
172174
:group_id "org.clojars.dantheman"
173175
:released_at date-string-with-ms?
174176
:version "0.0.2"}
175177
{:artifact_id "test"
178+
:description "TEST"
176179
:group_id "org.clojars.dantheman"
177180
:released_at date-string-with-ms?
178181
:version "0.0.3-SNAPSHOT"}
179182
{:artifact_id "test"
183+
:description "TEST"
180184
:group_id "org.clojars.dantheman"
181185
:released_at date-string-with-ms?
182186
:version "0.0.3-SNAPSHOT"}]}
@@ -205,10 +209,12 @@
205209
{:next_from (str (Instant/ofEpochMilli (+ start-time 3)))
206210
:releases
207211
[{:artifact_id "test"
212+
:description nil
208213
:group_id "org.clojars.dantheman"
209214
:released_at date-string-with-ms?
210215
:version "0.0.1"}
211216
{:artifact_id "test"
217+
:description nil
212218
:group_id "org.clojars.dantheman"
213219
:released_at date-string-with-ms?
214220
:version "0.0.2"}]}
@@ -218,10 +224,12 @@
218224
{:next_from (str (Instant/ofEpochMilli @curr-time))
219225
:releases
220226
[{:artifact_id "test"
227+
:description "TEST"
221228
:group_id "org.clojars.dantheman"
222229
:released_at date-string-with-ms?
223230
:version "0.0.3-SNAPSHOT"}
224231
{:artifact_id "test"
232+
:description "TEST"
225233
:group_id "org.clojars.dantheman"
226234
:released_at date-string-with-ms?
227235
:version "0.0.3-SNAPSHOT"}]}
@@ -265,20 +273,24 @@
265273
{:next_from (str (Instant/ofEpochMilli (inc start-time)))
266274
:releases
267275
[{:artifact_id "test"
276+
:description nil
268277
:group_id "org.clojars.dantheman"
269278
:released_at date-string-with-ms?
270279
:version "0.0.1"}]}
271280
body1))
272281

282+
273283
;; And: the rest of the former page is part of this one
274284
(is (match?
275285
{:next_from (str (Instant/ofEpochMilli (+ start-time 2)))
276286
:releases
277287
[{:artifact_id "test"
288+
:description nil
278289
:group_id "org.clojars.dantheman"
279290
:released_at date-string-with-ms?
280291
:version "0.0.2"}
281292
{:artifact_id "test"
293+
:description "TEST"
282294
:group_id "org.clojars.dantheman"
283295
:released_at date-string-with-ms?
284296
:version "0.0.3-SNAPSHOT"}]}
@@ -289,6 +301,7 @@
289301
{:next_from (str (Instant/ofEpochMilli (+ start-time 3)))
290302
:releases
291303
[{:artifact_id "test"
304+
:description "TEST"
292305
:group_id "org.clojars.dantheman"
293306
:released_at date-string-with-ms?
294307
:version "0.0.3-SNAPSHOT"}]}

0 commit comments

Comments
 (0)