gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant] branch master updated (349cb248 -> 18cb9a0b)


From: gnunet
Subject: [taler-merchant] branch master updated (349cb248 -> 18cb9a0b)
Date: Wed, 13 Dec 2023 21:46:40 +0100

This is an automated email from the git hooks/post-receive script.

devan-carpenter pushed a change to branch master
in repository merchant.

    from 349cb248 bump submodules
     new 364ebfdc ci: add basic CI config
     new d618ade5 ci: add script to run CI locally
     new 18cb9a0b -make code spell again

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 contrib/ci/Containerfile                           |  74 +++++++++++++++
 contrib/ci/ci.sh                                   |  34 +++++++
 contrib/ci/jobs/0-codespell/config.ini             |   6 ++
 contrib/ci/jobs/0-codespell/dictionary.txt         |  45 +++++++++
 contrib/ci/jobs/0-codespell/job.sh                 | 101 +++++++++++++++++++++
 contrib/ci/jobs/1-build/build.sh                   |   9 ++
 contrib/ci/jobs/1-build/job.sh                     |   6 ++
 contrib/ci/jobs/2-test/config.ini                  |   6 ++
 contrib/ci/jobs/2-test/job.sh                      |   6 ++
 contrib/ci/jobs/2-test/test.sh                     |  40 ++++++++
 contrib/ci/jobs/3-docs/config.ini                  |   6 ++
 contrib/ci/jobs/3-docs/docs.sh                     |  11 +++
 contrib/ci/jobs/3-docs/job.sh                      |   6 ++
 contrib/ci/jobs/4-deb-package/job.sh               |  23 +++++
 contrib/ci/jobs/4-deb-package/version.sh           |  17 ++++
 ...r-merchant-httpd_private-get-instances-ID-kyc.c |   6 +-
 src/backenddb/merchant-0001.sql                    |   2 +-
 src/include/taler_merchant_service.h               |   6 +-
 src/testing/testing_api_cmd_post_orders_paid.c     |   2 +-
 src/testing/testing_api_cmd_reward_authorize.c     |   2 +-
 20 files changed, 399 insertions(+), 9 deletions(-)
 create mode 100644 contrib/ci/Containerfile
 create mode 100755 contrib/ci/ci.sh
 create mode 100644 contrib/ci/jobs/0-codespell/config.ini
 create mode 100644 contrib/ci/jobs/0-codespell/dictionary.txt
 create mode 100755 contrib/ci/jobs/0-codespell/job.sh
 create mode 100755 contrib/ci/jobs/1-build/build.sh
 create mode 100755 contrib/ci/jobs/1-build/job.sh
 create mode 100644 contrib/ci/jobs/2-test/config.ini
 create mode 100755 contrib/ci/jobs/2-test/job.sh
 create mode 100755 contrib/ci/jobs/2-test/test.sh
 create mode 100644 contrib/ci/jobs/3-docs/config.ini
 create mode 100755 contrib/ci/jobs/3-docs/docs.sh
 create mode 100755 contrib/ci/jobs/3-docs/job.sh
 create mode 100755 contrib/ci/jobs/4-deb-package/job.sh
 create mode 100755 contrib/ci/jobs/4-deb-package/version.sh

