* [bug#66491] [maintenance] hydra: build-package-metadata: Add boolean for Git submodules in sources.json.
@ 2023-10-12 12:39 Simon Tournier
2023-10-14 17:23 ` Ludovic Courtès
2023-10-17 11:58 ` [bug#66491] [PATCH v2] " Simon Tournier
0 siblings, 2 replies; 5+ messages in thread
From: Simon Tournier @ 2023-10-12 12:39 UTC (permalink / raw)
To: 66491; +Cc: Simon Tournier, ludo
This format had been discussed in
<https://gitlab.softwareheritage.org/swh/devel/swh-loader-git/-/issues/4751#note_150607>
* hydra/build-package-metadata.scm (origin->json)[resolve]: Add the keyword
'submodule' when the Git reference is recursive.
---
hydra/build-package-metadata.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Hi,
This patch helps on SWH side.
Nevertheless, if it is possible from your side to add a new boolean field in
the JSON file (submodules ?) indicating that submodules should be fetched to
compute the hash, this will simplify the processing from our side.
<https://gitlab.softwareheritage.org/swh/devel/swh-loader-git/-/issues/4751#note_150593>
Cheers,
simon
diff --git a/hydra/build-package-metadata.scm b/hydra/build-package-metadata.scm
index 0a75204..9f90c5e 100755
--- a/hydra/build-package-metadata.scm
+++ b/hydra/build-package-metadata.scm
@@ -182,7 +182,10 @@ superseded packages."
"recursive"))))
'())
,@(if (eq? method git-fetch)
- `(("git_ref" . ,(git-reference-commit uri)))
+ `(("git_ref" . ,(git-reference-commit uri))
+ ,@(if (git-reference-recursive? uri)
+ '(("submodule" . "true"))
+ '()))
'())
,@(if (eq? method svn-fetch)
`(("svn_revision" . ,(svn-reference-revision uri)))
base-commit: 8f703892a6d549d52eb0374deb11d6af734065d4
--
2.38.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [bug#66491] [maintenance] hydra: build-package-metadata: Add boolean for Git submodules in sources.json.
2023-10-12 12:39 [bug#66491] [maintenance] hydra: build-package-metadata: Add boolean for Git submodules in sources.json Simon Tournier
@ 2023-10-14 17:23 ` Ludovic Courtès
2023-10-17 11:59 ` Simon Tournier
2023-10-17 11:58 ` [bug#66491] [PATCH v2] " Simon Tournier
1 sibling, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2023-10-14 17:23 UTC (permalink / raw)
To: Simon Tournier; +Cc: 66491
Hi,
Simon Tournier <zimon.toutoune@gmail.com> skribis:
> This format had been discussed in
> <https://gitlab.softwareheritage.org/swh/devel/swh-loader-git/-/issues/4751#note_150607>
>
> * hydra/build-package-metadata.scm (origin->json)[resolve]: Add the keyword
> 'submodule' when the Git reference is recursive.
[...]
> ,@(if (eq? method git-fetch)
> - `(("git_ref" . ,(git-reference-commit uri)))
> + `(("git_ref" . ,(git-reference-commit uri))
> + ,@(if (git-reference-recursive? uri)
> + '(("submodule" . "true"))
> + '()))
I think you’ll want to make it #t instead of "true", so that it
translates to the Boolean true, not the string "true":
--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (scm->json-string '((a . "true")))
$8 = "{\"a\":\"true\"}"
scheme@(guile-user)> (scm->json-string '((a . #true)))
$9 = "{\"a\":true}"
--8<---------------cut here---------------end--------------->8---
Otherwise LGTM!
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [bug#66491] [maintenance] hydra: build-package-metadata: Add boolean for Git submodules in sources.json.
2023-10-14 17:23 ` Ludovic Courtès
@ 2023-10-17 11:59 ` Simon Tournier
0 siblings, 0 replies; 5+ messages in thread
From: Simon Tournier @ 2023-10-17 11:59 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 66491
Hi Ludo,
On Sat, 14 Oct 2023 at 19:23, Ludovic Courtès <ludo@gnu.org> wrote:
> I think you’ll want to make it #t instead of "true", so that it
> translates to the Boolean true, not the string "true":
Thanks, yeah that’s better and consistent.
I have sent v2 because I am not sure to be allowed to push to
maintenance (authorization all that :-)).
Cheers,
simon
^ permalink raw reply [flat|nested] 5+ messages in thread
* [bug#66491] [PATCH v2] hydra: build-package-metadata: Add boolean for Git submodules in sources.json.
2023-10-12 12:39 [bug#66491] [maintenance] hydra: build-package-metadata: Add boolean for Git submodules in sources.json Simon Tournier
2023-10-14 17:23 ` Ludovic Courtès
@ 2023-10-17 11:58 ` Simon Tournier
2023-10-17 12:29 ` bug#66491: [maintenance] " Mathieu Othacehe
1 sibling, 1 reply; 5+ messages in thread
From: Simon Tournier @ 2023-10-17 11:58 UTC (permalink / raw)
To: 66491; +Cc: Simon Tournier, ludo
This format had been discussed in
<https://gitlab.softwareheritage.org/swh/devel/swh-loader-git/-/issues/4751#note_150607>
* hydra/build-package-metadata.scm (origin->json)[resolve]: Add the keyword
'submodule' when the Git reference is recursive.
---
hydra/build-package-metadata.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hydra/build-package-metadata.scm b/hydra/build-package-metadata.scm
index 0a75204..6b862eb 100755
--- a/hydra/build-package-metadata.scm
+++ b/hydra/build-package-metadata.scm
@@ -182,7 +182,10 @@ superseded packages."
"recursive"))))
'())
,@(if (eq? method git-fetch)
- `(("git_ref" . ,(git-reference-commit uri)))
+ `(("git_ref" . ,(git-reference-commit uri))
+ ,@(if (git-reference-recursive? uri)
+ '(("submodule" . #true))
+ '()))
'())
,@(if (eq? method svn-fetch)
`(("svn_revision" . ,(svn-reference-revision uri)))
base-commit: 053839dc9457f95792d6dce2e2e73292b9584b30
--
2.38.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-10-17 12:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-12 12:39 [bug#66491] [maintenance] hydra: build-package-metadata: Add boolean for Git submodules in sources.json Simon Tournier
2023-10-14 17:23 ` Ludovic Courtès
2023-10-17 11:59 ` Simon Tournier
2023-10-17 11:58 ` [bug#66491] [PATCH v2] " Simon Tournier
2023-10-17 12:29 ` bug#66491: [maintenance] " Mathieu Othacehe
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).