Subject: Re: [bug#28283] Status: [PATCH 1/1] gnu: services: version-control: Add cgit.
From: [email-masked] (Ludovic Courtès)
To: Oleg Pykhalov <[email-masked]>
Cc: [email-masked]
Date: Tue, 03 Oct 2017 15:07:40 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Oleg Pykhalov <[email-masked]> skribis:

> From 984b619620046015113cc4876569f5c87dd37c79 Mon Sep 17 00:00:00 2001
> From: Oleg Pykhalov <[email-masked]>
> Date: Thu, 28 Sep 2017 20:02:35 +0300
> Subject: [PATCH] gnu: services: version-control: Add cgit.
>
> * gnu/services/version-control.scm
> (<cgit-configuration-file>, <cgit-configuration>): New record types.
> (cgit-configuration-robots-string, cgit-activation,
> cgit-configuration-nginx-config): New procedures.
> (%cgit-configuration-nginx, cgit-service-type): New variables.
> * doc/guix.texi (Version Control): Document the cgit service.
> ---
>  doc/guix.texi                    |  65 ++++++++++++++++
>  gnu/local.mk                     |   1 +
>  gnu/services/version-control.scm | 119 ++++++++++++++++++++++++++++-
>  gnu/tests/version-control.scm    | 161 +++++++++++++++++++++++++++++++++++++++
>  4 files changed, 345 insertions(+), 1 deletion(-)
>  create mode 100644 gnu/tests/version-control.scm

Awesome!

I took the liberty to add more URL tests:

--8<---------------cut here---------------start------------->8---
          ;; Make sure we can access pages that correspond to our repository.
          (letrec-syntax ((test-url
                           (syntax-rules ()
                             ((_ path code)
                              (test-equal (string-append "GET " path)
                                code
                                (let-values (((response body)
                                              (http-get (string-append
                                                         "http://localhost:8080"
                                                         path))))
                                  (response-code response))))
                             ((_ path)
                              (test-url path 200)))))
            (test-url "/")
            (test-url "/test")
            (test-url "/test/log")
            (test-url "/test/tree")
            (test-url "/test/does-not-exist" 404)
            (test-url "/does-not-exist" 404))
--8<---------------cut here---------------end--------------->8---

Will push in a minute.  Thank you!

Ludo’.