[Git][reproducible-builds/reproducible-notes][master] gitlab-ci: fixup: provide input to the pre-receive githook

James Addison (@jayaddison) gitlab at salsa.debian.org
Mon Mar 11 16:55:40 UTC 2024



James Addison pushed to branch master at Reproducible Builds / reproducible-notes


Commits:
0c2f08c7 by James Addison at 2024-03-11T16:55:33+00:00
gitlab-ci: fixup: provide input to the pre-receive githook

Current versions of GitLab appear not to send any text through stdin
during job steps; without input from stdin, the pre-receive githook
does nothing.

Includes a Python3-compatibility fixup.

- - - - -


2 changed files:

- .gitlab-ci.yml
- hooks/pre-receive


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -6,7 +6,7 @@ before_script:
 test:
   image: debian:unstable
   script:
-    - hooks/pre-receive
+    - echo "${CI_COMMIT_BEFORE_SHA}" "${CI_COMMIT_SHA}" "${CI_COMMIT_REF_NAME}" | hooks/pre-receive
     - git clone --depth=1 https://salsa.debian.org/reproducible-builds/reproducible-misc.git misc
     - misc/clean-notes
     - if [ -n "$(git status --untracked-files=no --porcelain)" ]; then printf "NOTES NOT CLEAN!\n\n" ; git diff ; exit 1 ; else echo "Then notes are clean ☺" ; fi


=====================================
hooks/pre-receive
=====================================
@@ -12,14 +12,14 @@ def read_from_git(ref, path):
 
 
 def validate_issues(issues):
-    for name, data in issues.iteritems():
+    for name, data in issues.items():
         if 'description' not in data:
             print('ERROR: issue %s is missing a description' % name, file=sys.stderr)
             sys.exit(1)
 
 
 def ensure_issues_are_known(issues, packages):
-    for package, data in packages.iteritems():
+    for package, data in packages.items():
         for issue in data.get('issues', []):
             if issue not in issues:
                 print('ERROR: issue %s not listed in issues.yml' % issue, file=sys.stderr)



View it on GitLab: https://salsa.debian.org/reproducible-builds/reproducible-notes/-/commit/0c2f08c7af92f0d3fb61abbf7138678b7fca76a5

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/reproducible-notes/-/commit/0c2f08c7af92f0d3fb61abbf7138678b7fca76a5
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20240311/6574c091/attachment.htm>


More information about the rb-commits mailing list