diff --git a/contrib/ci/Containerfile b/contrib/ci/Containerfile
new file mode 100644
index 00000000..fa9d4055
--- /dev/null
+++ b/contrib/ci/Containerfile
@@ -0,0 +1,74 @@
+FROM docker.io/library/debian:bookworm
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get update -yqq && \
+    apt-get install -yqq \
+                   git \
+                  autoconf \
+                  libjansson-dev \
+                  libgcrypt-dev \
+                  libqrencode-dev \
+                  libpq-dev \
+                  pkg-config \
+                   libtool \
+                   recutils \
+                  make \
+                   python3-pip \
+                  python3-sphinx \
+                  python3-sphinx-rtd-theme \
+                   texinfo \
+                  autopoint \
+                  curl \
+                   libcurl4-openssl-dev \
+                   libsodium-dev \
+                  libidn11-dev \
+                  zlib1g-dev \
+                  libunistring-dev
+
+# Debian packaging tools
+RUN apt-get install -yqq \
+                   po-debconf \
+                   build-essential \
+                   debhelper-compat \
+                   devscripts \
+                  git-buildpackage
+
+RUN pip3 install --break-system-packages requests click poetry uwsgi htmlark
+
+# Install docs generation utils
+RUN apt-get update -yqq && \
+    apt-get install -yqq \
+                   graphviz \
+                  doxygen \
+   && rm -rf /var/lib/apt/lists/*
+
+# Install Taler (and friends) packages
+RUN curl -sS https://deb.taler.net/apt-nightly/taler-bookworm-ci.sources \
+    | tee /etc/apt/sources.list.d/taler-bookworm-ci.sources
+
+RUN echo '\
+Package: * \n\
+Pin: origin "deb.taler.net" \n\
+Pin-Priority: 999' > /etc/apt/preferences.d/taler
+
+RUN cat /etc/apt/preferences.d/taler && \
+    apt-get update -y && \
+    apt-get install -y \
+                   libgnunet-dev \
+                   libgnunet \
+                  libtalerexchange-dev \
+                  libtalerexchange \
+                  taler-exchange \
+                  taler-exchange-database \
+                  taler-exchange-offline \
+                  taler-auditor \
+&& rm -rf /var/lib/apt/lists/*
+
+RUN apt-get update -yqq && \
+    apt-get install -yqq \
+                   jq
+
+WORKDIR /workdir
+
+CMD ["bash", "/workdir/ci/ci.sh"]
diff --git a/contrib/ci/ci.sh b/contrib/ci/ci.sh
new file mode 100755
index 00000000..47c7a211
--- /dev/null
+++ b/contrib/ci/ci.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+set -exvuo pipefail
+
+# Use podman if available, otherwise use docker.
+# Fails if neither is found in PATH
+OCI_RUNTIME=$(which podman || which docker)
+REPO_NAME=$(basename "${PWD}")
+JOB_NAME="${1}"
+JOB_CONTAINER=$((grep CONTAINER_NAME contrib/ci/jobs/${JOB_NAME}/config.ini | 
cut -d' ' -f 3) || echo "${REPO_NAME}")
+JOB_ARCH=$((grep CONTAINER_ARCH contrib/ci/jobs/${JOB_NAME}/config.ini | cut 
-d' ' -f 3) || echo "${2:-amd64}")
+CONTAINER_BUILD=$((grep CONTAINER_BUILD contrib/ci/jobs/${JOB_NAME}/config.ini 
| cut -d' ' -f 3) || echo "True")
+
+echo "${JOB_CONTAINER}"
+
+if [ "${CONTAINER_BUILD}" = "True" ] ; then
+       "${OCI_RUNTIME}" build \
+               --arch "${JOB_ARCH}" \
+               -t "${JOB_CONTAINER}" \
+               -f contrib/ci/Containerfile .
+fi
+
+"${OCI_RUNTIME}" run \
+       --rm \
+       -ti \
+       --arch "${JOB_ARCH}" \
+       --env CI_COMMIT_REF="$(git rev-parse HEAD)" \
+       --volume "${PWD}":/workdir \
+       --workdir /workdir \
+       "${JOB_CONTAINER}" \
+       contrib/ci/jobs/"${JOB_NAME}"/job.sh
+
+top_dir=$(dirname "${BASH_SOURCE[0]}")
+
+#"${top_dir}"/build.sh
diff --git a/contrib/ci/jobs/0-codespell/config.ini 
b/contrib/ci/jobs/0-codespell/config.ini
new file mode 100644
index 00000000..bd7d7386
--- /dev/null
+++ b/contrib/ci/jobs/0-codespell/config.ini
@@ -0,0 +1,6 @@
+[build]
+HALT_ON_FAILURE = False
+WARN_ON_FAILURE = True
+CONTAINER_BUILD = False
+CONTAINER_NAME = nixery.dev/shell/codespell
+CONTAINER_ARCH = amd64
diff --git a/contrib/ci/jobs/0-codespell/dictionary.txt 
b/contrib/ci/jobs/0-codespell/dictionary.txt
new file mode 100644
index 00000000..065c5ce3
--- /dev/null
+++ b/contrib/ci/jobs/0-codespell/dictionary.txt
@@ -0,0 +1,45 @@
+# List of "words" that codespell should ignore in our sources.
+#
+# Note: The word sensitivity depends on how the to-be-ignored word is
+#  spelled in codespell_lib/data/dictionary.txt.  F.e. if there is a word
+# 'foo' and you add 'Foo' _here_, codespell will continue to complain
+#  about 'Foo'.
+#
+BRE
+ND
+Nd
+TE
+TEH
+UPDATEing
+WAN
+aci
+acn
+ba
+bre
+cant
+complet
+doas
+ect
+ehr
+fo
+hel
+ifset
+ist
+keypair
+nd
+oce
+onl
+openin
+ot
+ser
+sie
+som
+sover
+te
+te
+teh
+tha
+ths
+updateing
+wan
+wih
diff --git a/contrib/ci/jobs/0-codespell/job.sh 
b/contrib/ci/jobs/0-codespell/job.sh
new file mode 100755
index 00000000..7b486bc7
--- /dev/null
+++ b/contrib/ci/jobs/0-codespell/job.sh
@@ -0,0 +1,101 @@
+#!/bin/bash
+set -exuo pipefail
+
+job_dir=$(dirname "${BASH_SOURCE[0]}")
+
+skip=$(cat <<EOF
+ABOUT-NLS
+*/afl-tests/*
+**/auditor/*.sql
+*.bbl
+*.bib
+*build-aux*
+*.bst
+*.cache/*
+*/cbdc-es.tex
+*/cbdc-it.tex
+ChangeLog
+*.cls
+configure*
+config.status
+config.guess
+depcomp
+*/contrib/*
+*/contrib/hellos/**
+*.dat
+*.deflate
+*.doc
+*/doc/*
+**/doc/flows/main.de.tex
+*/doc/texinfo.tex
+*.docx
+*.ecc
+*.eot
+*.epgz
+*.eps
+*.epub
+**/ExchangeSelection/example.ts
+*.fee
+*.fees
+*.file
+**/fonts/**
+*.gif
+*/.git/**
+*.gz
+*/i18n/strings.ts
+*.info
+*.jpeg
+*.jpg
+*.??.json
+*.json
+*.json-*
+*/keys/*
+*key
+*.latexmkrc
+*libtool*
+ltmain.sh
+*.log
+*/m4/*
+*.m4
+**/*.map
+*.min.js
+*.mp4
+*.odg
+*.ods
+*.odt
+*.pack.js
+*.pdf
+*.png
+*.PNG
+**/pnpm-lock.yaml
+*.po
+*.pptx
+*.priv
+**/rfc.bib
+*.rpath
+**/signing-key.asc
+*.sqlite
+*/src/anastasis-data.ts
+**/*.svg
+*.svg
+*.tag
+**/templating/mustach**
+*/templating/test?/**
+*/testcurl/test_tricky.c
+*.tgz
+*.ttf
+*.ttf
+**/valgrind.h
+*/vpn/tests/**
+*.wav
+*.woff
+*.woff2
+*.xcf
+*.xlsx
+*.zkey
+EOF
+);
+
+echo Current directory: `pwd`
+
+codespell -I "${job_dir}"/dictionary.txt -S ${skip//$'\n'/,}
diff --git a/contrib/ci/jobs/1-build/build.sh b/contrib/ci/jobs/1-build/build.sh
new file mode 100755
index 00000000..b1137429
--- /dev/null
+++ b/contrib/ci/jobs/1-build/build.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -exuo pipefail
+
+./bootstrap
+./configure CFLAGS="-ggdb -O0" \
+           --enable-logging=verbose \
+           --disable-doc
+
+make
diff --git a/contrib/ci/jobs/1-build/job.sh b/contrib/ci/jobs/1-build/job.sh
new file mode 100755
index 00000000..8d79902c
--- /dev/null
+++ b/contrib/ci/jobs/1-build/job.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+set -exuo pipefail
+
+job_dir=$(dirname "${BASH_SOURCE[0]}")
+
+"${job_dir}"/build.sh
diff --git a/contrib/ci/jobs/2-test/config.ini 
b/contrib/ci/jobs/2-test/config.ini
new file mode 100644
index 00000000..fe5df939
--- /dev/null
+++ b/contrib/ci/jobs/2-test/config.ini
@@ -0,0 +1,6 @@
+[build]
+HALT_ON_FAILURE = False
+WARN_ON_FAILURE = True
+CONTAINER_BUILD = True
+CONTAINER_NAME = merchant
+CONTAINER_ARCH = amd64
diff --git a/contrib/ci/jobs/2-test/job.sh b/contrib/ci/jobs/2-test/job.sh
new file mode 100755
index 00000000..bfb24e33
--- /dev/null
+++ b/contrib/ci/jobs/2-test/job.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+set -exuo pipefail
+
+job_dir=$(dirname "${BASH_SOURCE[0]}")
+
+"${job_dir}"/test.sh
diff --git a/contrib/ci/jobs/2-test/test.sh b/contrib/ci/jobs/2-test/test.sh
new file mode 100755
index 00000000..4c414230
--- /dev/null
+++ b/contrib/ci/jobs/2-test/test.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+set -evu
+
+apt-get update
+apt-get upgrade -yqq
+
+./bootstrap
+./configure CFLAGS="-ggdb -O0" \
+           --enable-logging=verbose \
+           --disable-doc
+make
+make install
+
+sudo -u postgres /usr/lib/postgresql/15/bin/postgres -D 
/etc/postgresql/15/main -h localhost -p 5432 &
+sleep 10
+sudo -u postgres createuser -p 5432 root
+sudo -u postgres createdb -p 5432 -O root talercheck
+
+check_command()
+{
+       # Set LD_LIBRARY_PATH so tests can find the installed libs
+       LD_LIBRARY_PATH=/usr/local/lib PGPORT=5432 make check
+}
+
+print_logs()
+{
+       for i in src/*/test-suite.log
+       do
+               for FAILURE in $(grep '^FAIL:' ${i} | cut -d' ' -f2)
+               do
+                       echo "Printing ${FAILURE}.log"
+                       tail "$(dirname $i)/${FAILURE}.log"
+               done
+       done
+}
+
+if ! check_command ; then
+       print_logs
+       exit 1
+fi
diff --git a/contrib/ci/jobs/3-docs/config.ini 
b/contrib/ci/jobs/3-docs/config.ini
new file mode 100644
index 00000000..ae1f46cc
--- /dev/null
+++ b/contrib/ci/jobs/3-docs/config.ini
@@ -0,0 +1,6 @@
+[build]
+HALT_ON_FAILURE = False
+WARN_ON_FAILURE = True
+CONTAINER_BUILD = True
+CONTAINER_NAME = localhost/merchant
+CONTAINER_ARCH = amd64
diff --git a/contrib/ci/jobs/3-docs/docs.sh b/contrib/ci/jobs/3-docs/docs.sh
new file mode 100755
index 00000000..fe2b9687
--- /dev/null
+++ b/contrib/ci/jobs/3-docs/docs.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+set -exuo pipefail
+
+./bootstrap
+./configure --enable-only-doc
+
+pushd ./doc/doxygen/
+
+make full
+
+popd
diff --git a/contrib/ci/jobs/3-docs/job.sh b/contrib/ci/jobs/3-docs/job.sh
new file mode 100755
index 00000000..a72bca4b
--- /dev/null
+++ b/contrib/ci/jobs/3-docs/job.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+set -exuo pipefail
+
+job_dir=$(dirname "${BASH_SOURCE[0]}")
+
+"${job_dir}"/docs.sh
diff --git a/contrib/ci/jobs/4-deb-package/job.sh 
b/contrib/ci/jobs/4-deb-package/job.sh
new file mode 100755
index 00000000..a0801b41
--- /dev/null
+++ b/contrib/ci/jobs/4-deb-package/job.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+set -exuo pipefail
+# This file is in the public domain.
+# Helper script to build the latest DEB packages in the container.
+
+
+unset LD_LIBRARY_PATH
+
+# Install build-time dependencies.
+# Update apt cache first
+apt-get update
+apt-get upgrade -y
+mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes 
--no-install-recommends --yes' debian/control
+
+export VERSION="$(./contrib/ci/jobs/4-deb-package/version.sh)"
+echo "Building package version ${VERSION}"
+EMAIL=none gbp dch --ignore-branch --debian-tag="%(version)s" --git-author 
--new-version="${VERSION}"
+./bootstrap
+dpkg-buildpackage -rfakeroot -b -uc -us
+
+ls -alh ../*.deb
+mkdir -p /artifacts/merchant/${CI_COMMIT_REF} # Variable comes from CI 
environment
+mv ../*.deb /artifacts/merchant/${CI_COMMIT_REF}/
diff --git a/contrib/ci/jobs/4-deb-package/version.sh 
b/contrib/ci/jobs/4-deb-package/version.sh
new file mode 100755
index 00000000..d2647785
--- /dev/null
+++ b/contrib/ci/jobs/4-deb-package/version.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -ex
+
+BRANCH=$(git name-rev --name-only HEAD)
+if [ -z "${BRANCH}" ]; then
+       exit 1
+else
+        # "Unshallow" our checkout, but only our current branch, and exclude 
the submodules.
+       git fetch --no-recurse-submodules --tags --depth=1000 origin "${BRANCH}"
+       RECENT_VERSION_TAG=$(git describe --tags --match 'v*.*.*' --always 
--abbrev=0 HEAD || exit 1)
+       commits="$(git rev-list ${RECENT_VERSION_TAG}..HEAD --count)"
+       if [ "${commits}" = "0" ]; then
+               git describe --tag HEAD || exit 1
+       else
+               echo $(echo ${RECENT_VERSION_TAG} | sed -r 
's/^v//')-${commits}-$(git rev-parse --short=8 HEAD)
+       fi
+fi
diff --git a/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c 
b/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
index d269402b..8a338e7d 100644
--- a/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
+++ b/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
@@ -39,13 +39,13 @@
  * How long should clients cache a KYC failure response?
  */
 #define EXPIRATION_KYC_FAILURE GNUNET_TIME_relative_multiply ( \
