Skip to content

Commit 0c2a99c

Browse files
committed
fix: Keep the project-link keys in the source map
1 parent 547ae63 commit 0c2a99c

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/bone/common.clj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,7 @@
10781078
(merge {:source-type stype}
10791079
(select-keys src [:list :alias :to :commands :labels :notifications
10801080
:archive-format-string :list-archive :base-url
1081+
:website :contribute-url :post-address
10811082
:maintainers :awaiting-delay :periods])
10821083
(when global-st {:global-labels global-st})
10831084
(when global-cmd {:global-commands global-cmd})

test/bone/common_test.clj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,18 @@
206206
(is (= #{} (get-in sm ["source" :restricted-types])))
207207
(is (true? (get-in sm ["source" :patch-triggers?]))))))
208208

209+
(deftest build-source-map-keeps-project-links
210+
(testing "the project-link keys survive the source-map whitelist --
211+
they feed the JSON envelope and the exported pages"
212+
(let [sm (common/build-source-map
213+
{:sources [{:name "s" :list "l.example.org"
214+
:website "https://p.example.org"
215+
:contribute-url "https://p.example.org/contribute"
216+
:post-address "bugs@example.org"}]})]
217+
(is (= "https://p.example.org" (get-in sm ["s" :website])))
218+
(is (= "https://p.example.org/contribute" (get-in sm ["s" :contribute-url])))
219+
(is (= "bugs@example.org" (get-in sm ["s" :post-address]))))))
220+
209221
;; ---------------------------------------------------------------------------
210222
;; slugify
211223
;; ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)