-    GNUNET_TIME_UNIT_MINUTES, 5)
+          GNUNET_TIME_UNIT_MINUTES, 5)
 
 /**
  * How long should clients cache a KYC success response?
  */
 #define EXPIRATION_KYC_SUCCESS GNUNET_TIME_relative_multiply ( \
-    GNUNET_TIME_UNIT_HOURS, 1)
+          GNUNET_TIME_UNIT_HOURS, 1)
 
 
 /**
@@ -447,7 +447,7 @@ ekr_finished (struct ExchangeKycRequest *ekr)
   if (NULL != kc->exchange_pending_head)
     return; /* wait for more */
   /* All exchange requests done, create final
-     big response from cummulated replies */
+     big response from cumulated replies */
   if ( (0 == json_array_size (kc->pending_kycs)) &&
        (0 == json_array_size (kc->timeout_kycs)) )
   {
diff --git a/src/backenddb/merchant-0001.sql b/src/backenddb/merchant-0001.sql
index d6b25d8d..51fe5099 100644
--- a/src/backenddb/merchant-0001.sql
+++ b/src/backenddb/merchant-0001.sql
@@ -135,7 +135,7 @@ COMMENT ON COLUMN merchant_login_tokens.creation_time
 COMMENT ON COLUMN merchant_login_tokens.expiration_time
   IS 'determines when the token expires';
 COMMENT ON COLUMN merchant_login_tokens.validity_scope
-  IS 'identifies the opeations for which the token is valid';
+  IS 'identifies the operations for which the token is valid';
 COMMENT ON COLUMN merchant_login_tokens.merchant_serial
   IS 'identifies the instance for which the token is valid';
 
diff --git a/src/include/taler_merchant_service.h 
b/src/include/taler_merchant_service.h
index b3e15025..0abef2a8 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -345,7 +345,7 @@ struct TALER_MERCHANT_ConfigResponse
        * supported by this merchant backend.
        */
       const struct TALER_CurrencySpecification *cspecs;
-      
+
     } ok;
   } details;
 };
@@ -908,7 +908,7 @@ TALER_MERCHANT_instance_delete_cancel (
  * @param arg request to cancel.
  */
 #define TALER_MERCHANT_instance_purge_cancel(arg) \
-  TALER_MERCHANT_instance_delete_cancel (arg)
+        TALER_MERCHANT_instance_delete_cancel (arg)
 
 
 /* *************** Accounts **************** */
@@ -2589,7 +2589,7 @@ typedef void
  * @param ctx execution context
  * @param backend_url base URL of the merchant backend
  * @param order_id order id to identify the payment
- * @param session_id sesion id for the payment (or NULL if the check is not
+ * @param session_id session id for the payment (or NULL if the check is not
  *                   bound to a session)
  * @param transfer if true, obtain the wire transfer status from the exchange.
  *               Otherwise, the wire transfer status MAY be returned if it is 
available.
diff --git a/src/testing/testing_api_cmd_post_orders_paid.c 
b/src/testing/testing_api_cmd_post_orders_paid.c
index fd6d2892..f4806788 100644
--- a/src/testing/testing_api_cmd_post_orders_paid.c
+++ b/src/testing/testing_api_cmd_post_orders_paid.c
@@ -55,7 +55,7 @@ struct PostOrdersPaidState
   const char *pay_reference;
 
   /**
-   * The session to use for the requet.
+   * The session to use for the request.
    */
   const char *session_id;
 
diff --git a/src/testing/testing_api_cmd_reward_authorize.c 
b/src/testing/testing_api_cmd_reward_authorize.c
index 9fe73659..1e8579ab 100644
--- a/src/testing/testing_api_cmd_reward_authorize.c
+++ b/src/testing/testing_api_cmd_reward_authorize.c
@@ -47,7 +47,7 @@ struct RewardAuthorizeState
   unsigned int http_status;
 
   /**
-   * Reference to the reserv to authorize the reward
+   * Reference to the reserve to authorize the reward
    * from (if NULL, the merchant decides).
    */
   const char *reserve_reference;

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]