From 3c7e82759bf2d6ca2c1d097ea2a99c7a6033aae6 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 24 Aug 2018 12:49:31 +0100 Subject: [PATCH 001/255] Document usage of global whitelist This change affects documentation only. To apply in your real world deployments: - Merge https://github.com/Tecnativa/doodba-scaffolding/pull/5 in your downstream scaffolding clone. - Follow instructions added to README here. --- README.md | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/README.md b/README.md index 6c5cd7ad..5abbfa88 100644 --- a/README.md +++ b/README.md @@ -728,6 +728,95 @@ Test it in your machine with: This environment also needs a [global inverse proxy](#global-inverse-proxy). +###### Global whitelist + +Since the testing environment is [network-isolated](#network-isolation), +this can change some deadlocks or big timeouts in code chunks that are not +ready for such situation. Odoo happens to have some of them. + +The [development][] environment includes the default recommended whitelist +proxies, but for [testing][], it is recommended to have a separate docker +compose project running along in the same server that provides a +`globalwhitelist_default` network where all whitelist proxies exist. This is +a better practice for a testing environment where many services might coexist, +because it will let you save lots of processing power and IP addresses. + +The recommended `globalwhitelist/docker-compose.yaml` file should contain: + +```yaml +version: "2.1" + +networks: + public: + driver_opts: + encrypted: 1 + shared: + internal: true + driver_opts: + encrypted: 1 + +services: + cdnjs_cloudflare_com: + image: tecnativa/whitelist + restart: unless-stopped + networks: + public: + shared: + aliases: + - "cdnjs.cloudflare.com" + environment: + TARGET: "cdnjs.cloudflare.com" + PRE_RESOLVE: 1 + + fonts_googleapis_com: + image: tecnativa/whitelist + restart: unless-stopped + networks: + public: + shared: + aliases: + - "fonts.googleapis.com" + environment: + TARGET: "fonts.googleapis.com" + PRE_RESOLVE: 1 + + fonts_gstatic_com: + image: tecnativa/whitelist + restart: unless-stopped + networks: + public: + shared: + aliases: + - "fonts.gstatic.com" + environment: + TARGET: "fonts.gstatic.com" + PRE_RESOLVE: 1 + + www_google_com: + image: tecnativa/whitelist + restart: unless-stopped + networks: + public: + shared: + aliases: + - "www.google.com" + environment: + TARGET: "www.google.com" + PRE_RESOLVE: 1 + + www_gravatar_com: + image: tecnativa/whitelist + restart: unless-stopped + networks: + public: + shared: + aliases: + - "www.gravatar.com" + environment: + TARGET: "www.gravatar.com" + PRE_RESOLVE: 1 +``` + #### Other usage scenarios In examples below I will skip the `-f .yaml` part and assume you From f76b004f7577f933724a7f0251f7d8cc5ac29820 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 23 Aug 2018 11:59:02 +0100 Subject: [PATCH 002/255] Easier usage of ptvsd debugger The command you need to use to have ptvsd working and correctly integrated is a little bit hard to do manually, and more with the proxies and all stuff integrated in the scaffolding. Now, just set `PTVSD_ENABLE=1` when booting the container to autoprefix the command with ptvsd stuff. Instructions on how to use new feature from https://github.com/Tecnativa/doodba-scaffolding/pull/4 are added too. --- 11.0.Dockerfile | 2 ++ 8.0.Dockerfile | 2 ++ README.md | 17 ++++++++++++++--- bin/direxec | 26 +++++++++++++++++--------- lib/odoobaselib/__init__.py | 9 +++++++++ 5 files changed, 44 insertions(+), 12 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index b3b10875..7f3c32b6 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -21,6 +21,8 @@ ENV DB_FILTER=.* \ OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ PATH="/home/odoo/.local/bin:$PATH" \ PIP_NO_CACHE_DIR=0 \ + PTVSD_ARGS="-s doodba-rocks -p 6899" \ + PTVSD_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ PYTHONOPTIMIZE=1 \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 27b75e60..f8f9e613 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -21,6 +21,8 @@ ENV DB_FILTER=.* \ OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ PATH="/home/odoo/.local/bin:$PATH" \ PIP_NO_CACHE_DIR=0 \ + PTVSD_ARGS="-s doodba-rocks -p 6899" \ + PTVSD_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ PYTHONOPTIMIZE=1 \ diff --git a/README.md b/README.md index 5abbfa88..6946253d 100644 --- a/README.md +++ b/README.md @@ -385,15 +385,26 @@ The same is true for any other [Postgres client applications][]. [VSCode][] debugger. If you use this editor with its python module, you will find it useful. -To debug, add this Python code somewhere: +To debug at a certain point of the code, add this Python code somewhere: ```python import ptvsd -ptvsd.enable_attach("my_secret", address=("0.0.0.0", 6899)) +ptvsd.enable_attach("doodba-rocks", address=("0.0.0.0", 6899)) print("ptvsd waiting...") ptvsd.wait_for_attach() ``` +To start Odoo within a ptvsd environment, which will obey the breakpoints +established in your IDE (but will work slowly), just add `-e PTVSD_ENABLE=1` +to your odoo container. + +If you use the official [scaffolding][], you can boot it in ptvsd mode with: + +```bash +export DOODBA_PTVSD_ENABLE=1 +docker-compose -f devel.yaml up -d +``` + Of course, you need to have properly configured your [VSCode][]. To do so, make sure in your project there is a `.vscode/launch.json` file with these minimal contents: @@ -409,7 +420,7 @@ contents: "localRoot": "${workspaceRoot}/odoo", "remoteRoot": "/opt/odoo", "port": 6899, - "secret": "my_secret", + "secret": "doodba-rocks", "host": "localhost" } ] diff --git a/bin/direxec b/bin/direxec index 7560b756..952e5bb5 100755 --- a/bin/direxec +++ b/bin/direxec @@ -6,7 +6,7 @@ import sys from psycopg2 import connect, OperationalError -from odoobaselib import logger +from odoobaselib import logger, which # Call this file linked from another file called `build` or `entrypoint` mode = os.path.basename(__file__) @@ -35,13 +35,21 @@ if extra_command: if extra_command[0] == 'shell' or extra_command[0].startswith("-"): extra_command.insert(0, "odoo") # Set the DB creation language, if needed - if (extra_command[0] in {"odoo", "/usr/local/bin/odoo"} and - os.environ.get("INITIAL_LANG")): - try: - connection = connect(dbname=os.environ.get("PGDATABASE")) - connection.close() - except OperationalError: - # No DB exists, set initial language - extra_command += ["--load-language", os.environ["INITIAL_LANG"]] + if extra_command[0] in {"odoo", "/usr/local/bin/odoo"}: + if os.environ.get("INITIAL_LANG"): + try: + connection = connect(dbname=os.environ.get("PGDATABASE")) + connection.close() + except OperationalError: + # No DB exists, set initial language + extra_command += ["--load-language", os.environ["INITIAL_LANG"]] + if os.environ["PTVSD_ENABLE"] == "1": + # See `python -m ptvsd -h` to understand this + extra_command[0] = os.path.realpath(which(extra_command[0])) + extra_command = ( + ["python", "-m", "ptvsd"] + + os.environ["PTVSD_ARGS"].split() + + extra_command[0] + ["-"] + extra_command[1:] + ) logger.info("Executing %s", " ".join(extra_command)) os.execvp(extra_command[0], extra_command) diff --git a/lib/odoobaselib/__init__.py b/lib/odoobaselib/__init__.py index 2d979f6c..7b60cabe 100644 --- a/lib/odoobaselib/__init__.py +++ b/lib/odoobaselib/__init__.py @@ -4,6 +4,7 @@ from glob import glob from pprint import pformat +from subprocess import check_output import yaml @@ -152,3 +153,11 @@ def addons_config(filtered=True, strict=False): u"Addon {} defined in several repos {}".format(addon, repos), ) yield addon, repos.pop() + + +try: + from shutil import which +except ImportError: + # Custom which implementation for Python 2 + def which(binary): + return check_output(["which", binary]).strip() From 8965c1349b0c00a235e15f4e45fb1ee7e99b57af Mon Sep 17 00:00:00 2001 From: Cristian Moncho Date: Tue, 13 Mar 2018 16:51:06 +0100 Subject: [PATCH 003/255] [ADD] odoo8: document and workflow deps --- bin/install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/install.sh b/bin/install.sh index 295acc61..8c37c5dd 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -28,6 +28,10 @@ if [ "$ODOO_VERSION" == "8.0" ]; then sed -ir 's/pyparsing|six/#\0/' $reqs # Extra dependencies for Odoo at runtime apt-get install -y --no-install-recommends file + # Extra dependencies for 'document' (doc & pdf support) + apt-get install -y --no-install-recommends antiword poppler-utils + # Extra dependencies for Workflow reports + apt-get install -y --no-install-recommends graphviz ghostscript fi # Build and install Odoo dependencies with pip From b2646bee846602f0b829c84430e66443cc5955fd Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 11 Sep 2018 11:01:03 +0100 Subject: [PATCH 004/255] Make ptvsd great again Without this patch, we were stick in an old ptvsd version, because it was the only one that was actually working, as explained in https://github.com/Microsoft/vscode-python/issues/133#issuecomment-353757512. However, today it's the contrary: version 3.0.0 is no longer supported by Visual Studio Code, so we need to update it. The new version has a different CLI, so it's adapted here too (BTW it was broken before too). Usage instructions updated too. --- 11.0.Dockerfile | 4 ++-- 8.0.Dockerfile | 4 ++-- README.md | 9 ++++++--- bin/direxec | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 7f3c32b6..e753ab26 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -21,7 +21,7 @@ ENV DB_FILTER=.* \ OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ PATH="/home/odoo/.local/bin:$PATH" \ PIP_NO_CACHE_DIR=0 \ - PTVSD_ARGS="-s doodba-rocks -p 6899" \ + PTVSD_ARGS="--server-host 0.0.0.0 --port 6899" \ PTVSD_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ @@ -72,7 +72,7 @@ RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version ' # Other facilities WORKDIR /opt/odoo RUN pip install \ - astor git-aggregator openupgradelib ptvsd==3.0.0 pudb wdb + astor git-aggregator openupgradelib ptvsd pudb wdb COPY bin/* /usr/local/bin/ COPY lib/odoobaselib /usr/local/lib/python3.5/dist-packages/odoobaselib COPY build.d common/build.d diff --git a/8.0.Dockerfile b/8.0.Dockerfile index f8f9e613..aa6d5270 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -21,7 +21,7 @@ ENV DB_FILTER=.* \ OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ PATH="/home/odoo/.local/bin:$PATH" \ PIP_NO_CACHE_DIR=0 \ - PTVSD_ARGS="-s doodba-rocks -p 6899" \ + PTVSD_ARGS="--server-host 0.0.0.0 --port 6899" \ PTVSD_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ @@ -75,7 +75,7 @@ RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version ' # Other facilities WORKDIR /opt/odoo RUN pip install \ - astor git-aggregator openupgradelib ptvsd==3.0.0 pudb wdb + astor git-aggregator openupgradelib ptvsd pudb wdb COPY bin/* /usr/local/bin/ COPY lib/odoobaselib /usr/local/lib/python2.7/dist-packages/odoobaselib COPY build.d common/build.d diff --git a/README.md b/README.md index 6946253d..568053b7 100644 --- a/README.md +++ b/README.md @@ -417,10 +417,13 @@ contents: "name": "Attach to debug in devel.yaml", "type": "python", "request": "attach", - "localRoot": "${workspaceRoot}/odoo", - "remoteRoot": "/opt/odoo", + "pathMappings": [ + { + "localRoot": "${workspaceRoot}/odoo", + "remoteRoot": "/opt/odoo" + } + ], "port": 6899, - "secret": "doodba-rocks", "host": "localhost" } ] diff --git a/bin/direxec b/bin/direxec index 952e5bb5..69442279 100755 --- a/bin/direxec +++ b/bin/direxec @@ -49,7 +49,7 @@ if extra_command: extra_command = ( ["python", "-m", "ptvsd"] + os.environ["PTVSD_ARGS"].split() + - extra_command[0] + ["-"] + extra_command[1:] + extra_command ) logger.info("Executing %s", " ".join(extra_command)) os.execvp(extra_command[0], extra_command) From 6e8ac5a8394a68c053c5811536ae4744e2eaacf2 Mon Sep 17 00:00:00 2001 From: Paul Catinean Date: Tue, 3 Oct 2017 18:32:12 +0200 Subject: [PATCH 005/255] 1st attempt to autodownload repos when specified only in addons.yaml --- 11.0.Dockerfile | 2 + 8.0.Dockerfile | 2 + build.d/300-oca-dependencies | 97 ++++++++++++++++++++++++++++++++++++ lib/odoobaselib/__init__.py | 23 ++++++++- 4 files changed, 123 insertions(+), 1 deletion(-) create mode 100755 build.d/300-oca-dependencies diff --git a/11.0.Dockerfile b/11.0.Dockerfile index e753ab26..c5088acb 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -135,6 +135,7 @@ ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] ONBUILD ARG AGGREGATE=true ONBUILD ARG AUTO_REQUIREMENTS=false +ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/%s.git" ONBUILD ARG DEPTH_DEFAULT=1 ONBUILD ARG DEPTH_MERGE=100 ONBUILD ARG CLEAN=true @@ -156,6 +157,7 @@ ONBUILD ARG PGPORT=5432 ONBUILD ARG PGDATABASE=prod # Config variables ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ + DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \ UNACCENT="$UNACCENT" \ PGUSER="$PGUSER" \ PGPASSWORD="$PGPASSWORD" \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index aa6d5270..ac5f359d 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -121,6 +121,7 @@ ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] ONBUILD ARG AGGREGATE=true ONBUILD ARG AUTO_REQUIREMENTS=false +ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/%s.git" ONBUILD ARG DEPTH_DEFAULT=1 ONBUILD ARG DEPTH_MERGE=100 ONBUILD ARG CLEAN=true @@ -142,6 +143,7 @@ ONBUILD ARG PGPORT=5432 ONBUILD ARG PGDATABASE=prod # Config variables ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ + DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \ UNACCENT="$UNACCENT" \ PGUSER="$PGUSER" \ PGPASSWORD="$PGPASSWORD" \ diff --git a/build.d/300-oca-dependencies b/build.d/300-oca-dependencies new file mode 100755 index 00000000..92b1f7a4 --- /dev/null +++ b/build.d/300-oca-dependencies @@ -0,0 +1,97 @@ +#!/usr/bin/env python + +import os +import sys +import yaml +import logging +import urllib2 +from glob import iglob + +from odoobaselib import ( + CUSTOM_DIR, AUTO_ADDONS_YAML, AUTO_REPOS_YAML, ADDONS_YAML, REPOS_YAML +) + +# Skip aggregation of dependencies if AGGREGATE env var is not set +if not os.environ.get('AGGREGATE'): + logging.warning("Skipping oca dependency aggregation") + sys.exit() + +BASE_URL = 'https://raw.githubusercontent.com/OCA' + + +# Method from maintainer-quality-tools +def parse_depfile(depfile, owner='OCA'): + deps = set() + for line in depfile: + line = line.strip() + if not line or line.startswith('#'): + continue + parts = line.split() + repo = parts[0] + if len(parts) > 2: + branch = parts[2] + else: + branch = os.environ['ODOO_VERSION'] + if len(parts) > 1: + url = parts[1] + else: + url = os.environ['DEFAULT_REPO_PATTERN'] % repo + deps.add((repo, url, branch)) + return deps + + +def process_dependencies(dep_list): + """Attempt fetching oca_dependencies.txt files from github to build a list + of dependencies in order to aggregate only once""" + processed_dependencies = set() + for dep in dep_list: + if dep in processed_dependencies: + continue + oca_dep_url = '%s/%s/%s/oca_dependencies.txt' % ( + BASE_URL, dep[0], branch + ) + logging.info('Attempting to fetch %s' % oca_dep_url) + try: + data = urllib2.urlopen(oca_dep_url) + dependencies = set(parse_depfile(data)) + if dep[0] not in ADDONS_YAML.keys(): + processed_dependencies.add(dep) + processed_dependencies |= process_dependencies(dependencies) + logging.info('Fetched dependencies for %s' % oca_dep_url) + except Exception as e: + # Not neccesairly error but it might not have oca_dependencies.txt + logging.warning('Error fetching url "%s". Error: %s' % ( + oca_dep_url, e.code) + ) + # TODO: Retry mechanism + return processed_dependencies + +branch = os.environ['ODOO_VERSION'] + +# Find all dependency files after initial aggregation +dep_files = iglob('%s/*/oca_dependencies.txt' % CUSTOM_DIR) +initial_dependencies = set() + +# Get all initial repositories across all projects +for dep in dep_files: + file_obj = open(dep, 'r') + deps = set(parse_depfile(file_obj)) + initial_dependencies.update(deps) + +# Get all subsequent repositories from oca_dependencies via github +dependencies = process_dependencies(initial_dependencies) + +# Generate auto_addons and auto_repos yaml files +for dep in dependencies: + ADDONS_YAML[dep[0]] = ['*'] + + repo_vals = { + 'defaults': {'depth': '$DEPTH_DEFAULT'}, + 'remotes': {'origin': dep[1]}, + 'target': {'origin': '$ODOO_VERSION'}, + 'merges': [{'origin': '$ODOO_VERSION'}], + } + REPOS_YAML[dep[0]] = {'%s' % dep[0]: repo_vals} + +yaml.dump(ADDONS_YAML, AUTO_ADDONS_YAML, default_flow_style=False) +yaml.dump(REPOS_YAML, AUTO_REPOS_YAML, default_flow_style=False) diff --git a/lib/odoobaselib/__init__.py b/lib/odoobaselib/__init__.py index 7b60cabe..590ade77 100644 --- a/lib/odoobaselib/__init__.py +++ b/lib/odoobaselib/__init__.py @@ -10,13 +10,34 @@ # Constants needed in scripts CUSTOM_DIR = "/opt/odoo/custom" +AUTO_DIR = "/opt/odoo/auto" +ADDONS_DIR = os.path.join(AUTO_DIR, 'addons') SRC_DIR = os.path.join(CUSTOM_DIR, 'src') + ADDONS_YAML = os.path.join(SRC_DIR, 'addons') if os.path.isfile('%s.yaml' % ADDONS_YAML): ADDONS_YAML = '%s.yaml' % ADDONS_YAML else: ADDONS_YAML = '%s.yml' % ADDONS_YAML -ADDONS_DIR = "/opt/odoo/auto/addons" + +REPOS_YAML = os.path.join(SRC_DIR, 'repos') +if os.path.isfile('%s.yaml' % REPOS_YAML): + REPOS_YAML = '%s.yaml' % REPOS_YAML +else: + REPOS_YAML = '%s.yml' % REPOS_YAML + +AUTO_ADDONS_YAML = os.path.join(AUTO_DIR, 'addons') +if os.path.isfile('%s.yaml' % AUTO_ADDONS_YAML): + AUTO_ADDONS_YAML = '%s.yaml' % AUTO_ADDONS_YAML +else: + AUTO_ADDONS_YAML = '%s.yml' % AUTO_ADDONS_YAML + +AUTO_REPOS_YAML = os.path.join(AUTO_DIR, 'repos') +if os.path.isfile('%s.yaml' % AUTO_REPOS_YAML): + AUTO_REPOS_YAML = '%s.yaml' % AUTO_REPOS_YAML +else: + AUTO_REPOS_YAML = '%s.yml' % AUTO_REPOS_YAML + CLEAN = os.environ.get("CLEAN") == "true" AUTO_REQUIREMENTS = os.environ.get("AUTO_REQUIREMENTS") == "true" LOG_LEVELS = ("DEBUG", "INFO", "WARNING", "ERROR") From 070323c871586ef2fad8998ee9c6a56d51ec9332 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 13 Sep 2018 12:38:59 +0100 Subject: [PATCH 006/255] Fix automatic repos.yaml generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With this change, definitely we can have a Doodba scaffolding without `repos.yaml` file. It will do this: 1. Download all git code from repos in `repos.yaml`, if any. 2. Get the list of expected code repos from `addons.yaml`. 3. Autogenerate a `repos.yaml` file for all expected but absent repos, based on the provided patterns. 4. Download all of that missing code. 5. Continue normal operation. As a šŸŽ, we now download git code in parallel if the building machine has more than 1 CPU. Some tests have been modified to ensure they still pass with this new feature. --- 11.0.Dockerfile | 4 +- 8.0.Dockerfile | 4 +- bin/autoaggregate | 167 ++++++++++++++---- build.d/300-oca-dependencies | 97 ---------- lib/odoobaselib/__init__.py | 15 +- tests/__init__.py | 2 + .../dependencies/custom/src/addons.yaml | 2 + .../smallest/custom/src/repos.yaml | 12 -- 8 files changed, 146 insertions(+), 157 deletions(-) delete mode 100755 build.d/300-oca-dependencies delete mode 100644 tests/scaffoldings/smallest/custom/src/repos.yaml diff --git a/11.0.Dockerfile b/11.0.Dockerfile index c5088acb..232b554b 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -135,7 +135,8 @@ ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] ONBUILD ARG AGGREGATE=true ONBUILD ARG AUTO_REQUIREMENTS=false -ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/%s.git" +ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" +ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" ONBUILD ARG DEPTH_DEFAULT=1 ONBUILD ARG DEPTH_MERGE=100 ONBUILD ARG CLEAN=true @@ -158,6 +159,7 @@ ONBUILD ARG PGDATABASE=prod # Config variables ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \ + DEFAULT_REPO_PATTERN_ODOO="$DEFAULT_REPO_PATTERN_ODOO" \ UNACCENT="$UNACCENT" \ PGUSER="$PGUSER" \ PGPASSWORD="$PGPASSWORD" \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index ac5f359d..81d0dd2f 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -121,7 +121,8 @@ ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] ONBUILD ARG AGGREGATE=true ONBUILD ARG AUTO_REQUIREMENTS=false -ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/%s.git" +ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" +ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" ONBUILD ARG DEPTH_DEFAULT=1 ONBUILD ARG DEPTH_MERGE=100 ONBUILD ARG CLEAN=true @@ -144,6 +145,7 @@ ONBUILD ARG PGDATABASE=prod # Config variables ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \ + DEFAULT_REPO_PATTERN_ODOO="$DEFAULT_REPO_PATTERN_ODOO" \ UNACCENT="$UNACCENT" \ PGUSER="$PGUSER" \ PGPASSWORD="$PGPASSWORD" \ diff --git a/bin/autoaggregate b/bin/autoaggregate index 46728ca6..ac0d0a7d 100755 --- a/bin/autoaggregate +++ b/bin/autoaggregate @@ -1,37 +1,130 @@ -#!/bin/bash -set -e - -conf=/opt/odoo/custom/src/repos - -if [ -f "${conf}.yaml" ]; then - conf="${conf}.yaml" -elif [ -f "${conf}.yml" ]; then - conf="${conf}.yml" -fi - -# Update linked repositories, if the `repos.yaml` file is found -if [ -f $conf ]; then - log INFO Aggregating repositories from $conf - cd $(dirname $conf) - - # Avoid wrong umask in aggregated files - if [ -n "$UMASK" ]; then - umask "$UMASK" - fi - - # Perform aggregation with environment variables expansion - set +e - gitaggregate --expand-env -c $conf - code=$? - set -e - - # Avoid wrong user/group in aggregated files - if [ -n "$GID" -a -n "$UID" ]; then - chown -R "$UID:$GID" . - fi - - [ $code -eq 0 ] || exit $code -else - log ERROR Cannot aggregate repositories: $conf not found - exit 1 -fi +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import os +import sys +import yaml +from multiprocessing import cpu_count +from subprocess import check_call + +from odoobaselib import ( + ADDONS_YAML, + AUTO_REPOS_YAML, + CORE, + logger, + PRIVATE, + REPOS_YAML, + SRC_DIR, +) + +UMASK = os.environ.get("UMASK") +UID = int(os.environ.get("UID") or -1) +GID = int(os.environ.get("GID") or -1) +DEFAULT_REPO_PATTERN = os.environ.get("DEFAULT_REPO_PATTERN") +DEFAULT_REPO_PATTERN_ODOO = os.environ.get("DEFAULT_REPO_PATTERN_ODOO") + + +def aggregate(config): + """Execute git aggregator to pull git code. + + :param str config: + Path where to find the ``repos.yaml`` file. + """ + logger.info("Running gitaggregate with %s", config) + old_umask = None + try: + # Download git code with the specified umask, if any + if UMASK: + old_umask = os.umask(int(UMASK)) + check_call( + ["gitaggregate", "--expand-env", "--config", config, + "--jobs", str(cpu_count() or 1)], + cwd=SRC_DIR, + stderr=sys.stderr, + stdout=sys.stdout, + ) + finally: + # Restore umask, if changed + if old_umask is not None: + os.umask(old_umask) + # Chown recursively, if UID or GID are specified + if ~UID or ~GID: + for root, dirs, files in os.walk(SRC_DIR): + for target in dirs + files: + os.chown(os.path.join(root, target), UID, GID) + + +def origin_for(folder): + """Guess the default git origin for that folder. + + :param str folder: + Normally an absolute path to an expected git repo, whose name should + match the git repository where it comes from, using the env-supplied + pattern. + """ + base = os.path.basename(folder) + pattern = DEFAULT_REPO_PATTERN + if base == "odoo": + pattern = DEFAULT_REPO_PATTERN_ODOO + return pattern.format(base) + + +def missing_repos_config(): + """Find the undefined repositories and return their default configuration. + + :return dict: + git-aggregator-ready configuration dict for undefined repositories. + """ + defined, expected = set(), {os.path.join(SRC_DIR, "odoo")} + # Find the repositories defined by hand + try: + with open(REPOS_YAML) as yaml_file: + for doc in yaml.load_all(yaml_file): + for repo in doc: + defined.add(os.path.abspath(os.path.join(SRC_DIR, repo))) + except (IOError, AttributeError): + logger.debug("No repositories defined by hand") + # Find the repositories that should be present + try: + with open(ADDONS_YAML) as yaml_file: + for doc in yaml.load_all(yaml_file): + for repo in doc: + if repo in {PRIVATE, CORE, "ONLY"}: + continue + repo_path = os.path.abspath(os.path.join(SRC_DIR, repo)) + if not os.path.exists(repo_path) or os.path.isdir( + os.path.join(repo_path, ".git")): + expected.add(repo_path) + except (IOError, AttributeError): + logger.debug("No addons are expected to be present") + # Find the undefined repositories and generate a config for them + missing = expected - defined + config = { + repo_path: { + 'defaults': {'depth': '$DEPTH_DEFAULT'}, + 'merges': ['origin $ODOO_VERSION'], + 'remotes': { + 'origin': origin_for(repo_path), + }, + 'target': 'origin $ODOO_VERSION', + } + for repo_path in missing + } + logger.debug("Generated missing repos config %r", config) + return config + + +# Aggregate user-specified repos +if os.path.isfile(REPOS_YAML): + # HACK https://github.com/acsone/git-aggregator/pull/23 + has_contents = True + with open(REPOS_YAML) as repos_file: + has_contents = yaml.load(repos_file) + if has_contents: + aggregate(REPOS_YAML) + +# Aggregate unspecified repos +missing_config = missing_repos_config() +if missing_config: + with open(AUTO_REPOS_YAML, "w") as autorepos: + yaml.dump(missing_config, autorepos) + aggregate(AUTO_REPOS_YAML) diff --git a/build.d/300-oca-dependencies b/build.d/300-oca-dependencies deleted file mode 100755 index 92b1f7a4..00000000 --- a/build.d/300-oca-dependencies +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -import yaml -import logging -import urllib2 -from glob import iglob - -from odoobaselib import ( - CUSTOM_DIR, AUTO_ADDONS_YAML, AUTO_REPOS_YAML, ADDONS_YAML, REPOS_YAML -) - -# Skip aggregation of dependencies if AGGREGATE env var is not set -if not os.environ.get('AGGREGATE'): - logging.warning("Skipping oca dependency aggregation") - sys.exit() - -BASE_URL = 'https://raw.githubusercontent.com/OCA' - - -# Method from maintainer-quality-tools -def parse_depfile(depfile, owner='OCA'): - deps = set() - for line in depfile: - line = line.strip() - if not line or line.startswith('#'): - continue - parts = line.split() - repo = parts[0] - if len(parts) > 2: - branch = parts[2] - else: - branch = os.environ['ODOO_VERSION'] - if len(parts) > 1: - url = parts[1] - else: - url = os.environ['DEFAULT_REPO_PATTERN'] % repo - deps.add((repo, url, branch)) - return deps - - -def process_dependencies(dep_list): - """Attempt fetching oca_dependencies.txt files from github to build a list - of dependencies in order to aggregate only once""" - processed_dependencies = set() - for dep in dep_list: - if dep in processed_dependencies: - continue - oca_dep_url = '%s/%s/%s/oca_dependencies.txt' % ( - BASE_URL, dep[0], branch - ) - logging.info('Attempting to fetch %s' % oca_dep_url) - try: - data = urllib2.urlopen(oca_dep_url) - dependencies = set(parse_depfile(data)) - if dep[0] not in ADDONS_YAML.keys(): - processed_dependencies.add(dep) - processed_dependencies |= process_dependencies(dependencies) - logging.info('Fetched dependencies for %s' % oca_dep_url) - except Exception as e: - # Not neccesairly error but it might not have oca_dependencies.txt - logging.warning('Error fetching url "%s". Error: %s' % ( - oca_dep_url, e.code) - ) - # TODO: Retry mechanism - return processed_dependencies - -branch = os.environ['ODOO_VERSION'] - -# Find all dependency files after initial aggregation -dep_files = iglob('%s/*/oca_dependencies.txt' % CUSTOM_DIR) -initial_dependencies = set() - -# Get all initial repositories across all projects -for dep in dep_files: - file_obj = open(dep, 'r') - deps = set(parse_depfile(file_obj)) - initial_dependencies.update(deps) - -# Get all subsequent repositories from oca_dependencies via github -dependencies = process_dependencies(initial_dependencies) - -# Generate auto_addons and auto_repos yaml files -for dep in dependencies: - ADDONS_YAML[dep[0]] = ['*'] - - repo_vals = { - 'defaults': {'depth': '$DEPTH_DEFAULT'}, - 'remotes': {'origin': dep[1]}, - 'target': {'origin': '$ODOO_VERSION'}, - 'merges': [{'origin': '$ODOO_VERSION'}], - } - REPOS_YAML[dep[0]] = {'%s' % dep[0]: repo_vals} - -yaml.dump(ADDONS_YAML, AUTO_ADDONS_YAML, default_flow_style=False) -yaml.dump(REPOS_YAML, AUTO_REPOS_YAML, default_flow_style=False) diff --git a/lib/odoobaselib/__init__.py b/lib/odoobaselib/__init__.py index 590ade77..1e650ea2 100644 --- a/lib/odoobaselib/__init__.py +++ b/lib/odoobaselib/__init__.py @@ -26,17 +26,11 @@ else: REPOS_YAML = '%s.yml' % REPOS_YAML -AUTO_ADDONS_YAML = os.path.join(AUTO_DIR, 'addons') -if os.path.isfile('%s.yaml' % AUTO_ADDONS_YAML): - AUTO_ADDONS_YAML = '%s.yaml' % AUTO_ADDONS_YAML -else: - AUTO_ADDONS_YAML = '%s.yml' % AUTO_ADDONS_YAML - AUTO_REPOS_YAML = os.path.join(AUTO_DIR, 'repos') -if os.path.isfile('%s.yaml' % AUTO_REPOS_YAML): - AUTO_REPOS_YAML = '%s.yaml' % AUTO_REPOS_YAML -else: +if os.path.isfile('%s.yml' % AUTO_REPOS_YAML): AUTO_REPOS_YAML = '%s.yml' % AUTO_REPOS_YAML +else: + AUTO_REPOS_YAML = '%s.yaml' % AUTO_REPOS_YAML CLEAN = os.environ.get("CLEAN") == "true" AUTO_REQUIREMENTS = os.environ.get("AUTO_REQUIREMENTS") == "true" @@ -86,6 +80,9 @@ def addons_config(filtered=True, strict=False): :param bool strict: Use ``True`` to raise an exception if any declared addon is not found. + + :return Iterator[str, str]: + A generator that yields ``(addon, repo)`` pairs. """ config = dict() missing_glob = set() diff --git a/tests/__init__.py b/tests/__init__.py index 97bf23c0..8c0bf09e 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -253,6 +253,8 @@ def test_dependencies(self): ("test", "!", "-f", "custom/dependencies/gem.txt"), ("test", "!", "-f", "custom/dependencies/npm.txt"), ("test", "!", "-f", "custom/dependencies/pip.txt"), + # It should have module_auto_update available + ("test", "-d", "custom/src/server-tools/module_auto_update"), # Patched Werkzeug version ("bash", "-c", ('test "$(python -c "import werkzeug; ' 'print(werkzeug.__version__)")" == 0.14.1')), diff --git a/tests/scaffoldings/dependencies/custom/src/addons.yaml b/tests/scaffoldings/dependencies/custom/src/addons.yaml index e69de29b..c6df2c52 100644 --- a/tests/scaffoldings/dependencies/custom/src/addons.yaml +++ b/tests/scaffoldings/dependencies/custom/src/addons.yaml @@ -0,0 +1,2 @@ +server-tools: +- module_auto_update diff --git a/tests/scaffoldings/smallest/custom/src/repos.yaml b/tests/scaffoldings/smallest/custom/src/repos.yaml deleted file mode 100644 index 1eddc934..00000000 --- a/tests/scaffoldings/smallest/custom/src/repos.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Odoo is always required -./odoo: - defaults: - # Shallow repositores are faster & thinner - depth: $DEPTH_DEFAULT - remotes: - ocb: https://github.com/OCA/OCB.git - odoo: https://github.com/odoo/odoo.git - target: - ocb $ODOO_VERSION - merges: - - ocb $ODOO_VERSION From bb03a138cd8a25f6b5d51d2f16032f8d7e41e4de Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 14 Sep 2018 11:12:02 +0100 Subject: [PATCH 007/255] Fix possible error on corrupted file trees Maybe you don't have permission, or it is a broken symlink. In any case, let's continue sliently. It will probably not affect you. --- bin/autoaggregate | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/autoaggregate b/bin/autoaggregate index ac0d0a7d..6a0d2fb3 100755 --- a/bin/autoaggregate +++ b/bin/autoaggregate @@ -50,7 +50,13 @@ def aggregate(config): if ~UID or ~GID: for root, dirs, files in os.walk(SRC_DIR): for target in dirs + files: - os.chown(os.path.join(root, target), UID, GID) + try: + os.chown(os.path.join(root, target), UID, GID) + except: + logger.debug( + "Error trying to chown on file. Skipping...", + exc_info=True, + ) def origin_for(folder): From 9bfbac2cf15850bf7cb2fae359a6b908a1d822a7 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 18 Sep 2018 13:54:58 +0100 Subject: [PATCH 008/255] Document new things landed in #86 --- README.md | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/README.md b/README.md index 568053b7..309ef228 100644 --- a/README.md +++ b/README.md @@ -173,6 +173,106 @@ You can choose your Odoo version, and even merge PRs from many of them using A [git-aggregator](#git-aggregator) configuration file. +It should look similar to this: + +```yaml +# Odoo must be in the `odoo` folder for Doodba to work +odoo: + defaults: + # This will use git shallow clones. + # $DEPTH_DEFAULT is 1 in test and prod, but 100 in devel. + # $DEPTH_MERGE is always 100. + # You can use any integer value, OTOH. + depth: $DEPTH_MERGE + remotes: + origin: https://github.com/OCA/OCB.git + odoo: https://github.com/odoo/odoo.git + openupgrade: https://github.com/OCA/OpenUpgrade.git + # $ODOO_VERSION is... the Odoo version! "11.0" or similar + target: origin $ODOO_VERSION + merges: + - origin $ODOO_VERSION + - odoo refs/pull/25594/head # Expose `Field` from search_filters.js + +web: + defaults: + depth: $DEPTH_MERGE + remotes: + origin: https://github.com/OCA/web.git + tecnativa: https://github.com/Tecnativa/partner-contact.git + target: origin $ODOO_VERSION + merges: + - origin $ODOO_VERSION + - origin refs/pull/1007/head # web_responsive search + - tecnativa 11.0-some_addon-custom # Branch for this customer only +``` + +###### Automatic download of repos + +Doodba is smart enough to download automatically git repositories even if they +are missing in `repos.yaml`. It will happen if it is used in [`addons.yaml`][], +except for the special [`private`][] repo. This will help you keep your +deployment definitions DRY. + +You can configure this behavior with these environment variables (default +values shown): + +- `DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git"` +- `DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git"` + +As you probably guessed, we use something like `str.format(repo_basename)` +on top of those variables to compute the default remote origin. If, i.e., +you want to use your own repositories as default remotes, just add these +build arguments to your `docker-compose.yaml` file: + +```yaml +# [...] +services: + odoo: + build: + args: + DEFAULT_REPO_PATTERN: &origin "https://github.com/Tecnativa/{}.git" + DEFAULT_REPO_PATTERN_ODOO: *origin +# [...] +``` + +So, for example, if your [`repos.yaml`][] file is empty and +your [`addons.yaml`][] contains this: + +```yaml +server-tools: +- module_auto_update +``` + +A `/opt/odoo/auto/repos.yaml` file with this will be generated and used to +download git code: + +```yaml +/opt/odoo/custom/src/odoo: + depth: $DEPTH_DEFAULT + remotes: + origin: https://github.com/OCA/OCB.git + target: origin $ODOO_VERSION + merges: + - origin $ODOO_VERSION +/opt/odoo/custom/src/server-tools: + depth: $DEPTH_DEFAULT + remotes: + origin: https://github.com/OCA/server-tools.git + target: origin $ODOO_VERSION + merges: + - origin $ODOO_VERSION +``` + +All of this means that, you only need to define the git aggregator +spec in [`repos.yaml`][] if anything diverges from the standard: + +- You need special merges. +- You need a special origin. +- The folder name does not match the origin pattern. +- The branch name does not match `$ODOO_VERSION`. +- Etc. + ##### `/opt/odoo/custom/src/addons.yaml` One entry per repo and addon you want to activate in your project. Like this: From 32ecddd137983bc78a13ab0ae2e25a1dcacf44a2 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 20 Sep 2018 10:58:28 +0100 Subject: [PATCH 009/255] Rename odoobaselib to doodbalib --- 11.0.Dockerfile | 6 ++++-- 8.0.Dockerfile | 6 ++++-- bin/addons | 2 +- bin/autoaggregate | 2 +- bin/direxec | 2 +- bin/log | 2 +- build.d/200-dependencies | 4 ++-- build.d/400-clean | 2 +- build.d/900-dependencies-cleanup | 4 ++-- entrypoint.d/40-addons-link | 2 +- lib/{odoobaselib => doodbalib}/__init__.py | 0 lib/{odoobaselib => doodbalib}/installer.py | 2 +- 12 files changed, 19 insertions(+), 15 deletions(-) rename lib/{odoobaselib => doodbalib}/__init__.py (100%) rename lib/{odoobaselib => doodbalib}/installer.py (99%) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 232b554b..9b8ef349 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -74,7 +74,9 @@ WORKDIR /opt/odoo RUN pip install \ astor git-aggregator openupgradelib ptvsd pudb wdb COPY bin/* /usr/local/bin/ -COPY lib/odoobaselib /usr/local/lib/python3.5/dist-packages/odoobaselib +COPY lib/doodbalib /usr/local/lib/python3.5/dist-packages/doodbalib +RUN ln -s /usr/local/lib/python3.5/dist-packages/doodbalib \ + /usr/local/lib/python3.5/dist-packages/odoobaselib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d @@ -82,7 +84,7 @@ RUN mkdir -p auto/addons custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ - && chmod -R a+rX /usr/local/lib/python3.5/dist-packages/odoobaselib \ + && chmod -R a+rX /usr/local/lib/python3.5/dist-packages/doodbalib \ && ln -s $(which python3) /usr/local/bin/python \ && sync diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 81d0dd2f..0fcda71e 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -77,7 +77,9 @@ WORKDIR /opt/odoo RUN pip install \ astor git-aggregator openupgradelib ptvsd pudb wdb COPY bin/* /usr/local/bin/ -COPY lib/odoobaselib /usr/local/lib/python2.7/dist-packages/odoobaselib +COPY lib/doodbalib /usr/local/lib/python2.7/dist-packages/doodbalib +RUN ln -s /usr/local/lib/python2.7/dist-packages/doodbalib \ + /usr/local/lib/python2.7/dist-packages/odoobaselib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d @@ -85,7 +87,7 @@ RUN mkdir -p auto/addons custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ - && chmod -R a+rX /usr/local/lib/python2.7/dist-packages/odoobaselib \ + && chmod -R a+rX /usr/local/lib/python2.7/dist-packages/doodbalib \ && sync # Execute installation script by Odoo version diff --git a/bin/addons b/bin/addons index 7c88ee24..0d6e4862 100755 --- a/bin/addons +++ b/bin/addons @@ -5,7 +5,7 @@ import os import sys from argparse import ArgumentParser from subprocess import check_call -from odoobaselib import ( +from doodbalib import ( addons_config, AddonsConfigError, CORE, diff --git a/bin/autoaggregate b/bin/autoaggregate index 6a0d2fb3..49f1a1ee 100755 --- a/bin/autoaggregate +++ b/bin/autoaggregate @@ -6,7 +6,7 @@ import yaml from multiprocessing import cpu_count from subprocess import check_call -from odoobaselib import ( +from doodbalib import ( ADDONS_YAML, AUTO_REPOS_YAML, CORE, diff --git a/bin/direxec b/bin/direxec index 69442279..e1d34224 100755 --- a/bin/direxec +++ b/bin/direxec @@ -6,7 +6,7 @@ import sys from psycopg2 import connect, OperationalError -from odoobaselib import logger, which +from doodbalib import logger, which # Call this file linked from another file called `build` or `entrypoint` mode = os.path.basename(__file__) diff --git a/bin/log b/bin/log index 00fafb27..f5db03f6 100755 --- a/bin/log +++ b/bin/log @@ -4,7 +4,7 @@ from __future__ import unicode_literals import argparse import logging -from odoobaselib import LOG_LEVELS, logger +from doodbalib import LOG_LEVELS, logger parser = argparse.ArgumentParser(description="Easy logging for scripts") parser.add_argument("level", choices=LOG_LEVELS) diff --git a/build.d/200-dependencies b/build.d/200-dependencies index aff68406..ceae1c57 100755 --- a/build.d/200-dependencies +++ b/build.d/200-dependencies @@ -4,13 +4,13 @@ from os.path import basename, join, splitext from glob import glob -from odoobaselib import ( +from doodbalib import ( AUTO_REQUIREMENTS, CUSTOM_DIR, FILE_APT_BUILD, SRC_DIR, ) -from odoobaselib.installer import install, INSTALLERS, logger +from doodbalib.installer import install, INSTALLERS, logger # Build dependencies installed before any others diff --git a/build.d/400-clean b/build.d/400-clean index 39e20771..36cabd75 100755 --- a/build.d/400-clean +++ b/build.d/400-clean @@ -4,7 +4,7 @@ import os import shutil import sys -from odoobaselib import addons_config, CORE, CLEAN, logger, PRIVATE, SRC_DIR +from doodbalib import addons_config, CORE, CLEAN, logger, PRIVATE, SRC_DIR if not CLEAN: logger.warning("Not cleaning garbage") diff --git a/build.d/900-dependencies-cleanup b/build.d/900-dependencies-cleanup index f0e8fedf..6da4af70 100755 --- a/build.d/900-dependencies-cleanup +++ b/build.d/900-dependencies-cleanup @@ -3,8 +3,8 @@ import os -from odoobaselib import CUSTOM_DIR, FILE_APT_BUILD -from odoobaselib.installer import INSTALLERS +from doodbalib import CUSTOM_DIR, FILE_APT_BUILD +from doodbalib.installer import INSTALLERS # Build-time dependencies must be removed when finishing build diff --git a/entrypoint.d/40-addons-link b/entrypoint.d/40-addons-link index e6849af5..604c20a0 100755 --- a/entrypoint.d/40-addons-link +++ b/entrypoint.d/40-addons-link @@ -3,7 +3,7 @@ import os from glob import iglob -from odoobaselib import ( +from doodbalib import ( addons_config, ADDONS_DIR, ADDONS_YAML, diff --git a/lib/odoobaselib/__init__.py b/lib/doodbalib/__init__.py similarity index 100% rename from lib/odoobaselib/__init__.py rename to lib/doodbalib/__init__.py diff --git a/lib/odoobaselib/installer.py b/lib/doodbalib/installer.py similarity index 99% rename from lib/odoobaselib/installer.py rename to lib/doodbalib/installer.py index 745d5695..701c6337 100644 --- a/lib/odoobaselib/installer.py +++ b/lib/doodbalib/installer.py @@ -2,7 +2,7 @@ from collections import OrderedDict from os.path import exists from subprocess import check_call -from odoobaselib import logger +from doodbalib import logger class Installer(object): From 7bb6d0f8b64a7d94ae137da6b9e7f8b6f514fd55 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 20 Sep 2018 13:40:22 +0100 Subject: [PATCH 010/255] =?UTF-8?q?Prepare=20for=20upcoming=20Odoo=2012.0?= =?UTF-8?q?=20(#168)=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Support non-float style $ODOO_VERSION variable. - Add `skip_12` decorator to all tests that are expected to fail in Odoo 12.0. This is normal because it has not been released yet. I will have to remove that and fix it when released. - Base in `python:3.5-stretch` image, which includes some development dependencies, and it will make it easier to bump the python version in future releases, if needed. --- .travis.yml | 1 + 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 179 ++++++++++++++++++++++++++++++++++++++ lib/doodbalib/__init__.py | 4 +- tests/__init__.py | 13 ++- 5 files changed, 194 insertions(+), 5 deletions(-) create mode 100644 12.0.Dockerfile diff --git a/.travis.yml b/.travis.yml index 8bb1e3d8..3be13f1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,7 @@ env: - DOCKER_TAG=9.0 - DOCKER_TAG=10.0 - DOCKER_TAG=11.0 + - DOCKER_TAG=12.0 before_install: - sudo apt-get update diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 9b8ef349..ea7a702c 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -178,7 +178,7 @@ ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ WITHOUT_DEMO="$WITHOUT_DEMO" ONBUILD ARG LOCAL_CUSTOM_DIR=./custom ONBUILD COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom -# https://docs.python.org/2.7/library/logging.html#levels +# https://docs.python.org/3/library/logging.html#levels ONBUILD ARG LOG_LEVEL=INFO ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ && ln -s /opt/odoo/custom/ssh ~root/.ssh \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile new file mode 100644 index 00000000..ac50153c --- /dev/null +++ b/12.0.Dockerfile @@ -0,0 +1,179 @@ +FROM python:3.5-stretch AS base + +# Enable Odoo user and filestore +RUN useradd -md /home/odoo -s /bin/false odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo \ + && sync +VOLUME ["/var/lib/odoo"] +EXPOSE 8069 8072 + +ARG WKHTMLTOPDF_VERSION=0.12.5 +ARG WKHTMLTOPDF_CHECKSUM='1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb' +ENV DB_FILTER=.* \ + DEPTH_DEFAULT=1 \ + DEPTH_MERGE=100 \ + EMAIL=https://hub.docker.com/r/tecnativa/odoo \ + GIT_AUTHOR_NAME=docker-odoo \ + INITIAL_LANG="" \ + LC_ALL=C.UTF-8 \ + NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \ + OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ + PATH="/home/odoo/.local/bin:$PATH" \ + PIP_NO_CACHE_DIR=0 \ + PTVSD_ARGS="--server-host 0.0.0.0 --port 6899" \ + PTVSD_ENABLE=0 \ + PUDB_RDB_HOST=0.0.0.0 \ + PUDB_RDB_PORT=6899 \ + PYTHONOPTIMIZE=1 \ + UNACCENT=true \ + WAIT_DB=true \ + WDB_NO_BROWSER_AUTO_OPEN=True \ + WDB_SOCKET_SERVER=wdb \ + WDB_WEB_PORT=1984 \ + WDB_WEB_SERVER=localhost + +# Other requirements and recommendations to run Odoo +# See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control +RUN apt-get -qq update \ + && apt-get -yqq upgrade \ + && apt-get install -yqq --no-install-recommends \ + chromium \ + gettext-base \ + gnupg2 \ + locales-all \ + nano \ + telnet \ + vim \ + zlibc \ + && echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && curl https://bootstrap.pypa.io/get-pip.py | python3 /dev/stdin \ + && curl -sL https://deb.nodesource.com/setup_8.x | bash - \ + && apt-get update \ + && apt-get install -yqq --no-install-recommends nodejs postgresql-client \ + && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.stretch_amd64.deb \ + && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ + && apt-get install -yqq --no-install-recommends ./wkhtmltox.deb \ + && rm wkhtmltox.deb \ + && wkhtmltopdf --version \ + && rm -Rf /var/lib/apt/lists/* /tmp/* + +# Special case to get latest Less +RUN ln -s /usr/bin/nodejs /usr/local/bin/node \ + && npm install -g less \ + && rm -Rf ~/.npm /tmp/* + +# Other facilities +WORKDIR /opt/odoo +RUN pip install \ + astor \ + git-aggregator \ + openupgradelib \ + pg_activity \ + ptvsd \ + pudb \ + wdb \ + && sync +COPY bin/* /usr/local/bin/ +COPY lib/doodbalib /usr/local/lib/python3.5/site-packages/doodbalib +COPY build.d common/build.d +COPY conf.d common/conf.d +COPY entrypoint.d common/entrypoint.d +RUN mkdir -p auto/addons custom/src/private \ + && ln /usr/local/bin/direxec common/entrypoint \ + && ln /usr/local/bin/direxec common/build \ + && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ + && chmod -R a+rX /usr/local/lib/python3.5/site-packages/doodbalib \ + && sync + +# Execute installation script by Odoo version +# This is at the end to benefit from cache at build time +# https://docs.docker.com/engine/reference/builder/#/impact-on-build-caching +# TODO Use OCA/OCB when OCB 12.0 is released +ARG ODOO_SOURCE=odoo/odoo +ARG ODOO_VERSION=12.0 +# TODO Use "$ODOO_VERSION" when OCB or Odoo 12.0 is released +ENV ODOO_VERSION="saas-11.5" +RUN debs="libldap2-dev libsasl2-dev" \ + && apt-get update \ + && apt-get install -yqq --no-install-recommends $debs \ + && pip install -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + && (python3 -m compileall -q /usr/local/lib/python3.5/ || true) \ + && apt-get purge -yqq $debs \ + && rm -Rf /var/lib/apt/lists/* /tmp/* + +# HACK Special case for Werkzeug +USER odoo +RUN pip install --user Werkzeug==0.14.1 +USER root + +# Metadata +ARG VCS_REF +ARG BUILD_DATE +ARG VERSION +LABEL org.label-schema.schema-version="$VERSION" \ + org.label-schema.vendor=Tecnativa \ + org.label-schema.license=Apache-2.0 \ + org.label-schema.build-date="$BUILD_DATE" \ + org.label-schema.vcs-ref="$VCS_REF" \ + org.label-schema.vcs-url="https://github.com/Tecnativa/doodba" + +# Onbuild version, with all the magic +FROM base AS onbuild + +# Subimage triggers +ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] +ONBUILD CMD ["/usr/local/bin/odoo"] +ONBUILD ARG AGGREGATE=true +ONBUILD ARG AUTO_REQUIREMENTS=false +ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" +# TODO Use OCA/OCB when OCB 12.0 is released +ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/odoo/odoo.git" +ONBUILD ARG DEPTH_DEFAULT=1 +ONBUILD ARG DEPTH_MERGE=100 +ONBUILD ARG CLEAN=true +ONBUILD ARG COMPILE=true +ONBUILD ARG PIP_INSTALL_ODOO=true +ONBUILD ARG ADMIN_PASSWORD=admin +ONBUILD ARG SMTP_SERVER=smtp +ONBUILD ARG SMTP_PORT=25 +ONBUILD ARG SMTP_USER=false +ONBUILD ARG SMTP_PASSWORD=false +ONBUILD ARG SMTP_SSL=false +ONBUILD ARG EMAIL_FROM="" +ONBUILD ARG PROXY_MODE=false +ONBUILD ARG WITHOUT_DEMO=all +ONBUILD ARG PGUSER=odoo +ONBUILD ARG PGPASSWORD=odoopassword +ONBUILD ARG PGHOST=db +ONBUILD ARG PGPORT=5432 +ONBUILD ARG PGDATABASE=prod +# Config variables +ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ + DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \ + DEFAULT_REPO_PATTERN_ODOO="$DEFAULT_REPO_PATTERN_ODOO" \ + UNACCENT="$UNACCENT" \ + PGUSER="$PGUSER" \ + PGPASSWORD="$PGPASSWORD" \ + PGHOST="$PGHOST" \ + PGPORT=$PGPORT \ + PGDATABASE="$PGDATABASE" \ + PROXY_MODE="$PROXY_MODE" \ + SMTP_SERVER="$SMTP_SERVER" \ + SMTP_PORT=$SMTP_PORT \ + SMTP_USER="$SMTP_USER" \ + SMTP_PASSWORD="$SMTP_PASSWORD" \ + SMTP_SSL="$SMTP_SSL" \ + EMAIL_FROM="$EMAIL_FROM" \ + WITHOUT_DEMO="$WITHOUT_DEMO" +ONBUILD ARG LOCAL_CUSTOM_DIR=./custom +ONBUILD COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom +# https://docs.python.org/3/library/logging.html#levels +ONBUILD ARG LOG_LEVEL=INFO +ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ + && ln -s /opt/odoo/custom/ssh ~root/.ssh \ + && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ + && sync +ONBUILD RUN /opt/odoo/common/build && sync +ONBUILD USER odoo diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index 1e650ea2..f677de2c 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -42,9 +42,9 @@ CORE = "odoo/addons" PRIVATE_DIR = os.path.join(SRC_DIR, PRIVATE) CORE_DIR = os.path.join(SRC_DIR, CORE) -ODOO_VERSION = float(os.environ["ODOO_VERSION"]) +ODOO_VERSION = os.environ["ODOO_VERSION"] MANIFESTS = ("__manifest__.py", "__openerp__.py") -if ODOO_VERSION < 10: +if ODOO_VERSION in {"8.0", "9.0"}: MANIFESTS = MANIFESTS[1:] # Customize logging for build diff --git a/tests/__init__.py b/tests/__init__.py index 8c0bf09e..c0bf13df 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -19,11 +19,16 @@ DIR = dirname(__file__) ODOO_PREFIX = ("odoo", "--stop-after-init", "--workers=0") ODOO_VERSIONS = frozenset(environ.get( - "DOCKER_TAG", "8.0 9.0 10.0 11.0").split()) + "DOCKER_TAG", "8.0 9.0 10.0 11.0 12.0").split()) PG_VERSIONS = frozenset(environ.get( - "PG_VERSIONS", "9.6").split()) + "PG_VERSIONS", "10").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") +# TODO Remove when OCB 12.0 gets released, and fix errors raised +skip_12 = unittest.skipIf( + ODOO_VERSIONS == {"12.0"}, + "Test not ready for OCB 12.0") + def matrix(odoo=ODOO_VERSIONS, pg=PG_VERSIONS, odoo_skip=frozenset(), pg_skip=frozenset()): @@ -91,6 +96,7 @@ def compose_test(self, workdir, sub_env, *commands): env=full_env, ) + @skip_12 def test_addons_filtered(self): """Test addons filtering with ``ONLY`` keyword in ``addons.yaml``.""" project_dir = join(SCAFFOLDINGS_DIR, "dotd") @@ -162,6 +168,7 @@ def test_addons_filtered(self): ("bash", "-c", 'test "$(addons list -cWsale)" == crm'), ) + @skip_12 def test_settings(self): """Test settings are filled OK""" folder = join(SCAFFOLDINGS_DIR, "settings") @@ -209,6 +216,7 @@ def test_smallest(self): *commands ) + @skip_12 def test_dotd(self): """Test environment with common ``*.d`` directories.""" for sub_env in matrix(): @@ -243,6 +251,7 @@ def test_dotd(self): ("--version",), ) + @skip_12 def test_dependencies(self): """Test dependencies installation.""" dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies") From 1670801bc219c8bfc8bec5b35a44f11d23bca6fa Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 1 Oct 2018 10:38:27 +0100 Subject: [PATCH 011/255] Use OCB 12.0 (#171) - Branch 12.0 of OCB has been released, so use it now. - Enable some tests that should work now. There are still anothers that are disabled. - Add some random unneeded build dependencies on some tests to test they are removed afterwards, now that, basing on `python` official Docker image, `gcc` is always built-in. - Use Python 3.7, now that [it is officially supported][1]. [1]: https://twitter.com/__yajo/status/1045228965928062977 --- 12.0.Dockerfile | 18 ++++++++---------- tests/__init__.py | 8 +++----- .../custom/dependencies/apt_build.txt | 4 +++- .../dotd/custom/dependencies/apt_build.txt | 4 +++- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/12.0.Dockerfile b/12.0.Dockerfile index ac50153c..5c1593b6 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.5-stretch AS base +FROM python:3.7-stretch AS base # Enable Odoo user and filestore RUN useradd -md /home/odoo -s /bin/false odoo \ @@ -43,6 +43,7 @@ RUN apt-get -qq update \ gnupg2 \ locales-all \ nano \ + ruby \ telnet \ vim \ zlibc \ @@ -76,7 +77,7 @@ RUN pip install \ wdb \ && sync COPY bin/* /usr/local/bin/ -COPY lib/doodbalib /usr/local/lib/python3.5/site-packages/doodbalib +COPY lib/doodbalib /usr/local/lib/python3.7/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d @@ -84,22 +85,20 @@ RUN mkdir -p auto/addons custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ - && chmod -R a+rX /usr/local/lib/python3.5/site-packages/doodbalib \ + && chmod -R a+rX /usr/local/lib/python3.7/site-packages/doodbalib \ && sync # Execute installation script by Odoo version # This is at the end to benefit from cache at build time # https://docs.docker.com/engine/reference/builder/#/impact-on-build-caching -# TODO Use OCA/OCB when OCB 12.0 is released -ARG ODOO_SOURCE=odoo/odoo +ARG ODOO_SOURCE=OCA/OCB ARG ODOO_VERSION=12.0 -# TODO Use "$ODOO_VERSION" when OCB or Odoo 12.0 is released -ENV ODOO_VERSION="saas-11.5" +ENV ODOO_VERSION="$ODOO_VERSION" RUN debs="libldap2-dev libsasl2-dev" \ && apt-get update \ && apt-get install -yqq --no-install-recommends $debs \ && pip install -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ - && (python3 -m compileall -q /usr/local/lib/python3.5/ || true) \ + && (python3 -m compileall -q /usr/local/lib/python3.7/ || true) \ && apt-get purge -yqq $debs \ && rm -Rf /var/lib/apt/lists/* /tmp/* @@ -128,8 +127,7 @@ ONBUILD CMD ["/usr/local/bin/odoo"] ONBUILD ARG AGGREGATE=true ONBUILD ARG AUTO_REQUIREMENTS=false ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" -# TODO Use OCA/OCB when OCB 12.0 is released -ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/odoo/odoo.git" +ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" ONBUILD ARG DEPTH_DEFAULT=1 ONBUILD ARG DEPTH_MERGE=100 ONBUILD ARG CLEAN=true diff --git a/tests/__init__.py b/tests/__init__.py index c0bf13df..92824846 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -24,7 +24,7 @@ "PG_VERSIONS", "10").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") -# TODO Remove when OCB 12.0 gets released, and fix errors raised +# TODO Remove when required OCA addons for 12.0 are released, and fix errors skip_12 = unittest.skipIf( ODOO_VERSIONS == {"12.0"}, "Test not ready for OCB 12.0") @@ -168,7 +168,6 @@ def test_addons_filtered(self): ("bash", "-c", 'test "$(addons list -cWsale)" == crm'), ) - @skip_12 def test_settings(self): """Test settings are filled OK""" folder = join(SCAFFOLDINGS_DIR, "settings") @@ -216,7 +215,6 @@ def test_smallest(self): *commands ) - @skip_12 def test_dotd(self): """Test environment with common ``*.d`` directories.""" for sub_env in matrix(): @@ -229,7 +227,7 @@ def test_dotd(self): # ``custom/conf.d`` was properly concatenated ("grep", "test-conf", "auto/odoo.conf"), # ``custom/dependencies`` were installed - ("test", "!", "-e", "/usr/bin/gcc"), + ("test", "!", "-e", "/usr/sbin/sshd"), ("test", "!", "-e", "/var/lib/apt/lists/lock"), ("busybox", "whoami"), ("bash", "-c", "echo $NODE_PATH"), @@ -269,7 +267,7 @@ def test_dependencies(self): 'print(werkzeug.__version__)")" == 0.14.1')), # apt_build.txt ("test", "-f", "custom/dependencies/apt_build.txt"), - ("test", "!", "-e", "/usr/bin/gcc"), + ("test", "!", "-e", "/usr/sbin/sshd"), # apt-without-sequence.txt ("test", "-f", "custom/dependencies/apt-without-sequence.txt"), ("test", "!", "-e", "/bin/busybox"), diff --git a/tests/scaffoldings/dependencies/custom/dependencies/apt_build.txt b/tests/scaffoldings/dependencies/custom/dependencies/apt_build.txt index a06f5b92..0b02fdcb 100644 --- a/tests/scaffoldings/dependencies/custom/dependencies/apt_build.txt +++ b/tests/scaffoldings/dependencies/custom/dependencies/apt_build.txt @@ -1,5 +1,7 @@ # This installs gcc among other things build-essential -# This is the basic need to build any python extensions +# This is the basic need to build any python extensions in v11- python-dev python3-dev +# Just to test it is removed later +openssh-server diff --git a/tests/scaffoldings/dotd/custom/dependencies/apt_build.txt b/tests/scaffoldings/dotd/custom/dependencies/apt_build.txt index a06f5b92..ddb98b39 100644 --- a/tests/scaffoldings/dotd/custom/dependencies/apt_build.txt +++ b/tests/scaffoldings/dotd/custom/dependencies/apt_build.txt @@ -1,5 +1,7 @@ # This installs gcc among other things build-essential -# This is the basic need to build any python extensions +# This is the basic need to build any python extensions on v11- python-dev python3-dev +# Just to test it is removed after building +openssh-server From 1672dba6ffe55a0c666e4cbcef8849dc5678b652 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 8 Oct 2018 08:46:15 +0100 Subject: [PATCH 012/255] Add websocket-client to v12 This is a soft dependency required to perform browser tests. Temporary workaround for https://github.com/odoo/odoo/pull/27507, to be reverted when merged. --- 12.0.Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 5c1593b6..988911ce 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -97,7 +97,9 @@ ENV ODOO_VERSION="$ODOO_VERSION" RUN debs="libldap2-dev libsasl2-dev" \ && apt-get update \ && apt-get install -yqq --no-install-recommends $debs \ - && pip install -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + && pip install \ + -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + 'websocket-client~=0.53' \ && (python3 -m compileall -q /usr/local/lib/python3.7/ || true) \ && apt-get purge -yqq $debs \ && rm -Rf /var/lib/apt/lists/* /tmp/* From f1d5b4e65d463eb25b1bece981bc806e9237310f Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 11 Oct 2018 09:12:20 +0100 Subject: [PATCH 013/255] Update instructions about dependencies for development This should avoid confusion for a newcomer that is unfamiliar with used technologies. Fixes #173. --- README.md | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 309ef228..8a1e0842 100644 --- a/README.md +++ b/README.md @@ -598,23 +598,35 @@ Get up and running quickly with the provided ### Skip the boring parts -I will assume you know how to use Git, Docker and Docker Compose. +You will need these tools, so install them locally (and learn how to use them, +check their docs, Doodba is not the place to learn them šŸ˜‰): - git clone https://github.com/Tecnativa/doodba-scaffolding.git myproject - cd myproject - ln -s devel.yaml docker-compose.yml - chown -R $USER:1000 odoo/auto - chmod -R ug+rwX odoo/auto - export UID GID="$(id -g $USER)" UMASK="$(umask)" - docker-compose build --pull - docker-compose -f setup-devel.yaml run --rm odoo - docker-compose up +- [Git](https://git-scm.com/do) +- [Docker Engine](https://www.docker.com/products/docker-engine) + (running locally) +- [Docker Compose](https://docs.docker.com/compose/overview/) -And if you don't want to have a chance to do a `git merge` and get possible +Then run these Bash commands: + +```bash +git clone https://github.com/Tecnativa/doodba-scaffolding.git myproject +cd myproject +ln -s devel.yaml docker-compose.yml +chown -R $USER:1000 odoo/auto +chmod -R ug+rwX odoo/auto +export UID GID="$(id -g $USER)" UMASK="$(umask)" +docker-compose build --pull +docker-compose -f setup-devel.yaml run --rm odoo +docker-compose up +``` + +And if you don't want to have a chance to do a `git pull` and get possible future scaffolding updates merged in your project's `git log`: - rm -Rf .git - git init +```bash +rm -Rf .git +git init +``` ### Tell me the boring parts From 3e199cefe6dd62eded31424e29f4662b272776e3 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 11 Oct 2018 11:57:14 +0100 Subject: [PATCH 014/255] Drop support for `$AUTO_REQUIREMENTS` (#175) This feature was introduced in #71, but time has proven it buggy and not much useful. This feature has a chicken-and-egg problem in the devel environment: code doesn't exist at build time, but it is expected to be able to find the `requirements.txt` files inside it. It confuses the developer and creates divergencies between devel and test/prod environments (where that problem doesn't exist). Also it's breaking #174, which is a more important and actually used feature. The best fix is to drop support for this. If you really want to have requirements from remotes, you can add this to your `dependencies/pip.txt` file: ``` # Assuming you are installing all from server-tools -r https://raw.githubusercontent.com/OCA/server-tools/11.0/requirements.txt ``` It's a better choice because: - It's basic official pip. - It's explicit. - It works fine across environments. --- 11.0.Dockerfile | 1 - 12.0.Dockerfile | 1 - 8.0.Dockerfile | 1 - build.d/200-dependencies | 4 ---- lib/doodbalib/__init__.py | 1 - tests/scaffoldings/dotd/custom/dependencies/pip.txt | 2 ++ .../scaffoldings/dotd/custom/src/dummy_repo/requirements.txt | 1 - tests/scaffoldings/dotd/docker-compose.yaml | 1 - tests/scaffoldings/settings/docker-compose.yaml | 1 - 9 files changed, 2 insertions(+), 11 deletions(-) delete mode 100644 tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt diff --git a/11.0.Dockerfile b/11.0.Dockerfile index ea7a702c..80d9825f 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -136,7 +136,6 @@ FROM base AS onbuild ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] ONBUILD ARG AGGREGATE=true -ONBUILD ARG AUTO_REQUIREMENTS=false ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" ONBUILD ARG DEPTH_DEFAULT=1 diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 988911ce..3b03718a 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -127,7 +127,6 @@ FROM base AS onbuild ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] ONBUILD ARG AGGREGATE=true -ONBUILD ARG AUTO_REQUIREMENTS=false ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" ONBUILD ARG DEPTH_DEFAULT=1 diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 0fcda71e..bbdbb9a4 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -122,7 +122,6 @@ ONBUILD USER root ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] ONBUILD ARG AGGREGATE=true -ONBUILD ARG AUTO_REQUIREMENTS=false ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" ONBUILD ARG DEPTH_DEFAULT=1 diff --git a/build.d/200-dependencies b/build.d/200-dependencies index ceae1c57..745566a2 100755 --- a/build.d/200-dependencies +++ b/build.d/200-dependencies @@ -5,7 +5,6 @@ from os.path import basename, join, splitext from glob import glob from doodbalib import ( - AUTO_REQUIREMENTS, CUSTOM_DIR, FILE_APT_BUILD, SRC_DIR, @@ -18,9 +17,6 @@ install("apt", FILE_APT_BUILD) for name in INSTALLERS: req_files = [] - # pip `requirements.txt` files found in repositories - if name == "pip" and AUTO_REQUIREMENTS: - req_files += glob(join(SRC_DIR, "*", "requirements.txt")) # Normal dependency installation req_files.append(join(CUSTOM_DIR, 'dependencies', '%s.txt' % name)) for req_file in req_files: diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index f677de2c..bdac6d2c 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -33,7 +33,6 @@ AUTO_REPOS_YAML = '%s.yaml' % AUTO_REPOS_YAML CLEAN = os.environ.get("CLEAN") == "true" -AUTO_REQUIREMENTS = os.environ.get("AUTO_REQUIREMENTS") == "true" LOG_LEVELS = ("DEBUG", "INFO", "WARNING", "ERROR") FILE_APT_BUILD = os.path.join( CUSTOM_DIR, 'dependencies', 'apt_build.txt', diff --git a/tests/scaffoldings/dotd/custom/dependencies/pip.txt b/tests/scaffoldings/dotd/custom/dependencies/pip.txt index 5b9322ed..bc8535dd 100644 --- a/tests/scaffoldings/dotd/custom/dependencies/pip.txt +++ b/tests/scaffoldings/dotd/custom/dependencies/pip.txt @@ -2,3 +2,5 @@ pycrypto==2.6.1 --no-binary :all: # Odoo pins docutils==0.12, so let's check it gets upgraded docutils==0.14 +# External dependency files can be included too; example: cfssl +-r https://raw.githubusercontent.com/Tecnativa/doodba/f1d5b4e65d463eb25b1bece981bc806e9237310f/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt diff --git a/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt b/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt deleted file mode 100644 index 0139cd0a..00000000 --- a/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -cfssl diff --git a/tests/scaffoldings/dotd/docker-compose.yaml b/tests/scaffoldings/dotd/docker-compose.yaml index 75ebd8d5..22a0119d 100644 --- a/tests/scaffoldings/dotd/docker-compose.yaml +++ b/tests/scaffoldings/dotd/docker-compose.yaml @@ -4,7 +4,6 @@ services: build: context: ./ args: - AUTO_REQUIREMENTS: "true" LOG_LEVEL: DEBUG ODOO_VERSION: $ODOO_MINOR tty: true diff --git a/tests/scaffoldings/settings/docker-compose.yaml b/tests/scaffoldings/settings/docker-compose.yaml index 73d45fc5..e83fc641 100644 --- a/tests/scaffoldings/settings/docker-compose.yaml +++ b/tests/scaffoldings/settings/docker-compose.yaml @@ -4,7 +4,6 @@ services: build: context: ./ args: - AUTO_REQUIREMENTS: "true" LOG_LEVEL: DEBUG ODOO_VERSION: $ODOO_MINOR tty: true From fe9961d1bb35625f172edc7f6049dd10e102e599 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 5 Nov 2018 11:02:37 +0000 Subject: [PATCH 015/255] Latest is now 12.0 --- hooks/build | 2 +- hooks/post_push | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hooks/build b/hooks/build index 3ed0146c..f38dca1a 100755 --- a/hooks/build +++ b/hooks/build @@ -4,7 +4,7 @@ set -ex # Get Odoo version version="$DOCKER_TAG" if [ "$version" == latest ]; then - version=11.0 + version=12.0 fi if [ -z "$IMAGE_NAME" ]; then diff --git a/hooks/post_push b/hooks/post_push index 306545d2..0fbcb8ca 100755 --- a/hooks/post_push +++ b/hooks/post_push @@ -4,7 +4,7 @@ set -ex # Get Odoo version version="$DOCKER_TAG" if [ "$version" == latest ]; then - version=11.0 + version=12.0 fi if [ -z "$IMAGE_NAME" ]; then From 390897f1152f87a1e819f94c4a905e1b5a9ffecd Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 5 Nov 2018 11:00:50 +0000 Subject: [PATCH 016/255] Update python in v11 image (switch base) The outdated and buggy Python 3.5 version that Debian 9 ships was triggering werid behaviors in some production instances. I switch here the base to Docker Hub's `python:3.5-stretch`, which shares the same underlying OS, but uses latest Python 3.5 (3.5.6 as of today) and gets updates faster. The main upgrade problem would be that projects adding `python-dev` to their `apt_build.txt` files should remove it now. Not a big problem nor fix, so it seems legit for the stable release. --- 11.0.Dockerfile | 65 +++++++++++++++++++++++-------------------------- README.md | 5 +++- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 80d9825f..9c70e956 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -1,4 +1,4 @@ -FROM debian:9 AS base +FROM python:3.5-stretch AS base # Enable Odoo user and filestore RUN useradd -md /home/odoo -s /bin/false odoo \ @@ -38,13 +38,16 @@ ENV DB_FILTER=.* \ RUN apt-get -qq update \ && apt-get -yqq upgrade \ && apt-get install -yqq --no-install-recommends \ - python3 ruby-compass \ - fontconfig libfreetype6 libxml2 libxslt1.1 libjpeg62-turbo zlib1g \ - libfreetype6 liblcms2-2 libtiff5 tk tcl libpq5 \ - libldap-2.4-2 libsasl2-2 libx11-6 libxext6 libxrender1 \ - locales-all zlibc \ - bzip2 ca-certificates curl gettext-base git gnupg2 nano vim \ - openssh-client telnet xz-utils \ + chromium \ + gettext-base \ + gnupg2 \ + locales-all \ + ruby-compass \ + nano \ + ruby \ + telnet \ + vim \ + zlibc \ && echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && curl https://bootstrap.pypa.io/get-pip.py | python3 /dev/stdin \ @@ -56,9 +59,7 @@ RUN apt-get -qq update \ && apt-get install -yqq --no-install-recommends ./wkhtmltox.deb \ && rm wkhtmltox.deb \ && wkhtmltopdf --version \ - && apt-get -yqq purge python2.7 \ - && apt-get -yqq autoremove \ - && rm -Rf /var/lib/apt/lists/* + && rm -Rf /var/lib/apt/lists/* /tmp/* # Special case to get latest Less and PhantomJS RUN ln -s /usr/bin/nodejs /usr/local/bin/node \ @@ -72,11 +73,18 @@ RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version ' # Other facilities WORKDIR /opt/odoo RUN pip install \ - astor git-aggregator openupgradelib ptvsd pudb wdb + astor \ + git-aggregator \ + openupgradelib \ + pg_activity \ + ptvsd \ + pudb \ + wdb \ + && sync COPY bin/* /usr/local/bin/ -COPY lib/doodbalib /usr/local/lib/python3.5/dist-packages/doodbalib -RUN ln -s /usr/local/lib/python3.5/dist-packages/doodbalib \ - /usr/local/lib/python3.5/dist-packages/odoobaselib +COPY lib/doodbalib /usr/local/lib/python3.5/site-packages/doodbalib +RUN ln -s /usr/local/lib/python3.5/site-packages/doodbalib \ + /usr/local/lib/python3.5/site-packages/odoobaselib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d @@ -84,8 +92,7 @@ RUN mkdir -p auto/addons custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ - && chmod -R a+rX /usr/local/lib/python3.5/dist-packages/doodbalib \ - && ln -s $(which python3) /usr/local/bin/python \ + && chmod -R a+rX /usr/local/lib/python3.5/site-packages/doodbalib \ && sync # Execute installation script by Odoo version @@ -94,24 +101,14 @@ RUN mkdir -p auto/addons custom/src/private \ ARG ODOO_SOURCE=OCA/OCB ARG ODOO_VERSION=11.0 ENV ODOO_VERSION="$ODOO_VERSION" -RUN apt-get update \ - && apt-get install -y \ - build-essential \ - libevent-dev \ - libjpeg-dev \ - libldap2-dev \ - libsasl2-dev \ - libssl-dev \ - libxml2-dev \ - libxslt1-dev \ - python3-dev \ - zlib1g-dev \ - && pip install -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ - && pip install pg_activity \ +RUN debs="libldap2-dev libsasl2-dev" \ + && apt-get update \ + && apt-get install -yqq --no-install-recommends $debs \ + && pip install \ + -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ && (python3 -m compileall -q /usr/local/lib/python3.5/ || true) \ - && apt-get purge -yqq build-essential '*-dev' \ - && apt-mark -qq manual '*' \ - && rm -Rf /var/lib/apt/lists/* + && apt-get purge -yqq $debs \ + && rm -Rf /var/lib/apt/lists/* /tmp/* # HACK Special case for Werkzeug USER odoo diff --git a/README.md b/README.md index 8a1e0842..e2c6e63e 100644 --- a/README.md +++ b/README.md @@ -352,7 +352,10 @@ package managers: - `apt_build.txt`: build-time dependencies, installed before any others and removed after all the others too. Usually these would include Debian packages - such as `build-essential` or `python-dev`. + such as `build-essential` or `python-dev`. From Doodba 11.0, this is most + likely not needed, as build dependencies are shipped with the image, and + local python develpment headers should be used instead of those downloaded + from apt. - `apt.txt`: run-time dependencies installed by apt. - `gem.txt`: run-time dependencies installed by gem. - `npm.txt`: run-time dependencies installed by npm. From a34a96b5ede7f95f21617ccb4ec5b34ddaf119eb Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 5 Nov 2018 13:12:39 +0000 Subject: [PATCH 017/255] Allow to find dependant addons only (#177) This tool is required to be able to apply the same testing workflow as found in OCA, namely: 1. Install dependencies of chosen addons. 2. Test & install chosen addons. --- bin/addons | 34 +++++++++++-------- tests/__init__.py | 2 ++ .../dummy_repo/dummy_addon/__manifest__.py | 1 + .../src/private/private_addon/__openerp__.py | 1 + 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/bin/addons b/bin/addons index 0d6e4862..5342860a 100755 --- a/bin/addons +++ b/bin/addons @@ -23,6 +23,9 @@ parser.add_argument( parser.add_argument( "-c", "--core", action="store_true", help="Use all Odoo core addons") +parser.add_argument( + "-d", "--dependencies", action="store_true", + help="Use only dependencies of selected addons") parser.add_argument( "-e", "--extra", action="store_true", help="Use all extra addons") @@ -53,10 +56,13 @@ parser.add_argument( # Generate the matching addons set args = parser.parse_args() +dependencies = {"base"} addons = set(args.with_) without = set(args.without) if addons & without: sys.exit("Cannot include and exclude the same addon!") +if args.dependencies and args.fullpath: + sys.exit("Unsupported combination of --dependencies and --fullpath") try: for addon, repo in addons_config(strict=args.explicit): if addon in without: @@ -66,28 +72,26 @@ try: private_ok = args.private and repo == PRIVATE if private_ok or core_ok or extra_ok: addon_path = os.path.join(SRC_DIR, repo, addon) - if args.installable: - installable = False - manifests = list(MANIFESTS) - while True: - try: - manifest = os.path.join(addon_path, manifests.pop()) - with open(manifest, "r") as code: - manifest = ast.literal_eval(code.read()) - except IndexError: - break - except IOError: - continue - else: - installable = manifest.get("installable", True) + manifest = {} + for manifest_name in MANIFESTS: + try: + manifest_path = os.path.join(addon_path, manifest_name) + with open(manifest_path, "r") as code: + manifest = ast.literal_eval(code.read()) break - if not installable: + except IOError: continue + if args.installable and not manifest.get("installable", True): + continue + dependencies.update(manifest.get("depends", [])) if args.fullpath and args.action == "list": addon = addon_path addons.add(addon) except AddonsConfigError as error: sys.exit(error.message) +# Use dependencies instead, if requested +if args.dependencies: + addons = dependencies - addons # Do the required action if not addons: diff --git a/tests/__init__.py b/tests/__init__.py index 92824846..5f5a90df 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -137,6 +137,8 @@ def test_addons_filtered(self): self.compose_test( project_dir, dict(sub_env, DBNAME="prod"), + ("bash", "-c", + 'test "$(addons list -ped)" == base,web,website'), # ``dummy_addon`` and ``private_addon`` exist ("test", "-d", "auto/addons/dummy_addon"), ("test", "-h", "auto/addons/dummy_addon"), diff --git a/tests/scaffoldings/dotd/custom/src/dummy_repo/dummy_addon/__manifest__.py b/tests/scaffoldings/dotd/custom/src/dummy_repo/dummy_addon/__manifest__.py index d7bb944e..d967bb94 100644 --- a/tests/scaffoldings/dotd/custom/src/dummy_repo/dummy_addon/__manifest__.py +++ b/tests/scaffoldings/dotd/custom/src/dummy_repo/dummy_addon/__manifest__.py @@ -1,4 +1,5 @@ { "name": "dummy_addon", + "depends": ["web"], "installable": True, } diff --git a/tests/scaffoldings/dotd/custom/src/private/private_addon/__openerp__.py b/tests/scaffoldings/dotd/custom/src/private/private_addon/__openerp__.py index 24035e9a..f99d2d0e 100644 --- a/tests/scaffoldings/dotd/custom/src/private/private_addon/__openerp__.py +++ b/tests/scaffoldings/dotd/custom/src/private/private_addon/__openerp__.py @@ -1,3 +1,4 @@ { "name": "private_addon", + "depends": ["dummy_addon", "website"], } From e83a46ff279cc324ed667eddeebf08a609f0342e Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 15 Nov 2018 11:50:28 +0000 Subject: [PATCH 018/255] Change default fonts to liberation Current fonts shipped by Debian do not render fine in Adobe PDF on Windows and Mac OS. Most users will use those OS & PDF reader combination, and [Odoo demos and runbots use MS fonts][1]. So, in the hope of providing an opinionated sane default that makes most users happy, we are going to ship Liberation fonts by default, which are an open source alternative to MS fonts that, according to tests, render just fine everywhere. If anybody wants a more corporative font, they should use it in their reports and install it from apt with provided tools. [1]: https://github.com/odoo/odoo/issues/27487#issuecomment-431847389 --- 11.0.Dockerfile | 1 + 12.0.Dockerfile | 1 + 8.0.Dockerfile | 1 + 3 files changed, 3 insertions(+) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 9c70e956..103f85fc 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -39,6 +39,7 @@ RUN apt-get -qq update \ && apt-get -yqq upgrade \ && apt-get install -yqq --no-install-recommends \ chromium \ + fonts-liberation2 \ gettext-base \ gnupg2 \ locales-all \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 3b03718a..9c75eaaa 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -39,6 +39,7 @@ RUN apt-get -qq update \ && apt-get -yqq upgrade \ && apt-get install -yqq --no-install-recommends \ chromium \ + fonts-liberation2 \ gettext-base \ gnupg2 \ locales-all \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index bbdbb9a4..48682fe3 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -40,6 +40,7 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends \ python ruby-compass \ fontconfig libfreetype6 libxml2 libxslt1.1 libjpeg62-turbo zlib1g \ + fonts-liberation \ libfreetype6 liblcms2-2 libopenjpeg5 libtiff5 tk tcl libpq5 \ libldap-2.4-2 libsasl2-2 libx11-6 libxext6 libxrender1 \ locales-all zlibc \ From 7ab4d1f680c5d4f0ca7e9254074c5e6a94e0a3ad Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 16 Nov 2018 09:02:46 +0000 Subject: [PATCH 019/255] Expand default addons.yaml sections like the rest (#182) * Expand default addons.yaml sections like the rest Before this patch, when addons.yaml was not defining private or odoo/addons keys, all contents there were being included. If anybody put there a text file, it was getting included also, so this patch fixes #179. Now, those are processed in equal conditions as the rest of repo-addon definitions. BTW I'm removing the deprecated `filtered` parameter, which wasn't being used since we deprecated the addon linking at build long ago in #27. --- lib/doodbalib/__init__.py | 93 ++++++++----------- .../src/private/some_random_evil_file.txt | 0 2 files changed, 41 insertions(+), 52 deletions(-) create mode 100644 tests/scaffoldings/dotd/custom/src/private/some_random_evil_file.txt diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index bdac6d2c..64e5fd66 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -70,13 +70,9 @@ def __init__(self, message, *args): self.message = message -def addons_config(filtered=True, strict=False): +def addons_config(strict=False): """Yield addon name and path from ``ADDONS_YAML``. - :param bool filtered: - Use ``False`` to include all addon definitions. Use ``True`` (default) - to include only those matched by ``ONLY`` clauses, if any. - :param bool strict: Use ``True`` to raise an exception if any declared addon is not found. @@ -86,53 +82,53 @@ def addons_config(filtered=True, strict=False): config = dict() missing_glob = set() missing_manifest = set() - special_missing = {PRIVATE, CORE} + all_globs = {} try: with open(ADDONS_YAML) as addons_file: for doc in yaml.load_all(addons_file): - # When not filtering, private and core addons should be either - # defined under every doc, or defaulted to `*` in the - # ones where it is missing - if not filtered: - doc.setdefault(CORE, ["*"]) - doc.setdefault(PRIVATE, ["*"]) # Skip sections with ONLY and that don't match - elif any(os.environ.get(key) not in values - for key, values in doc.get("ONLY", dict()).items()): - logger.debug("Skipping section with ONLY %s", doc["ONLY"]) + only = doc.pop("ONLY", {}) + if any(os.environ.get(key) not in values + for key, values in only.items()): + logger.debug("Skipping section with ONLY %s", only) continue # Flatten all sections in a single dict - for repo, addons in doc.items(): - if repo == "ONLY": - continue - logger.debug("Processing %s repo", repo) - special_missing.discard(repo) - for partial_glob in addons: - logger.debug("Expanding glob %s", partial_glob) - full_glob = os.path.join(SRC_DIR, repo, partial_glob) - found = glob(full_glob) - if not found: - missing_glob.add(full_glob) - logger.debug( - "Skipping unexpandable glob '%s'", - full_glob) - continue - for addon in found: - manifests = ( - os.path.join(addon, m) for m in MANIFESTS - ) - if not any(os.path.isfile(m) for m in manifests): - missing_manifest.add(addon) - logger.debug( - "Skipping '%s' as it is not a valid Odoo " - "module", addon) - continue - logger.debug("Registering addon %s", addon) - addon = os.path.basename(addon) - config.setdefault(addon, set()) - config[addon].add(repo) + for repo, partial_globs in doc.items(): + all_globs.setdefault(repo, set()) + all_globs[repo].update(partial_globs) except IOError: logger.debug('Could not find addons configuration yaml.') + logger.debug("Processing %s repo", repo) + # Add default values for special sections + for repo in (CORE, PRIVATE): + all_globs.setdefault(repo, {"*"}) + logger.debug("Merged addons definition before expanding: %r", all_globs) + # Expand all globs and store config + for repo, partial_globs in all_globs.items(): + for partial_glob in partial_globs: + logger.debug("Expanding in repo %s glob %s", repo, partial_glob) + full_glob = os.path.join(SRC_DIR, repo, partial_glob) + found = glob(full_glob) + if not found: + missing_glob.add(full_glob) + logger.debug( + "Skipping unexpandable glob '%s'", + full_glob) + continue + for addon in found: + manifests = ( + os.path.join(addon, m) for m in MANIFESTS + ) + if not any(os.path.isfile(m) for m in manifests): + missing_manifest.add(addon) + logger.debug( + "Skipping '%s' as it is not a valid Odoo " + "module", addon) + continue + logger.debug("Registering addon %s", addon) + addon = os.path.basename(addon) + config.setdefault(addon, set()) + config[addon].add(repo) # Fail now if running in strict mode if strict: error = [] @@ -146,14 +142,7 @@ def addons_config(filtered=True, strict=False): missing_glob, missing_manifest, ) - # By default, all private and core addons are enabled - for repo in special_missing: - logger.debug("Auto-adding all addons from %s", repo) - for addon in glob(os.path.join(SRC_DIR, repo, "*")): - addon = os.path.basename(addon) - config.setdefault(addon, set()) - config[addon].add(repo) - logger.debug("Resulting configuration: %r", config) + logger.debug("Resulting configuration after expanding: %r", config) for addon, repos in config.items(): # Private addons are most important if PRIVATE in repos: diff --git a/tests/scaffoldings/dotd/custom/src/private/some_random_evil_file.txt b/tests/scaffoldings/dotd/custom/src/private/some_random_evil_file.txt new file mode 100644 index 00000000..e69de29b From 28f549d5e9360ae752e244ddfc703e948c798b30 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 16 Nov 2018 11:05:53 +0000 Subject: [PATCH 020/255] Update default ptvsd arguments Fixes #183 by changing to `--host`. BTW, I'm adding a couple of useful new arguments: - `--multiprocess` to be able to debug in workers mode. - `--wait` to avoid running code before the debugger is attached. --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 8.0.Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 103f85fc..86859b10 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -21,7 +21,7 @@ ENV DB_FILTER=.* \ OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ PATH="/home/odoo/.local/bin:$PATH" \ PIP_NO_CACHE_DIR=0 \ - PTVSD_ARGS="--server-host 0.0.0.0 --port 6899" \ + PTVSD_ARGS="--host 0.0.0.0 --port 6899 --wait --multiprocess" \ PTVSD_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 9c75eaaa..6b5e23d3 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -21,7 +21,7 @@ ENV DB_FILTER=.* \ OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ PATH="/home/odoo/.local/bin:$PATH" \ PIP_NO_CACHE_DIR=0 \ - PTVSD_ARGS="--server-host 0.0.0.0 --port 6899" \ + PTVSD_ARGS="--host 0.0.0.0 --port 6899 --wait --multiprocess" \ PTVSD_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 48682fe3..61d6cab9 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -21,7 +21,7 @@ ENV DB_FILTER=.* \ OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ PATH="/home/odoo/.local/bin:$PATH" \ PIP_NO_CACHE_DIR=0 \ - PTVSD_ARGS="--server-host 0.0.0.0 --port 6899" \ + PTVSD_ARGS="--host 0.0.0.0 --port 6899 --wait --multiprocess" \ PTVSD_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ From a0178913810f46557311ae16a3c5d3e0914529bd Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 16 Nov 2018 12:19:46 +0000 Subject: [PATCH 021/255] Fix error on Doodba QA when private folder is empty (#184) * Fix error on Doodba QA when private folder is empty Since #182, the `addons-install` script in doodba-qa, in projects without private addons, yielded this error: Addons not found: {'/opt/odoo/custom/src/private/*'} This should never be an error, as projects without private addons are not only supported but actually encouraged! So, I add here this specific exception. --- lib/doodbalib/__init__.py | 4 +++- tests/__init__.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index 64e5fd66..a9b5660a 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -110,7 +110,9 @@ def addons_config(strict=False): full_glob = os.path.join(SRC_DIR, repo, partial_glob) found = glob(full_glob) if not found: - missing_glob.add(full_glob) + # Projects without private addons should never fail + if (repo, partial_glob) != (PRIVATE, "*"): + missing_glob.add(full_glob) logger.debug( "Skipping unexpandable glob '%s'", full_glob) diff --git a/tests/__init__.py b/tests/__init__.py index 5f5a90df..51948d1b 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -200,6 +200,7 @@ def test_smallest(self): ("test", "-d", "/opt/odoo/custom/src/private"), ("test", "-d", "/opt/odoo/custom/ssh"), ("test", "-x", "/usr/local/bin/unittest"), + ("addons", "list", "-cpix"), ("pg_activity", "--version"), # Must be able to install base addon ODOO_PREFIX + ("--init", "base"), From b0a3c39827a0fed9aa331acaba0c44cba7a0cbf8 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 19 Nov 2018 14:05:38 +0000 Subject: [PATCH 022/255] Include watchdog in odoo v9+ (#186) Fixes #180. --- 11.0.Dockerfile | 1 + 12.0.Dockerfile | 1 + 8.0.Dockerfile | 2 +- bin/install.sh | 7 +++++++ tests/__init__.py | 16 +++++++++------- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 86859b10..2071a8ec 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -80,6 +80,7 @@ RUN pip install \ pg_activity \ ptvsd \ pudb \ + watchdog \ wdb \ && sync COPY bin/* /usr/local/bin/ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 6b5e23d3..29a3c89e 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -75,6 +75,7 @@ RUN pip install \ pg_activity \ ptvsd \ pudb \ + watchdog \ wdb \ && sync COPY bin/* /usr/local/bin/ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 61d6cab9..f8454be5 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -76,7 +76,7 @@ RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version ' # Other facilities WORKDIR /opt/odoo RUN pip install \ - astor git-aggregator openupgradelib ptvsd pudb wdb + git-aggregator openupgradelib ptvsd pudb wdb COPY bin/* /usr/local/bin/ COPY lib/doodbalib /usr/local/lib/python2.7/dist-packages/doodbalib RUN ln -s /usr/local/lib/python2.7/dist-packages/doodbalib \ diff --git a/bin/install.sh b/bin/install.sh index 8c37c5dd..7696254d 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Notice that this file is only used in odoo v8-10 set -ex reqs=https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt @@ -36,6 +37,12 @@ fi # Build and install Odoo dependencies with pip pip install --requirement $reqs +if [ "$ODOO_VERSION" != "8.0" ]; then + pip install watchdog +fi +if [ "$ODOO_VERSION" == "10.0" ]; then + pip install astor +fi # Remove all installed garbage apt-get -y purge $apt_deps diff --git a/tests/__init__.py b/tests/__init__.py index 51948d1b..1d86f96e 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -209,7 +209,10 @@ def test_smallest(self): ) smallest_dir = join(SCAFFOLDINGS_DIR, "smallest") for sub_env in matrix(odoo_skip={"8.0"}): - self.compose_test(smallest_dir, sub_env, *commands) + self.compose_test( + smallest_dir, sub_env, *commands, + ("python", "-c", "import watchdog"), + ) for sub_env in matrix(odoo={"8.0"}): self.compose_test( smallest_dir, sub_env, @@ -302,11 +305,10 @@ def test_main_scaffolding(self): "https://github.com/Tecnativa/doodba-scaffolding.git"), cwd=tmpdirname, ) - # Create inverseproxy_shared network - self.popen( - ("docker", "network", "create", "inverseproxy_shared") - ) - tmpdirname = join(tmpdirname, "doodba") + # Create needed external networks + for network in ("inverseproxy_shared", "globalwhitelist_shared"): + self.popen(("docker", "network", "create", network)) + tmpdirname = join(tmpdirname, "doodba-scaffolding") # Special env keys for setup-devel pwdata = getpwnam(environ["USER"]) setup_env = { @@ -316,7 +318,7 @@ def test_main_scaffolding(self): "GID": str(pwdata.pw_gid), } # TODO Test all supported versions - for sub_env in matrix(odoo={"10.0"}): + for sub_env in matrix(odoo={MAIN_SCAFFOLDING_VERSION}): # Setup the devel environment self.compose_test(tmpdirname, dict(sub_env, **setup_env), ()) # Travis seems to have a different UID than 1000 From a8bf965098e0fa66db65f6811ebeaca01d97db15 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 20 Nov 2018 09:54:28 +0000 Subject: [PATCH 023/255] Restore ability to unfilter addons (#187) This option was wrongly removed in 7ab4d1f680c5d4f0ca7e9254074c5e6a94e0a3ad, so I'm reverting that change. We need to know the total addons used, to avoid cleaning them on image build. --- build.d/400-clean | 2 +- lib/doodbalib/__init__.py | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/build.d/400-clean b/build.d/400-clean index 36cabd75..614a5695 100755 --- a/build.d/400-clean +++ b/build.d/400-clean @@ -10,7 +10,7 @@ if not CLEAN: logger.warning("Not cleaning garbage") sys.exit() -addons = set(addons_config(False)) +addons = set(addons_config(filtered=False)) repos = {addon[1] for addon in addons} | {CORE, PRIVATE} for directory in os.listdir(SRC_DIR): # Special directories must be preserved diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index a9b5660a..e1c8d0b1 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -70,9 +70,13 @@ def __init__(self, message, *args): self.message = message -def addons_config(strict=False): +def addons_config(filtered=True, strict=False): """Yield addon name and path from ``ADDONS_YAML``. + :param bool filtered: + Use ``False`` to include all addon definitions. Use ``True`` (default) + to include only those matched by ``ONLY`` clauses, if any. + :param bool strict: Use ``True`` to raise an exception if any declared addon is not found. @@ -88,8 +92,11 @@ def addons_config(strict=False): for doc in yaml.load_all(addons_file): # Skip sections with ONLY and that don't match only = doc.pop("ONLY", {}) - if any(os.environ.get(key) not in values - for key, values in only.items()): + if not filtered: + doc.setdefault(CORE, ["*"]) + doc.setdefault(PRIVATE, ["*"]) + elif any(os.environ.get(key) not in values + for key, values in only.items()): logger.debug("Skipping section with ONLY %s", only) continue # Flatten all sections in a single dict From c085b23c4dffac716d036d1cb6647a9214697d67 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 21 Nov 2018 07:55:54 +0000 Subject: [PATCH 024/255] Install fonts-liberation2 in Debian 8 builds (#188) This package comes from Debian 9, but it is needed because only Liberation 2.x fonts support "ZERO WIDTH NO-BREAK SPACE (U+FEFF)" character, used by Odoo from https://github.com/odoo/odoo/commit/cb2a3afa7e010d1cd7a01c64f5c3ac58b6fd76d2 onwards. --- 8.0.Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/8.0.Dockerfile b/8.0.Dockerfile index f8454be5..54fcece3 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -49,6 +49,8 @@ RUN apt-get update \ && curl https://bootstrap.pypa.io/get-pip.py | python /dev/stdin \ && curl -sL https://deb.nodesource.com/setup_6.x | bash - \ && apt-get install -yqq nodejs \ + && curl -SLo fonts-liberation2.deb http://ftp.debian.org/debian/pool/main/f/fonts-liberation2/fonts-liberation2_2.00.1-3_all.deb \ + && dpkg --install fonts-liberation2.deb \ && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.jessie_amd64.deb \ && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ && (dpkg --install wkhtmltox.deb || true) \ From a209b25b873b31b0bd164e4b0506b637e56f280c Mon Sep 17 00:00:00 2001 From: remi-filament <30716308+remi-filament@users.noreply.github.com> Date: Wed, 21 Nov 2018 10:54:32 +0100 Subject: [PATCH 025/255] Unlink directories --- build.d/400-clean | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build.d/400-clean b/build.d/400-clean index 614a5695..d92bfc59 100755 --- a/build.d/400-clean +++ b/build.d/400-clean @@ -25,7 +25,10 @@ for directory in os.listdir(SRC_DIR): # Remove directories not listed in addons.yaml if directory not in repos: logger.info("Removing directory %s", full) - shutil.rmtree(full) + try: + shutil.rmtree(full) + except OSError: + os.unlink(full) continue # Traverse addons @@ -37,4 +40,7 @@ for directory in os.listdir(SRC_DIR): # Remove addon if not used if (subdirectory, directory) not in addons: logger.info("Removing subdirectory %s", subfull) - shutil.rmtree(subfull) + try: + shutil.rmtree(subfull) + except OSError: + os.unlink(subfull) From b2a31bdb40e611a7376180c2823bc557a1512817 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 22 Nov 2018 08:40:19 +0000 Subject: [PATCH 026/255] Test that #189 is fixed --- tests/__init__.py | 2 ++ tests/scaffoldings/dotd/custom/src/dummy_repo/dummy_link | 1 + 2 files changed, 3 insertions(+) create mode 120000 tests/scaffoldings/dotd/custom/src/dummy_repo/dummy_link diff --git a/tests/__init__.py b/tests/__init__.py index 1d86f96e..4594676a 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -245,7 +245,9 @@ def test_dotd(self): ("python", "-c", "import cfssl"), # Local executable binaries found in $PATH ("sh", "-c", "pip install --user -q flake8 && which flake8"), + # Addon cleanup works correctly ("test", "!", "-e", "custom/src/private/dummy_addon"), + ("test", "!", "-e", "custom/src/dummy_repo/dummy_link"), ("test", "-d", "custom/src/private/private_addon"), ("test", "-f", "custom/src/private/private_addon/__init__.py"), ("test", "-e", "auto/addons/private_addon"), diff --git a/tests/scaffoldings/dotd/custom/src/dummy_repo/dummy_link b/tests/scaffoldings/dotd/custom/src/dummy_repo/dummy_link new file mode 120000 index 00000000..abb95d99 --- /dev/null +++ b/tests/scaffoldings/dotd/custom/src/dummy_repo/dummy_link @@ -0,0 +1 @@ +dummy_addon \ No newline at end of file From d79f5913976bfc2485339ea733f17a73ff6e7ef9 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 22 Nov 2018 11:23:43 +0000 Subject: [PATCH 027/255] Remove fonts-liberation2.deb file after installing --- 8.0.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 54fcece3..f1e1875a 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -55,7 +55,7 @@ RUN apt-get update \ && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ && (dpkg --install wkhtmltox.deb || true) \ && apt-get install -yqq --no-install-recommends --fix-broken \ - && rm wkhtmltox.deb \ + && rm fonts-liberation2.deb wkhtmltox.deb \ && wkhtmltopdf --version \ && rm -Rf /var/lib/apt/lists/* From 76f4585285d9ba87d48c2643bd72d5d136676cd1 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 30 Nov 2018 08:59:28 +0000 Subject: [PATCH 028/255] Document traefik.enable=false This responds to the logical and legitimate request made in https://github.com/Tecnativa/doodba-scaffolding/issues/14#issuecomment-443045266 --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index e2c6e63e..0bde10e5 100644 --- a/README.md +++ b/README.md @@ -1054,6 +1054,16 @@ To **add** the `www.` prefix, it is almost the same: Of course, both domains should point to the same machine before booting, or Let's Encrypt might ban your server for some time. +### How to run a parallel Odoo container without crashing Traefik? + +Just run it in this fashion: + +```bash +docker-compose run --rm -l traefik.enable=false odoo bash +``` + +With that label, Traefik will ignore that container. + ### How to allow access from several host names? In `.env`, set `DOMAIN_PROD` to `host1.com,host2.com,www.host1.com`, etc. From fc0552f8e52058f434f01a9bd2a8faa605be207b Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 12 Dec 2018 10:42:27 +0000 Subject: [PATCH 029/255] Add Posbox/IoT box FAQ --- README.md | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/README.md b/README.md index 0bde10e5..bb6de52e 100644 --- a/README.md +++ b/README.md @@ -1099,6 +1099,96 @@ Most likely you are using versions `8.0` or `9.0` of the image. If so: - `odoo --workers 0` for Odoo 8.0. - `odoo --workers 0 --dev` for Odoo 9.0. +### How can I run a Posbox/IoT box service for development? + +Posbox has special needs that are not useful for most projects, and is quite +tightly related to specific hardware and peripherals, so it makes not much +sense to ship it by default in Doodba and its [scaffolding][]. + +However, for testing connection issues, developing, etc., you might want to +boot a resource-limited posbox instance imitation. + +The best you can do is buy a Posbox/IoT box and peripherals and use it, but +for quick tests that do not involve specific hardware, you can boot it with +Doodba by: + +- Add the `apt` dependency `usbutils` (which contains `lsusb` binary). +- Add the `pip` dependencies `evdev` and `netifaces`. +- Add a `posbox` container, which: + - Can read usb devices, privileged. + - Loads at boot all required `hw_*` addons, except for `hw_posbox_upgrade`. + - Exposes a port that doesn't conflict with Odoo, such as `8070` i.e. + +
+Example patch for official scaffolding + +```diff +diff --git a/devel.yaml b/devel.yaml +index e029d48..2f800de 100644 +--- a/devel.yaml ++++ b/devel.yaml +@@ -15,7 +15,7 @@ services: + PORT: "6899 8069" + TARGET: odoo + +- odoo: ++ odoo: &odoo + extends: + file: common.yaml + service: odoo +@@ -53,6 +53,21 @@ services: + # XXX Odoo v8 has no `--dev` mode; Odoo v9 has no parameters + - --dev=reload,qweb,werkzeug,xml + ++ posbox: ++ <<: *odoo ++ ports: ++ - "127.0.0.1:8070:8069" ++ privileged: true ++ networks: *public ++ volumes: ++ - ./odoo/custom:/opt/odoo/custom:ro,z ++ - ./odoo/auto/addons:/opt/odoo/auto/addons:rw,z ++ - /dev/bus/usb ++ command: ++ - odoo ++ - --workers=0 ++ - --load=web,hw_proxy,hw_posbox_homepage,hw_scale,hw_scanner,hw_escpos,hw_blackbox_be,hw_screen ++ + db: + extends: + file: common.yaml +diff --git a/odoo/custom/dependencies/apt.txt b/odoo/custom/dependencies/apt.txt +index 8b13789..e32891b 100644 +--- a/odoo/custom/dependencies/apt.txt ++++ b/odoo/custom/dependencies/apt.txt +@@ -1 +1 @@ ++usbutils +diff --git a/odoo/custom/dependencies/pip.txt b/odoo/custom/dependencies/pip.txt +index e69de29..6eef737 100644 +--- a/odoo/custom/dependencies/pip.txt ++++ b/odoo/custom/dependencies/pip.txt +@@ -0,0 +1,2 @@ ++evdev ++netifaces +``` + +
+ +Once you apply those changes, to use it: + +1. `docker-compose build` to install the new dependencies. +1. `docker-compose up -d` to start all services. +1. Visit `http://localhost:8070` to see the posbox running. +1. Visit `http://localhost:${ODOO_MAJOR}069` to see Odoo. +1. Install `point_of_sale` in Odoo. +1. Configure the POS in Odoo to connect to Posbox in `localhost:8070`. + +Of course this won't be fully functional, but it will give you an overview +on the posbox stuff. + +[Beware about possible mixed content errors][mixed-content-posbox]. + ### This project is too opinionated, but can I question any of those opinions? Of course. There's no guarantee that we will like it, but please do it. :wink: @@ -1227,6 +1317,7 @@ scaffolding versions is preserved. [glob]: https://docs.python.org/3/library/glob.html [Let's Encrypt]: https://letsencrypt.org/ [MailHog]: #mailhog +[mixed-content-posbox]: https://github.com/odoo/odoo/issues/3156#issuecomment-443727760 [OCA]: https://odoo-community.org/ [OCB]: https://github.com/OCA/OCB [Odoo S.A.]: https://www.odoo.com From 2b50d5ae9e64d0efb6af3e4f5c82b472300e99ec Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 18 Dec 2018 14:01:37 +0100 Subject: [PATCH 030/255] Bundle QA dependencies (#192) Following the QA redesign stated in https://github.com/Tecnativa/doodba-qa/issues/8, here I'm bundling all QA dependencies in a separate virtualenv located in `/qa` folder, inside the image, to make QA easier to execute under any environment. --- 11.0.Dockerfile | 20 ++++++- 12.0.Dockerfile | 18 ++++++ 8.0.Dockerfile | 22 ++++++- README.md | 11 +++- qa/insider | 60 +++++++++++++++++++ tests/__init__.py | 15 +++++ .../settings/custom/scripts/qa-insider-test | 23 +++++++ 7 files changed, 165 insertions(+), 4 deletions(-) create mode 100755 qa/insider create mode 100755 tests/scaffoldings/settings/custom/scripts/qa-insider-test diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 2071a8ec..a6a490d1 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -8,6 +8,7 @@ RUN useradd -md /home/odoo -s /bin/false odoo \ VOLUME ["/var/lib/odoo"] EXPOSE 8069 8072 +ARG MQT=https://github.com/OCA/maintainer-quality-tools.git ARG WKHTMLTOPDF_VERSION=0.12.5 ARG WKHTMLTOPDF_CHECKSUM='1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb' ENV DB_FILTER=.* \ @@ -68,7 +69,7 @@ RUN ln -s /usr/bin/nodejs /usr/local/bin/node \ && rm -Rf ~/.npm /tmp/* # Special case to get bootstrap-sass, required by Odoo for Sass assets -RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version '<4' \ +RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version '<3.4' \ && rm -Rf ~/.gem /var/lib/gems/*/cache/ # Other facilities @@ -97,6 +98,23 @@ RUN mkdir -p auto/addons custom/src/private \ && chmod -R a+rX /usr/local/lib/python3.5/site-packages/doodbalib \ && sync +# Doodba-QA dependencies in a separate virtualenv +COPY qa /qa +RUN python -m venv --system-site-packages /qa/venv \ + && . /qa/venv/bin/activate \ + && pip install --no-cache-dir \ + click \ + coverage \ + flake8 \ + pylint-odoo \ + six \ + && npm install --loglevel error --prefix /qa eslint \ + && deactivate \ + && mkdir -p /qa/artifacts \ + && chown -R odoo:odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && git clone --depth 1 $MQT /qa/mqt + # Execute installation script by Odoo version # This is at the end to benefit from cache at build time # https://docs.docker.com/engine/reference/builder/#/impact-on-build-caching diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 29a3c89e..8b630162 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -8,6 +8,7 @@ RUN useradd -md /home/odoo -s /bin/false odoo \ VOLUME ["/var/lib/odoo"] EXPOSE 8069 8072 +ARG MQT=https://github.com/OCA/maintainer-quality-tools.git ARG WKHTMLTOPDF_VERSION=0.12.5 ARG WKHTMLTOPDF_CHECKSUM='1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb' ENV DB_FILTER=.* \ @@ -90,6 +91,23 @@ RUN mkdir -p auto/addons custom/src/private \ && chmod -R a+rX /usr/local/lib/python3.7/site-packages/doodbalib \ && sync +# Doodba-QA dependencies in a separate virtualenv +COPY qa /qa +RUN python -m venv --system-site-packages /qa/venv \ + && . /qa/venv/bin/activate \ + && pip install --no-cache-dir \ + click \ + coverage \ + flake8 \ + pylint-odoo \ + six \ + && npm install --loglevel error --prefix /qa eslint \ + && deactivate \ + && mkdir -p /qa/artifacts \ + && chown -R odoo:odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && git clone --depth 1 $MQT /qa/mqt + # Execute installation script by Odoo version # This is at the end to benefit from cache at build time # https://docs.docker.com/engine/reference/builder/#/impact-on-build-caching diff --git a/8.0.Dockerfile b/8.0.Dockerfile index f1e1875a..c019baa6 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -8,6 +8,7 @@ RUN useradd -md /home/odoo -s /bin/false odoo \ VOLUME ["/var/lib/odoo"] EXPOSE 8069 8072 +ARG MQT=https://github.com/OCA/maintainer-quality-tools.git ARG WKHTMLTOPDF_VERSION=0.12.5 ARG WKHTMLTOPDF_CHECKSUM='2583399a865d7604726da166ee7cec656b87ae0a6016e6bce7571dcd3045f98b' ENV DB_FILTER=.* \ @@ -72,13 +73,13 @@ RUN ln -s /usr/bin/nodejs /usr/local/bin/node \ && rm -Rf ~/.npm /tmp/* # Special case to get bootstrap-sass, required by Odoo for Sass assets -RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version '<4' \ +RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version '<3.4' \ && rm -Rf ~/.gem /var/lib/gems/*/cache/ # Other facilities WORKDIR /opt/odoo RUN pip install \ - git-aggregator openupgradelib ptvsd pudb wdb + git-aggregator openupgradelib ptvsd pudb virtualenv wdb COPY bin/* /usr/local/bin/ COPY lib/doodbalib /usr/local/lib/python2.7/dist-packages/doodbalib RUN ln -s /usr/local/lib/python2.7/dist-packages/doodbalib \ @@ -93,6 +94,23 @@ RUN mkdir -p auto/addons custom/src/private \ && chmod -R a+rX /usr/local/lib/python2.7/dist-packages/doodbalib \ && sync +# Doodba-QA dependencies in a separate virtualenv +COPY qa /qa +RUN virtualenv --system-site-packages /qa/venv \ + && . /qa/venv/bin/activate \ + && pip install --no-cache-dir \ + click \ + coverage \ + flake8 \ + pylint-odoo \ + six \ + && npm install --loglevel error --prefix /qa eslint \ + && deactivate \ + && mkdir -p /qa/artifacts \ + && chown -R odoo:odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && git clone --depth 1 $MQT /qa/mqt + # Execute installation script by Odoo version # This is at the end to benefit from cache at build time # https://docs.docker.com/engine/reference/builder/#/impact-on-build-caching diff --git a/README.md b/README.md index bb6de52e..6fea10c5 100644 --- a/README.md +++ b/README.md @@ -1038,6 +1038,14 @@ might get deprecated and removed at some point. The best you can do is to [subscribe to the compatibility breakage announcements issue][retrobreak]. +### How to have good QA and test in my CI with Doodba? + +Inside this image, there's the `/qa` folder, which provides some necessary +plumbing to perform quality assurance and continous integration if you use +[doodba-qa][], which is a separate (but related) project with that purpose. + +Go there to get more instructions. + ### I need to force addition or removal of `www.` prefix in production These instructions assume you use the official [scaffolding][]. @@ -1296,7 +1304,7 @@ scaffolding versions is preserved. ## Related Projects -- [QA tools for Doodba-based projects](https://github.com/Tecnativa/doodba-qa) +- [QA tools for Doodba-based projects][doodba-qa] - [Ansible role for automated deployment / update from Le Filament](https://github.com/remi-filament/ansible_role_odoo_docker) - Find others by searching [GitHub projects tagged with `#doodba`](https://github.com/topics/doodba) @@ -1313,6 +1321,7 @@ scaffolding versions is preserved. [builds]: https://hub.docker.com/r/tecnativa/doodba/builds/ [development]: #development [docker-socket-proxy]: https://hub.docker.com/r/tecnativa/docker-socket-proxy/ +[doodba-qa]: https://github.com/Tecnativa/doodba-qa [Fish]: http://fishshell.com/ [glob]: https://docs.python.org/3/library/glob.html [Let's Encrypt]: https://letsencrypt.org/ diff --git a/qa/insider b/qa/insider new file mode 100755 index 00000000..288c1899 --- /dev/null +++ b/qa/insider @@ -0,0 +1,60 @@ +#!/usr/bin/env python +from __future__ import print_function + +import os +import stat +import subprocess +import sys +import shutil + +from argparse import ArgumentParser +from tempfile import mkstemp, NamedTemporaryFile + +from doodbalib import logger + +# Define CLI options +parser = ArgumentParser( + description="Execute some code in this container's QA environment.") +parser.add_argument( + "script", + help="The source code that will be executed. " + "It should start with a shebang.") +parser.add_argument( + "arguments", nargs="*", + help="Additional arguments passed to the script.") +args = parser.parse_args() + +# Copy the source code to an executable file +executable = NamedTemporaryFile(mode="w+", delete=False) +with executable as tmp: + logger.debug("Insider script source code:\n%s", args.script) + tmp.write(args.script) +os.chmod( + executable.name, + stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH, +) + +# Execute the script +cmd = [executable.name] + args.arguments +try: + logger.debug("Executing %r", cmd) + subprocess.check_call( + cmd, + stderr=subprocess.STDOUT, + stdout=sys.stderr, + ) +finally: + logger.debug("Deleting %s", executable.name) + os.unlink(executable.name) + + artifacts_zip_path = mkstemp()[1] + logger.debug("Zipping /qa/artifacts in %s.zip", artifacts_zip_path) + shutil.make_archive(artifacts_zip_path, "zip", "/qa/artifacts") + artifacts_zip_path += ".zip" + with open(artifacts_zip_path, "rb") as zip_fd, \ + os.fdopen(sys.stdout.fileno(), "wb") as stdout_bytes: + stdout_bytes.write(zip_fd.read()) + stdout_bytes.flush() + + logger.debug("Deleting %s", artifacts_zip_path) + os.unlink(artifacts_zip_path) diff --git a/tests/__init__.py b/tests/__init__.py index 4594676a..cdd0b040 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -170,6 +170,21 @@ def test_addons_filtered(self): ("bash", "-c", 'test "$(addons list -cWsale)" == crm'), ) + def test_qa(self): + """Test that QA tools are in place and work as expected.""" + folder = join(SCAFFOLDINGS_DIR, "settings") + commands = ( + ("./custom/scripts/qa-insider-test",), + ("/qa/node_modules/.bin/eslint", "--version"), + ("/qa/venv/bin/flake8", "--version"), + ("/qa/venv/bin/pylint", "--version"), + ("/qa/venv/bin/python", "--version"), + ("/qa/venv/bin/python", "-c", "import pylint_odoo"), + ("test", "-d", "/qa/mqt"), + ) + for sub_env in matrix(): + self.compose_test(folder, sub_env, *commands) + def test_settings(self): """Test settings are filled OK""" folder = join(SCAFFOLDINGS_DIR, "settings") diff --git a/tests/scaffoldings/settings/custom/scripts/qa-insider-test b/tests/scaffoldings/settings/custom/scripts/qa-insider-test new file mode 100755 index 00000000..92cdad3b --- /dev/null +++ b/tests/scaffoldings/settings/custom/scripts/qa-insider-test @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -ex + +# Declare some scripts +bash_script='#!/usr/bin/env bash +echo "$@"' +python_script='#!/usr/bin/env python +import sys +with open("/qa/artifacts/python", "w+") as fd: + for arg in sys.argv[1:]: + fd.write(arg)' + +# Test bash script +bash_result="$(/qa/insider "$bash_script" 1 2 3 2>/dev/stdout >/dev/null)" +test "$bash_result" == "1 2 3" + +# Test python script +python_result="$(mktemp --suffix .zip)" +/qa/insider "$python_script" 1 2 > "$python_result" +python_unzipped="$(mktemp -d)" +python -m zipfile -e "$python_result" "$python_unzipped" +ls -lR "$python_unzipped" +test "$(cat "$python_unzipped/python")" == "12" From 20df947bb3a1e3644c950ed1b55c76b4048e69d3 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 19 Dec 2018 14:28:19 +0100 Subject: [PATCH 031/255] Better output for insider script results --- qa/insider | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/qa/insider b/qa/insider index 288c1899..f4745ad8 100755 --- a/qa/insider +++ b/qa/insider @@ -36,13 +36,17 @@ os.chmod( # Execute the script cmd = [executable.name] + args.arguments +returncode = 0 try: logger.debug("Executing %r", cmd) subprocess.check_call( cmd, - stderr=subprocess.STDOUT, stdout=sys.stderr, + **({"text": True} if sys.version_info.major > 2 else {}), ) +except subprocess.CalledProcessError as error: + logger.debug("Subcommand exception:", exc_info=True) + returncode = error.returncode finally: logger.debug("Deleting %s", executable.name) os.unlink(executable.name) @@ -52,9 +56,11 @@ finally: shutil.make_archive(artifacts_zip_path, "zip", "/qa/artifacts") artifacts_zip_path += ".zip" with open(artifacts_zip_path, "rb") as zip_fd, \ - os.fdopen(sys.stdout.fileno(), "wb") as stdout_bytes: - stdout_bytes.write(zip_fd.read()) - stdout_bytes.flush() + os.fdopen(sys.stdout.fileno(), "wb", closefd=False) as stdout: + stdout.write(zip_fd.read()) + stdout.flush() logger.debug("Deleting %s", artifacts_zip_path) os.unlink(artifacts_zip_path) + +sys.exit(returncode) From 262003818098912a783a85be3dd6fa6ade639ca6 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 7 Jan 2019 09:16:53 +0000 Subject: [PATCH 032/255] Do not log always the QA insider script The output of this scripts adds unneeded clutter to most CI run, where the developer doesn't really care about the CI script code, but about the Odoo code. So, when executing `/qa/insider`, there's an exception and we log the command as DEBUG level. --- bin/direxec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/direxec b/bin/direxec index e1d34224..e7249b12 100755 --- a/bin/direxec +++ b/bin/direxec @@ -4,6 +4,8 @@ import os import subprocess import sys +from logging import DEBUG, INFO + from psycopg2 import connect, OperationalError from doodbalib import logger, which @@ -51,5 +53,9 @@ if extra_command: os.environ["PTVSD_ARGS"].split() + extra_command ) - logger.info("Executing %s", " ".join(extra_command)) + logger.log( + DEBUG if extra_command[0] == "/qa/insider" else INFO, + "Executing %s", + " ".join(extra_command), + ) os.execvp(extra_command[0], extra_command) From fe41a23e0bc48725609aea8a67a00b94a6d35ca8 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 7 Jan 2019 11:38:02 +0000 Subject: [PATCH 033/255] Use Python 2+3 compatible code I was using the `text=True` argument, only in PY3+, for `subprocess.check_call`, but it turns out that argument only exists in PY3.7+, and this code is executed also by PY2.7 and PY3.5, depending on the Odoo image version. Instead, I just use now `universal_newlines=True`, which is the backwards-compatible equivalent to `text=True`. We'll change that when that backwards compatibility is removed and/or we only support PY3.7+ (a.k.a. only Odoo 12.0+). Also, when using Python 2, the `closefd` argument for `os.fdopen` is not available, so we need to use a lower-level system to write bytes to STDOUT. This system is used only for Python 2, and marked to be removed when Odoo 10 support is dropped. --- qa/insider | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/qa/insider b/qa/insider index f4745ad8..ff568d5e 100755 --- a/qa/insider +++ b/qa/insider @@ -42,7 +42,8 @@ try: subprocess.check_call( cmd, stdout=sys.stderr, - **({"text": True} if sys.version_info.major > 2 else {}), + # TODO Change to text=True when we support Python 3.7+ only + universal_newlines=True, ) except subprocess.CalledProcessError as error: logger.debug("Subcommand exception:", exc_info=True) @@ -55,10 +56,15 @@ finally: logger.debug("Zipping /qa/artifacts in %s.zip", artifacts_zip_path) shutil.make_archive(artifacts_zip_path, "zip", "/qa/artifacts") artifacts_zip_path += ".zip" - with open(artifacts_zip_path, "rb") as zip_fd, \ - os.fdopen(sys.stdout.fileno(), "wb", closefd=False) as stdout: - stdout.write(zip_fd.read()) - stdout.flush() + with open(artifacts_zip_path, "rb") as zip_fd: + if sys.version_info >= (3,): + with os.fdopen(sys.stdout.fileno(), "wb", closefd=False) as stdout: + stdout.write(zip_fd.read()) + stdout.flush() + # TODO Delete when dropping Python 2 (Odoo 10.0 and lower) support, + # as this is a less safe and idiomatic way of doing the same as above + else: + os.write(sys.stdout.fileno(), zip_fd.read()) logger.debug("Deleting %s", artifacts_zip_path) os.unlink(artifacts_zip_path) From 14b9fc6614639654e7639f1f0ea154c5ef694ea5 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 31 Jan 2019 07:53:12 +0000 Subject: [PATCH 034/255] Add phonenumbers in 12.0 This is a soft dependency in Odoo 12.0 for addons [`phone_validation`][1] and [`sms`][2]. IMHO it should be included by default. We want all Odoo features built-in out of the box. [1]: https://github.com/odoo/odoo/blob/8f4b98e67fe49516c0c830524de351db67c58357/addons/phone_validation/tools/phone_validation.py#L14 [2]: https://github.com/odoo/odoo/blob/8f4b98e67fe49516c0c830524de351db67c58357/addons/sms/wizard/send_sms.py#L13 --- 12.0.Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 8b630162..1f87aeb3 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -119,6 +119,7 @@ RUN debs="libldap2-dev libsasl2-dev" \ && apt-get install -yqq --no-install-recommends $debs \ && pip install \ -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + phonenumbers \ 'websocket-client~=0.53' \ && (python3 -m compileall -q /usr/local/lib/python3.7/ || true) \ && apt-get purge -yqq $debs \ From 3efef66bbef5864fc35dbddcbf738a6885061324 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 5 Feb 2019 08:27:37 +0000 Subject: [PATCH 035/255] Downgrade Python version to 3.5 in v12 This is the minimal version that is supported. --- 12.0.Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 1f87aeb3..0613a5c4 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7-stretch AS base +FROM python:3.5-stretch AS base # Enable Odoo user and filestore RUN useradd -md /home/odoo -s /bin/false odoo \ @@ -80,7 +80,7 @@ RUN pip install \ wdb \ && sync COPY bin/* /usr/local/bin/ -COPY lib/doodbalib /usr/local/lib/python3.7/site-packages/doodbalib +COPY lib/doodbalib /usr/local/lib/python3.5/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d @@ -88,7 +88,7 @@ RUN mkdir -p auto/addons custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ - && chmod -R a+rX /usr/local/lib/python3.7/site-packages/doodbalib \ + && chmod -R a+rX /usr/local/lib/python3.5/site-packages/doodbalib \ && sync # Doodba-QA dependencies in a separate virtualenv @@ -121,7 +121,7 @@ RUN debs="libldap2-dev libsasl2-dev" \ -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ phonenumbers \ 'websocket-client~=0.53' \ - && (python3 -m compileall -q /usr/local/lib/python3.7/ || true) \ + && (python3 -m compileall -q /usr/local/lib/python3.5/ || true) \ && apt-get purge -yqq $debs \ && rm -Rf /var/lib/apt/lists/* /tmp/* From 5419a6202b9386437465cec3027275812a84b57c Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 6 Feb 2019 10:01:25 +0000 Subject: [PATCH 036/255] Include click-odoo-contrib packages This should let us use click-odoo-update instead of autoupdate, and start moving custom scripts to a broader audience and a better supported odoo scripting framework. --- 11.0.Dockerfile | 1 + 12.0.Dockerfile | 1 + 8.0.Dockerfile | 9 ++++++++- README.md | 8 ++++++++ bin/autoupdate | 5 +++++ tests/__init__.py | 1 + 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index a6a490d1..33d4ed19 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -76,6 +76,7 @@ RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version ' WORKDIR /opt/odoo RUN pip install \ astor \ + click-odoo-contrib \ git-aggregator \ openupgradelib \ pg_activity \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 0613a5c4..55ef94a1 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -71,6 +71,7 @@ RUN ln -s /usr/bin/nodejs /usr/local/bin/node \ WORKDIR /opt/odoo RUN pip install \ astor \ + click-odoo-contrib \ git-aggregator \ openupgradelib \ pg_activity \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index c019baa6..b2b10b10 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -79,7 +79,14 @@ RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version ' # Other facilities WORKDIR /opt/odoo RUN pip install \ - git-aggregator openupgradelib ptvsd pudb virtualenv wdb + click-odoo-contrib \ + git-aggregator \ + openupgradelib \ + ptvsd \ + pudb \ + virtualenv \ + wdb \ + && sync COPY bin/* /usr/local/bin/ COPY lib/doodbalib /usr/local/lib/python2.7/dist-packages/doodbalib RUN ln -s /usr/local/lib/python2.7/dist-packages/doodbalib \ diff --git a/README.md b/README.md index 6fea10c5..8c839745 100644 --- a/README.md +++ b/README.md @@ -421,6 +421,12 @@ configuration. Call `addons --help` for usage instructions. +### `click-odoo` and related scripts + +The great [`click-odoo`][] scripting framework and the collection of scripts +found in [`click-odoo-contrib`][] are included. Refer to their sites to know +how to use them. + ### [`nano`][] The CLI text editor we all know, just in case you need to inspect some bug in @@ -1318,6 +1324,8 @@ scaffolding versions is preserved. [`private`]: #optodoocustomsrcprivate [`PYTHONOPTIMIZE=1`]: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONOPTIMIZE [`repos.yaml`]: #optodoocustomsrcreposyaml +[`click-odoo`]: https://github.com/acsone/click-odoo +[`click-odoo-contrib`]: https://github.com/acsone/click-odoo-contrib [builds]: https://hub.docker.com/r/tecnativa/doodba/builds/ [development]: #development [docker-socket-proxy]: https://hub.docker.com/r/tecnativa/docker-socket-proxy/ diff --git a/bin/autoupdate b/bin/autoupdate index 41f0102c..cc9bd68e 100755 --- a/bin/autoupdate +++ b/bin/autoupdate @@ -1,6 +1,11 @@ #!/usr/local/bin/python-odoo-shell +import logging import os +_logger = logging.getLogger("autoupdate") + +# TODO Delete this script at some point +_logger.warning("`autoupdate` is DEPRECATED. Use click-odoo-update instead.") # Note: ``module_auto_update`` must be installed in Odoo for this to work. try: diff --git a/tests/__init__.py b/tests/__init__.py index cdd0b040..f7296e3d 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -221,6 +221,7 @@ def test_smallest(self): ODOO_PREFIX + ("--init", "base"), # Auto updater must work ("autoupdate",), + ("click-odoo-update",), ) smallest_dir = join(SCAFFOLDINGS_DIR, "smallest") for sub_env in matrix(odoo_skip={"8.0"}): From 3f5644dd3e3892ffbe4e854d634f4012b2a59b71 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 10 Oct 2018 10:54:41 +0100 Subject: [PATCH 037/255] Fix removal of wanted files Previous implementation of `400-clean` build script was expecting a very specific directory structure of `repo/addons`, or otherwise it could be removing things that you actually wanted. Imagine for instance that 2 doodba projects share the same private addons, so you add them in `odoo/src/private` in the 1st one, and link them in the 2nd one with repos+addons combination, adding something like this to `addons.yaml`: ```yaml other-doodba/odoo/src/private: - custom_other_addon ``` Previous implementation of the clean step would be removing the `other-doodba` folder entierly, as it was not following the expected structure. This new implementation is smarter: 1. Preserve all Odoo source code, outside of its `addons` folder (which is handled as a normal addons repo, to be able to restrict them if wanted). 2. For other folders, check if it can be found inside an activated addons path. If not, remove it. 3. Repeat, recursively, bottom-up. It should be more flexible and less error-prone. A test that was testing the cleanup has been slightly modified to support this use case. --- build.d/400-clean | 74 +++++++++++-------- lib/doodbalib/__init__.py | 1 + tests/__init__.py | 2 +- .../scaffoldings/dotd/custom/src/addons.yaml | 2 +- .../src/dummy_repo/product/__manifest__.py | 3 - .../odoo/src/private}/dummy_addon/__init__.py | 0 .../src/private}/dummy_addon/__manifest__.py | 0 .../odoo/src/private}/product/__init__.py | 0 .../odoo/src/private/product/__manifest__.py | 3 + 9 files changed, 49 insertions(+), 36 deletions(-) delete mode 100644 tests/scaffoldings/dotd/custom/src/dummy_repo/product/__manifest__.py rename tests/scaffoldings/dotd/custom/src/{dummy_repo => other-doodba/odoo/src/private}/dummy_addon/__init__.py (100%) rename tests/scaffoldings/dotd/custom/src/{dummy_repo => other-doodba/odoo/src/private}/dummy_addon/__manifest__.py (100%) rename tests/scaffoldings/dotd/custom/src/{dummy_repo => other-doodba/odoo/src/private}/product/__init__.py (100%) create mode 100644 tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/product/__manifest__.py diff --git a/build.d/400-clean b/build.d/400-clean index d92bfc59..eef3ac28 100755 --- a/build.d/400-clean +++ b/build.d/400-clean @@ -4,43 +4,55 @@ import os import shutil import sys -from doodbalib import addons_config, CORE, CLEAN, logger, PRIVATE, SRC_DIR +from doodbalib import ( + addons_config, + CLEAN, + logger, + ODOO_DIR, + PRIVATE_DIR, + SRC_DIR, +) if not CLEAN: logger.warning("Not cleaning garbage") sys.exit() -addons = set(addons_config(filtered=False)) -repos = {addon[1] for addon in addons} | {CORE, PRIVATE} -for directory in os.listdir(SRC_DIR): - # Special directories must be preserved - if directory == "odoo": - directory = CORE +# Get the enabled paths +repos_addons = {} +for addon, repo in addons_config(filtered=False): + repo_path = os.path.realpath(os.path.join(SRC_DIR, repo)) + repos_addons.setdefault(repo_path, set()) + repos_addons[repo_path].add(addon) +logger.debug("Addon paths enabled: %s", repos_addons) - # Skip regular files - full = os.path.join(SRC_DIR, directory) - if not os.path.isdir(full): +# Traverse src dir and remove anything not explicitly enabled +for directory, subdirectories, subfiles in os.walk(SRC_DIR): + logger.debug("Checking for cleanup directory %s", directory) + # Skip main src directory + if directory == SRC_DIR: continue - - # Remove directories not listed in addons.yaml - if directory not in repos: - logger.info("Removing directory %s", full) - try: - shutil.rmtree(full) - except OSError: - os.unlink(full) + # Always skip private/* + if directory == PRIVATE_DIR: + subdirectories[:] = [] continue - - # Traverse addons - for subdirectory in os.listdir(full): - subfull = os.path.join(full, subdirectory) - # Skip regular files - if not os.path.isdir(subfull): + # Inside the odoo dir, skip all but addons dir + if directory == ODOO_DIR: + subdirectories[:] = ["addons"] + continue + try: + # Get addons enalbed in current directory + enabled_addons = repos_addons[directory] + except KeyError: + # This isn't a repo; is there anything inside to preserve? + directory += os.path.sep + if any(repo.startswith(directory) for repo in repos_addons): + # Then, let's walk in; we'll remove later if needed continue - # Remove addon if not used - if (subdirectory, directory) not in addons: - logger.info("Removing subdirectory %s", subfull) - try: - shutil.rmtree(subfull) - except OSError: - os.unlink(subfull) + else: + # This is an addons repo; do not walk into the enabled ones + for addon in enabled_addons: + subdirectories.remove(addon) + continue + # Remove every other directory + logger.info("Removing directory %s", directory) + shutil.rmtree(directory) diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index e1c8d0b1..3f3ffa7f 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -41,6 +41,7 @@ CORE = "odoo/addons" PRIVATE_DIR = os.path.join(SRC_DIR, PRIVATE) CORE_DIR = os.path.join(SRC_DIR, CORE) +ODOO_DIR = os.path.join(SRC_DIR, "odoo") ODOO_VERSION = os.environ["ODOO_VERSION"] MANIFESTS = ("__manifest__.py", "__openerp__.py") if ODOO_VERSION in {"8.0", "9.0"}: diff --git a/tests/__init__.py b/tests/__init__.py index f7296e3d..0af3924c 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -147,7 +147,7 @@ def test_addons_filtered(self): # Addon from extra repo takes higher priority than core version ("realpath", "auto/addons/product"), ("bash", "-c", 'test "$(realpath auto/addons/product)" == ' - '/opt/odoo/custom/src/dummy_repo/product'), + '/opt/odoo/custom/src/other-doodba/odoo/src/private/product'), ("bash", "-c", 'test "$(addons list -e)" == dummy_addon,product'), ) diff --git a/tests/scaffoldings/dotd/custom/src/addons.yaml b/tests/scaffoldings/dotd/custom/src/addons.yaml index f4689cb2..41128ef9 100644 --- a/tests/scaffoldings/dotd/custom/src/addons.yaml +++ b/tests/scaffoldings/dotd/custom/src/addons.yaml @@ -1,4 +1,4 @@ -dummy_repo: +other-doodba/odoo/src/private: - absent_addon - dummy_addon - product diff --git a/tests/scaffoldings/dotd/custom/src/dummy_repo/product/__manifest__.py b/tests/scaffoldings/dotd/custom/src/dummy_repo/product/__manifest__.py deleted file mode 100644 index a77ba4fd..00000000 --- a/tests/scaffoldings/dotd/custom/src/dummy_repo/product/__manifest__.py +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "dummy_repo/product", -} diff --git a/tests/scaffoldings/dotd/custom/src/dummy_repo/dummy_addon/__init__.py b/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/dummy_addon/__init__.py similarity index 100% rename from tests/scaffoldings/dotd/custom/src/dummy_repo/dummy_addon/__init__.py rename to tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/dummy_addon/__init__.py diff --git a/tests/scaffoldings/dotd/custom/src/dummy_repo/dummy_addon/__manifest__.py b/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/dummy_addon/__manifest__.py similarity index 100% rename from tests/scaffoldings/dotd/custom/src/dummy_repo/dummy_addon/__manifest__.py rename to tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/dummy_addon/__manifest__.py diff --git a/tests/scaffoldings/dotd/custom/src/dummy_repo/product/__init__.py b/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/product/__init__.py similarity index 100% rename from tests/scaffoldings/dotd/custom/src/dummy_repo/product/__init__.py rename to tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/product/__init__.py diff --git a/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/product/__manifest__.py b/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/product/__manifest__.py new file mode 100644 index 00000000..3a269390 --- /dev/null +++ b/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/product/__manifest__.py @@ -0,0 +1,3 @@ +{ + "name": "other-doodba/product", +} From c6f3bb010d27ea82307958bc0f990c7e8ce49f88 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 12 Feb 2019 10:46:40 +0000 Subject: [PATCH 038/255] Include click-odoo-update with parallel support This is a preview feature. Before https://github.com/Tecnativa/doodba/pull/200, the only way to autoupdate addons was to use [OCA's `module_auto_update` module](https://www.odoo.com/apps/modules/11.0/module_auto_update/). As a preview feature, I'm pre-merging https://github.com/acsone/click-odoo-contrib/pull/38 here in Doodba, to allow trusted parallel upgrades everywhere. However, this should be considered a beta feature. This commit should be reverted when the above PR is merged in upstream click-odoo-contrib package. Closes https://github.com/Tecnativa/doodba/pull/160. --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 8.0.Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 33d4ed19..5958366c 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -76,7 +76,7 @@ RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version ' WORKDIR /opt/odoo RUN pip install \ astor \ - click-odoo-contrib \ + git+https://github.com/Tecnativa/click-odoo-contrib.git@update-parallel-db-lock-watcher#egg=click-odoo-contrib \ git-aggregator \ openupgradelib \ pg_activity \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 55ef94a1..a05bb22b 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -71,7 +71,7 @@ RUN ln -s /usr/bin/nodejs /usr/local/bin/node \ WORKDIR /opt/odoo RUN pip install \ astor \ - click-odoo-contrib \ + git+https://github.com/Tecnativa/click-odoo-contrib.git@update-parallel-db-lock-watcher#egg=click-odoo-contrib \ git-aggregator \ openupgradelib \ pg_activity \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index b2b10b10..ed09bef1 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -79,7 +79,7 @@ RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version ' # Other facilities WORKDIR /opt/odoo RUN pip install \ - click-odoo-contrib \ + git+https://github.com/Tecnativa/click-odoo-contrib.git@update-parallel-db-lock-watcher#egg=click-odoo-contrib \ git-aggregator \ openupgradelib \ ptvsd \ From eae43976d91c949f8f66dbecfb4dd55a3fc8444b Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 14 Feb 2019 09:43:11 +0000 Subject: [PATCH 039/255] Allow to set list_db parameter by env variable This should allow us to disable the database manager at will in environments, removing the need to protect those controllers through the external proxy. --- 11.0.Dockerfile | 1 + 12.0.Dockerfile | 1 + 8.0.Dockerfile | 1 + conf.d/20-database.conf | 1 + 4 files changed, 4 insertions(+) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 5958366c..c8f0f8e0 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -18,6 +18,7 @@ ENV DB_FILTER=.* \ GIT_AUTHOR_NAME=docker-odoo \ INITIAL_LANG="" \ LC_ALL=C.UTF-8 \ + LIST_DB=false \ NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \ OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ PATH="/home/odoo/.local/bin:$PATH" \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index a05bb22b..44a7686d 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -18,6 +18,7 @@ ENV DB_FILTER=.* \ GIT_AUTHOR_NAME=docker-odoo \ INITIAL_LANG="" \ LC_ALL=C.UTF-8 \ + LIST_DB=false \ NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \ OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ PATH="/home/odoo/.local/bin:$PATH" \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index ed09bef1..1f18fbfc 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -18,6 +18,7 @@ ENV DB_FILTER=.* \ GIT_AUTHOR_NAME=docker-odoo \ INITIAL_LANG="" \ LC_ALL=C.UTF-8 \ + LIST_DB=false \ NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \ OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ PATH="/home/odoo/.local/bin:$PATH" \ diff --git a/conf.d/20-database.conf b/conf.d/20-database.conf index dd6074e9..5d214022 100644 --- a/conf.d/20-database.conf +++ b/conf.d/20-database.conf @@ -5,3 +5,4 @@ db_host = $PGHOST db_port = $PGPORT db_name = $PGDATABASE dbfilter = $DB_FILTER +list_db = $LIST_DB From 5c74086081f202110a06c46de78e53dbabe13a51 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 21 Feb 2019 12:19:24 +0000 Subject: [PATCH 040/255] Remove test workarounds for v12 Fix https://github.com/Tecnativa/doodba/issues/170. --- tests/__init__.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 0af3924c..45bc6f87 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -24,11 +24,6 @@ "PG_VERSIONS", "10").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") -# TODO Remove when required OCA addons for 12.0 are released, and fix errors -skip_12 = unittest.skipIf( - ODOO_VERSIONS == {"12.0"}, - "Test not ready for OCB 12.0") - def matrix(odoo=ODOO_VERSIONS, pg=PG_VERSIONS, odoo_skip=frozenset(), pg_skip=frozenset()): @@ -96,7 +91,6 @@ def compose_test(self, workdir, sub_env, *commands): env=full_env, ) - @skip_12 def test_addons_filtered(self): """Test addons filtering with ``ONLY`` keyword in ``addons.yaml``.""" project_dir = join(SCAFFOLDINGS_DIR, "dotd") @@ -273,7 +267,6 @@ def test_dotd(self): ("--version",), ) - @skip_12 def test_dependencies(self): """Test dependencies installation.""" dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies") From 95b23eb461e78c8b4ac606c1029b332aeea4df6d Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 5 Mar 2019 08:46:31 +0000 Subject: [PATCH 041/255] Fix bug in docs. `auto/odoo.conf` is expanded in the entrypoint now. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8c839745..8e6f2497 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ and then subsequently run. #### `/opt/odoo/custom/conf.d` Files here will be environment-variable-expanded and concatenated in -`/opt/odoo/auto/odoo.conf` at build time. +`/opt/odoo/auto/odoo.conf` in the entrypoint. #### `/opt/odoo/custom/ssh` From ed9bfd6d9dd22ad74af07691a875c3ebd66fb98b Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 14 Mar 2019 10:36:40 +0000 Subject: [PATCH 042/255] Document outsourcing of secrets - Document changes from https://github.com/Tecnativa/doodba-scaffolding/pull/24. - Remove scaffolding tests. Since https://github.com/Tecnativa/doodba-scaffolding/pull/15, the scaffolding has its own tests, and these are very hard to maintain. --- README.md | 18 ++++++++++++++-- tests/__init__.py | 54 +---------------------------------------------- 2 files changed, 17 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 8e6f2497..7a2da891 100644 --- a/README.md +++ b/README.md @@ -745,12 +745,24 @@ change many things inside it, it's just a guideline. It includes pluggable `smtp` and `backup` services. +###### Adding secrets + +Before booting this environment, you need to create a few files, which are +excluded in Git and contain some secrets, needed to make this environment +safe: + +- `./.docker/odoo.env` must define `ADMIN_PASSWORD`. +- `./.docker/db-access.env` must define `PGPASSWORD`. +- `./.docker/db-creation.env` must define `POSTGRES_PASSWORD` (must be equal to `PGPASSWORD` above). +- `./.docker/smtp.env` must define `MAIL_RELAY_PASS` (password to access the real SMTP relay). +- `./.docker/backup.env` must define `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` (obtained from S3 provider) and `PASSPHRASE` (to encrypt backup archives). + +###### Booting production + Once you fixed everything needed, run it with: docker-compose -f prod.yaml up --build --remove-orphans -Remember that you will want to backup the filestore in `/var/lib/odoo` volume. - ###### Global inverse proxy For [production][] and [test][] templates to work fine, you need to have a @@ -857,6 +869,8 @@ but *removing possible pollution points*: - It is [isolated](#network-isolation). +To use it, you need to [add secrets files just like for production](#adding-secrets), although secrets for smtp and backup containers are not needed because those don't exist here. + Test it in your machine with: docker-compose -f test.yaml up --build diff --git a/tests/__init__.py b/tests/__init__.py index 45bc6f87..f2c89a62 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -4,18 +4,15 @@ Each test must be a valid docker-compose.yaml file with a ``odoo`` service. """ import logging -import tempfile import unittest from itertools import product -from os import environ, getlogin +from os import environ from os.path import dirname, join -from pwd import getpwnam from subprocess import Popen logging.basicConfig(level=logging.DEBUG) -MAIN_SCAFFOLDING_VERSION = "11.0" DIR = dirname(__file__) ODOO_PREFIX = ("odoo", "--stop-after-init", "--workers=0") ODOO_VERSIONS = frozenset(environ.get( @@ -304,55 +301,6 @@ def test_dependencies(self): ("aloha_world",), ) - @unittest.skipUnless( - MAIN_SCAFFOLDING_VERSION in ODOO_VERSIONS, - "Main scaffolding version is not being tested") - def test_main_scaffolding(self): - """Test the official scaffolding.""" - with tempfile.TemporaryDirectory() as tmpdirname: - # Clone main scaffolding - self.popen( - ("git", "clone", "--depth", "1", - "https://github.com/Tecnativa/doodba-scaffolding.git"), - cwd=tmpdirname, - ) - # Create needed external networks - for network in ("inverseproxy_shared", "globalwhitelist_shared"): - self.popen(("docker", "network", "create", network)) - tmpdirname = join(tmpdirname, "doodba-scaffolding") - # Special env keys for setup-devel - pwdata = getpwnam(environ["USER"]) - setup_env = { - "COMPOSE_FILE": "setup-devel.yaml", - # Avoid unlink permission errors - "UID": str(pwdata.pw_uid), - "GID": str(pwdata.pw_gid), - } - # TODO Test all supported versions - for sub_env in matrix(odoo={MAIN_SCAFFOLDING_VERSION}): - # Setup the devel environment - self.compose_test(tmpdirname, dict(sub_env, **setup_env), ()) - # Travis seems to have a different UID than 1000 - if environ.get("TRAVIS"): - self.popen( - ("sudo", "chown", "1000:1000", - join(tmpdirname, "odoo", "auto", "addons")), - ) - # Test all 3 official environments - for dcfile in ("devel", "test", "prod"): - sub_env["COMPOSE_FILE"] = "{}.yaml".format(dcfile) - self.compose_test( - tmpdirname, sub_env, - # ``odoo`` command works - ("odoo", "--version"), - ) - # Restore owner in Travis so directory can be removed - if environ.get("TRAVIS"): - self.popen( - ("sudo", "chown", "-R", "{0}:{0}".format(getlogin()), - join(tmpdirname, "odoo", "auto", "addons")), - ) - if __name__ == "__main__": unittest.main() From 4db092e12f6323f272d0b8b32f13704d2bf07ee9 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 21 Mar 2019 08:48:55 +0000 Subject: [PATCH 043/255] Use tecnativa/postgres-autoconf in dotd tests This will just test that this image that will be introduced in https://github.com/Tecnativa/doodba-scaffolding/pull/26 is a drop-in replacement for most use cases. --- tests/scaffoldings/dotd/docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scaffoldings/dotd/docker-compose.yaml b/tests/scaffoldings/dotd/docker-compose.yaml index 22a0119d..fbbaec8d 100644 --- a/tests/scaffoldings/dotd/docker-compose.yaml +++ b/tests/scaffoldings/dotd/docker-compose.yaml @@ -18,7 +18,7 @@ services: - filestore:/var/lib/odoo:z postgresql: - image: postgres:${DB_VERSION}-alpine + image: tecnativa/postgres-autoconf:${DB_VERSION}-alpine environment: POSTGRES_USER: another_odoo POSTGRES_PASSWORD: anotherodoopassword From 704517c4f015bebf046a282762748992879b2d90 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 26 Mar 2019 14:03:50 +0000 Subject: [PATCH 044/255] Disable the jessie-updates repo in old images Images for Odoo v8-10, based on Debian 8, started to display errors when doing `apt-get update`. The reason is that [the `jessie-updates` apt repo has been removed from apt mirrors](https://lists.debian.org/debian-devel-announce/2019/03/msg00006.html). I might consider updating the base OS, but for now IMHO the safest thing to do is to remove that repo. --- 8.0.Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 1f18fbfc..1ce734d9 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -37,7 +37,8 @@ ENV DB_FILTER=.* \ # Other requirements and recommendations to run Odoo # See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control -RUN apt-get update \ +RUN sed -Ei 's@(^deb http://deb.debian.org/debian jessie-updates main$)@#\1@' /etc/apt/sources.list \ + && apt-get update \ && apt-get -y upgrade \ && apt-get install -y --no-install-recommends \ python ruby-compass \ From 1d0be230a70a5ef4b2a9ef079446c4b4f3bf30c0 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 21 Mar 2019 09:06:10 +0000 Subject: [PATCH 045/255] Supress yaml.load security warning Last builds were saying about previous call to `yaml.load()`: /usr/local/lib/python3.5/site-packages/doodbalib/__init__.py:93: YAMLLoadWarning: calling yaml.load_all() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. Using the safe loader now. --- lib/doodbalib/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index 3f3ffa7f..2f56f3d3 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -90,7 +90,7 @@ def addons_config(filtered=True, strict=False): all_globs = {} try: with open(ADDONS_YAML) as addons_file: - for doc in yaml.load_all(addons_file): + for doc in yaml.safe_load_all(addons_file): # Skip sections with ONLY and that don't match only = doc.pop("ONLY", {}) if not filtered: From cb9c186cbc7249c6b6b53e9c81c17f301e790690 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 1 Apr 2019 12:09:26 +0100 Subject: [PATCH 046/255] Do not --upgrade when installing pip dependencies It can lead to unexpected or unneeded upgrades, making downstream images bigger and less stable. If you really need a newer (or older) version of any dependency than the one bundled (the one shipped from Odoo `requirements.txt` file), all you have to do is pin it in the scaffolding's `pip.txt` file. --- lib/doodbalib/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/doodbalib/installer.py b/lib/doodbalib/installer.py index 701c6337..10c39950 100644 --- a/lib/doodbalib/installer.py +++ b/lib/doodbalib/installer.py @@ -101,7 +101,7 @@ class NpmInstaller(Installer): class PipInstaller(Installer): - _install_command = ["pip", "install", "--upgrade", "--no-cache-dir", "-r"] + _install_command = ["pip", "install", "--no-cache-dir", "-r"] def requirements(self): """Pip will use its ``--requirements`` feature.""" From 3366eddb0f5c6d4e6a45bcf05a2c222b41954c6c Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 2 Apr 2019 12:26:59 +0100 Subject: [PATCH 047/255] Remove openupgradelib Being practical, most of the time you need to install this library from git master. Since https://github.com/Tecnativa/doodba/pull/213 adding [the corresponding line][1] to the scaffolding didn't actually install the version from master. The pip requirements file doesn't have a way to force updating a dependency when it is already installed from git. It seems the easiest way to fix the situation is to remove `openupgradelib` from the base image. If you really need it, install it when building your subimage, either from pip or from git, however you want. [1]: https://github.com/Tecnativa/doodba-scaffolding/blob/55a5e1b3ba65bec8604f3260e361f8b6a1d64b2e/odoo/custom/dependencies/pip.txt#L1 --- 11.0.Dockerfile | 1 - 12.0.Dockerfile | 1 - 8.0.Dockerfile | 1 - 3 files changed, 3 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index c8f0f8e0..f38945f3 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -79,7 +79,6 @@ RUN pip install \ astor \ git+https://github.com/Tecnativa/click-odoo-contrib.git@update-parallel-db-lock-watcher#egg=click-odoo-contrib \ git-aggregator \ - openupgradelib \ pg_activity \ ptvsd \ pudb \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 44a7686d..cef68819 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -74,7 +74,6 @@ RUN pip install \ astor \ git+https://github.com/Tecnativa/click-odoo-contrib.git@update-parallel-db-lock-watcher#egg=click-odoo-contrib \ git-aggregator \ - openupgradelib \ pg_activity \ ptvsd \ pudb \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 1ce734d9..6a95f761 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -83,7 +83,6 @@ WORKDIR /opt/odoo RUN pip install \ git+https://github.com/Tecnativa/click-odoo-contrib.git@update-parallel-db-lock-watcher#egg=click-odoo-contrib \ git-aggregator \ - openupgradelib \ ptvsd \ pudb \ virtualenv \ From df4c705806addfeb299e404f1357c82ce93c53d5 Mon Sep 17 00:00:00 2001 From: Hans Henrik Gabelgaard Date: Thu, 4 Apr 2019 22:34:12 +0200 Subject: [PATCH 048/255] yaml.load security warning I'm gettings warnings when running setup-devel: /usr/local/bin/autoaggregate:87: YAMLLoadWarning: calling yaml.load_all() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. for doc in yaml.load_all(yaml_file): /usr/local/bin/autoaggregate:95: YAMLLoadWarning: calling yaml.load_all() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. for doc in yaml.load_all(yaml_file): Looks a lot like #209 BTW, Thanks ffor a GREAT project! --- bin/autoaggregate | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/autoaggregate b/bin/autoaggregate index 49f1a1ee..6328e74b 100755 --- a/bin/autoaggregate +++ b/bin/autoaggregate @@ -84,7 +84,7 @@ def missing_repos_config(): # Find the repositories defined by hand try: with open(REPOS_YAML) as yaml_file: - for doc in yaml.load_all(yaml_file): + for doc in yaml.safe_load_all(yaml_file): for repo in doc: defined.add(os.path.abspath(os.path.join(SRC_DIR, repo))) except (IOError, AttributeError): @@ -92,7 +92,7 @@ def missing_repos_config(): # Find the repositories that should be present try: with open(ADDONS_YAML) as yaml_file: - for doc in yaml.load_all(yaml_file): + for doc in yaml.safe_load_all(yaml_file): for repo in doc: if repo in {PRIVATE, CORE, "ONLY"}: continue From 6bf0b3979a5df2d5eee4e8eb23cd954a15f17954 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 15 Apr 2019 13:40:00 +0100 Subject: [PATCH 049/255] Filter db when testing addons [In Odoo v12, tours do not know the database being used](https://github.com/odoo/odoo/issues/32687). This is a simple workaround that lets us keep on working in v12 as before, and should be backwards compatible. The fix is to add `--db-filter "^$PGDATABASE$"` to the command. This can be rolled back when fixed upstream. --- bin/addons | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/addons b/bin/addons index 5342860a..1b5bccd8 100755 --- a/bin/addons +++ b/bin/addons @@ -104,5 +104,10 @@ else: command = ["odoo", "--stop-after-init", "--{}".format(args.action), addons] if args.test: command += ["--test-enable", "--workers", "0"] + if os.environ.get("PGDATABASE"): + command += [ + "--db-filter", + u"^{}$".format(os.environ.get("PGDATABASE")), + ] logger.info("Executing %s", " ".join(command)) check_call(command) From 1ac97290351a859d93313189c0685b96f23748a9 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 16 Apr 2019 09:31:35 +0100 Subject: [PATCH 050/255] Include ffmpeg in v12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Odoo v12 supports logging a screencast of failed tours when `ffmpeg` is present and `--logfile` is supplied. Obviously, including `ffmpeg` here. Screencasts everywhere! šŸ“¹ --- 12.0.Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/12.0.Dockerfile b/12.0.Dockerfile index cef68819..4448a1bf 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -41,6 +41,7 @@ RUN apt-get -qq update \ && apt-get -yqq upgrade \ && apt-get install -yqq --no-install-recommends \ chromium \ + ffmpeg \ fonts-liberation2 \ gettext-base \ gnupg2 \ From 0d20f604e080321f1d6a7d5319a5084af60e1055 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Tue, 7 May 2019 09:44:10 +0200 Subject: [PATCH 051/255] [IMP] enable using other uids than 1000 for odoo user Co-authored-by: Jairo Llopis --- 11.0.Dockerfile | 29 +++++++++-------- 12.0.Dockerfile | 29 +++++++++-------- 8.0.Dockerfile | 28 +++++++++------- README.md | 1 - tests/__init__.py | 31 ++++++++++++++++++ tests/scaffoldings/uids_1001/Dockerfile | 2 ++ .../uids_1001/custom/src/addons.yaml | 0 .../uids_1001/custom/src/repos.yaml | 11 +++++++ .../uids_1001/docker-compose.yaml | 32 +++++++++++++++++++ tests/scaffoldings/uids_default/Dockerfile | 2 ++ .../uids_default/custom/src/addons.yaml | 0 .../uids_default/custom/src/repos.yaml | 11 +++++++ .../uids_default/docker-compose.yaml | 30 +++++++++++++++++ 13 files changed, 167 insertions(+), 39 deletions(-) create mode 100644 tests/scaffoldings/uids_1001/Dockerfile create mode 100644 tests/scaffoldings/uids_1001/custom/src/addons.yaml create mode 100644 tests/scaffoldings/uids_1001/custom/src/repos.yaml create mode 100644 tests/scaffoldings/uids_1001/docker-compose.yaml create mode 100644 tests/scaffoldings/uids_default/Dockerfile create mode 100644 tests/scaffoldings/uids_default/custom/src/addons.yaml create mode 100644 tests/scaffoldings/uids_default/custom/src/repos.yaml create mode 100644 tests/scaffoldings/uids_default/docker-compose.yaml diff --git a/11.0.Dockerfile b/11.0.Dockerfile index f38945f3..3f545eda 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -1,11 +1,5 @@ FROM python:3.5-stretch AS base -# Enable Odoo user and filestore -RUN useradd -md /home/odoo -s /bin/false odoo \ - && mkdir -p /var/lib/odoo \ - && chown -R odoo:odoo /var/lib/odoo \ - && sync -VOLUME ["/var/lib/odoo"] EXPOSE 8069 8072 ARG MQT=https://github.com/OCA/maintainer-quality-tools.git @@ -112,8 +106,6 @@ RUN python -m venv --system-site-packages /qa/venv \ && npm install --loglevel error --prefix /qa eslint \ && deactivate \ && mkdir -p /qa/artifacts \ - && chown -R odoo:odoo /qa/artifacts \ - && chmod a=rwX /qa/artifacts \ && git clone --depth 1 $MQT /qa/mqt # Execute installation script by Odoo version @@ -131,11 +123,6 @@ RUN debs="libldap2-dev libsasl2-dev" \ && apt-get purge -yqq $debs \ && rm -Rf /var/lib/apt/lists/* /tmp/* -# HACK Special case for Werkzeug -USER odoo -RUN pip install --user Werkzeug==0.14.1 -USER root - # Metadata ARG VCS_REF ARG BUILD_DATE @@ -195,6 +182,19 @@ ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ WITHOUT_DEMO="$WITHOUT_DEMO" ONBUILD ARG LOCAL_CUSTOM_DIR=./custom ONBUILD COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom + +# Enable setting custom uids for odoo user during build of scaffolds +ONBUILD ARG UID=1000 +ONBUILD ARG GID=1000 + +# Enable Odoo user and filestore +ONBUILD RUN groupadd -g $GID odoo \ + && useradd -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && sync + # https://docs.python.org/3/library/logging.html#levels ONBUILD ARG LOG_LEVEL=INFO ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ @@ -202,4 +202,7 @@ ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ && sync ONBUILD RUN /opt/odoo/common/build && sync +ONBUILD VOLUME ["/var/lib/odoo"] ONBUILD USER odoo +# HACK Special case for Werkzeug +ONBUILD RUN pip install --user Werkzeug==0.14.1 diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 4448a1bf..84f59b62 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -1,11 +1,5 @@ FROM python:3.5-stretch AS base -# Enable Odoo user and filestore -RUN useradd -md /home/odoo -s /bin/false odoo \ - && mkdir -p /var/lib/odoo \ - && chown -R odoo:odoo /var/lib/odoo \ - && sync -VOLUME ["/var/lib/odoo"] EXPOSE 8069 8072 ARG MQT=https://github.com/OCA/maintainer-quality-tools.git @@ -106,8 +100,6 @@ RUN python -m venv --system-site-packages /qa/venv \ && npm install --loglevel error --prefix /qa eslint \ && deactivate \ && mkdir -p /qa/artifacts \ - && chown -R odoo:odoo /qa/artifacts \ - && chmod a=rwX /qa/artifacts \ && git clone --depth 1 $MQT /qa/mqt # Execute installation script by Odoo version @@ -127,11 +119,6 @@ RUN debs="libldap2-dev libsasl2-dev" \ && apt-get purge -yqq $debs \ && rm -Rf /var/lib/apt/lists/* /tmp/* -# HACK Special case for Werkzeug -USER odoo -RUN pip install --user Werkzeug==0.14.1 -USER root - # Metadata ARG VCS_REF ARG BUILD_DATE @@ -191,6 +178,19 @@ ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ WITHOUT_DEMO="$WITHOUT_DEMO" ONBUILD ARG LOCAL_CUSTOM_DIR=./custom ONBUILD COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom + +# Enable setting custom uids for odoo user during build of scaffolds +ONBUILD ARG UID=1000 +ONBUILD ARG GID=1000 + +# Enable Odoo user and filestore +ONBUILD RUN groupadd -g $GID odoo \ + && useradd -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && sync + # https://docs.python.org/3/library/logging.html#levels ONBUILD ARG LOG_LEVEL=INFO ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ @@ -198,4 +198,7 @@ ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ && sync ONBUILD RUN /opt/odoo/common/build && sync +ONBUILD VOLUME ["/var/lib/odoo"] ONBUILD USER odoo +# HACK Special case for Werkzeug +ONBUILD RUN pip install --user Werkzeug==0.14.1 diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 6a95f761..b82b6acc 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -1,11 +1,5 @@ FROM debian:8 AS base -# Enable Odoo user and filestore -RUN useradd -md /home/odoo -s /bin/false odoo \ - && mkdir -p /var/lib/odoo \ - && chown -R odoo:odoo /var/lib/odoo \ - && sync -VOLUME ["/var/lib/odoo"] EXPOSE 8069 8072 ARG MQT=https://github.com/OCA/maintainer-quality-tools.git @@ -115,8 +109,6 @@ RUN virtualenv --system-site-packages /qa/venv \ && npm install --loglevel error --prefix /qa eslint \ && deactivate \ && mkdir -p /qa/artifacts \ - && chown -R odoo:odoo /qa/artifacts \ - && chmod a=rwX /qa/artifacts \ && git clone --depth 1 $MQT /qa/mqt # Execute installation script by Odoo version @@ -128,10 +120,6 @@ ENV ODOO_VERSION="$ODOO_VERSION" RUN install.sh RUN pip install pg_activity -# HACK Special case for Werkzeug -USER odoo -RUN pip install --user Werkzeug==0.14.1 - # Metadata ARG VCS_REF ARG BUILD_DATE @@ -192,6 +180,19 @@ ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ WITHOUT_DEMO="$WITHOUT_DEMO" ONBUILD ARG LOCAL_CUSTOM_DIR=./custom ONBUILD COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom + +# Enable setting custom uids for odoo user during build of scaffolds +ONBUILD ARG UID=1000 +ONBUILD ARG GID=1000 + +# Enable Odoo user and filestore +ONBUILD RUN groupadd -g $GID odoo \ + && useradd -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo /qa/artifacts\ + && chmod a=rwX /qa/artifacts \ + && sync + # https://docs.python.org/2.7/library/logging.html#levels ONBUILD ARG LOG_LEVEL=INFO ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ @@ -199,4 +200,7 @@ ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ && sync ONBUILD RUN /opt/odoo/common/build && sync +ONBUILD VOLUME ["/var/lib/odoo"] ONBUILD USER odoo +# HACK Special case for Werkzeug +ONBUILD RUN pip install --user Werkzeug==0.14.1 diff --git a/README.md b/README.md index 7a2da891..45c0ac24 100644 --- a/README.md +++ b/README.md @@ -621,7 +621,6 @@ Then run these Bash commands: git clone https://github.com/Tecnativa/doodba-scaffolding.git myproject cd myproject ln -s devel.yaml docker-compose.yml -chown -R $USER:1000 odoo/auto chmod -R ug+rwX odoo/auto export UID GID="$(id -g $USER)" UMASK="$(umask)" docker-compose build --pull diff --git a/tests/__init__.py b/tests/__init__.py index f2c89a62..b4f847e5 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -301,6 +301,37 @@ def test_dependencies(self): ("aloha_world",), ) + def test_modified_uids(self): + """tests if we can build an image with a custom uid and gid of odoo""" + uids_dir = join(SCAFFOLDINGS_DIR, "uids_1001") + for sub_env in matrix(): + self.compose_test( + uids_dir, sub_env, + # verify that odoo user has the given ids + ("bash", "-c", 'test "$(id -u)" == "1001"'), + ("bash", "-c", 'test "$(id -g)" == "1002"'), + ("bash", "-c", 'test "$(id -u -n)" == "odoo"'), + # all those directories need to belong to odoo (user or group odoo) + ("bash", "-c", 'test "$(stat -c \'%U:%G\' /var/lib/odoo)" == "odoo:odoo"'), + ("bash", "-c", 'test "$(stat -c \'%U:%G\' /opt/odoo/auto/addons)" == "root:odoo"'), + ("bash", "-c", 'test "$(stat -c \'%U:%G\' /opt/odoo/custom/src)" == "root:odoo"'), + ) + + def test_default_uids(self): + uids_dir = join(SCAFFOLDINGS_DIR, "uids_default") + for sub_env in matrix(): + self.compose_test( + uids_dir, sub_env, + # verify that odoo user has the given ids + ("bash", "-c", 'test "$(id -u)" == "1000"'), + ("bash", "-c", 'test "$(id -g)" == "1000"'), + ("bash", "-c", 'test "$(id -u -n)" == "odoo"'), + # all those directories need to belong to odoo (user or group odoo) + ("bash", "-c", 'test "$(stat -c \'%U:%G\' /var/lib/odoo)" == "odoo:odoo"'), + ("bash", "-c", 'test "$(stat -c \'%U:%G\' /opt/odoo/auto/addons)" == "root:odoo"'), + ("bash", "-c", 'test "$(stat -c \'%U:%G\' /opt/odoo/custom/src)" == "root:odoo"'), + ) + if __name__ == "__main__": unittest.main() diff --git a/tests/scaffoldings/uids_1001/Dockerfile b/tests/scaffoldings/uids_1001/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/uids_1001/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/uids_1001/custom/src/addons.yaml b/tests/scaffoldings/uids_1001/custom/src/addons.yaml new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/uids_1001/custom/src/repos.yaml b/tests/scaffoldings/uids_1001/custom/src/repos.yaml new file mode 100644 index 00000000..d4f265db --- /dev/null +++ b/tests/scaffoldings/uids_1001/custom/src/repos.yaml @@ -0,0 +1,11 @@ +# Odoo is always required +./odoo: + defaults: + # Shallow repositores are faster & thinner + depth: $DEPTH_DEFAULT + remotes: + odoo: https://github.com/odoo/odoo.git + target: + odoo $ODOO_VERSION + merges: + - odoo $ODOO_VERSION diff --git a/tests/scaffoldings/uids_1001/docker-compose.yaml b/tests/scaffoldings/uids_1001/docker-compose.yaml new file mode 100644 index 00000000..1f5de81c --- /dev/null +++ b/tests/scaffoldings/uids_1001/docker-compose.yaml @@ -0,0 +1,32 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + WITHOUT_DEMO: "false" + UID: 1001 + GID: 1002 + + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + volumes: + - filestore:/var/lib/odoo:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: diff --git a/tests/scaffoldings/uids_default/Dockerfile b/tests/scaffoldings/uids_default/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/uids_default/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/uids_default/custom/src/addons.yaml b/tests/scaffoldings/uids_default/custom/src/addons.yaml new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/uids_default/custom/src/repos.yaml b/tests/scaffoldings/uids_default/custom/src/repos.yaml new file mode 100644 index 00000000..d4f265db --- /dev/null +++ b/tests/scaffoldings/uids_default/custom/src/repos.yaml @@ -0,0 +1,11 @@ +# Odoo is always required +./odoo: + defaults: + # Shallow repositores are faster & thinner + depth: $DEPTH_DEFAULT + remotes: + odoo: https://github.com/odoo/odoo.git + target: + odoo $ODOO_VERSION + merges: + - odoo $ODOO_VERSION diff --git a/tests/scaffoldings/uids_default/docker-compose.yaml b/tests/scaffoldings/uids_default/docker-compose.yaml new file mode 100644 index 00000000..57d7953c --- /dev/null +++ b/tests/scaffoldings/uids_default/docker-compose.yaml @@ -0,0 +1,30 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + WITHOUT_DEMO: "false" + + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + volumes: + - filestore:/var/lib/odoo:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: From ef8d35b9a01e599cf67f9b5fcf77e83ab75ffef5 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 8 Jul 2019 10:21:42 +0100 Subject: [PATCH 052/255] Smarter, less strict, config generator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before Odoo v11, Odoo wasn't so strict when reading configuration. Since v11, where Python 3 started to be used, it used the new default `strict=True` mode to read configuration files. The strict mode forbids section and option repetitions. Although that seems legit for most apps (even Odoo itself), in Doodba we provide a set of predefined defaults that downstream scaffoldings should be able to override. To allow such behavior, now the script that generates the final config will do it in `strict=False` mode, but will remove duplicates and just use the latest option defined, effectively producing a strict config file out of a collection of non-strict configs. Of course, options until now are respected, like output of result while in `LOG_LEVEL=DEBUG` or env variable substitution. Full power! šŸ’Ŗ --- bin/config-generate | 60 ++++++++++++++++--- conf.d/10-addons.conf | 1 + conf.d/20-database.conf | 1 + conf.d/30-proxy-mode.conf | 1 + conf.d/40-smtp.conf | 1 + conf.d/50-demo-data.conf | 1 + .../settings/custom/conf.d/00-defaults.conf | 3 + .../settings/custom/conf.d/10-custom.conf | 3 + .../settings/custom/scripts/test_settings.py | 1 + 9 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 tests/scaffoldings/settings/custom/conf.d/00-defaults.conf create mode 100644 tests/scaffoldings/settings/custom/conf.d/10-custom.conf diff --git a/bin/config-generate b/bin/config-generate index c41d370f..fa04a514 100755 --- a/bin/config-generate +++ b/bin/config-generate @@ -1,9 +1,51 @@ -#!/bin/bash -# Generate Odoo server configuration from templates -set -e -src="/opt/odoo/common/conf.d/* /opt/odoo/custom/conf.d/*" -log INFO Merging $(ls $src | wc -l) configuration files in $OPENERP_SERVER -conf=$(cat $src | envsubst) -log DEBUG "Resulting configuration: -$conf" -echo "$conf" > $OPENERP_SERVER +#!/usr/bin/env python +# -*- coding: utf-8 -*- +"""Generate Odoo server configuration from templates""" + +import os +from contextlib import closing +from doodbalib import logger +from string import Template + +try: + # Python 2, where io.StringIO fails because it is unicode-only + from StringIO import StringIO +except ImportError: + from io import StringIO + +try: + from configparser import RawConfigParser + parser = RawConfigParser(strict=False) +except ImportError: + # Python 2, where strict=True doesn't exist + from ConfigParser import RawConfigParser + parser = RawConfigParser() + +ODOO_VERSION = os.environ.get("ODOO_VERSION") +TARGET_FILE = os.environ.get("OPENERP_SERVER", "/opt/odoo/auto/odoo.conf") +if ODOO_VERSION not in {"8.0", "9.0"}: + TARGET_FILE = os.environ.get("ODOO_RC", TARGET_FILE) +CONFIG_DIRS = ("/opt/odoo/common/conf.d", "/opt/odoo/custom/conf.d") +CONFIG_FILES = [] + +# Read all configuraiton files found in those folders +logger.info("Merging found configuration files in %s", TARGET_FILE) +for dir_ in CONFIG_DIRS: + try: + for file_ in os.listdir(dir_): + parser.read(os.path.join(dir_, file_)) + except OSError: # TODO Use FileNotFoundError when we drop python 2 + continue + +# Write it to a memory string object +with closing(StringIO()) as resultfp: + parser.write(resultfp) + resultfp.seek(0) + # Obtain the config string + result = resultfp.read() + # Expand environment variables found within + result = Template(result).substitute(os.environ) + logger.debug("Resulting configuration:\n%s", result) + # Write it to destination + with open(TARGET_FILE, "w") as targetfp: + targetfp.write(result) diff --git a/conf.d/10-addons.conf b/conf.d/10-addons.conf index d7ad1445..56393e80 100644 --- a/conf.d/10-addons.conf +++ b/conf.d/10-addons.conf @@ -1,2 +1,3 @@ +[options] ; Addons in priority order: private, then other repos, then base Odoo addons_path = /opt/odoo/auto/addons diff --git a/conf.d/20-database.conf b/conf.d/20-database.conf index 5d214022..e6fe35df 100644 --- a/conf.d/20-database.conf +++ b/conf.d/20-database.conf @@ -1,3 +1,4 @@ +[options] ; Database settings, matching defaults when you execute `psql` db_user = $PGUSER db_password = $PGPASSWORD diff --git a/conf.d/30-proxy-mode.conf b/conf.d/30-proxy-mode.conf index 31ce6027..ab33311a 100644 --- a/conf.d/30-proxy-mode.conf +++ b/conf.d/30-proxy-mode.conf @@ -1,2 +1,3 @@ +[options] ; Normally Odoo should run behind a proxy proxy_mode = $PROXY_MODE diff --git a/conf.d/40-smtp.conf b/conf.d/40-smtp.conf index 2befcf4e..91d268c9 100644 --- a/conf.d/40-smtp.conf +++ b/conf.d/40-smtp.conf @@ -1,3 +1,4 @@ +[options] ; Prepared to link with https://hub.docker.com/r/tecnativa/postfix-relay smtp_server = $SMTP_SERVER smtp_port = $SMTP_PORT diff --git a/conf.d/50-demo-data.conf b/conf.d/50-demo-data.conf index 421d4018..90e90581 100644 --- a/conf.d/50-demo-data.conf +++ b/conf.d/50-demo-data.conf @@ -1,2 +1,3 @@ +[options] ; Useful for testing, useless for production, disabled by default without_demo = $WITHOUT_DEMO diff --git a/tests/scaffoldings/settings/custom/conf.d/00-defaults.conf b/tests/scaffoldings/settings/custom/conf.d/00-defaults.conf new file mode 100644 index 00000000..9c9e224c --- /dev/null +++ b/tests/scaffoldings/settings/custom/conf.d/00-defaults.conf @@ -0,0 +1,3 @@ +[options] +# Simulate a default value of 1000 MiB +limit_memory_soft = 1048576000 diff --git a/tests/scaffoldings/settings/custom/conf.d/10-custom.conf b/tests/scaffoldings/settings/custom/conf.d/10-custom.conf new file mode 100644 index 00000000..230541e3 --- /dev/null +++ b/tests/scaffoldings/settings/custom/conf.d/10-custom.conf @@ -0,0 +1,3 @@ +[options] +# Customize the default to 2000 MiB +limit_memory_soft = 2097152000 diff --git a/tests/scaffoldings/settings/custom/scripts/test_settings.py b/tests/scaffoldings/settings/custom/scripts/test_settings.py index fcebe86a..8615bca1 100755 --- a/tests/scaffoldings/settings/custom/scripts/test_settings.py +++ b/tests/scaffoldings/settings/custom/scripts/test_settings.py @@ -6,6 +6,7 @@ assert config.get("email_from") == "test@example.com" +assert config.get("limit_memory_soft") == 2097152000 assert config.get("smtp_password") is False assert config.get("smtp_port") == 1025 assert config.get("smtp_server") == "mailhog" From e00e55ce4beab8bc5bfadcdbfd84fa44a6d5b478 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 17 Jul 2019 12:25:38 +0100 Subject: [PATCH 053/255] Install ESLint 5.x, because 6.x is not compatible with node 6 anymore --- 11.0.Dockerfile | 2 +- 8.0.Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 3f545eda..1fa6c330 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -103,7 +103,7 @@ RUN python -m venv --system-site-packages /qa/venv \ flake8 \ pylint-odoo \ six \ - && npm install --loglevel error --prefix /qa eslint \ + && npm install --loglevel error --prefix /qa 'eslint@<6' \ && deactivate \ && mkdir -p /qa/artifacts \ && git clone --depth 1 $MQT /qa/mqt diff --git a/8.0.Dockerfile b/8.0.Dockerfile index b82b6acc..0c8fc251 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -106,7 +106,7 @@ RUN virtualenv --system-site-packages /qa/venv \ flake8 \ pylint-odoo \ six \ - && npm install --loglevel error --prefix /qa eslint \ + && npm install --loglevel error --prefix /qa 'eslint@<6' \ && deactivate \ && mkdir -p /qa/artifacts \ && git clone --depth 1 $MQT /qa/mqt From 43c70b96e6c41c91d067b09725e71414625d1d4e Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 18 Jul 2019 09:06:40 +0100 Subject: [PATCH 054/255] Log digests of all images before pushing --- hooks/pre_push | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 hooks/pre_push diff --git a/hooks/pre_push b/hooks/pre_push new file mode 100755 index 00000000..353d3e8d --- /dev/null +++ b/hooks/pre_push @@ -0,0 +1,5 @@ +#!/bin/bash +set -ex + +# Log all locally available images; will help to pin images +docker image ls --digests "${DOCKER_REPO:-tecnativa/doodba}" From c58b01d382c6f16acfb91ce16c5bc300ccb008f3 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Thu, 18 Jul 2019 16:17:32 +0200 Subject: [PATCH 055/255] [FIX] add configs in sorted order configs should be read in order: 00-something.conf should be parsed before 10-another_thing.conf fixes https://github.com/Tecnativa/doodba/issues/230 --- bin/config-generate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/config-generate b/bin/config-generate index fa04a514..ceb01176 100755 --- a/bin/config-generate +++ b/bin/config-generate @@ -32,7 +32,7 @@ CONFIG_FILES = [] logger.info("Merging found configuration files in %s", TARGET_FILE) for dir_ in CONFIG_DIRS: try: - for file_ in os.listdir(dir_): + for file_ in sorted(os.listdir(dir_)): parser.read(os.path.join(dir_, file_)) except OSError: # TODO Use FileNotFoundError when we drop python 2 continue From 092cda99ee14fe0738ebadff24910cb6d6ef2d78 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 22 Jul 2019 13:44:27 +0100 Subject: [PATCH 056/255] Remove unsafe call This chunk of code was warning: ``` /usr/local/bin/autoaggregate:127: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. has_contents = yaml.load(repos_file) ``` Since it was just a workaround for https://github.com/acsone/git-aggregator/pull/23 and that's fixed already, I can remove it and fix the warning all with one shot. --- bin/autoaggregate | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bin/autoaggregate b/bin/autoaggregate index 6328e74b..2a9c3bac 100755 --- a/bin/autoaggregate +++ b/bin/autoaggregate @@ -121,12 +121,7 @@ def missing_repos_config(): # Aggregate user-specified repos if os.path.isfile(REPOS_YAML): - # HACK https://github.com/acsone/git-aggregator/pull/23 - has_contents = True - with open(REPOS_YAML) as repos_file: - has_contents = yaml.load(repos_file) - if has_contents: - aggregate(REPOS_YAML) + aggregate(REPOS_YAML) # Aggregate unspecified repos missing_config = missing_repos_config() From ea482af88bcc9bd1efdfac380ee4e870555813d1 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 12 Aug 2019 10:08:43 +0200 Subject: [PATCH 057/255] Fix logging call Fix #233. --- lib/doodbalib/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index 2f56f3d3..a80887e9 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -102,11 +102,11 @@ def addons_config(filtered=True, strict=False): continue # Flatten all sections in a single dict for repo, partial_globs in doc.items(): + logger.debug("Processing %s repo", repo) all_globs.setdefault(repo, set()) all_globs[repo].update(partial_globs) except IOError: logger.debug('Could not find addons configuration yaml.') - logger.debug("Processing %s repo", repo) # Add default values for special sections for repo in (CORE, PRIVATE): all_globs.setdefault(repo, {"*"}) From 89360140728b2e09c97cbd5bb7daae6ff581fbd0 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 29 Aug 2019 09:29:47 +0100 Subject: [PATCH 058/255] Support Odoo v7 This support is suboptimal, not targeted for production, just for migrations. Notable differences: - Use requirements.txt from odoo v8, because v7 didn't have. Add missing requirements by hand. - Had to skip or modify some tests. - Removed repos.yaml file from tests that were downloading code from odoo. We default to OCB, which has more up-to-date dependencies in v7. - Modified a test that tested the presence of the website addon. That addon didn't exist in v7, so I used web instead. - Disable in v7 tests that used module_auto_update addon. It didn't exist. - Disable in v7 tests that use odoo shell or click-odoo. They're not supported. --- .travis.yml | 5 +++-- 7.0.Dockerfile | 1 + bin/install.sh | 10 +++++++-- build.d/700-odoo-install | 21 +++++++++++++----- tests/__init__.py | 22 +++++++++---------- .../uids_1001/custom/src/repos.yaml | 11 ---------- .../uids_default/custom/src/repos.yaml | 11 ---------- 7 files changed, 38 insertions(+), 43 deletions(-) create mode 120000 7.0.Dockerfile delete mode 100644 tests/scaffoldings/uids_1001/custom/src/repos.yaml delete mode 100644 tests/scaffoldings/uids_default/custom/src/repos.yaml diff --git a/.travis.yml b/.travis.yml index 3be13f1d..1091dcc6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,8 +20,9 @@ env: # Variables found by default in Docker Hub builder - DOCKER_REPO=tecnativa/doodba matrix: - - DOCKER_TAG=8.0 - - DOCKER_TAG=9.0 + - DOCKER_TAG=7.0 PG_VERSIONS=9.6 + - DOCKER_TAG=8.0 PG_VERSIONS=10 + - DOCKER_TAG=9.0 PG_VERSIONS=11 - DOCKER_TAG=10.0 - DOCKER_TAG=11.0 - DOCKER_TAG=12.0 diff --git a/7.0.Dockerfile b/7.0.Dockerfile new file mode 120000 index 00000000..04c2b0a4 --- /dev/null +++ b/7.0.Dockerfile @@ -0,0 +1 @@ +8.0.Dockerfile \ No newline at end of file diff --git a/bin/install.sh b/bin/install.sh index 7696254d..e48eb59a 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -1,8 +1,14 @@ #!/bin/bash -# Notice that this file is only used in odoo v8-10 +# Notice that this file is only used in odoo v7-10 set -ex reqs=https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt +if [ "$ODOO_VERSION" == "7.0" ]; then + # V7 has no requirements file, but almost matches v8 + reqs=https://raw.githubusercontent.com/$ODOO_SOURCE/8.0/requirements.txt + # These are the only differences + pip install 'pywebdav<0.9.8' +fi apt_deps="python-dev build-essential" apt-get update @@ -37,7 +43,7 @@ fi # Build and install Odoo dependencies with pip pip install --requirement $reqs -if [ "$ODOO_VERSION" != "8.0" ]; then +if [ "$ODOO_VERSION" == "9.0" -o "$ODOO_VERSION" == "10.0" ]; then pip install watchdog fi if [ "$ODOO_VERSION" == "10.0" ]; then diff --git a/build.d/700-odoo-install b/build.d/700-odoo-install index cfc44067..856e2f5d 100755 --- a/build.d/700-odoo-install +++ b/build.d/700-odoo-install @@ -7,22 +7,31 @@ log INFO Installing Odoo from $src # For development you could want to avoid installing Odoo to speed up build if [ "$PIP_INSTALL_ODOO" == true ]; then args="--no-cache-dir" - # Odoo v8 dependencies could crash at install, so we don't use them - if [ "$ODOO_VERSION" == "8.0" ]; then + # Odoo <= v8 dependencies could crash at install, so we don't use them + if [ "$ODOO_VERSION" == "7.0" -o "$ODOO_VERSION" == "8.0" ]; then args="$args --no-deps" fi pip install $args --editable $src - # Make version 8.0 and 9.0 have an `odoo` executable - if [ "$ODOO_VERSION" == "8.0" -o "$ODOO_VERSION" == "9.0" ]; then + # Make versions 7.0 to 9.0 have an `odoo` executable + if [ "$ODOO_VERSION" == "7.0" ]; then + ln -s /usr/local/bin/openerp-server $dst + elif [ "$ODOO_VERSION" == "8.0" -o "$ODOO_VERSION" == "9.0" ]; then ln -s $dst.py $dst fi else log WARNING Blindly symlinking odoo executable bin=$src/odoo-bin - if [ "$ODOO_VERSION" == "8.0" -o "$ODOO_VERSION" == "9.0" ]; then + if [ -x $src/openerp-server ]; then + bin=$src/openerp-server + ln -s $src/openerp-server /usr/local/bin + fi + if [ -x $src/openerp-gevent ]; then + ln -s $src/openerp-gevent /usr/local/bin + fi + if [ -x $src/odoo.py ]; then bin=$src/odoo.py - ln -s /opt/odoo/custom/src/odoo/openerp-{gevent,server} /usr/local/bin/ + ln -s $src/odoo.py /usr/local/bin fi ln -s $bin $dst fi diff --git a/tests/__init__.py b/tests/__init__.py index b4f847e5..38d91239 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -16,9 +16,9 @@ DIR = dirname(__file__) ODOO_PREFIX = ("odoo", "--stop-after-init", "--workers=0") ODOO_VERSIONS = frozenset(environ.get( - "DOCKER_TAG", "8.0 9.0 10.0 11.0 12.0").split()) + "DOCKER_TAG", "7.0 8.0 9.0 10.0 11.0 12.0").split()) PG_VERSIONS = frozenset(environ.get( - "PG_VERSIONS", "10").split()) + "PG_VERSIONS", "11").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") @@ -95,7 +95,7 @@ def test_addons_filtered(self): self.compose_test( project_dir, dict(sub_env, DBNAME="prod"), - ("test", "-e", "auto/addons/website"), + ("test", "-e", "auto/addons/web"), ("test", "-e", "auto/addons/private_addon"), ("bash", "-c", 'test "$(addons list -p)" == disabled_addon,private_addon'), @@ -107,7 +107,7 @@ def test_addons_filtered(self): self.compose_test( project_dir, dict(sub_env, DBNAME="limited_private"), - ("test", "-e", "auto/addons/website"), + ("test", "-e", "auto/addons/web"), ("test", "!", "-e", "auto/addons/private_addon"), ("bash", "-c", 'test -z "$(addons list -p)"'), ("bash", "-c", @@ -118,13 +118,13 @@ def test_addons_filtered(self): self.compose_test( project_dir, dict(sub_env, DBNAME="limited_core"), - ("test", "!", "-e", "auto/addons/website"), + ("test", "!", "-e", "auto/addons/web"), ("test", "!", "-e", "auto/addons/private_addon"), ("bash", "-c", 'test -z "$(addons list -p)"'), ("bash", "-c", 'test "$(addons list -c)" == crm,sale'), ) # Skip Odoo versions that don't support __manifest__.py files - for sub_env in matrix(odoo_skip={"8.0", "9.0"}): + for sub_env in matrix(odoo_skip={"7.0", "8.0", "9.0"}): self.compose_test( project_dir, dict(sub_env, DBNAME="prod"), @@ -195,7 +195,7 @@ def test_settings(self): """test "$(psql -Atqc "SELECT code FROM res_lang WHERE active = TRUE")" == es_ES"""), ) - for sub_env in matrix(odoo_skip={"8.0", "9.0"}): + for sub_env in matrix(odoo_skip={"7.0", "8.0", "9.0"}): self.compose_test(folder, sub_env, *commands) def test_smallest(self): @@ -215,7 +215,7 @@ def test_smallest(self): ("click-odoo-update",), ) smallest_dir = join(SCAFFOLDINGS_DIR, "smallest") - for sub_env in matrix(odoo_skip={"8.0"}): + for sub_env in matrix(odoo_skip={"7.0", "8.0"}): self.compose_test( smallest_dir, sub_env, *commands, ("python", "-c", "import watchdog"), @@ -223,8 +223,8 @@ def test_smallest(self): for sub_env in matrix(odoo={"8.0"}): self.compose_test( smallest_dir, sub_env, - # Odoo 8.0 does not autocreate the database - ("psql", "-d", "postgres", "-c", "create database prod"), + # Odoo <= 8.0 does not autocreate the database + ("createdb",), *commands ) @@ -267,7 +267,7 @@ def test_dotd(self): def test_dependencies(self): """Test dependencies installation.""" dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies") - for sub_env in matrix(): + for sub_env in matrix(odoo_skip={"7.0"}): self.compose_test( dependencies_dir, sub_env, ("test", "!", "-f", "custom/dependencies/apt.txt"), diff --git a/tests/scaffoldings/uids_1001/custom/src/repos.yaml b/tests/scaffoldings/uids_1001/custom/src/repos.yaml deleted file mode 100644 index d4f265db..00000000 --- a/tests/scaffoldings/uids_1001/custom/src/repos.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# Odoo is always required -./odoo: - defaults: - # Shallow repositores are faster & thinner - depth: $DEPTH_DEFAULT - remotes: - odoo: https://github.com/odoo/odoo.git - target: - odoo $ODOO_VERSION - merges: - - odoo $ODOO_VERSION diff --git a/tests/scaffoldings/uids_default/custom/src/repos.yaml b/tests/scaffoldings/uids_default/custom/src/repos.yaml deleted file mode 100644 index d4f265db..00000000 --- a/tests/scaffoldings/uids_default/custom/src/repos.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# Odoo is always required -./odoo: - defaults: - # Shallow repositores are faster & thinner - depth: $DEPTH_DEFAULT - remotes: - odoo: https://github.com/odoo/odoo.git - target: - odoo $ODOO_VERSION - merges: - - odoo $ODOO_VERSION From 4fe371d1f2735c7e21a1af310cf3a102b60f0bbf Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 9 Sep 2019 11:17:34 +0100 Subject: [PATCH 059/255] Warn when using deprecated features - All deprecated scripts are now inside `bin-deprecated` folder. - All of them log a warning indicating the modern direct replacement. - Remove their docs; replace them with a note indicating what replaces them. This will help preparing the upcoming 13.0 release. --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 8.0.Dockerfile | 2 +- README.md | 74 ++++++++--------------- {bin => bin-deprecated}/autoupdate | 5 +- {bin => bin-deprecated}/install.sh | 0 {bin => bin-deprecated}/python-odoo-shell | 2 + {bin => bin-deprecated}/unittest | 2 + 8 files changed, 35 insertions(+), 54 deletions(-) rename {bin => bin-deprecated}/autoupdate (84%) rename {bin => bin-deprecated}/install.sh (100%) rename {bin => bin-deprecated}/python-odoo-shell (50%) rename {bin => bin-deprecated}/unittest (71%) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 1fa6c330..f3d88f63 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -79,7 +79,7 @@ RUN pip install \ watchdog \ wdb \ && sync -COPY bin/* /usr/local/bin/ +COPY bin-deprecated/* bin/* /usr/local/bin/ COPY lib/doodbalib /usr/local/lib/python3.5/site-packages/doodbalib RUN ln -s /usr/local/lib/python3.5/site-packages/doodbalib \ /usr/local/lib/python3.5/site-packages/odoobaselib diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 84f59b62..f6669d6e 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -75,7 +75,7 @@ RUN pip install \ watchdog \ wdb \ && sync -COPY bin/* /usr/local/bin/ +COPY bin-deprecated/* bin/* /usr/local/bin/ COPY lib/doodbalib /usr/local/lib/python3.5/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 0c8fc251..9fb72548 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -82,7 +82,7 @@ RUN pip install \ virtualenv \ wdb \ && sync -COPY bin/* /usr/local/bin/ +COPY bin-deprecated/* bin/* /usr/local/bin/ COPY lib/doodbalib /usr/local/lib/python2.7/dist-packages/doodbalib RUN ln -s /usr/local/lib/python2.7/dist-packages/doodbalib \ /usr/local/lib/python2.7/dist-packages/odoobaselib diff --git a/README.md b/README.md index 45c0ac24..18ae6f81 100644 --- a/README.md +++ b/README.md @@ -317,7 +317,7 @@ l10n-spain: - l10n_es # Overrides built-in l10n_es under odoo/addons server-tools: - "*date*" # All modules that contain "date" in their name - - module_auto_update # Makes `autoupdate` script actually autoupdate addons + - auditlog web: - "*" # All web addons --- @@ -427,6 +427,8 @@ The great [`click-odoo`][] scripting framework and the collection of scripts found in [`click-odoo-contrib`][] are included. Refer to their sites to know how to use them. +\* Note: This replaces the deprecated `python-odoo-shell` binary. + ### [`nano`][] The CLI text editor we all know, just in case you need to inspect some bug in @@ -446,41 +448,7 @@ Usage: pot my_addon,my_other_addon -### `python-odoo-shell` - -Little shortcut to make your `odoo shell` scripts executable. - -For example, create this file in your scaffolding-based project: -`odoo/custom/shell-scripts/whoami.py`. Fill it with: - -```python -#!/usr/local/bin/python-odoo-shell -from __future__ import print_function -print(env.user.name) -print(env.context) -``` - -Now run it: - -```bash -$ chmod a+x odoo/custom/shell-scripts/whoami.py # Make it executable -$ docker-compose build --pull # Rebuild the image, unless in devel -$ docker-compose run --rm odoo custom/shell-scripts/whoami.py -``` - -### `unittest` - -Another little shell script, useful for debugging. Just run it like this and -Odoo will execute unit tests in its default database: - - unittest my_addon,my_other_addon - -Note that the addon must be installed for it to work. Otherwise, you should run -it as: - - unittest my_addon,my_other_addon -i my_addon,my_other_addon - -### [`psql`](https://www.postgresql.org/docs/9.5/static/app-psql.html) +### [`psql`](https://www.postgresql.org/docs/current/app-psql.html) Environment variables are there so that if you need to connect with the database, you just need to execute: @@ -990,8 +958,17 @@ In production: ##### Run unit tests for some addon - docker-compose run --rm odoo odoo --stop-after-init --init addon1,addon2 - docker-compose run --rm odoo unittest addon1,addon2 +```bash +modules=addon1,addon2 +# Install their dependencies first +docker-compose run --rm odoo addons init --dependencies $modules +# Test them at install +docker-compose run --rm odoo addons init --test $modules +# Test them again at update +docker-compose run --rm odoo addons update --test $modules +``` + +\* Note: This replaces the old deprecated `unittest` script. ##### Reading the logs @@ -1013,22 +990,19 @@ Only Odoo's: ##### Update changed addons only -Add `module_auto_update` from https://github.com/OCA/server-tools to your -installation following the standard methods of `repos.yaml` + `addons.yaml`. +Just run: -Now we will install the addon: +```bash +docker-compose run --rm odoo click-odoo-update --watcher-max-seconds 30 +``` - docker-compose up -d - docker-compose run --rm odoo --stop-after-init -u base - docker-compose run --rm odoo --stop-after-init -i module_auto_update - docker-compose restart odoo +This script is part of [`click-odoo-contrib`][]; check it for more details. -It will automatically update addons that got updated every night. -To force that automatic update now in a separate container: +\* Note: `--watcher-max-seconds` is available because we ship a +[patched](https://github.com/acsone/click-odoo-contrib/pull/38) +version. Check that PR for docs. - docker-compose up -d - docker-compose run --rm odoo autoupdate - docker-compose restart odoo +\* Note: This replaces the old deprecated `autoupdate` script. ##### Export some addon's translations to stdout diff --git a/bin/autoupdate b/bin-deprecated/autoupdate similarity index 84% rename from bin/autoupdate rename to bin-deprecated/autoupdate index cc9bd68e..51f36777 100755 --- a/bin/autoupdate +++ b/bin-deprecated/autoupdate @@ -5,7 +5,10 @@ import os _logger = logging.getLogger("autoupdate") # TODO Delete this script at some point -_logger.warning("`autoupdate` is DEPRECATED. Use click-odoo-update instead.") +_logger.warning( + "`autoupdate` is DEPRECATED and will be removed in Doodba 13.0, " + "use instead: click-odoo-update" +) # Note: ``module_auto_update`` must be installed in Odoo for this to work. try: diff --git a/bin/install.sh b/bin-deprecated/install.sh similarity index 100% rename from bin/install.sh rename to bin-deprecated/install.sh diff --git a/bin/python-odoo-shell b/bin-deprecated/python-odoo-shell similarity index 50% rename from bin/python-odoo-shell rename to bin-deprecated/python-odoo-shell index 31f3c4cc..9f2ac550 100755 --- a/bin/python-odoo-shell +++ b/bin-deprecated/python-odoo-shell @@ -1,3 +1,5 @@ #!/usr/bin/env bash export PYTHONOPTIMIZE="" # You'll want to `assert` in your scripts +log WARNING python-odoo-shell is deprecated and will be removed in \ + Doodba 13.0, use instead: click-odoo exec odoo shell < "$1" diff --git a/bin/unittest b/bin-deprecated/unittest similarity index 71% rename from bin/unittest rename to bin-deprecated/unittest index 866b8a23..f4017d92 100755 --- a/bin/unittest +++ b/bin-deprecated/unittest @@ -1,4 +1,6 @@ #!/bin/bash +log WARNING unittest is deprecated and will be removed in Doodba 13.0, \ + use instead: addons update --test $@ # Shortcut to run Odoo in unit testing mode set -e addons=$1 From e31a7c34fdc830d07abce75b2abae3869235057c Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 16 Sep 2019 12:17:24 +0100 Subject: [PATCH 060/255] Add default fonts control In #181 and #188 we added Liberation fonts as the default ones for reports. However this made it a little bit harder to choose a different default font (default fonts are the ones that the system interprets for `monospace`, `sans-serif` and `serif`). From now on, if you want to override the default fonts, you have to add the package in `dependencies/apt.txt` or a `build.d` script, and add one or more of these new build arguments: `FONT_{MONO,SANS,SERIF}`. This way you make sure to override the default fonts. Before this, if you only added the package, it only made those fonts available, *not default*. --- 11.0.Dockerfile | 3 +++ 12.0.Dockerfile | 3 +++ 8.0.Dockerfile | 3 +++ README.md | 19 +++++++++++++++++++ build.d/300-fontconfig | 30 ++++++++++++++++++++++++++++++ tests/__init__.py | 4 ++++ 6 files changed, 62 insertions(+) create mode 100755 build.d/300-fontconfig diff --git a/11.0.Dockerfile b/11.0.Dockerfile index f3d88f63..3b700771 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -147,6 +147,9 @@ ONBUILD ARG DEPTH_DEFAULT=1 ONBUILD ARG DEPTH_MERGE=100 ONBUILD ARG CLEAN=true ONBUILD ARG COMPILE=true +ONBUILD ARG FONT_MONO="Liberation Mono" +ONBUILD ARG FONT_SANS="Liberation Sans" +ONBUILD ARG FONT_SERIF="Liberation Serif" ONBUILD ARG PIP_INSTALL_ODOO=true ONBUILD ARG ADMIN_PASSWORD=admin ONBUILD ARG SMTP_SERVER=smtp diff --git a/12.0.Dockerfile b/12.0.Dockerfile index f6669d6e..95feb788 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -143,6 +143,9 @@ ONBUILD ARG DEPTH_DEFAULT=1 ONBUILD ARG DEPTH_MERGE=100 ONBUILD ARG CLEAN=true ONBUILD ARG COMPILE=true +ONBUILD ARG FONT_MONO="Liberation Mono" +ONBUILD ARG FONT_SANS="Liberation Sans" +ONBUILD ARG FONT_SERIF="Liberation Serif" ONBUILD ARG PIP_INSTALL_ODOO=true ONBUILD ARG ADMIN_PASSWORD=admin ONBUILD ARG SMTP_SERVER=smtp diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 9fb72548..b189eed6 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -145,6 +145,9 @@ ONBUILD ARG DEPTH_DEFAULT=1 ONBUILD ARG DEPTH_MERGE=100 ONBUILD ARG CLEAN=true ONBUILD ARG COMPILE=true +ONBUILD ARG FONT_MONO="Liberation Mono" +ONBUILD ARG FONT_SANS="Liberation Sans" +ONBUILD ARG FONT_SERIF="Liberation Serif" ONBUILD ARG PIP_INSTALL_ODOO=true ONBUILD ARG ADMIN_PASSWORD=admin ONBUILD ARG SMTP_SERVER=smtp diff --git a/README.md b/README.md index 18ae6f81..7085c355 100644 --- a/README.md +++ b/README.md @@ -1266,6 +1266,23 @@ FROM tecnativa/doodba@sha256:fba69478f9b0616561aa3aba4d18e4bcc2f728c9568057946c9 Make sure there's a `ir.config_parameter` called `report.url` with the value `http://localhost:8069`. +### How to change report fonts? + +Doodba ships [Liberation fonts](https://wikipedia.org/wiki/Liberation_fonts) +as defaults. + +If you want to make another font package _available_, just add it to +[`apt.txt`][dependencies] (if it's a normal Debian package) or install it in +a [custom build script][build.d] called i.e. `build.d/200-custom-fonts` +(if you need to install it in a more complex way). + +If, in addition to that, you want those fonts to be the _defaults_, then add +one (or more) of these build arguments: + +- `FONT_MONO` +- `FONT_SANS` +- `FONT_SERIF` + ### How can I whitelist a service and allow external access to it? This can become useful when you have isolated environments @@ -1313,7 +1330,9 @@ scaffolding versions is preserved. [`repos.yaml`]: #optodoocustomsrcreposyaml [`click-odoo`]: https://github.com/acsone/click-odoo [`click-odoo-contrib`]: https://github.com/acsone/click-odoo-contrib +[build.d]: #optodoocustombuildd [builds]: https://hub.docker.com/r/tecnativa/doodba/builds/ +[dependencies]: #optodoocustomdependenciestxt [development]: #development [docker-socket-proxy]: https://hub.docker.com/r/tecnativa/docker-socket-proxy/ [doodba-qa]: https://github.com/Tecnativa/doodba-qa diff --git a/build.d/300-fontconfig b/build.d/300-fontconfig new file mode 100755 index 00000000..ff0b91aa --- /dev/null +++ b/build.d/300-fontconfig @@ -0,0 +1,30 @@ +#!/bin/bash +set -e + +cat < ~odoo/.fonts.conf + + + + + + monospace + + $FONT_MONO + + + + sans-serif + + $FONT_SANS + + + + serif + + $FONT_SERIF + + + +END + +chown odoo:odoo ~odoo/.fonts.conf diff --git a/tests/__init__.py b/tests/__init__.py index 38d91239..ac4b6d0b 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -208,6 +208,10 @@ def test_smallest(self): ("test", "-x", "/usr/local/bin/unittest"), ("addons", "list", "-cpix"), ("pg_activity", "--version"), + # Default fonts must be liberation + ("bash", "-c", """test "$(fc-match monospace)" == 'LiberationMono-Regular.ttf: "Liberation Mono" "Regular"'"""), + ("bash", "-c", """test "$(fc-match sans-serif)" == 'LiberationSans-Regular.ttf: "Liberation Sans" "Regular"'"""), + ("bash", "-c", """test "$(fc-match serif)" == 'LiberationSerif-Regular.ttf: "Liberation Serif" "Regular"'"""), # Must be able to install base addon ODOO_PREFIX + ("--init", "base"), # Auto updater must work From 3d8bc9bf00562ab5bc916fd3a01c22d44f577e51 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 17 Sep 2019 13:57:24 +0100 Subject: [PATCH 061/255] Add pychart for v7 Recently faced this error just with `odoo --version`: ERROR: openerp 7.0 requires pychart, which is not installed. [...] pkg_resources.DistributionNotFound: The 'pychart' distribution was not found and is required by openerp --- bin-deprecated/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin-deprecated/install.sh b/bin-deprecated/install.sh index e48eb59a..d7cd792b 100755 --- a/bin-deprecated/install.sh +++ b/bin-deprecated/install.sh @@ -7,7 +7,7 @@ if [ "$ODOO_VERSION" == "7.0" ]; then # V7 has no requirements file, but almost matches v8 reqs=https://raw.githubusercontent.com/$ODOO_SOURCE/8.0/requirements.txt # These are the only differences - pip install 'pywebdav<0.9.8' + pip install python-chart 'pywebdav<0.9.8' fi apt_deps="python-dev build-essential" apt-get update From 41b7f0614b7424eea148cc99f0111779bfdca90d Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 23 Sep 2019 11:30:05 +0100 Subject: [PATCH 062/255] Fix wrong location of odoo script target The odoo script must always point to the right executable in whatever odoo version you're using. That's how it works for test and prod environments, but 89360140728b2e09c97cbd5bb7daae6ff581fbd0 introduced a regression on this matter for devel environment. The main problem is that it was trying to be "smarter" by checking script existence, while at build time, in devel, those scripts still do not exist, so it always resolved to latest version (which uses `odoo-bin`) and broke older versions (those that use `openerp-server` or `odoo.py`). I made it dumber-but-working again, and added a little comment to avoid future me to try to "fix" this again. --- build.d/700-odoo-install | 14 ++++++-------- tests/scaffoldings/uids_1001/docker-compose.yaml | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/build.d/700-odoo-install b/build.d/700-odoo-install index 856e2f5d..ef245fde 100755 --- a/build.d/700-odoo-install +++ b/build.d/700-odoo-install @@ -22,16 +22,14 @@ if [ "$PIP_INSTALL_ODOO" == true ]; then else log WARNING Blindly symlinking odoo executable bin=$src/odoo-bin - if [ -x $src/openerp-server ]; then + # Cannot check for scripts existence and link all: they probably do not + # exist yet at build time! Just check Odoo version and act properly. + if [ "$ODOO_VERSION" == "7.0" ]; then bin=$src/openerp-server - ln -s $src/openerp-server /usr/local/bin - fi - if [ -x $src/openerp-gevent ]; then - ln -s $src/openerp-gevent /usr/local/bin - fi - if [ -x $src/odoo.py ]; then + ln -s /opt/odoo/custom/src/odoo/openerp-server /usr/local/bin/ + elif [ "$ODOO_VERSION" == "8.0" -o "$ODOO_VERSION" == "9.0" ]; then bin=$src/odoo.py - ln -s $src/odoo.py /usr/local/bin + ln -s /opt/odoo/custom/src/odoo/openerp-{gevent,server} /usr/local/bin/ fi ln -s $bin $dst fi diff --git a/tests/scaffoldings/uids_1001/docker-compose.yaml b/tests/scaffoldings/uids_1001/docker-compose.yaml index 1f5de81c..8b043308 100644 --- a/tests/scaffoldings/uids_1001/docker-compose.yaml +++ b/tests/scaffoldings/uids_1001/docker-compose.yaml @@ -6,6 +6,7 @@ services: args: COMPILE: "false" ODOO_VERSION: $ODOO_MINOR + PIP_INSTALL_ODOO: "false" WITHOUT_DEMO: "false" UID: 1001 GID: 1002 From 8abe01e1d6097e846efd4effcd06918bcdb6aecd Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 9 Sep 2019 13:00:35 +0100 Subject: [PATCH 063/255] Support v13 Initial version of Odoo v13. Some remarkable new thingies: - Uses Debian 10 as base. - Uses Python 3.7. - Uses the slim variant of the python base image. I hope this reduces about 700MiB of size. - All features deprecated in 4fe371d1f2735c7e21a1af310cf3a102b60f0bbf are absent. - Also Less is absent. - Ruby is not installed by default. Add it as apt dependency if you need to install gems. - ... because Sass is also absent by default. Only Scss using the C version. - Use saas-12.5 branch from odoo/odoo repo until OCB 13.0 is available. - Stop testing deprecated features. - Werkzeug 0.14.1 hack no longer needed since https://github.com/odoo/odoo/pull/36553 is merged. --- .travis.yml | 1 + 13.0.Dockerfile | 214 ++++++++++++++++++ tests/__init__.py | 22 +- .../dependencies/custom/src/repos.yaml | 12 - .../dotd/custom/dependencies/apt.txt | 1 + tests/scaffoldings/dotd/custom/src/repos.yaml | 12 - 6 files changed, 235 insertions(+), 27 deletions(-) create mode 100644 13.0.Dockerfile delete mode 100644 tests/scaffoldings/dependencies/custom/src/repos.yaml delete mode 100644 tests/scaffoldings/dotd/custom/src/repos.yaml diff --git a/.travis.yml b/.travis.yml index 1091dcc6..468bd06d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,7 @@ env: - DOCKER_TAG=10.0 - DOCKER_TAG=11.0 - DOCKER_TAG=12.0 + - DOCKER_TAG=13.0 before_install: - sudo apt-get update diff --git a/13.0.Dockerfile b/13.0.Dockerfile new file mode 100644 index 00000000..68368140 --- /dev/null +++ b/13.0.Dockerfile @@ -0,0 +1,214 @@ +FROM python:3.7-slim-buster AS base + +EXPOSE 8069 8072 + +ARG MQT=https://github.com/OCA/maintainer-quality-tools.git +ARG WKHTMLTOPDF_VERSION=0.12.5 +ARG WKHTMLTOPDF_CHECKSUM='1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb' +ENV DB_FILTER=.* \ + DEPTH_DEFAULT=1 \ + DEPTH_MERGE=100 \ + EMAIL=https://hub.docker.com/r/tecnativa/odoo \ + GIT_AUTHOR_NAME=docker-odoo \ + INITIAL_LANG="" \ + LC_ALL=C.UTF-8 \ + LIST_DB=false \ + NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \ + OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ + PATH="/home/odoo/.local/bin:$PATH" \ + PIP_NO_CACHE_DIR=1 \ + PTVSD_ARGS="--host 0.0.0.0 --port 6899 --wait --multiprocess" \ + PTVSD_ENABLE=0 \ + PUDB_RDB_HOST=0.0.0.0 \ + PUDB_RDB_PORT=6899 \ + PYTHONOPTIMIZE=1 \ + UNACCENT=true \ + WAIT_DB=true \ + WDB_NO_BROWSER_AUTO_OPEN=True \ + WDB_SOCKET_SERVER=wdb \ + WDB_WEB_PORT=1984 \ + WDB_WEB_SERVER=localhost + +# Other requirements and recommendations +# See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control +RUN apt-get -qq update \ + && apt-get install -yqq --no-install-recommends \ + curl \ + && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.stretch_amd64.deb \ + && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ + && apt-get install -yqq --no-install-recommends \ + ./wkhtmltox.deb \ + chromium \ + ffmpeg \ + fonts-liberation2 \ + gettext-base \ + git \ + gnupg2 \ + locales-all \ + nano \ + npm \ + postgresql-client \ + postgresql-common \ + telnet \ + vim \ + zlibc \ + && apt-get autopurge -yqq \ + && rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \ + && sync + +WORKDIR /opt/odoo +COPY bin/* /usr/local/bin/ +COPY lib/doodbalib /usr/local/lib/python3.7/site-packages/doodbalib +COPY build.d common/build.d +COPY conf.d common/conf.d +COPY entrypoint.d common/entrypoint.d +RUN mkdir -p auto/addons custom/src/private \ + && ln /usr/local/bin/direxec common/entrypoint \ + && ln /usr/local/bin/direxec common/build \ + && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ + && chmod -R a+rX /usr/local/lib/python3.7/site-packages/doodbalib \ + && sync + +# Doodba-QA dependencies in a separate virtualenv +COPY qa /qa +RUN python -m venv --system-site-packages /qa/venv \ + && . /qa/venv/bin/activate \ + && pip install \ + click \ + coverage \ + flake8 \ + pylint-odoo \ + six \ + && npm install --loglevel error --prefix /qa eslint \ + && deactivate \ + && mkdir -p /qa/artifacts \ + && git clone --depth 1 $MQT /qa/mqt + +# HACK OCB 13.0 not yet available +ARG ODOO_SOURCE=odoo/odoo +ARG ODOO_VERSION=13.0 +ENV ODOO_VERSION="saas-12.5" + +# Install Odoo hard & soft dependencies, and Doodba utilities +RUN build_deps=" \ + build-essential \ + libfreetype6-dev \ + libfribidi-dev \ + libghc-zlib-dev \ + libharfbuzz-dev \ + libjpeg-dev \ + liblcms2-dev \ + libldap2-dev \ + libopenjp2-7-dev \ + libpq-dev \ + libsasl2-dev \ + libtiff5-dev \ + libwebp-dev \ + tcl-dev \ + tk-dev \ + zlib1g-dev \ + " \ + && apt-get update \ + && apt-get install -yqq --no-install-recommends $build_deps \ + && pip install \ + -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + 'websocket-client~=0.56' \ + astor \ + git-aggregator \ + git+https://github.com/Tecnativa/click-odoo-contrib.git@update-parallel-db-lock-watcher#egg=click-odoo-contrib \ + pg_activity \ + phonenumbers \ + ptvsd \ + pudb \ + watchdog \ + wdb \ + && (python3 -m compileall -q /usr/local/lib/python3.7/ || true) \ + && apt-get purge -yqq $build_deps \ + && apt-get autopurge -yqq \ + && rm -Rf /var/lib/apt/lists/* /tmp/* + +# Metadata +ARG VCS_REF +ARG BUILD_DATE +ARG VERSION +LABEL org.label-schema.schema-version="$VERSION" \ + org.label-schema.vendor=Tecnativa \ + org.label-schema.license=Apache-2.0 \ + org.label-schema.build-date="$BUILD_DATE" \ + org.label-schema.vcs-ref="$VCS_REF" \ + org.label-schema.vcs-url="https://github.com/Tecnativa/doodba" + +# Onbuild version, with all the magic +FROM base AS onbuild + +# Subimage triggers +ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] +ONBUILD CMD ["/usr/local/bin/odoo"] +ONBUILD ARG AGGREGATE=true +ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" +# HACK OCB 13.0 not yet available +ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/odoo/odoo.git" +ONBUILD ARG DEPTH_DEFAULT=1 +ONBUILD ARG DEPTH_MERGE=100 +ONBUILD ARG CLEAN=true +ONBUILD ARG COMPILE=true +ONBUILD ARG FONT_MONO="Liberation Mono" +ONBUILD ARG FONT_SANS="Liberation Sans" +ONBUILD ARG FONT_SERIF="Liberation Serif" +ONBUILD ARG PIP_INSTALL_ODOO=true +ONBUILD ARG ADMIN_PASSWORD=admin +ONBUILD ARG SMTP_SERVER=smtp +ONBUILD ARG SMTP_PORT=25 +ONBUILD ARG SMTP_USER=false +ONBUILD ARG SMTP_PASSWORD=false +ONBUILD ARG SMTP_SSL=false +ONBUILD ARG EMAIL_FROM="" +ONBUILD ARG PROXY_MODE=false +ONBUILD ARG WITHOUT_DEMO=all +ONBUILD ARG PGUSER=odoo +ONBUILD ARG PGPASSWORD=odoopassword +ONBUILD ARG PGHOST=db +ONBUILD ARG PGPORT=5432 +ONBUILD ARG PGDATABASE=prod +# Config variables +ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ + DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \ + DEFAULT_REPO_PATTERN_ODOO="$DEFAULT_REPO_PATTERN_ODOO" \ + UNACCENT="$UNACCENT" \ + PGUSER="$PGUSER" \ + PGPASSWORD="$PGPASSWORD" \ + PGHOST="$PGHOST" \ + PGPORT=$PGPORT \ + PGDATABASE="$PGDATABASE" \ + PROXY_MODE="$PROXY_MODE" \ + SMTP_SERVER="$SMTP_SERVER" \ + SMTP_PORT=$SMTP_PORT \ + SMTP_USER="$SMTP_USER" \ + SMTP_PASSWORD="$SMTP_PASSWORD" \ + SMTP_SSL="$SMTP_SSL" \ + EMAIL_FROM="$EMAIL_FROM" \ + WITHOUT_DEMO="$WITHOUT_DEMO" +ONBUILD ARG LOCAL_CUSTOM_DIR=./custom +ONBUILD COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom + +# Enable setting custom uids for odoo user during build of scaffolds +ONBUILD ARG UID=1000 +ONBUILD ARG GID=1000 + +# Enable Odoo user and filestore +ONBUILD RUN groupadd -g $GID odoo \ + && useradd -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && sync + +# https://docs.python.org/3/library/logging.html#levels +ONBUILD ARG LOG_LEVEL=INFO +ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ + && ln -s /opt/odoo/custom/ssh ~root/.ssh \ + && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ + && sync +ONBUILD RUN /opt/odoo/common/build && sync +ONBUILD VOLUME ["/var/lib/odoo"] +ONBUILD USER odoo diff --git a/tests/__init__.py b/tests/__init__.py index ac4b6d0b..9a6963c7 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -16,11 +16,20 @@ DIR = dirname(__file__) ODOO_PREFIX = ("odoo", "--stop-after-init", "--workers=0") ODOO_VERSIONS = frozenset(environ.get( - "DOCKER_TAG", "7.0 8.0 9.0 10.0 11.0 12.0").split()) + "DOCKER_TAG", "7.0 8.0 9.0 10.0 11.0 12.0 13.0").split()) PG_VERSIONS = frozenset(environ.get( "PG_VERSIONS", "11").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") +# This decorator skips tests that will fail until some branches and/or addons +# are migrated to the next release. It is used in situations where Doodba is +# preparing the pre-release for the next version of Odoo, which hasn't been +# released yet. +prerelease_skip = unittest.skipIf( + ODOO_VERSIONS == {"13.0"}, + "Tests not supported in pre-release", +) + def matrix(odoo=ODOO_VERSIONS, pg=PG_VERSIONS, odoo_skip=frozenset(), pg_skip=frozenset()): @@ -161,6 +170,7 @@ def test_addons_filtered(self): ("bash", "-c", 'test "$(addons list -cWsale)" == crm'), ) + @prerelease_skip def test_qa(self): """Test that QA tools are in place and work as expected.""" folder = join(SCAFFOLDINGS_DIR, "settings") @@ -176,6 +186,7 @@ def test_qa(self): for sub_env in matrix(): self.compose_test(folder, sub_env, *commands) + @prerelease_skip def test_settings(self): """Test settings are filled OK""" folder = join(SCAFFOLDINGS_DIR, "settings") @@ -198,6 +209,10 @@ def test_settings(self): for sub_env in matrix(odoo_skip={"7.0", "8.0", "9.0"}): self.compose_test(folder, sub_env, *commands) + # It could work in prerelease, without a bug in click-odoo + # HACK https://github.com/acsone/click-odoo-contrib/pull/56 + # TODO Remove decorator when OCB 13.0 is released + @prerelease_skip def test_smallest(self): """Tests for the smallest possible environment.""" commands = ( @@ -205,7 +220,6 @@ def test_smallest(self): ("test", "-f", "/opt/odoo/auto/odoo.conf"), ("test", "-d", "/opt/odoo/custom/src/private"), ("test", "-d", "/opt/odoo/custom/ssh"), - ("test", "-x", "/usr/local/bin/unittest"), ("addons", "list", "-cpix"), ("pg_activity", "--version"), # Default fonts must be liberation @@ -215,7 +229,6 @@ def test_smallest(self): # Must be able to install base addon ODOO_PREFIX + ("--init", "base"), # Auto updater must work - ("autoupdate",), ("click-odoo-update",), ) smallest_dir = join(SCAFFOLDINGS_DIR, "smallest") @@ -268,6 +281,9 @@ def test_dotd(self): ("--version",), ) + # TODO Remove decorator when OCB 13.0 is released and server-tools 13.0 + # has a valid module to test + @prerelease_skip def test_dependencies(self): """Test dependencies installation.""" dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies") diff --git a/tests/scaffoldings/dependencies/custom/src/repos.yaml b/tests/scaffoldings/dependencies/custom/src/repos.yaml deleted file mode 100644 index 1eddc934..00000000 --- a/tests/scaffoldings/dependencies/custom/src/repos.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Odoo is always required -./odoo: - defaults: - # Shallow repositores are faster & thinner - depth: $DEPTH_DEFAULT - remotes: - ocb: https://github.com/OCA/OCB.git - odoo: https://github.com/odoo/odoo.git - target: - ocb $ODOO_VERSION - merges: - - ocb $ODOO_VERSION diff --git a/tests/scaffoldings/dotd/custom/dependencies/apt.txt b/tests/scaffoldings/dotd/custom/dependencies/apt.txt index ce054159..b56177ad 100644 --- a/tests/scaffoldings/dotd/custom/dependencies/apt.txt +++ b/tests/scaffoldings/dotd/custom/dependencies/apt.txt @@ -1,2 +1,3 @@ # This line should be ignored busybox +ruby diff --git a/tests/scaffoldings/dotd/custom/src/repos.yaml b/tests/scaffoldings/dotd/custom/src/repos.yaml deleted file mode 100644 index 1eddc934..00000000 --- a/tests/scaffoldings/dotd/custom/src/repos.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Odoo is always required -./odoo: - defaults: - # Shallow repositores are faster & thinner - depth: $DEPTH_DEFAULT - remotes: - ocb: https://github.com/OCA/OCB.git - odoo: https://github.com/odoo/odoo.git - target: - ocb $ODOO_VERSION - merges: - - ocb $ODOO_VERSION From 40a2bd09fa41fa25c651edccf8153eeee24333c4 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 24 Sep 2019 09:34:42 +0100 Subject: [PATCH 064/255] Pass doodbalib log level to gitaggregate This allows builds to pass `LOG_LEVEL=DEBUG` and somehow workaround https://github.com/acsone/git-aggregator/issues/31 while https://github.com/acsone/git-aggregator/pull/35 is not released yet. --- bin/autoaggregate | 5 ++++- lib/doodbalib/__init__.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/autoaggregate b/bin/autoaggregate index 2a9c3bac..e21e4b77 100755 --- a/bin/autoaggregate +++ b/bin/autoaggregate @@ -10,6 +10,7 @@ from doodbalib import ( ADDONS_YAML, AUTO_REPOS_YAML, CORE, + LOG_LEVELS, logger, PRIVATE, REPOS_YAML, @@ -21,6 +22,7 @@ UID = int(os.environ.get("UID") or -1) GID = int(os.environ.get("GID") or -1) DEFAULT_REPO_PATTERN = os.environ.get("DEFAULT_REPO_PATTERN") DEFAULT_REPO_PATTERN_ODOO = os.environ.get("DEFAULT_REPO_PATTERN_ODOO") +log_level = os.environ.get("LOG_LEVEL", "INFO") def aggregate(config): @@ -37,6 +39,7 @@ def aggregate(config): old_umask = os.umask(int(UMASK)) check_call( ["gitaggregate", "--expand-env", "--config", config, + "--log-level", log_level, "--jobs", str(cpu_count() or 1)], cwd=SRC_DIR, stderr=sys.stderr, @@ -52,7 +55,7 @@ def aggregate(config): for target in dirs + files: try: os.chown(os.path.join(root, target), UID, GID) - except: + except Exception: logger.debug( "Error trying to chown on file. Skipping...", exc_info=True, diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index a80887e9..71e033b1 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -33,7 +33,7 @@ AUTO_REPOS_YAML = '%s.yaml' % AUTO_REPOS_YAML CLEAN = os.environ.get("CLEAN") == "true" -LOG_LEVELS = ("DEBUG", "INFO", "WARNING", "ERROR") +LOG_LEVELS = frozenset({"DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"}) FILE_APT_BUILD = os.path.join( CUSTOM_DIR, 'dependencies', 'apt_build.txt', ) From 9255406d3f7d3dbb17dd79c04a5c50c74b4c47cf Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 30 Sep 2019 08:31:08 +0100 Subject: [PATCH 065/255] Build 13.0 using OCB 13.0 Branch 13.0 of OCA/OCB is now released, so let's use it. --- 13.0.Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 68368140..5bd67391 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -84,10 +84,9 @@ RUN python -m venv --system-site-packages /qa/venv \ && mkdir -p /qa/artifacts \ && git clone --depth 1 $MQT /qa/mqt -# HACK OCB 13.0 not yet available -ARG ODOO_SOURCE=odoo/odoo +ARG ODOO_SOURCE=OCA/OCB ARG ODOO_VERSION=13.0 -ENV ODOO_VERSION="saas-12.5" +ENV ODOO_VERSION="$ODOO_VERSION" # Install Odoo hard & soft dependencies, and Doodba utilities RUN build_deps=" \ @@ -146,8 +145,7 @@ ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] ONBUILD ARG AGGREGATE=true ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" -# HACK OCB 13.0 not yet available -ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/odoo/odoo.git" +ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" ONBUILD ARG DEPTH_DEFAULT=1 ONBUILD ARG DEPTH_MERGE=100 ONBUILD ARG CLEAN=true From f97341b22563f1071c8ee3fd473048187fcb8324 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 3 Oct 2019 08:48:50 +0100 Subject: [PATCH 066/255] Install click-odoo[-contrib] from upstream repos I'd like to install them from pypi, but our required patches are not yet released. They are merged, however, so I install them now from upstream repositories, pinning the commit. --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 13.0.Dockerfile | 3 ++- 8.0.Dockerfile | 2 +- tests/__init__.py | 4 ---- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 3b700771..80c7b581 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -71,7 +71,7 @@ RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version ' WORKDIR /opt/odoo RUN pip install \ astor \ - git+https://github.com/Tecnativa/click-odoo-contrib.git@update-parallel-db-lock-watcher#egg=click-odoo-contrib \ + git+https://github.com/acsone/click-odoo-contrib.git@1a8ef8bcbeaf8ecbfdfe9b83936ad9f2dd819fc3 \ git-aggregator \ pg_activity \ ptvsd \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 95feb788..27019c3c 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -67,7 +67,7 @@ RUN ln -s /usr/bin/nodejs /usr/local/bin/node \ WORKDIR /opt/odoo RUN pip install \ astor \ - git+https://github.com/Tecnativa/click-odoo-contrib.git@update-parallel-db-lock-watcher#egg=click-odoo-contrib \ + git+https://github.com/acsone/click-odoo-contrib.git@1a8ef8bcbeaf8ecbfdfe9b83936ad9f2dd819fc3 \ git-aggregator \ pg_activity \ ptvsd \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 5bd67391..dab323c5 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -114,13 +114,14 @@ RUN build_deps=" \ 'websocket-client~=0.56' \ astor \ git-aggregator \ - git+https://github.com/Tecnativa/click-odoo-contrib.git@update-parallel-db-lock-watcher#egg=click-odoo-contrib \ + git+https://github.com/acsone/click-odoo-contrib.git@1a8ef8bcbeaf8ecbfdfe9b83936ad9f2dd819fc3 \ pg_activity \ phonenumbers \ ptvsd \ pudb \ watchdog \ wdb \ + && pip install -U git+https://github.com/Tecnativa/click-odoo.git@parse-version \ && (python3 -m compileall -q /usr/local/lib/python3.7/ || true) \ && apt-get purge -yqq $build_deps \ && apt-get autopurge -yqq \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index b189eed6..c172154e 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -75,7 +75,7 @@ RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version ' # Other facilities WORKDIR /opt/odoo RUN pip install \ - git+https://github.com/Tecnativa/click-odoo-contrib.git@update-parallel-db-lock-watcher#egg=click-odoo-contrib \ + git+https://github.com/acsone/click-odoo-contrib.git@1a8ef8bcbeaf8ecbfdfe9b83936ad9f2dd819fc3 \ git-aggregator \ ptvsd \ pudb \ diff --git a/tests/__init__.py b/tests/__init__.py index 9a6963c7..c57cc826 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -209,10 +209,6 @@ def test_settings(self): for sub_env in matrix(odoo_skip={"7.0", "8.0", "9.0"}): self.compose_test(folder, sub_env, *commands) - # It could work in prerelease, without a bug in click-odoo - # HACK https://github.com/acsone/click-odoo-contrib/pull/56 - # TODO Remove decorator when OCB 13.0 is released - @prerelease_skip def test_smallest(self): """Tests for the smallest possible environment.""" commands = ( From 7dae581a09994f951b552520cb34c3e3fd2d1fe7 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 3 Oct 2019 09:59:36 +0100 Subject: [PATCH 067/255] Move fontconfig to modern XDG-based location This is required for fontconfig to work fine with Debian 10. --- build.d/300-fontconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.d/300-fontconfig b/build.d/300-fontconfig index ff0b91aa..e22bdcab 100755 --- a/build.d/300-fontconfig +++ b/build.d/300-fontconfig @@ -1,7 +1,8 @@ #!/bin/bash set -e -cat < ~odoo/.fonts.conf +mkdir -p ~odoo/.config/fontconfig/conf.d +cat < ~odoo/.config/fontconfig/conf.d/100-doodba.conf @@ -27,4 +28,4 @@ cat < ~odoo/.fonts.conf END -chown odoo:odoo ~odoo/.fonts.conf +chown odoo:odoo ~odoo/.config From 9c5cf322293d2403b013a5177f448c28fdad8785 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 7 Oct 2019 09:09:47 +0200 Subject: [PATCH 068/255] fix build errors by using released versions for click-odoo[-contrib] previously a now deleted branch was used, but now that click-odoo and click-odoo-crontib are released with the patches it is is no longer necessary fixes https://github.com/Tecnativa/doodba/issues/247 reverts partially f97341b22563f1071c8ee3fd473048187fcb8324 reverts c6f3bb010d27ea82307958bc0f990c7e8ce49f88 --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 13.0.Dockerfile | 3 +-- 8.0.Dockerfile | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 80c7b581..9f418fe2 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -71,7 +71,7 @@ RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version ' WORKDIR /opt/odoo RUN pip install \ astor \ - git+https://github.com/acsone/click-odoo-contrib.git@1a8ef8bcbeaf8ecbfdfe9b83936ad9f2dd819fc3 \ + click-odoo-contrib \ git-aggregator \ pg_activity \ ptvsd \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 27019c3c..2d1b5179 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -67,7 +67,7 @@ RUN ln -s /usr/bin/nodejs /usr/local/bin/node \ WORKDIR /opt/odoo RUN pip install \ astor \ - git+https://github.com/acsone/click-odoo-contrib.git@1a8ef8bcbeaf8ecbfdfe9b83936ad9f2dd819fc3 \ + click-odoo-contrib \ git-aggregator \ pg_activity \ ptvsd \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index dab323c5..da8ba717 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -114,14 +114,13 @@ RUN build_deps=" \ 'websocket-client~=0.56' \ astor \ git-aggregator \ - git+https://github.com/acsone/click-odoo-contrib.git@1a8ef8bcbeaf8ecbfdfe9b83936ad9f2dd819fc3 \ + click-odoo-contrib \ pg_activity \ phonenumbers \ ptvsd \ pudb \ watchdog \ wdb \ - && pip install -U git+https://github.com/Tecnativa/click-odoo.git@parse-version \ && (python3 -m compileall -q /usr/local/lib/python3.7/ || true) \ && apt-get purge -yqq $build_deps \ && apt-get autopurge -yqq \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index c172154e..c868c4b5 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -75,7 +75,7 @@ RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version ' # Other facilities WORKDIR /opt/odoo RUN pip install \ - git+https://github.com/acsone/click-odoo-contrib.git@1a8ef8bcbeaf8ecbfdfe9b83936ad9f2dd819fc3 \ + click-odoo-contrib \ git-aggregator \ ptvsd \ pudb \ From 704ce45f927a94a1aaf5dd94308e49e242a22525 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 7 Oct 2019 09:39:22 +0100 Subject: [PATCH 069/255] Include ssh client in v13 Fix #246. Test it too. --- 13.0.Dockerfile | 1 + tests/__init__.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/13.0.Dockerfile b/13.0.Dockerfile index da8ba717..a86c7ac9 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -47,6 +47,7 @@ RUN apt-get -qq update \ locales-all \ nano \ npm \ + openssh-client \ postgresql-client \ postgresql-common \ telnet \ diff --git a/tests/__init__.py b/tests/__init__.py index c57cc826..d0f373af 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -226,6 +226,12 @@ def test_smallest(self): ODOO_PREFIX + ("--init", "base"), # Auto updater must work ("click-odoo-update",), + # Needed tools exist + ("curl", "--version"), + ("git", "--version"), + ("pg_activity", "--version"), + ("psql", "--version"), + ("ssh", "-V"), ) smallest_dir = join(SCAFFOLDINGS_DIR, "smallest") for sub_env in matrix(odoo_skip={"7.0", "8.0"}): From b2286b8733c876ec0f97bd01ee9cc346af6648fb Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 23 Oct 2019 12:59:42 +0100 Subject: [PATCH 070/255] Add pre-commit with black, isort and cool things, and run it Big diff, but nothing important here. --- .editorconfig | 2 +- .isort.cfg | 12 ++ .pre-commit-config.yaml | 29 +++ .vscode/settings.json | 15 ++ bin/addons | 85 +++++--- bin/autoaggregate | 33 +-- bin/config-generate | 5 +- bin/direxec | 20 +- bin/log | 1 + build.d/200-dependencies | 18 +- build.d/400-clean | 9 +- build.d/900-dependencies-cleanup | 8 +- entrypoint.d/40-addons-link | 13 +- lib/doodbalib/__init__.py | 60 +++--- lib/doodbalib/installer.py | 58 +++--- qa/insider | 17 +- requirements-ci.txt | 1 + tests/__init__.py | 188 ++++++++++++------ .../custom/entrypoint.d/check-requirements | 1 + .../src/private/dummy_addon/__manifest__.py | 7 +- .../odoo/src/private/product/__manifest__.py | 5 +- .../src/private/disabled_addon/__openerp__.py | 6 +- .../src/private/private_addon/__openerp__.py | 6 +- .../settings/custom/scripts/test_settings.py | 1 + 24 files changed, 353 insertions(+), 247 deletions(-) create mode 100644 .isort.cfg create mode 100644 .pre-commit-config.yaml create mode 100644 .vscode/settings.json diff --git a/.editorconfig b/.editorconfig index 0721c303..9d797f57 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,5 +8,5 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[*.{md,yaml,yml}] +[*.{md,yaml,yml,yaml}] indent_size = 2 diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 00000000..a3773794 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,12 @@ +# From https://github.com/OCA/maintainer-quality-tools/blob/master/sample_files/pre-commit-13.0/.isort.cfg +[settings] +multi_line_output=3 +include_trailing_comma=True +force_grid_wrap=0 +combine_as_imports=True +use_parentheses=True +line_length=88 +known_odoo=odoo +known_odoo_addons=odoo.addons +sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER +known_third_party=doodbalib,yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..584e3c31 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,29 @@ +default_language_version: + python: python3 +repos: +- repo: https://github.com/psf/black + rev: 19.3b0 + hooks: + - id: black +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: debug-statements + - id: fix-encoding-pragma + - id: check-case-conflict + - id: check-docstring-first + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: check-xml + - id: mixed-line-ending + args: ["--fix=lf"] +- repo: https://github.com/asottile/seed-isort-config + rev: v1.9.3 + hooks: + - id: seed-isort-config +- repo: https://github.com/pre-commit/mirrors-isort + rev: v4.3.21 + hooks: + - id: isort diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..2927f047 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,15 @@ +{ + "python.autoComplete.extraPaths": [ + "./lib", + "./tests", + ], + "editor.formatOnSave": true, + "editor.formatOnSaveTimeout": 1000, + "python.formatting.provider": "black", + "python.linting.flake8Args": [ + "--max-line-length=88" + ], + "python.linting.flake8Enabled": true, + "python.linting.pylintEnabled": true, + "python.pythonPath": "python3", +} diff --git a/bin/addons b/bin/addons index 1b5bccd8..05c9734f 100755 --- a/bin/addons +++ b/bin/addons @@ -1,58 +1,82 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- from __future__ import print_function + import ast import os import sys from argparse import ArgumentParser from subprocess import check_call + from doodbalib import ( - addons_config, - AddonsConfigError, CORE, - logger, MANIFESTS, PRIVATE, SRC_DIR, + AddonsConfigError, + addons_config, + logger, ) # Define CLI options parser = ArgumentParser(description="Install addons in current environment") parser.add_argument( - "action", choices=("init", "update", "list"), - help="What to do with the matched addons.") -parser.add_argument( - "-c", "--core", action="store_true", - help="Use all Odoo core addons") + "action", + choices=("init", "update", "list"), + help="What to do with the matched addons.", +) parser.add_argument( - "-d", "--dependencies", action="store_true", - help="Use only dependencies of selected addons") + "-c", "--core", action="store_true", help="Use all Odoo core addons" +) parser.add_argument( - "-e", "--extra", action="store_true", - help="Use all extra addons") + "-d", + "--dependencies", + action="store_true", + help="Use only dependencies of selected addons", +) +parser.add_argument("-e", "--extra", action="store_true", help="Use all extra addons") parser.add_argument( - "-f", "--fullpath", action="store_true", - help="Print addon's full path, only useful with list mode") + "-f", + "--fullpath", + action="store_true", + help="Print addon's full path, only useful with list mode", +) parser.add_argument( - "-i", "--installable", action="store_true", - help="Include only installable addons") + "-i", "--installable", action="store_true", help="Include only installable addons" +) parser.add_argument( - "-p", "--private", action="store_true", - help="Use all private addons") + "-p", "--private", action="store_true", help="Use all private addons" +) parser.add_argument( - "-s", "--separator", type=str, default=",", - help="String that separates addons only useful with list mode") + "-s", + "--separator", + type=str, + default=",", + help="String that separates addons only useful with list mode", +) parser.add_argument( - "-t", "--test", action="store_true", - help="Run unit tests for these addons, usually combined with update") + "-t", + "--test", + action="store_true", + help="Run unit tests for these addons, usually combined with update", +) parser.add_argument( - "-x", "--explicit", action="store_true", - help="Fail if any addon is explicitly declared but not found") + "-x", + "--explicit", + action="store_true", + help="Fail if any addon is explicitly declared but not found", +) parser.add_argument( - "-w", "--with", action="append", dest="with_", default=[], - help="Addons to include always.") + "-w", + "--with", + action="append", + dest="with_", + default=[], + help="Addons to include always.", +) parser.add_argument( - "-W", "--without", action="append", default=[], - help="Addons to exclude always.") + "-W", "--without", action="append", default=[], help="Addons to exclude always." +) # Generate the matching addons set args = parser.parse_args() @@ -105,9 +129,6 @@ else: if args.test: command += ["--test-enable", "--workers", "0"] if os.environ.get("PGDATABASE"): - command += [ - "--db-filter", - u"^{}$".format(os.environ.get("PGDATABASE")), - ] + command += ["--db-filter", u"^{}$".format(os.environ.get("PGDATABASE"))] logger.info("Executing %s", " ".join(command)) check_call(command) diff --git a/bin/autoaggregate b/bin/autoaggregate index e21e4b77..fc35bfb5 100755 --- a/bin/autoaggregate +++ b/bin/autoaggregate @@ -2,19 +2,19 @@ # -*- coding: utf-8 -*- import os import sys -import yaml from multiprocessing import cpu_count from subprocess import check_call +import yaml from doodbalib import ( ADDONS_YAML, AUTO_REPOS_YAML, CORE, LOG_LEVELS, - logger, PRIVATE, REPOS_YAML, SRC_DIR, + logger, ) UMASK = os.environ.get("UMASK") @@ -38,9 +38,16 @@ def aggregate(config): if UMASK: old_umask = os.umask(int(UMASK)) check_call( - ["gitaggregate", "--expand-env", "--config", config, - "--log-level", log_level, - "--jobs", str(cpu_count() or 1)], + [ + "gitaggregate", + "--expand-env", + "--config", + config, + "--log-level", + log_level, + "--jobs", + str(cpu_count() or 1), + ], cwd=SRC_DIR, stderr=sys.stderr, stdout=sys.stdout, @@ -57,8 +64,7 @@ def aggregate(config): os.chown(os.path.join(root, target), UID, GID) except Exception: logger.debug( - "Error trying to chown on file. Skipping...", - exc_info=True, + "Error trying to chown on file. Skipping...", exc_info=True ) @@ -101,7 +107,8 @@ def missing_repos_config(): continue repo_path = os.path.abspath(os.path.join(SRC_DIR, repo)) if not os.path.exists(repo_path) or os.path.isdir( - os.path.join(repo_path, ".git")): + os.path.join(repo_path, ".git") + ): expected.add(repo_path) except (IOError, AttributeError): logger.debug("No addons are expected to be present") @@ -109,12 +116,10 @@ def missing_repos_config(): missing = expected - defined config = { repo_path: { - 'defaults': {'depth': '$DEPTH_DEFAULT'}, - 'merges': ['origin $ODOO_VERSION'], - 'remotes': { - 'origin': origin_for(repo_path), - }, - 'target': 'origin $ODOO_VERSION', + "defaults": {"depth": "$DEPTH_DEFAULT"}, + "merges": ["origin $ODOO_VERSION"], + "remotes": {"origin": origin_for(repo_path)}, + "target": "origin $ODOO_VERSION", } for repo_path in missing } diff --git a/bin/config-generate b/bin/config-generate index ceb01176..88e33d71 100755 --- a/bin/config-generate +++ b/bin/config-generate @@ -4,9 +4,10 @@ import os from contextlib import closing -from doodbalib import logger from string import Template +from doodbalib import logger + try: # Python 2, where io.StringIO fails because it is unicode-only from StringIO import StringIO @@ -15,10 +16,12 @@ except ImportError: try: from configparser import RawConfigParser + parser = RawConfigParser(strict=False) except ImportError: # Python 2, where strict=True doesn't exist from ConfigParser import RawConfigParser + parser = RawConfigParser() ODOO_VERSION = os.environ.get("ODOO_VERSION") diff --git a/bin/direxec b/bin/direxec index e7249b12..a9cdf4e7 100755 --- a/bin/direxec +++ b/bin/direxec @@ -1,21 +1,21 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- import os import subprocess import sys - from logging import DEBUG, INFO -from psycopg2 import connect, OperationalError - from doodbalib import logger, which +from psycopg2 import OperationalError, connect + # Call this file linked from another file called `build` or `entrypoint` mode = os.path.basename(__file__) -dir_odoo = '/opt/odoo' -dir_common = os.path.join(dir_odoo, 'common', '%s.d' % mode) -dir_custom = os.path.join(dir_odoo, 'custom', '%s.d' % mode) +dir_odoo = "/opt/odoo" +dir_common = os.path.join(dir_odoo, "common", "%s.d" % mode) +dir_custom = os.path.join(dir_odoo, "custom", "%s.d" % mode) # Find scripts files = [(d, dir_common) for d in os.listdir(dir_common)] @@ -34,7 +34,7 @@ for executable, folder in sorted(files): # Allow to omit 1st command and default to `odoo` extra_command = sys.argv[1:] if extra_command: - if extra_command[0] == 'shell' or extra_command[0].startswith("-"): + if extra_command[0] == "shell" or extra_command[0].startswith("-"): extra_command.insert(0, "odoo") # Set the DB creation language, if needed if extra_command[0] in {"odoo", "/usr/local/bin/odoo"}: @@ -49,9 +49,9 @@ if extra_command: # See `python -m ptvsd -h` to understand this extra_command[0] = os.path.realpath(which(extra_command[0])) extra_command = ( - ["python", "-m", "ptvsd"] + - os.environ["PTVSD_ARGS"].split() + - extra_command + ["python", "-m", "ptvsd"] + + os.environ["PTVSD_ARGS"].split() + + extra_command ) logger.log( DEBUG if extra_command[0] == "/qa/insider" else INFO, diff --git a/bin/log b/bin/log index f5db03f6..ebc8d394 100755 --- a/bin/log +++ b/bin/log @@ -1,4 +1,5 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- from __future__ import unicode_literals import argparse diff --git a/build.d/200-dependencies b/build.d/200-dependencies index 745566a2..3a1dab65 100755 --- a/build.d/200-dependencies +++ b/build.d/200-dependencies @@ -1,16 +1,12 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- # Copyright 2017 LasLabs Inc. -from os.path import basename, join, splitext from glob import glob +from os.path import basename, join, splitext -from doodbalib import ( - CUSTOM_DIR, - FILE_APT_BUILD, - SRC_DIR, -) -from doodbalib.installer import install, INSTALLERS, logger - +from doodbalib import CUSTOM_DIR, FILE_APT_BUILD, SRC_DIR +from doodbalib.installer import INSTALLERS, install, logger # Build dependencies installed before any others install("apt", FILE_APT_BUILD) @@ -18,16 +14,16 @@ install("apt", FILE_APT_BUILD) for name in INSTALLERS: req_files = [] # Normal dependency installation - req_files.append(join(CUSTOM_DIR, 'dependencies', '%s.txt' % name)) + req_files.append(join(CUSTOM_DIR, "dependencies", "%s.txt" % name)) for req_file in req_files: install(name, req_file) # Sorted dependencies installation -dep_files = sorted(glob(join(CUSTOM_DIR, 'dependencies', '[0-9]*-*'))) +dep_files = sorted(glob(join(CUSTOM_DIR, "dependencies", "[0-9]*-*"))) for dep_file in dep_files: root, ext = splitext(basename(dep_file)) # Get the installer (xxx-installer[-description][.ext]) - installer = root.split('-', 2)[1] + installer = root.split("-", 2)[1] if installer not in INSTALLERS: logger.error("Unknown installer: %s", installer) raise Exception diff --git a/build.d/400-clean b/build.d/400-clean index eef3ac28..274893fd 100755 --- a/build.d/400-clean +++ b/build.d/400-clean @@ -4,14 +4,7 @@ import os import shutil import sys -from doodbalib import ( - addons_config, - CLEAN, - logger, - ODOO_DIR, - PRIVATE_DIR, - SRC_DIR, -) +from doodbalib import CLEAN, ODOO_DIR, PRIVATE_DIR, SRC_DIR, addons_config, logger if not CLEAN: logger.warning("Not cleaning garbage") diff --git a/build.d/900-dependencies-cleanup b/build.d/900-dependencies-cleanup index 6da4af70..467ea0bc 100755 --- a/build.d/900-dependencies-cleanup +++ b/build.d/900-dependencies-cleanup @@ -1,4 +1,5 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- # Copyright 2017 LasLabs Inc. import os @@ -6,18 +7,15 @@ import os from doodbalib import CUSTOM_DIR, FILE_APT_BUILD from doodbalib.installer import INSTALLERS - # Build-time dependencies must be removed when finishing build if os.path.isfile(FILE_APT_BUILD): - installer = INSTALLERS['apt'](FILE_APT_BUILD) + installer = INSTALLERS["apt"](FILE_APT_BUILD) installer.remove() installer.cleanup() # Clean up garbage generated by respective package managers for name, class_ in INSTALLERS.items(): - req_file = os.path.join( - CUSTOM_DIR, 'dependencies', '%s.txt' % name, - ) + req_file = os.path.join(CUSTOM_DIR, "dependencies", "%s.txt" % name) if os.path.isfile(req_file): class_(req_file).cleanup() diff --git a/entrypoint.d/40-addons-link b/entrypoint.d/40-addons-link index 604c20a0..626e3523 100755 --- a/entrypoint.d/40-addons-link +++ b/entrypoint.d/40-addons-link @@ -3,18 +3,9 @@ import os from glob import iglob -from doodbalib import ( - addons_config, - ADDONS_DIR, - ADDONS_YAML, - logger, - SRC_DIR, -) +from doodbalib import ADDONS_DIR, ADDONS_YAML, SRC_DIR, addons_config, logger -logger.info( - "Linking all addons from %s in %s", - ADDONS_YAML, - ADDONS_DIR) +logger.info("Linking all addons from %s in %s", ADDONS_YAML, ADDONS_DIR) # Remove all links in addons dir for link in iglob(os.path.join(ADDONS_DIR, "*")): diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index 71e033b1..b9871222 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import logging import os - from glob import glob from pprint import pformat from subprocess import check_output @@ -11,32 +10,30 @@ # Constants needed in scripts CUSTOM_DIR = "/opt/odoo/custom" AUTO_DIR = "/opt/odoo/auto" -ADDONS_DIR = os.path.join(AUTO_DIR, 'addons') -SRC_DIR = os.path.join(CUSTOM_DIR, 'src') +ADDONS_DIR = os.path.join(AUTO_DIR, "addons") +SRC_DIR = os.path.join(CUSTOM_DIR, "src") -ADDONS_YAML = os.path.join(SRC_DIR, 'addons') -if os.path.isfile('%s.yaml' % ADDONS_YAML): - ADDONS_YAML = '%s.yaml' % ADDONS_YAML +ADDONS_YAML = os.path.join(SRC_DIR, "addons") +if os.path.isfile("%s.yaml" % ADDONS_YAML): + ADDONS_YAML = "%s.yaml" % ADDONS_YAML else: - ADDONS_YAML = '%s.yml' % ADDONS_YAML + ADDONS_YAML = "%s.yml" % ADDONS_YAML -REPOS_YAML = os.path.join(SRC_DIR, 'repos') -if os.path.isfile('%s.yaml' % REPOS_YAML): - REPOS_YAML = '%s.yaml' % REPOS_YAML +REPOS_YAML = os.path.join(SRC_DIR, "repos") +if os.path.isfile("%s.yaml" % REPOS_YAML): + REPOS_YAML = "%s.yaml" % REPOS_YAML else: - REPOS_YAML = '%s.yml' % REPOS_YAML + REPOS_YAML = "%s.yml" % REPOS_YAML -AUTO_REPOS_YAML = os.path.join(AUTO_DIR, 'repos') -if os.path.isfile('%s.yml' % AUTO_REPOS_YAML): - AUTO_REPOS_YAML = '%s.yml' % AUTO_REPOS_YAML +AUTO_REPOS_YAML = os.path.join(AUTO_DIR, "repos") +if os.path.isfile("%s.yml" % AUTO_REPOS_YAML): + AUTO_REPOS_YAML = "%s.yml" % AUTO_REPOS_YAML else: - AUTO_REPOS_YAML = '%s.yaml' % AUTO_REPOS_YAML + AUTO_REPOS_YAML = "%s.yaml" % AUTO_REPOS_YAML CLEAN = os.environ.get("CLEAN") == "true" LOG_LEVELS = frozenset({"DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"}) -FILE_APT_BUILD = os.path.join( - CUSTOM_DIR, 'dependencies', 'apt_build.txt', -) +FILE_APT_BUILD = os.path.join(CUSTOM_DIR, "dependencies", "apt_build.txt") PRIVATE = "private" CORE = "odoo/addons" PRIVATE_DIR = os.path.join(SRC_DIR, PRIVATE) @@ -96,8 +93,9 @@ def addons_config(filtered=True, strict=False): if not filtered: doc.setdefault(CORE, ["*"]) doc.setdefault(PRIVATE, ["*"]) - elif any(os.environ.get(key) not in values - for key, values in only.items()): + elif any( + os.environ.get(key) not in values for key, values in only.items() + ): logger.debug("Skipping section with ONLY %s", only) continue # Flatten all sections in a single dict @@ -106,7 +104,7 @@ def addons_config(filtered=True, strict=False): all_globs.setdefault(repo, set()) all_globs[repo].update(partial_globs) except IOError: - logger.debug('Could not find addons configuration yaml.') + logger.debug("Could not find addons configuration yaml.") # Add default values for special sections for repo in (CORE, PRIVATE): all_globs.setdefault(repo, {"*"}) @@ -121,19 +119,15 @@ def addons_config(filtered=True, strict=False): # Projects without private addons should never fail if (repo, partial_glob) != (PRIVATE, "*"): missing_glob.add(full_glob) - logger.debug( - "Skipping unexpandable glob '%s'", - full_glob) + logger.debug("Skipping unexpandable glob '%s'", full_glob) continue for addon in found: - manifests = ( - os.path.join(addon, m) for m in MANIFESTS - ) + manifests = (os.path.join(addon, m) for m in MANIFESTS) if not any(os.path.isfile(m) for m in manifests): missing_manifest.add(addon) logger.debug( - "Skipping '%s' as it is not a valid Odoo " - "module", addon) + "Skipping '%s' as it is not a valid Odoo " "module", addon + ) continue logger.debug("Registering addon %s", addon) addon = os.path.basename(addon) @@ -147,11 +141,7 @@ def addons_config(filtered=True, strict=False): if missing_manifest: error += ["Addons without manifest:", pformat(missing_manifest)] if error: - raise AddonsConfigError( - "\n".join(error), - missing_glob, - missing_manifest, - ) + raise AddonsConfigError("\n".join(error), missing_glob, missing_manifest) logger.debug("Resulting configuration after expanding: %r", config) for addon, repos in config.items(): # Private addons are most important @@ -166,7 +156,7 @@ def addons_config(filtered=True, strict=False): # Other addons fall in between if len(repos) != 1: raise AddonsConfigError( - u"Addon {} defined in several repos {}".format(addon, repos), + u"Addon {} defined in several repos {}".format(addon, repos) ) yield addon, repos.pop() diff --git a/lib/doodbalib/installer.py b/lib/doodbalib/installer.py index 10c39950..cf305b22 100644 --- a/lib/doodbalib/installer.py +++ b/lib/doodbalib/installer.py @@ -2,11 +2,13 @@ from collections import OrderedDict from os.path import exists from subprocess import check_call + from doodbalib import logger class Installer(object): """Base class to install packages with some package system.""" + _cleanup_commands = [] _install_command = None _remove_command = None @@ -27,11 +29,9 @@ def cleanup(self): def install(self): """Install the requirements from the given file.""" if self._requirements: - return not self._run_command( - self._install_command + self._requirements) + return not self._run_command(self._install_command + self._requirements) else: - logger.info("No installable requirements found in %s", - self.file_path) + logger.info("No installable requirements found in %s", self.file_path) return False def remove(self): @@ -41,17 +41,16 @@ def remove(self): if self._requirements: self._run_command(self._remove_command + self._requirements) else: - logger.info("No removable requirements found in %s", - self.file_path) + logger.info("No removable requirements found in %s", self.file_path) def requirements(self): """Get a list of requirements from the given file.""" requirements = [] try: - with open(self.file_path, 'r') as fh: + with open(self.file_path, "r") as fh: for line in fh: line = line.strip() - if not line or line.startswith('#'): + if not line or line.startswith("#"): continue requirements += line.split() except IOError: @@ -61,15 +60,16 @@ def requirements(self): class AptInstaller(Installer): - _cleanup_commands = [ - ['apt-get', '-y', 'autoremove'], - 'rm -Rf /var/lib/apt/lists/*', - ] + _cleanup_commands = [["apt-get", "-y", "autoremove"], "rm -Rf /var/lib/apt/lists/*"] _install_command = [ - 'apt-get', - '-o', 'Dpkg::Options::=--force-confdef', - '-o', 'Dpkg::Options::=--force-confold', - '-y', '--no-install-recommends', 'install', + "apt-get", + "-o", + "Dpkg::Options::=--force-confdef", + "-o", + "Dpkg::Options::=--force-confold", + "-y", + "--no-install-recommends", + "install", ] _remove_command = ["apt-get", "purge", "-y"] @@ -82,21 +82,17 @@ def cleanup(self): def install(self): if not self._dirty() and self._requirements: - self._run_command(['apt-get', 'update']) + self._run_command(["apt-get", "update"]) return super(AptInstaller, self).install() class GemInstaller(Installer): - _cleanup_commands = [ - 'rm -Rf ~/.gem /var/lib/gems/*/cache/', - ] - _install_command = [ - "gem", "install", "--no-rdoc", "--no-ri", "--no-update-sources", - ] + _cleanup_commands = ["rm -Rf ~/.gem /var/lib/gems/*/cache/"] + _install_command = ["gem", "install", "--no-rdoc", "--no-ri", "--no-update-sources"] class NpmInstaller(Installer): - _cleanup_commands = ['rm -Rf ~/.npm /tmp/*'] + _cleanup_commands = ["rm -Rf ~/.npm /tmp/*"] _install_command = ["npm", "install", "-g"] @@ -108,12 +104,14 @@ def requirements(self): return [self.file_path] if exists(self.file_path) else [] -INSTALLERS = OrderedDict([ - ("apt", AptInstaller), - ("gem", GemInstaller), - ("npm", NpmInstaller), - ("pip", PipInstaller), -]) +INSTALLERS = OrderedDict( + [ + ("apt", AptInstaller), + ("gem", GemInstaller), + ("npm", NpmInstaller), + ("pip", PipInstaller), + ] +) def install(installer, file_path): diff --git a/qa/insider b/qa/insider index ff568d5e..a217466e 100755 --- a/qa/insider +++ b/qa/insider @@ -1,27 +1,28 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- from __future__ import print_function import os +import shutil import stat import subprocess import sys -import shutil - from argparse import ArgumentParser -from tempfile import mkstemp, NamedTemporaryFile +from tempfile import NamedTemporaryFile, mkstemp from doodbalib import logger # Define CLI options parser = ArgumentParser( - description="Execute some code in this container's QA environment.") + description="Execute some code in this container's QA environment." +) parser.add_argument( "script", - help="The source code that will be executed. " - "It should start with a shebang.") + help="The source code that will be executed. It should start with a shebang.", +) parser.add_argument( - "arguments", nargs="*", - help="Additional arguments passed to the script.") + "arguments", nargs="*", help="Additional arguments passed to the script." +) args = parser.parse_args() # Copy the source code to an executable file diff --git a/requirements-ci.txt b/requirements-ci.txt index e41f7569..c925c061 100644 --- a/requirements-ci.txt +++ b/requirements-ci.txt @@ -1 +1,2 @@ docker-compose +pre-commit diff --git a/tests/__init__.py b/tests/__init__.py index d0f373af..df5bb814 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 +# -*- coding: utf-8 -*- """Run tests for this base image. Each test must be a valid docker-compose.yaml file with a ``odoo`` service. """ import logging import unittest - from itertools import product from os import environ from os.path import dirname, join @@ -15,10 +15,10 @@ DIR = dirname(__file__) ODOO_PREFIX = ("odoo", "--stop-after-init", "--workers=0") -ODOO_VERSIONS = frozenset(environ.get( - "DOCKER_TAG", "7.0 8.0 9.0 10.0 11.0 12.0 13.0").split()) -PG_VERSIONS = frozenset(environ.get( - "PG_VERSIONS", "11").split()) +ODOO_VERSIONS = frozenset( + environ.get("DOCKER_TAG", "7.0 8.0 9.0 10.0 11.0 12.0 13.0").split() +) +PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "11").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") # This decorator skips tests that will fail until some branches and/or addons @@ -26,13 +26,13 @@ # preparing the pre-release for the next version of Odoo, which hasn't been # released yet. prerelease_skip = unittest.skipIf( - ODOO_VERSIONS == {"13.0"}, - "Tests not supported in pre-release", + ODOO_VERSIONS == {"13.0"}, "Tests not supported in pre-release" ) -def matrix(odoo=ODOO_VERSIONS, pg=PG_VERSIONS, - odoo_skip=frozenset(), pg_skip=frozenset()): +def matrix( + odoo=ODOO_VERSIONS, pg=PG_VERSIONS, odoo_skip=frozenset(), pg_skip=frozenset() +): """All possible combinations. We compute the variable matrix here instead of in ``.travis.yml`` because @@ -44,7 +44,7 @@ def matrix(odoo=ODOO_VERSIONS, pg=PG_VERSIONS, product( product(("ODOO_MINOR",), ODOO_VERSIONS & odoo - odoo_skip), product(("DB_VERSION",), PG_VERSIONS & pg - pg_skip), - ) + ), ) @@ -78,24 +78,14 @@ def compose_test(self, workdir, sub_env, *commands): full_env = dict(environ, **sub_env) with self.subTest(PWD=workdir, **sub_env): try: - self.popen( - ("docker-compose", "build"), - cwd=workdir, - env=full_env, - ) + self.popen(("docker-compose", "build"), cwd=workdir, env=full_env) for command in commands: with self.subTest(command=command): self.popen( - self.compose_run + command, - cwd=workdir, - env=full_env, + self.compose_run + command, cwd=workdir, env=full_env ) finally: - self.popen( - ("docker-compose", "down", "-v"), - cwd=workdir, - env=full_env, - ) + self.popen(("docker-compose", "down", "-v"), cwd=workdir, env=full_env) def test_addons_filtered(self): """Test addons filtering with ``ONLY`` keyword in ``addons.yaml``.""" @@ -106,10 +96,13 @@ def test_addons_filtered(self): dict(sub_env, DBNAME="prod"), ("test", "-e", "auto/addons/web"), ("test", "-e", "auto/addons/private_addon"), - ("bash", "-c", - 'test "$(addons list -p)" == disabled_addon,private_addon'), + ( + "bash", + "-c", + 'test "$(addons list -p)" == disabled_addon,private_addon', + ), ("bash", "-c", 'test "$(addons list -ip)" == private_addon'), - ("bash", "-c", 'addons list -c | grep ,crm,'), + ("bash", "-c", "addons list -c | grep ,crm,"), # absent_addon is missing and should fail ("bash", "-c", "! addons list -px"), ) @@ -119,10 +112,13 @@ def test_addons_filtered(self): ("test", "-e", "auto/addons/web"), ("test", "!", "-e", "auto/addons/private_addon"), ("bash", "-c", 'test -z "$(addons list -p)"'), - ("bash", "-c", - '[ "$(addons list -s. -pwfake1 -wfake2)" == fake1.fake2 ]'), + ( + "bash", + "-c", + '[ "$(addons list -s. -pwfake1 -wfake2)" == fake1.fake2 ]', + ), ("bash", "-c", "! addons list -wrepeat -Wrepeat"), - ("bash", "-c", 'addons list -c | grep ,crm,'), + ("bash", "-c", "addons list -c | grep ,crm,"), ) self.compose_test( project_dir, @@ -137,8 +133,7 @@ def test_addons_filtered(self): self.compose_test( project_dir, dict(sub_env, DBNAME="prod"), - ("bash", "-c", - 'test "$(addons list -ped)" == base,web,website'), + ("bash", "-c", 'test "$(addons list -ped)" == base,web,website'), # ``dummy_addon`` and ``private_addon`` exist ("test", "-d", "auto/addons/dummy_addon"), ("test", "-h", "auto/addons/dummy_addon"), @@ -146,26 +141,30 @@ def test_addons_filtered(self): ("test", "-e", "auto/addons/dummy_addon"), # Addon from extra repo takes higher priority than core version ("realpath", "auto/addons/product"), - ("bash", "-c", 'test "$(realpath auto/addons/product)" == ' - '/opt/odoo/custom/src/other-doodba/odoo/src/private/product'), - ("bash", "-c", - 'test "$(addons list -e)" == dummy_addon,product'), + ( + "bash", + "-c", + 'test "$(realpath auto/addons/product)" == ' + "/opt/odoo/custom/src/other-doodba/odoo/src/private/product", + ), + ("bash", "-c", 'test "$(addons list -e)" == dummy_addon,product'), ) self.compose_test( project_dir, dict(sub_env, DBNAME="limited_private"), ("test", "-e", "auto/addons/dummy_addon"), - ("bash", "-c", - 'test "$(addons list -e)" == dummy_addon,product'), + ("bash", "-c", 'test "$(addons list -e)" == dummy_addon,product'), ) self.compose_test( project_dir, dict(sub_env, DBNAME="limited_core"), ("test", "-e", "auto/addons/dummy_addon"), - ("bash", "-c", - '[ "$(addons list -s. -pwfake1 -wfake2)" == fake1.fake2 ]'), - ("bash", "-c", - 'test "$(addons list -e)" == dummy_addon,product'), + ( + "bash", + "-c", + '[ "$(addons list -s. -pwfake1 -wfake2)" == fake1.fake2 ]', + ), + ("bash", "-c", 'test "$(addons list -e)" == dummy_addon,product'), ("bash", "-c", 'test "$(addons list -c)" == crm,sale'), ("bash", "-c", 'test "$(addons list -cWsale)" == crm'), ) @@ -202,15 +201,19 @@ def test_settings(self): # Extra tests for versions >= 10.0, that support --load-language fine commands += ( # DB was created with the correct language - ("bash", "-c", - """test "$(psql -Atqc "SELECT code FROM res_lang - WHERE active = TRUE")" == es_ES"""), + ( + "bash", + "-c", + """test "$(psql -Atqc "SELECT code FROM res_lang + WHERE active = TRUE")" == es_ES""", + ), ) for sub_env in matrix(odoo_skip={"7.0", "8.0", "9.0"}): self.compose_test(folder, sub_env, *commands) def test_smallest(self): """Tests for the smallest possible environment.""" + liberation = 'Liberation{0}-Regular.ttf: "Liberation {0}" "Regular"' commands = ( # Must generate a configuration file ("test", "-f", "/opt/odoo/auto/odoo.conf"), @@ -219,9 +222,27 @@ def test_smallest(self): ("addons", "list", "-cpix"), ("pg_activity", "--version"), # Default fonts must be liberation - ("bash", "-c", """test "$(fc-match monospace)" == 'LiberationMono-Regular.ttf: "Liberation Mono" "Regular"'"""), - ("bash", "-c", """test "$(fc-match sans-serif)" == 'LiberationSans-Regular.ttf: "Liberation Sans" "Regular"'"""), - ("bash", "-c", """test "$(fc-match serif)" == 'LiberationSerif-Regular.ttf: "Liberation Serif" "Regular"'"""), + ( + "bash", + "-c", + """test "$(fc-match monospace)" == '{}'""".format( + liberation.format("Mono") + ), + ), + ( + "bash", + "-c", + """test "$(fc-match sans-serif)" == '{}'""".format( + liberation.format("Sans") + ), + ), + ( + "bash", + "-c", + """test "$(fc-match serif)" == '{}'""".format( + liberation.format("Serif") + ), + ), # Must be able to install base addon ODOO_PREFIX + ("--init", "base"), # Auto updater must work @@ -236,22 +257,23 @@ def test_smallest(self): smallest_dir = join(SCAFFOLDINGS_DIR, "smallest") for sub_env in matrix(odoo_skip={"7.0", "8.0"}): self.compose_test( - smallest_dir, sub_env, *commands, - ("python", "-c", "import watchdog"), + smallest_dir, sub_env, *commands, ("python", "-c", "import watchdog") ) for sub_env in matrix(odoo={"8.0"}): self.compose_test( - smallest_dir, sub_env, + smallest_dir, + sub_env, # Odoo <= 8.0 does not autocreate the database ("createdb",), - *commands + *commands, ) def test_dotd(self): """Test environment with common ``*.d`` directories.""" for sub_env in matrix(): self.compose_test( - join(SCAFFOLDINGS_DIR, "dotd"), sub_env, + join(SCAFFOLDINGS_DIR, "dotd"), + sub_env, # ``custom/build.d`` was properly executed ("test", "-f", "/home/odoo/created-at-build"), # ``custom/entrypoint.d`` was properly executed @@ -291,7 +313,8 @@ def test_dependencies(self): dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies") for sub_env in matrix(odoo_skip={"7.0"}): self.compose_test( - dependencies_dir, sub_env, + dependencies_dir, + sub_env, ("test", "!", "-f", "custom/dependencies/apt.txt"), ("test", "!", "-f", "custom/dependencies/gem.txt"), ("test", "!", "-f", "custom/dependencies/npm.txt"), @@ -299,8 +322,14 @@ def test_dependencies(self): # It should have module_auto_update available ("test", "-d", "custom/src/server-tools/module_auto_update"), # Patched Werkzeug version - ("bash", "-c", ('test "$(python -c "import werkzeug; ' - 'print(werkzeug.__version__)")" == 0.14.1')), + ( + "bash", + "-c", + ( + 'test "$(python -c "import werkzeug; ' + 'print(werkzeug.__version__)")" == 0.14.1' + ), + ), # apt_build.txt ("test", "-f", "custom/dependencies/apt_build.txt"), ("test", "!", "-e", "/usr/sbin/sshd"), @@ -311,8 +340,11 @@ def test_dependencies(self): ("test", "-f", "custom/dependencies/070-apt-bc.txt"), ("test", "-e", "/usr/bin/bc"), # 150-npm-aloha_world-install.txt - ("test", "-f", ("custom/dependencies/" - "150-npm-aloha_world-install.txt")), + ( + "test", + "-f", + ("custom/dependencies/" "150-npm-aloha_world-install.txt"), + ), ("node", "-e", "require('test-npm-install')"), # 200-pip-without-ext ("test", "-f", "custom/dependencies/200-pip-without-ext"), @@ -328,30 +360,56 @@ def test_modified_uids(self): uids_dir = join(SCAFFOLDINGS_DIR, "uids_1001") for sub_env in matrix(): self.compose_test( - uids_dir, sub_env, + uids_dir, + sub_env, # verify that odoo user has the given ids ("bash", "-c", 'test "$(id -u)" == "1001"'), ("bash", "-c", 'test "$(id -g)" == "1002"'), ("bash", "-c", 'test "$(id -u -n)" == "odoo"'), # all those directories need to belong to odoo (user or group odoo) - ("bash", "-c", 'test "$(stat -c \'%U:%G\' /var/lib/odoo)" == "odoo:odoo"'), - ("bash", "-c", 'test "$(stat -c \'%U:%G\' /opt/odoo/auto/addons)" == "root:odoo"'), - ("bash", "-c", 'test "$(stat -c \'%U:%G\' /opt/odoo/custom/src)" == "root:odoo"'), + ( + "bash", + "-c", + 'test "$(stat -c \'%U:%G\' /var/lib/odoo)" == "odoo:odoo"', + ), + ( + "bash", + "-c", + 'test "$(stat -c \'%U:%G\' /opt/odoo/auto/addons)" == "root:odoo"', + ), + ( + "bash", + "-c", + 'test "$(stat -c \'%U:%G\' /opt/odoo/custom/src)" == "root:odoo"', + ), ) def test_default_uids(self): uids_dir = join(SCAFFOLDINGS_DIR, "uids_default") for sub_env in matrix(): self.compose_test( - uids_dir, sub_env, + uids_dir, + sub_env, # verify that odoo user has the given ids ("bash", "-c", 'test "$(id -u)" == "1000"'), ("bash", "-c", 'test "$(id -g)" == "1000"'), ("bash", "-c", 'test "$(id -u -n)" == "odoo"'), # all those directories need to belong to odoo (user or group odoo) - ("bash", "-c", 'test "$(stat -c \'%U:%G\' /var/lib/odoo)" == "odoo:odoo"'), - ("bash", "-c", 'test "$(stat -c \'%U:%G\' /opt/odoo/auto/addons)" == "root:odoo"'), - ("bash", "-c", 'test "$(stat -c \'%U:%G\' /opt/odoo/custom/src)" == "root:odoo"'), + ( + "bash", + "-c", + 'test "$(stat -c \'%U:%G\' /var/lib/odoo)" == "odoo:odoo"', + ), + ( + "bash", + "-c", + 'test "$(stat -c \'%U:%G\' /opt/odoo/auto/addons)" == "root:odoo"', + ), + ( + "bash", + "-c", + 'test "$(stat -c \'%U:%G\' /opt/odoo/custom/src)" == "root:odoo"', + ), ) diff --git a/tests/scaffoldings/dotd/custom/entrypoint.d/check-requirements b/tests/scaffoldings/dotd/custom/entrypoint.d/check-requirements index f71069e8..85ebce78 100755 --- a/tests/scaffoldings/dotd/custom/entrypoint.d/check-requirements +++ b/tests/scaffoldings/dotd/custom/entrypoint.d/check-requirements @@ -1,2 +1,3 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- from cfssl import CFSSL diff --git a/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/dummy_addon/__manifest__.py b/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/dummy_addon/__manifest__.py index d967bb94..7a4cc997 100644 --- a/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/dummy_addon/__manifest__.py +++ b/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/dummy_addon/__manifest__.py @@ -1,5 +1,2 @@ -{ - "name": "dummy_addon", - "depends": ["web"], - "installable": True, -} +# -*- coding: utf-8 -*- +{"name": "dummy_addon", "depends": ["web"], "installable": True} diff --git a/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/product/__manifest__.py b/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/product/__manifest__.py index 3a269390..4e285873 100644 --- a/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/product/__manifest__.py +++ b/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/product/__manifest__.py @@ -1,3 +1,2 @@ -{ - "name": "other-doodba/product", -} +# -*- coding: utf-8 -*- +{"name": "other-doodba/product"} diff --git a/tests/scaffoldings/dotd/custom/src/private/disabled_addon/__openerp__.py b/tests/scaffoldings/dotd/custom/src/private/disabled_addon/__openerp__.py index 0776a71a..32114e6b 100644 --- a/tests/scaffoldings/dotd/custom/src/private/disabled_addon/__openerp__.py +++ b/tests/scaffoldings/dotd/custom/src/private/disabled_addon/__openerp__.py @@ -1,4 +1,2 @@ -{ - "name": "disabled_addon", - "installable": False, -} +# -*- coding: utf-8 -*- +{"name": "disabled_addon", "installable": False} diff --git a/tests/scaffoldings/dotd/custom/src/private/private_addon/__openerp__.py b/tests/scaffoldings/dotd/custom/src/private/private_addon/__openerp__.py index f99d2d0e..a9c52e7d 100644 --- a/tests/scaffoldings/dotd/custom/src/private/private_addon/__openerp__.py +++ b/tests/scaffoldings/dotd/custom/src/private/private_addon/__openerp__.py @@ -1,4 +1,2 @@ -{ - "name": "private_addon", - "depends": ["dummy_addon", "website"], -} +# -*- coding: utf-8 -*- +{"name": "private_addon", "depends": ["dummy_addon", "website"]} diff --git a/tests/scaffoldings/settings/custom/scripts/test_settings.py b/tests/scaffoldings/settings/custom/scripts/test_settings.py index 8615bca1..213b7e23 100755 --- a/tests/scaffoldings/settings/custom/scripts/test_settings.py +++ b/tests/scaffoldings/settings/custom/scripts/test_settings.py @@ -1,4 +1,5 @@ #!/usr/local/bin/python-odoo-shell +# -*- coding: utf-8 -*- try: from odoo.tools import config except ImportError: From 4b36befcc2b8c5f083bff911749429a7856db2d7 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 24 Oct 2019 13:26:34 +0100 Subject: [PATCH 071/255] Build on Travis and push from there to Docker Hub - Updated `.travis.yml` file. - Use pre-commit as a linter stage now. - Transform some build scripts to plumbum, to make them more maintainable. --- .travis.yml | 30 ++++++++++++++++++++--- hooks/build | 58 ++++++++++++++++++++++++++------------------- hooks/post_push | 14 ----------- hooks/pre_build | 3 +++ hooks/pre_push | 5 ---- hooks/push | 25 +++++++++++++++++++ requirements-ci.txt | 1 + 7 files changed, 89 insertions(+), 47 deletions(-) delete mode 100755 hooks/post_push create mode 100755 hooks/pre_build delete mode 100755 hooks/pre_push create mode 100755 hooks/push diff --git a/.travis.yml b/.travis.yml index 468bd06d..8ba80698 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -sudo: required +os: linux language: python @@ -11,15 +11,26 @@ services: git: depth: 1 +cache: + directories: + - $HOME/.cache/pip + - $HOME/.cache/pre-commit + branches: only: - master +stages: + - name: lint + - name: test + env: global: + # Indicates what's the equivalent to tecnativa/doodba:latest image + - LATEST_RELEASE=13.0 # Variables found by default in Docker Hub builder - DOCKER_REPO=tecnativa/doodba - matrix: + jobs: - DOCKER_TAG=7.0 PG_VERSIONS=9.6 - DOCKER_TAG=8.0 PG_VERSIONS=10 - DOCKER_TAG=9.0 PG_VERSIONS=11 @@ -28,10 +39,17 @@ env: - DOCKER_TAG=12.0 - DOCKER_TAG=13.0 +jobs: + include: + stage: lint + install: [] + script: + - pre-commit run --all --show-diff-on-failure + before_install: - sudo apt-get update - sudo apt-get -y -o Dpkg::Options::=--force-confnew install docker-ce - - pip install -r requirements-ci.txt + - ./hooks/pre_build install: - chown -R $USER:$USER . @@ -40,3 +58,9 @@ install: script: - python -m unittest -v tests + +deploy: + provider: script + script: ./hooks/push + on: + branch: master diff --git a/hooks/build b/hooks/build index f38dca1a..c7526b46 100755 --- a/hooks/build +++ b/hooks/build @@ -1,28 +1,36 @@ -#!/bin/bash -set -ex +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +from plumbum import FG, local -# Get Odoo version -version="$DOCKER_TAG" -if [ "$version" == latest ]; then - version=12.0 -fi +REPO = local.env["DOCKER_REPO"] +VERSION = local.env["DOCKER_TAG"] +ROOT = local.path(__file__).up(2) +COMMIT = local.env.get("GIT_SHA1", local.env.get("TRAVIS_COMMIT", "")) -if [ -z "$IMAGE_NAME" ]; then - IMAGE_NAME="$DOCKER_REPO:$DOCKER_TAG" -fi +# Shortcuts +build = local["time"]["docker", "image", "build"] +date = local["date"]["--rfc-3339", "ns"] +tag = local["docker"]["image", "tag"] -# See http://label-schema.org/rc1/#build-time-labels -for target in base onbuild; do - suffix='' - if [ "$target" == onbuild ]; then - suffix="-$target" - fi - time docker image build \ - --build-arg VCS_REF="$GIT_SHA1" \ - --build-arg BUILD_DATE="$(date --rfc-3339 ns)" \ - --build-arg ODOO_VERSION="$version" \ - --file "$version.Dockerfile" \ - --tag "$IMAGE_NAME$suffix" \ - --target $target \ - . -done +# Build base and onbuild images +for target, suffix in (("base", ""), ("onbuild", "-onbuild")): + image_name = "%s:%s%s" % (REPO, VERSION, suffix) + build[ + "--build-arg", + "VCS_REF=%s" % COMMIT, + "--build-arg", + "BUILD_DATE=%s" % date().strip(), + "--build-arg", + "ODOO_VERSION=%s" % VERSION, + "--tag", + image_name, + "--target", + target, + "--file", + "%s.Dockerfile" % VERSION, + ROOT, + ] & FG + + # Tag "latest" image if applicable + if VERSION == local.env.get("LATEST_RELEASE"): + tag[image_name, "%s:latest%s" % (REPO, suffix)] & FG diff --git a/hooks/post_push b/hooks/post_push deleted file mode 100755 index 0fbcb8ca..00000000 --- a/hooks/post_push +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -ex - -# Get Odoo version -version="$DOCKER_TAG" -if [ "$version" == latest ]; then - version=12.0 -fi - -if [ -z "$IMAGE_NAME" ]; then - IMAGE_NAME="$DOCKER_REPO:$DOCKER_TAG" -fi - -docker image push "$IMAGE_NAME-onbuild" diff --git a/hooks/pre_build b/hooks/pre_build new file mode 100755 index 00000000..83269c43 --- /dev/null +++ b/hooks/pre_build @@ -0,0 +1,3 @@ +#!/bin/bash +set -ex +pip install -r "$(dirname $0)/../requirements-ci.txt" diff --git a/hooks/pre_push b/hooks/pre_push deleted file mode 100755 index 353d3e8d..00000000 --- a/hooks/pre_push +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -ex - -# Log all locally available images; will help to pin images -docker image ls --digests "${DOCKER_REPO:-tecnativa/doodba}" diff --git a/hooks/push b/hooks/push new file mode 100755 index 00000000..74634c15 --- /dev/null +++ b/hooks/push @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +from plumbum import FG, local +from plumbum.cmd import docker # noqa pylint: disable=import-error + +REPO = local.env["DOCKER_REPO"] +VERSION = local.env["DOCKER_TAG"] + +# Log all locally available images; will help to pin images +docker["image", "ls", "--digests", REPO] & FG + +# Login in Docker Hub +docker( + "login", + "--username", + local.env["DOCKER_HUB_USERNAME"], + "--password", + local.env["DOCKER_HUB_TOKEN"], +) + +# Push built images +for suffix in ("", "-onbuild"): + docker["image", "push", "%s:%s%s" % (REPO, VERSION, suffix)] & FG + if VERSION == local.env.get("LATEST_RELEASE"): + docker["image", "push", "%s:latest%s" % (REPO, suffix)] & FG diff --git a/requirements-ci.txt b/requirements-ci.txt index c925c061..ccc6abca 100644 --- a/requirements-ci.txt +++ b/requirements-ci.txt @@ -1,2 +1,3 @@ docker-compose +plumbum pre-commit From ff483d4a6469403874fa0d8c4d9402b053fde179 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 25 Oct 2019 08:47:53 +0100 Subject: [PATCH 072/255] Do not deploy when linting --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8ba80698..132f8612 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,3 +64,5 @@ deploy: script: ./hooks/push on: branch: master + condition: + - $TRAVIS_BUILD_STAGE_NAME = Test From 17ad1e49aa2f9037d55d6e268d7dc83ee8c39496 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 25 Oct 2019 09:39:01 +0100 Subject: [PATCH 073/255] [ci skip] Invert build order Usually you'll be more interested in building first latest versions, so this will help having faster latest results. --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 132f8612..99e038ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,13 +31,13 @@ env: # Variables found by default in Docker Hub builder - DOCKER_REPO=tecnativa/doodba jobs: - - DOCKER_TAG=7.0 PG_VERSIONS=9.6 - - DOCKER_TAG=8.0 PG_VERSIONS=10 - - DOCKER_TAG=9.0 PG_VERSIONS=11 - - DOCKER_TAG=10.0 - - DOCKER_TAG=11.0 - - DOCKER_TAG=12.0 - DOCKER_TAG=13.0 + - DOCKER_TAG=12.0 + - DOCKER_TAG=11.0 + - DOCKER_TAG=10.0 + - DOCKER_TAG=9.0 PG_VERSIONS=11 + - DOCKER_TAG=8.0 PG_VERSIONS=10 + - DOCKER_TAG=7.0 PG_VERSIONS=9.6 jobs: include: From 87bf4f54cf9c24282bd0d93a3fb64ef2d7d352b3 Mon Sep 17 00:00:00 2001 From: Bertrand Retif Date: Wed, 13 Nov 2019 22:27:12 +0100 Subject: [PATCH 074/255] Add -l option to useradd --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 13.0.Dockerfile | 2 +- 8.0.Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 9f418fe2..9d410ee2 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -192,7 +192,7 @@ ONBUILD ARG GID=1000 # Enable Odoo user and filestore ONBUILD RUN groupadd -g $GID odoo \ - && useradd -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ && mkdir -p /var/lib/odoo \ && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ && chmod a=rwX /qa/artifacts \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 2d1b5179..49f27d7e 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -188,7 +188,7 @@ ONBUILD ARG GID=1000 # Enable Odoo user and filestore ONBUILD RUN groupadd -g $GID odoo \ - && useradd -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ && mkdir -p /var/lib/odoo \ && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ && chmod a=rwX /qa/artifacts \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index a86c7ac9..bd207b31 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -196,7 +196,7 @@ ONBUILD ARG GID=1000 # Enable Odoo user and filestore ONBUILD RUN groupadd -g $GID odoo \ - && useradd -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ && mkdir -p /var/lib/odoo \ && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ && chmod a=rwX /qa/artifacts \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index c868c4b5..202a053c 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -190,7 +190,7 @@ ONBUILD ARG GID=1000 # Enable Odoo user and filestore ONBUILD RUN groupadd -g $GID odoo \ - && useradd -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ && mkdir -p /var/lib/odoo \ && chown -R odoo:odoo /var/lib/odoo /qa/artifacts\ && chmod a=rwX /qa/artifacts \ From aee81c0f5c13c66f63f14587944a4470f2374180 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 2 Dec 2019 09:30:42 +0000 Subject: [PATCH 075/255] Add prettier to pre-commit and update other repos --- .pre-commit-config.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 584e3c31..68352718 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,11 +2,11 @@ default_language_version: python: python3 repos: - repo: https://github.com/psf/black - rev: 19.3b0 + rev: 19.10b0 hooks: - id: black - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.3.0 + rev: v2.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -27,3 +27,7 @@ repos: rev: v4.3.21 hooks: - id: isort +- repo: https://github.com/prettier/prettier + rev: 1.19.1 + hooks: + - id: prettier From 6068b15624313b7df3574a82813aa085fdff06fa Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 2 Dec 2019 09:31:19 +0000 Subject: [PATCH 076/255] Run updated pre-commit --- .pre-commit-config.yaml | 60 +-- .travis.yml | 4 +- .vscode/settings.json | 11 +- README.md | 346 +++++++++--------- .../dependencies/custom/src/addons.yaml | 2 +- .../scaffoldings/dotd/custom/src/addons.yaml | 1 - .../settings/custom/src/repos.yaml | 19 +- 7 files changed, 217 insertions(+), 226 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 68352718..4c47fe8b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,33 +1,33 @@ default_language_version: python: python3 repos: -- repo: https://github.com/psf/black - rev: 19.10b0 - hooks: - - id: black -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.4.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: debug-statements - - id: fix-encoding-pragma - - id: check-case-conflict - - id: check-docstring-first - - id: check-executables-have-shebangs - - id: check-merge-conflict - - id: check-xml - - id: mixed-line-ending - args: ["--fix=lf"] -- repo: https://github.com/asottile/seed-isort-config - rev: v1.9.3 - hooks: - - id: seed-isort-config -- repo: https://github.com/pre-commit/mirrors-isort - rev: v4.3.21 - hooks: - - id: isort -- repo: https://github.com/prettier/prettier - rev: 1.19.1 - hooks: - - id: prettier + - repo: https://github.com/psf/black + rev: 19.10b0 + hooks: + - id: black + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: debug-statements + - id: fix-encoding-pragma + - id: check-case-conflict + - id: check-docstring-first + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: check-xml + - id: mixed-line-ending + args: ["--fix=lf"] + - repo: https://github.com/asottile/seed-isort-config + rev: v1.9.3 + hooks: + - id: seed-isort-config + - repo: https://github.com/pre-commit/mirrors-isort + rev: v4.3.21 + hooks: + - id: isort + - repo: https://github.com/prettier/prettier + rev: 1.19.1 + hooks: + - id: prettier diff --git a/.travis.yml b/.travis.yml index 99e038ee..2a49c946 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,8 @@ git: cache: directories: - - $HOME/.cache/pip - - $HOME/.cache/pre-commit + - $HOME/.cache/pip + - $HOME/.cache/pre-commit branches: only: diff --git a/.vscode/settings.json b/.vscode/settings.json index 2927f047..c787fbc4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,15 +1,10 @@ { - "python.autoComplete.extraPaths": [ - "./lib", - "./tests", - ], + "python.autoComplete.extraPaths": ["./lib", "./tests"], "editor.formatOnSave": true, "editor.formatOnSaveTimeout": 1000, "python.formatting.provider": "black", - "python.linting.flake8Args": [ - "--max-line-length=88" - ], + "python.linting.flake8Args": ["--max-line-length=88"], "python.linting.flake8Enabled": true, "python.linting.pylintEnabled": true, - "python.pythonPath": "python3", + "python.pythonPath": "python3" } diff --git a/README.md b/README.md index 7085c355..7a3f98fb 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ structure. BTW, we use [Debian][]. I hope you like that. - [Debian]: https://debian.org/ +[debian]: https://debian.org/ ## Why? @@ -241,7 +241,7 @@ your [`addons.yaml`][] contains this: ```yaml server-tools: -- module_auto_update + - module_auto_update ``` A `/opt/odoo/auto/repos.yaml` file with this will be generated and used to @@ -279,10 +279,10 @@ One entry per repo and addon you want to activate in your project. Like this: ```yaml website: - - website_cookie_notice - - website_legal_page + - website_cookie_notice + - website_legal_page web: - - web_responsive + - web_responsive ``` Advanced features: @@ -325,7 +325,7 @@ web: website: - website_blog_excertp_img server-tools: # Here we repeat server-tools, but no problem because it's a - # different document + # different document - html_image_url_extractor - html_text --- @@ -488,22 +488,22 @@ contents: ```json { - "version": "0.2.0", - "configurations": [ + "version": "0.2.0", + "configurations": [ + { + "name": "Attach to debug in devel.yaml", + "type": "python", + "request": "attach", + "pathMappings": [ { - "name": "Attach to debug in devel.yaml", - "type": "python", - "request": "attach", - "pathMappings": [ - { - "localRoot": "${workspaceRoot}/odoo", - "remoteRoot": "/opt/odoo" - } - ], - "port": 6899, - "host": "localhost" + "localRoot": "${workspaceRoot}/odoo", + "remoteRoot": "/opt/odoo" } - ] + ], + "port": 6899, + "host": "localhost" + } + ] } ``` @@ -545,18 +545,17 @@ This example merges [several sources][`odoo`]: ```yaml ./odoo: - defaults: - # Shallow repositores are faster & thinner. You better use - # $DEPTH_DEFAULT here when you need no merges. - depth: $DEPTH_MERGE - remotes: - ocb: https://github.com/OCA/OCB.git - odoo: https://github.com/odoo/odoo.git - target: - ocb $ODOO_VERSION - merges: - - ocb $ODOO_VERSION - - odoo refs/pull/13635/head + defaults: + # Shallow repositores are faster & thinner. You better use + # $DEPTH_DEFAULT here when you need no merges. + depth: $DEPTH_MERGE + remotes: + ocb: https://github.com/OCA/OCB.git + odoo: https://github.com/odoo/odoo.git + target: ocb $ODOO_VERSION + merges: + - ocb $ODOO_VERSION + - odoo refs/pull/13635/head ``` ### [`odoo`](https://www.odoo.com/documentation/10.0/reference/cmdline.html) @@ -741,68 +740,68 @@ To have it, use this `inverseproxy.yaml` file: version: "2.1" services: - proxy: - image: traefik:1.6-alpine - networks: - shared: - private: - public: - volumes: - - acme:/etc/traefik/acme:rw,Z - ports: - - "80:80" - - "443:443" - depends_on: - - dockersocket - restart: unless-stopped - privileged: true - tty: true - command: - - --ACME.ACMELogging - - --ACME.Email=you@example.com - - --ACME.EntryPoint=https - - --ACME.HTTPChallenge.entryPoint=http - - --ACME.OnHostRule - - --ACME.Storage=/etc/traefik/acme/acme.json - - --DefaultEntryPoints=http,https - - --EntryPoints=Name:http Address::80 Redirect.EntryPoint:https - - --EntryPoints=Name:https Address::443 TLS - - --LogLevel=INFO - - --Docker - - --Docker.EndPoint=http://dockersocket:2375 - - --Docker.ExposedByDefault=false - - --Docker.Watch - - dockersocket: - image: tecnativa/docker-socket-proxy - privileged: true - networks: - private: - volumes: - - /var/run/docker.sock:/var/run/docker.sock - environment: - CONTAINERS: 1 - NETWORKS: 1 - SERVICES: 1 - SWARM: 1 - TASKS: 1 - restart: unless-stopped + proxy: + image: traefik:1.6-alpine + networks: + shared: + private: + public: + volumes: + - acme:/etc/traefik/acme:rw,Z + ports: + - "80:80" + - "443:443" + depends_on: + - dockersocket + restart: unless-stopped + privileged: true + tty: true + command: + - --ACME.ACMELogging + - --ACME.Email=you@example.com + - --ACME.EntryPoint=https + - --ACME.HTTPChallenge.entryPoint=http + - --ACME.OnHostRule + - --ACME.Storage=/etc/traefik/acme/acme.json + - --DefaultEntryPoints=http,https + - --EntryPoints=Name:http Address::80 Redirect.EntryPoint:https + - --EntryPoints=Name:https Address::443 TLS + - --LogLevel=INFO + - --Docker + - --Docker.EndPoint=http://dockersocket:2375 + - --Docker.ExposedByDefault=false + - --Docker.Watch + + dockersocket: + image: tecnativa/docker-socket-proxy + privileged: true + networks: + private: + volumes: + - /var/run/docker.sock:/var/run/docker.sock + environment: + CONTAINERS: 1 + NETWORKS: 1 + SERVICES: 1 + SWARM: 1 + TASKS: 1 + restart: unless-stopped networks: - shared: - internal: true - driver_opts: - encrypted: 1 + shared: + internal: true + driver_opts: + encrypted: 1 - private: - internal: true - driver_opts: - encrypted: 1 + private: + internal: true + driver_opts: + encrypted: 1 - public: + public: volumes: - acme: + acme: ``` Then boot it up with: @@ -820,15 +819,15 @@ surface when listening to the Docker socket. This allows you to: -* Have multiple domains for each Odoo instance. -* Have multiple Odoo instances in each node. -* Add an SSL layer automatically and for free. +- Have multiple domains for each Odoo instance. +- Have multiple Odoo instances in each node. +- Add an SSL layer automatically and for free. ##### Testing A good rule of thumb is test in testing before uploading to production, so this environment tries to imitate the [production][] one in everything, -but *removing possible pollution points*: +but _removing possible pollution points_: - It has a fake `smtp` service based on [MailHog][]. @@ -863,74 +862,74 @@ The recommended `globalwhitelist/docker-compose.yaml` file should contain: version: "2.1" networks: - public: - driver_opts: - encrypted: 1 - shared: - internal: true - driver_opts: - encrypted: 1 + public: + driver_opts: + encrypted: 1 + shared: + internal: true + driver_opts: + encrypted: 1 services: - cdnjs_cloudflare_com: - image: tecnativa/whitelist - restart: unless-stopped - networks: - public: - shared: - aliases: - - "cdnjs.cloudflare.com" - environment: - TARGET: "cdnjs.cloudflare.com" - PRE_RESOLVE: 1 - - fonts_googleapis_com: - image: tecnativa/whitelist - restart: unless-stopped - networks: - public: - shared: - aliases: - - "fonts.googleapis.com" - environment: - TARGET: "fonts.googleapis.com" - PRE_RESOLVE: 1 - - fonts_gstatic_com: - image: tecnativa/whitelist - restart: unless-stopped - networks: - public: - shared: - aliases: - - "fonts.gstatic.com" - environment: - TARGET: "fonts.gstatic.com" - PRE_RESOLVE: 1 - - www_google_com: - image: tecnativa/whitelist - restart: unless-stopped - networks: - public: - shared: - aliases: - - "www.google.com" - environment: - TARGET: "www.google.com" - PRE_RESOLVE: 1 - - www_gravatar_com: - image: tecnativa/whitelist - restart: unless-stopped - networks: - public: - shared: - aliases: - - "www.gravatar.com" - environment: - TARGET: "www.gravatar.com" - PRE_RESOLVE: 1 + cdnjs_cloudflare_com: + image: tecnativa/whitelist + restart: unless-stopped + networks: + public: + shared: + aliases: + - "cdnjs.cloudflare.com" + environment: + TARGET: "cdnjs.cloudflare.com" + PRE_RESOLVE: 1 + + fonts_googleapis_com: + image: tecnativa/whitelist + restart: unless-stopped + networks: + public: + shared: + aliases: + - "fonts.googleapis.com" + environment: + TARGET: "fonts.googleapis.com" + PRE_RESOLVE: 1 + + fonts_gstatic_com: + image: tecnativa/whitelist + restart: unless-stopped + networks: + public: + shared: + aliases: + - "fonts.gstatic.com" + environment: + TARGET: "fonts.gstatic.com" + PRE_RESOLVE: 1 + + www_google_com: + image: tecnativa/whitelist + restart: unless-stopped + networks: + public: + shared: + aliases: + - "www.google.com" + environment: + TARGET: "www.google.com" + PRE_RESOLVE: 1 + + www_gravatar_com: + image: tecnativa/whitelist + restart: unless-stopped + networks: + public: + shared: + aliases: + - "www.gravatar.com" + environment: + TARGET: "www.gravatar.com" + PRE_RESOLVE: 1 ``` #### Other usage scenarios @@ -1241,7 +1240,7 @@ image version is downloaded: Alternatively, you can browse [this image's builds][builds], click on the one you know it works fine for you, and search for the `digest` word using your -browser's *search in page* system (Ctrl+F usually). +browser's _search in page_ system (Ctrl+F usually). You will find lines similar to: @@ -1318,15 +1317,14 @@ scaffolding versions is preserved. - [Ansible role for automated deployment / update from Le Filament](https://github.com/remi-filament/ansible_role_odoo_docker) - Find others by searching [GitHub projects tagged with `#doodba`](https://github.com/topics/doodba) - [`/opt/odoo/auto/addons`]: #optodooautoaddons [`addons.yaml`]: #optodoocustomsrcaddonstxt -[`COMPOSE_FILE` environment variable]: https://docs.docker.com/compose/reference/envvars/#/composefile +[`compose_file` environment variable]: https://docs.docker.com/compose/reference/envvars/#/composefile [`nano`]: https://www.nano-editor.org/ [`odoo.conf`]: #optodooautoodooconf [`odoo`]: #optodoocustomsrcodoo [`private`]: #optodoocustomsrcprivate -[`PYTHONOPTIMIZE=1`]: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONOPTIMIZE +[`pythonoptimize=1`]: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONOPTIMIZE [`repos.yaml`]: #optodoocustomsrcreposyaml [`click-odoo`]: https://github.com/acsone/click-odoo [`click-odoo-contrib`]: https://github.com/acsone/click-odoo-contrib @@ -1336,23 +1334,23 @@ scaffolding versions is preserved. [development]: #development [docker-socket-proxy]: https://hub.docker.com/r/tecnativa/docker-socket-proxy/ [doodba-qa]: https://github.com/Tecnativa/doodba-qa -[Fish]: http://fishshell.com/ +[fish]: http://fishshell.com/ [glob]: https://docs.python.org/3/library/glob.html -[Let's Encrypt]: https://letsencrypt.org/ -[MailHog]: #mailhog +[let's encrypt]: https://letsencrypt.org/ +[mailhog]: #mailhog [mixed-content-posbox]: https://github.com/odoo/odoo/issues/3156#issuecomment-443727760 -[OCA]: https://odoo-community.org/ -[OCB]: https://github.com/OCA/OCB -[Odoo S.A.]: https://www.odoo.com -[OpenUpgrade]: https://github.com/OCA/OpenUpgrade/ -[Original Odoo]: https://github.com/odoo/odoo +[oca]: https://odoo-community.org/ +[ocb]: https://github.com/OCA/OCB +[odoo s.a.]: https://www.odoo.com +[openupgrade]: https://github.com/OCA/OpenUpgrade/ +[original odoo]: https://github.com/odoo/odoo [pip `requirements.txt`]: https://pip.readthedocs.io/en/latest/user_guide/#requirements-files -[Postgres client applications]: https://www.postgresql.org/docs/current/static/reference-client.html +[postgres client applications]: https://www.postgresql.org/docs/current/static/reference-client.html [production]: #production [retrobreak]: https://github.com/Tecnativa/doodba/issues/67 [scaffolding]: #scaffolding -[several YAML documents]: http://www.yaml.org/spec/1.2/spec.html#id2760395 +[several yaml documents]: http://www.yaml.org/spec/1.2/spec.html#id2760395 [ssh-conf]: https://www.digitalocean.com/community/tutorials/how-to-configure-custom-connection-options-for-your-ssh-client [testing]: #testing -[Traefik]: https://traefik.io/ -[VSCode]: https://code.visualstudio.com/ +[traefik]: https://traefik.io/ +[vscode]: https://code.visualstudio.com/ diff --git a/tests/scaffoldings/dependencies/custom/src/addons.yaml b/tests/scaffoldings/dependencies/custom/src/addons.yaml index c6df2c52..36de1f73 100644 --- a/tests/scaffoldings/dependencies/custom/src/addons.yaml +++ b/tests/scaffoldings/dependencies/custom/src/addons.yaml @@ -1,2 +1,2 @@ server-tools: -- module_auto_update + - module_auto_update diff --git a/tests/scaffoldings/dotd/custom/src/addons.yaml b/tests/scaffoldings/dotd/custom/src/addons.yaml index 41128ef9..5e19da66 100644 --- a/tests/scaffoldings/dotd/custom/src/addons.yaml +++ b/tests/scaffoldings/dotd/custom/src/addons.yaml @@ -2,7 +2,6 @@ other-doodba/odoo/src/private: - absent_addon - dummy_addon - product - --- ONLY: PGDATABASE: diff --git a/tests/scaffoldings/settings/custom/src/repos.yaml b/tests/scaffoldings/settings/custom/src/repos.yaml index 1eddc934..f07365a3 100644 --- a/tests/scaffoldings/settings/custom/src/repos.yaml +++ b/tests/scaffoldings/settings/custom/src/repos.yaml @@ -1,12 +1,11 @@ # Odoo is always required ./odoo: - defaults: - # Shallow repositores are faster & thinner - depth: $DEPTH_DEFAULT - remotes: - ocb: https://github.com/OCA/OCB.git - odoo: https://github.com/odoo/odoo.git - target: - ocb $ODOO_VERSION - merges: - - ocb $ODOO_VERSION + defaults: + # Shallow repositores are faster & thinner + depth: $DEPTH_DEFAULT + remotes: + ocb: https://github.com/OCA/OCB.git + odoo: https://github.com/odoo/odoo.git + target: ocb $ODOO_VERSION + merges: + - ocb $ODOO_VERSION From 4b813b1a3a9fbd95b2587d717c50de40acffb3d4 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Mon, 2 Dec 2019 14:45:39 +0500 Subject: [PATCH 077/255] :book: fix link under `addons.yaml` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a3f98fb..73565892 100644 --- a/README.md +++ b/README.md @@ -1318,7 +1318,7 @@ scaffolding versions is preserved. - Find others by searching [GitHub projects tagged with `#doodba`](https://github.com/topics/doodba) [`/opt/odoo/auto/addons`]: #optodooautoaddons -[`addons.yaml`]: #optodoocustomsrcaddonstxt +[`addons.yaml`]: #optodoocustomsrcaddonsyaml [`compose_file` environment variable]: https://docs.docker.com/compose/reference/envvars/#/composefile [`nano`]: https://www.nano-editor.org/ [`odoo.conf`]: #optodooautoodooconf From 324da9c87df66bc12d54727054f2136a57415b19 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 2 Dec 2019 09:52:30 +0000 Subject: [PATCH 078/255] Support Postgres 12 Added a test to run pg_dump, which will fail if the server is newer than the client. --- .travis.yml | 2 +- 13.0.Dockerfile | 6 ++++-- tests/__init__.py | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2a49c946..74f08c39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ env: - DOCKER_TAG=13.0 - DOCKER_TAG=12.0 - DOCKER_TAG=11.0 - - DOCKER_TAG=10.0 + - DOCKER_TAG=10.0 PG_VERSIONS=12 - DOCKER_TAG=9.0 PG_VERSIONS=11 - DOCKER_TAG=8.0 PG_VERSIONS=10 - DOCKER_TAG=7.0 PG_VERSIONS=9.6 diff --git a/13.0.Dockerfile b/13.0.Dockerfile index bd207b31..820db2e7 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -48,11 +48,13 @@ RUN apt-get -qq update \ nano \ npm \ openssh-client \ - postgresql-client \ - postgresql-common \ telnet \ vim \ zlibc \ + && echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && apt-get update \ + && apt-get install -yqq --no-install-recommends postgresql-client \ && apt-get autopurge -yqq \ && rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \ && sync diff --git a/tests/__init__.py b/tests/__init__.py index df5bb814..7d197553 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -18,7 +18,7 @@ ODOO_VERSIONS = frozenset( environ.get("DOCKER_TAG", "7.0 8.0 9.0 10.0 11.0 12.0 13.0").split() ) -PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "11").split()) +PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "12").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") # This decorator skips tests that will fail until some branches and/or addons @@ -253,6 +253,8 @@ def test_smallest(self): ("pg_activity", "--version"), ("psql", "--version"), ("ssh", "-V"), + # We are able to dump + ("pg_dump", "-f/var/lib/odoo/prod.sql", "prod"), ) smallest_dir = join(SCAFFOLDINGS_DIR, "smallest") for sub_env in matrix(odoo_skip={"7.0", "8.0"}): From 8bc7d38ed9136e59860c74d2ec893ca919d21746 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 2 Dec 2019 11:34:13 +0000 Subject: [PATCH 079/255] JSON files are better with 2 spaces Dockerfiles vscode autoformatter is ugly. Enable autoformat only for python. --- .editorconfig | 2 +- .vscode/settings.json | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.editorconfig b/.editorconfig index 9d797f57..b03e0976 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,5 +8,5 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[*.{md,yaml,yml,yaml}] +[*.{md,json,yaml,yml,yaml}] indent_size = 2 diff --git a/.vscode/settings.json b/.vscode/settings.json index c787fbc4..3735fa28 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,13 @@ { - "python.autoComplete.extraPaths": ["./lib", "./tests"], - "editor.formatOnSave": true, - "editor.formatOnSaveTimeout": 1000, - "python.formatting.provider": "black", - "python.linting.flake8Args": ["--max-line-length=88"], - "python.linting.flake8Enabled": true, - "python.linting.pylintEnabled": true, - "python.pythonPath": "python3" + "python.autoComplete.extraPaths": ["./lib", "./tests"], + "editor.formatOnSaveTimeout": 1000, + "python.formatting.provider": "black", + "python.linting.flake8Args": ["--max-line-length=88"], + "python.linting.flake8Enabled": true, + "python.linting.pylintEnabled": true, + "python.pythonPath": "python3", + + "[python]": { + "editor.formatOnSave": true + } } From 33dfdad2d40ecf1ad5bfbcd4cba9fc65a16ee7e7 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 11 Dec 2019 13:26:35 +0000 Subject: [PATCH 080/255] Skip files in external repos With this patch, if a repo has a README file (for example) and it's included as `*`, it will not fail saying that addon is missing. @Tecnativa TT20969 --- lib/doodbalib/__init__.py | 2 ++ .../src/other-doodba/odoo/src/private/some_random_evil_file.txt | 0 2 files changed, 2 insertions(+) create mode 100644 tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/some_random_evil_file.txt diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index b9871222..1850cb0e 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -122,6 +122,8 @@ def addons_config(filtered=True, strict=False): logger.debug("Skipping unexpandable glob '%s'", full_glob) continue for addon in found: + if not os.path.isdir(addon): + continue manifests = (os.path.join(addon, m) for m in MANIFESTS) if not any(os.path.isfile(m) for m in manifests): missing_manifest.add(addon) diff --git a/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/some_random_evil_file.txt b/tests/scaffoldings/dotd/custom/src/other-doodba/odoo/src/private/some_random_evil_file.txt new file mode 100644 index 00000000..e69de29b From 964fc1509dfb8c6b722c2610c3c40d6b593dda6c Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 16 Dec 2019 09:35:28 +0000 Subject: [PATCH 081/255] Document shell_command_after to merge diffs This is a useful case for Doodba users, where possibly you want to pre-merge a patch done for Odoo v11 into your Odoo v13 deployment, before Odoo approves it. Using just git branches is not much helpful in this case because no git history is shared, so conflicts would arise always. In fact, this might be the best way to apply merges *always*. That's to be investigated. Upstream support for diffs and patches is being tracked in https://github.com/acsone/git-aggregator/issues/34, but in the mean time this option is available today, so it's better to make it more obvious. @Tecnativa TT19951 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 73565892..70d29122 100644 --- a/README.md +++ b/README.md @@ -556,6 +556,9 @@ This example merges [several sources][`odoo`]: merges: - ocb $ODOO_VERSION - odoo refs/pull/13635/head + shell_command_after: + # Useful to merge a diff when there's no git history correlation + - curl -sSL https://github.com/odoo/odoo/pull/37187.diff | patch -fp1 ``` ### [`odoo`](https://www.odoo.com/documentation/10.0/reference/cmdline.html) From 8d59616354eb50a71b3a73df0a161d124010dd82 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Tue, 17 Dec 2019 14:41:07 +0500 Subject: [PATCH 082/255] Add new ENV node in addons.yaml (#261) * Fix README: slightly incorrect example of generated repos.yaml * Add new ENV node in addons.yaml Fix #258 --- README.md | 21 ++++++++- bin/autoaggregate | 47 +++++++++++++------ lib/doodbalib/__init__.py | 2 + tests/__init__.py | 16 +++++++ tests/scaffoldings/addons_env/Dockerfile | 2 + .../addons_env/custom/src/addons.yaml | 14 ++++++ .../addons_env/docker-compose.yaml | 29 ++++++++++++ 7 files changed, 115 insertions(+), 16 deletions(-) create mode 100644 tests/scaffoldings/addons_env/Dockerfile create mode 100644 tests/scaffoldings/addons_env/custom/src/addons.yaml create mode 100644 tests/scaffoldings/addons_env/docker-compose.yaml diff --git a/README.md b/README.md index 70d29122..9eb1c0c4 100644 --- a/README.md +++ b/README.md @@ -249,14 +249,16 @@ download git code: ```yaml /opt/odoo/custom/src/odoo: - depth: $DEPTH_DEFAULT + defaults: + depth: $DEPTH_DEFAULT remotes: origin: https://github.com/OCA/OCB.git target: origin $ODOO_VERSION merges: - origin $ODOO_VERSION /opt/odoo/custom/src/server-tools: - depth: $DEPTH_DEFAULT + defaults: + depth: $DEPTH_DEFAULT remotes: origin: https://github.com/OCA/server-tools.git target: origin $ODOO_VERSION @@ -297,6 +299,14 @@ Advanced features: - You can use `ONLY` to supply a dictionary of environment variables and a list of possible values to enable that document in the matching environments. +- You can use `ENV` to supply a dictionary of environment variables to be used + on downloading repositories. Following variables are supported: + + - `DEFAULT_REPO_PATTERN` + - `DEFAULT_REPO_PATTERN_ODOO` + - `DEPTH_DEFAULT` + - `ODOO_VERSION` - can be used as repository branch + - If an addon is found in several places at the same time, it will get linked according to this priority table: @@ -343,6 +353,13 @@ ONLY: - prod server-tools: - auth_* +--- +# Custom repositories +ENV: + DEFAULT_REPO_PATTERN: https://github.com/Tecnativa/{}.git + ODOO_VERSION: 13.0-new-feature +some-repo: # Cloned from https://github.com/Tecnativa/some-repo.git branch 13.0-new-feature + - some_custom_module ``` ##### `/opt/odoo/custom/dependencies/*.txt` diff --git a/bin/autoaggregate b/bin/autoaggregate index fc35bfb5..3a74f9df 100755 --- a/bin/autoaggregate +++ b/bin/autoaggregate @@ -11,6 +11,7 @@ from doodbalib import ( AUTO_REPOS_YAML, CORE, LOG_LEVELS, + ODOO_DIR, PRIVATE, REPOS_YAML, SRC_DIR, @@ -68,7 +69,11 @@ def aggregate(config): ) -def origin_for(folder): +def origin_for( + folder, + default_repo_pattern=DEFAULT_REPO_PATTERN, + odoo_repo_pattern=DEFAULT_REPO_PATTERN_ODOO, +): """Guess the default git origin for that folder. :param str folder: @@ -77,9 +82,9 @@ def origin_for(folder): pattern. """ base = os.path.basename(folder) - pattern = DEFAULT_REPO_PATTERN + pattern = default_repo_pattern if base == "odoo": - pattern = DEFAULT_REPO_PATTERN_ODOO + pattern = odoo_repo_pattern return pattern.format(base) @@ -89,7 +94,7 @@ def missing_repos_config(): :return dict: git-aggregator-ready configuration dict for undefined repositories. """ - defined, expected = set(), {os.path.join(SRC_DIR, "odoo")} + defined, expected = set(), {ODOO_DIR} # Find the repositories defined by hand try: with open(REPOS_YAML) as yaml_file: @@ -98,31 +103,45 @@ def missing_repos_config(): defined.add(os.path.abspath(os.path.join(SRC_DIR, repo))) except (IOError, AttributeError): logger.debug("No repositories defined by hand") + addons_env = {} # Find the repositories that should be present try: with open(ADDONS_YAML) as yaml_file: for doc in yaml.safe_load_all(yaml_file): + env = dict(os.environ, **doc.get("ENV", {})) for repo in doc: - if repo in {PRIVATE, CORE, "ONLY"}: + if repo in {PRIVATE, "ONLY", "ENV"}: continue - repo_path = os.path.abspath(os.path.join(SRC_DIR, repo)) + if repo == CORE: + repo_path = ODOO_DIR + else: + repo_path = os.path.abspath(os.path.join(SRC_DIR, repo)) if not os.path.exists(repo_path) or os.path.isdir( os.path.join(repo_path, ".git") ): expected.add(repo_path) + addons_env[repo_path] = env except (IOError, AttributeError): logger.debug("No addons are expected to be present") # Find the undefined repositories and generate a config for them missing = expected - defined - config = { - repo_path: { - "defaults": {"depth": "$DEPTH_DEFAULT"}, - "merges": ["origin $ODOO_VERSION"], - "remotes": {"origin": origin_for(repo_path)}, - "target": "origin $ODOO_VERSION", + config = {} + for repo_path in missing: + env = addons_env.get(repo_path, os.environ) + depth = env["DEPTH_DEFAULT"] + origin_version = "origin %s" % env["ODOO_VERSION"] + config[repo_path] = { + "defaults": {"depth": depth}, + "merges": [origin_version], + "remotes": { + "origin": origin_for( + repo_path, + env["DEFAULT_REPO_PATTERN"], + env["DEFAULT_REPO_PATTERN_ODOO"], + ) + }, + "target": origin_version, } - for repo_path in missing - } logger.debug("Generated missing repos config %r", config) return config diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index 1850cb0e..e0245051 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -100,6 +100,8 @@ def addons_config(filtered=True, strict=False): continue # Flatten all sections in a single dict for repo, partial_globs in doc.items(): + if repo == "ENV": + continue logger.debug("Processing %s repo", repo) all_globs.setdefault(repo, set()) all_globs[repo].update(partial_globs) diff --git a/tests/__init__.py b/tests/__init__.py index 7d197553..dd283eea 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -270,6 +270,22 @@ def test_smallest(self): *commands, ) + def test_addons_env(self): + """Test environment variables in addons.yaml""" + # 7.0 is skiped because the module is absent in that branch + for sub_env in matrix(odoo_skip={"7.0"}): + self.compose_test( + join(SCAFFOLDINGS_DIR, "addons_env"), + sub_env, + # check module from custom repo pattern + ("test", "-d", "custom/src/misc-addons"), + ("test", "-d", "custom/src/misc-addons/web_debranding"), + ("test", "-e", "auto/addons/web_debranding"), + # Migrations folder is only in OpenUpgrade + ("test", "-e", "auto/addons/crm"), + ("test", "-d", "auto/addons/crm/migrations"), + ) + def test_dotd(self): """Test environment with common ``*.d`` directories.""" for sub_env in matrix(): diff --git a/tests/scaffoldings/addons_env/Dockerfile b/tests/scaffoldings/addons_env/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/addons_env/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/addons_env/custom/src/addons.yaml b/tests/scaffoldings/addons_env/custom/src/addons.yaml new file mode 100644 index 00000000..948e520b --- /dev/null +++ b/tests/scaffoldings/addons_env/custom/src/addons.yaml @@ -0,0 +1,14 @@ +server-tools: + - module_auto_update +--- +ENV: + DEFAULT_REPO_PATTERN_ODOO: https://github.com/OCA/OpenUpgrade.git +odoo/addons: + - crm + - sale +--- +ENV: + DEFAULT_REPO_PATTERN: https://github.com/it-projects-llc/{}.git + DEPTH_DEFAULT: 2 +misc-addons: + - web_debranding diff --git a/tests/scaffoldings/addons_env/docker-compose.yaml b/tests/scaffoldings/addons_env/docker-compose.yaml new file mode 100644 index 00000000..5cb154cd --- /dev/null +++ b/tests/scaffoldings/addons_env/docker-compose.yaml @@ -0,0 +1,29 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + WITHOUT_DEMO: "false" + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + volumes: + - filestore:/var/lib/odoo:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: From 94dfdd3a4e7196d9a7c619fcc06cbdd95bea8cc7 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 17 Dec 2019 09:48:58 +0000 Subject: [PATCH 083/255] Fix dependency inclusion and exclusion detection Before this patch: - When an addon was included with `--with`, its dependencies were not detected. - When an addon was excluded with `--without` but it was a dependency of another addon that was included, it ended up in the final list (although explicitly excluded). TT20969 TT20963 --- bin/addons | 4 +++- tests/__init__.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/bin/addons b/bin/addons index 05c9734f..c529dfad 100755 --- a/bin/addons +++ b/bin/addons @@ -94,7 +94,8 @@ try: core_ok = args.core and repo == CORE extra_ok = args.extra and repo not in {CORE, PRIVATE} private_ok = args.private and repo == PRIVATE - if private_ok or core_ok or extra_ok: + manual_ok = addon in addons + if private_ok or core_ok or extra_ok or manual_ok: addon_path = os.path.join(SRC_DIR, repo, addon) manifest = {} for manifest_name in MANIFESTS: @@ -116,6 +117,7 @@ except AddonsConfigError as error: # Use dependencies instead, if requested if args.dependencies: addons = dependencies - addons +addons -= without # Do the required action if not addons: diff --git a/tests/__init__.py b/tests/__init__.py index dd283eea..98b56ce2 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -105,6 +105,22 @@ def test_addons_filtered(self): ("bash", "-c", "addons list -c | grep ,crm,"), # absent_addon is missing and should fail ("bash", "-c", "! addons list -px"), + # Test addon inclusion, exclusion, dependencies... + ( + "bash", + "-xc", + 'test "$(addons list -dw private_addon)" == base,dummy_addon,website', + ), + ( + "bash", + "-xc", + 'test "$(addons list -dwprivate_addon -Wwebsite)" == base,dummy_addon', + ), + ( + "bash", + "-xc", + 'test "$(addons list -dw private_addon -W dummy_addon)" == base,website', + ), ) self.compose_test( project_dir, From e186703785ed679413a14b397873a2d39d2d4a14 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 18 Dec 2019 10:51:07 +0000 Subject: [PATCH 084/255] Add -x to all bash/sh tests This makes logs actually useful because they will expand and print the commands being executed. --- tests/__init__.py | 80 +++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 98b56ce2..7da46192 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -98,13 +98,13 @@ def test_addons_filtered(self): ("test", "-e", "auto/addons/private_addon"), ( "bash", - "-c", + "-xc", 'test "$(addons list -p)" == disabled_addon,private_addon', ), - ("bash", "-c", 'test "$(addons list -ip)" == private_addon'), - ("bash", "-c", "addons list -c | grep ,crm,"), + ("bash", "-xc", 'test "$(addons list -ip)" == private_addon'), + ("bash", "-xc", "addons list -c | grep ,crm,"), # absent_addon is missing and should fail - ("bash", "-c", "! addons list -px"), + ("bash", "-xc", "! addons list -px"), # Test addon inclusion, exclusion, dependencies... ( "bash", @@ -127,29 +127,29 @@ def test_addons_filtered(self): dict(sub_env, DBNAME="limited_private"), ("test", "-e", "auto/addons/web"), ("test", "!", "-e", "auto/addons/private_addon"), - ("bash", "-c", 'test -z "$(addons list -p)"'), + ("bash", "-xc", 'test -z "$(addons list -p)"'), ( "bash", - "-c", + "-xc", '[ "$(addons list -s. -pwfake1 -wfake2)" == fake1.fake2 ]', ), - ("bash", "-c", "! addons list -wrepeat -Wrepeat"), - ("bash", "-c", "addons list -c | grep ,crm,"), + ("bash", "-xc", "! addons list -wrepeat -Wrepeat"), + ("bash", "-xc", "addons list -c | grep ,crm,"), ) self.compose_test( project_dir, dict(sub_env, DBNAME="limited_core"), ("test", "!", "-e", "auto/addons/web"), ("test", "!", "-e", "auto/addons/private_addon"), - ("bash", "-c", 'test -z "$(addons list -p)"'), - ("bash", "-c", 'test "$(addons list -c)" == crm,sale'), + ("bash", "-xc", 'test -z "$(addons list -p)"'), + ("bash", "-xc", 'test "$(addons list -c)" == crm,sale'), ) # Skip Odoo versions that don't support __manifest__.py files for sub_env in matrix(odoo_skip={"7.0", "8.0", "9.0"}): self.compose_test( project_dir, dict(sub_env, DBNAME="prod"), - ("bash", "-c", 'test "$(addons list -ped)" == base,web,website'), + ("bash", "-xc", 'test "$(addons list -ped)" == base,web,website'), # ``dummy_addon`` and ``private_addon`` exist ("test", "-d", "auto/addons/dummy_addon"), ("test", "-h", "auto/addons/dummy_addon"), @@ -159,17 +159,17 @@ def test_addons_filtered(self): ("realpath", "auto/addons/product"), ( "bash", - "-c", + "-xc", 'test "$(realpath auto/addons/product)" == ' "/opt/odoo/custom/src/other-doodba/odoo/src/private/product", ), - ("bash", "-c", 'test "$(addons list -e)" == dummy_addon,product'), + ("bash", "-xc", 'test "$(addons list -e)" == dummy_addon,product'), ) self.compose_test( project_dir, dict(sub_env, DBNAME="limited_private"), ("test", "-e", "auto/addons/dummy_addon"), - ("bash", "-c", 'test "$(addons list -e)" == dummy_addon,product'), + ("bash", "-xc", 'test "$(addons list -e)" == dummy_addon,product'), ) self.compose_test( project_dir, @@ -177,12 +177,12 @@ def test_addons_filtered(self): ("test", "-e", "auto/addons/dummy_addon"), ( "bash", - "-c", + "-xc", '[ "$(addons list -s. -pwfake1 -wfake2)" == fake1.fake2 ]', ), - ("bash", "-c", 'test "$(addons list -e)" == dummy_addon,product'), - ("bash", "-c", 'test "$(addons list -c)" == crm,sale'), - ("bash", "-c", 'test "$(addons list -cWsale)" == crm'), + ("bash", "-xc", 'test "$(addons list -e)" == dummy_addon,product'), + ("bash", "-xc", 'test "$(addons list -c)" == crm,sale'), + ("bash", "-xc", 'test "$(addons list -cWsale)" == crm'), ) @prerelease_skip @@ -219,7 +219,7 @@ def test_settings(self): # DB was created with the correct language ( "bash", - "-c", + "-xc", """test "$(psql -Atqc "SELECT code FROM res_lang WHERE active = TRUE")" == es_ES""", ), @@ -240,21 +240,21 @@ def test_smallest(self): # Default fonts must be liberation ( "bash", - "-c", + "-xc", """test "$(fc-match monospace)" == '{}'""".format( liberation.format("Mono") ), ), ( "bash", - "-c", + "-xc", """test "$(fc-match sans-serif)" == '{}'""".format( liberation.format("Sans") ), ), ( "bash", - "-c", + "-xc", """test "$(fc-match serif)" == '{}'""".format( liberation.format("Serif") ), @@ -318,15 +318,15 @@ def test_dotd(self): ("test", "!", "-e", "/usr/sbin/sshd"), ("test", "!", "-e", "/var/lib/apt/lists/lock"), ("busybox", "whoami"), - ("bash", "-c", "echo $NODE_PATH"), + ("bash", "-xc", "echo $NODE_PATH"), ("node", "-e", "require('test-npm-install')"), ("aloha_world",), - ("python", "-c", "import Crypto; print(Crypto.__version__)"), - ("sh", "-c", "rst2html.py --version | grep 'Docutils 0.14'"), + ("python", "-xc", "import Crypto; print(Crypto.__version__)"), + ("sh", "-xc", "rst2html.py --version | grep 'Docutils 0.14'"), # ``requirements.txt`` from addon repos were processed ("python", "-c", "import cfssl"), # Local executable binaries found in $PATH - ("sh", "-c", "pip install --user -q flake8 && which flake8"), + ("sh", "-xc", "pip install --user -q flake8 && which flake8"), # Addon cleanup works correctly ("test", "!", "-e", "custom/src/private/dummy_addon"), ("test", "!", "-e", "custom/src/dummy_repo/dummy_link"), @@ -358,7 +358,7 @@ def test_dependencies(self): # Patched Werkzeug version ( "bash", - "-c", + "-xc", ( 'test "$(python -c "import werkzeug; ' 'print(werkzeug.__version__)")" == 0.14.1' @@ -383,7 +383,7 @@ def test_dependencies(self): # 200-pip-without-ext ("test", "-f", "custom/dependencies/200-pip-without-ext"), ("python", "-c", "import Crypto; print(Crypto.__version__)"), - ("sh", "-c", "rst2html.py --version | grep 'Docutils 0.14'"), + ("sh", "-xc", "rst2html.py --version | grep 'Docutils 0.14'"), # 270-gem.txt ("test", "-f", "custom/dependencies/270-gem.txt"), ("aloha_world",), @@ -397,23 +397,23 @@ def test_modified_uids(self): uids_dir, sub_env, # verify that odoo user has the given ids - ("bash", "-c", 'test "$(id -u)" == "1001"'), - ("bash", "-c", 'test "$(id -g)" == "1002"'), - ("bash", "-c", 'test "$(id -u -n)" == "odoo"'), + ("bash", "-xc", 'test "$(id -u)" == "1001"'), + ("bash", "-xc", 'test "$(id -g)" == "1002"'), + ("bash", "-xc", 'test "$(id -u -n)" == "odoo"'), # all those directories need to belong to odoo (user or group odoo) ( "bash", - "-c", + "-xc", 'test "$(stat -c \'%U:%G\' /var/lib/odoo)" == "odoo:odoo"', ), ( "bash", - "-c", + "-xc", 'test "$(stat -c \'%U:%G\' /opt/odoo/auto/addons)" == "root:odoo"', ), ( "bash", - "-c", + "-xc", 'test "$(stat -c \'%U:%G\' /opt/odoo/custom/src)" == "root:odoo"', ), ) @@ -425,23 +425,23 @@ def test_default_uids(self): uids_dir, sub_env, # verify that odoo user has the given ids - ("bash", "-c", 'test "$(id -u)" == "1000"'), - ("bash", "-c", 'test "$(id -g)" == "1000"'), - ("bash", "-c", 'test "$(id -u -n)" == "odoo"'), + ("bash", "-xc", 'test "$(id -u)" == "1000"'), + ("bash", "-xc", 'test "$(id -g)" == "1000"'), + ("bash", "-xc", 'test "$(id -u -n)" == "odoo"'), # all those directories need to belong to odoo (user or group odoo) ( "bash", - "-c", + "-xc", 'test "$(stat -c \'%U:%G\' /var/lib/odoo)" == "odoo:odoo"', ), ( "bash", - "-c", + "-xc", 'test "$(stat -c \'%U:%G\' /opt/odoo/auto/addons)" == "root:odoo"', ), ( "bash", - "-c", + "-xc", 'test "$(stat -c \'%U:%G\' /opt/odoo/custom/src)" == "root:odoo"', ), ) From d0bfbd6097d825ac7bbb6c175aaa037f6c84e6a7 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 18 Dec 2019 10:07:28 +0000 Subject: [PATCH 085/255] Add --enterprise to addons command It's common that you want to test enterprise addons in a separate fashion from the rest of addons, same as core, extra or private addons. To support that, from now on, a repo called `enterprise` will be excluded when you run `addons` with `--extra` flag. Just add `--enterprise` explicitly if you need it. TT20969 --- bin/addons | 9 +++++++-- lib/doodbalib/__init__.py | 1 + tests/__init__.py | 6 ++++++ tests/scaffoldings/dotd/custom/src/addons.yaml | 2 ++ .../custom/src/enterprise/make_odoo_rich/__openerp__.py | 2 ++ 5 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tests/scaffoldings/dotd/custom/src/enterprise/make_odoo_rich/__openerp__.py diff --git a/bin/addons b/bin/addons index c529dfad..616a79ea 100755 --- a/bin/addons +++ b/bin/addons @@ -10,6 +10,7 @@ from subprocess import check_call from doodbalib import ( CORE, + ENTERPRISE, MANIFESTS, PRIVATE, SRC_DIR, @@ -44,6 +45,9 @@ parser.add_argument( parser.add_argument( "-i", "--installable", action="store_true", help="Include only installable addons" ) +parser.add_argument( + "-n", "--enterprise", action="store_true", help="Use all enterprise addons" +) parser.add_argument( "-p", "--private", action="store_true", help="Use all private addons" ) @@ -92,10 +96,11 @@ try: if addon in without: continue core_ok = args.core and repo == CORE - extra_ok = args.extra and repo not in {CORE, PRIVATE} + enterprise_ok = args.enterprise and repo == ENTERPRISE + extra_ok = args.extra and repo not in {CORE, ENTERPRISE, PRIVATE} private_ok = args.private and repo == PRIVATE manual_ok = addon in addons - if private_ok or core_ok or extra_ok or manual_ok: + if private_ok or core_ok or extra_ok or enterprise_ok or manual_ok: addon_path = os.path.join(SRC_DIR, repo, addon) manifest = {} for manifest_name in MANIFESTS: diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index e0245051..ac536b78 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -36,6 +36,7 @@ FILE_APT_BUILD = os.path.join(CUSTOM_DIR, "dependencies", "apt_build.txt") PRIVATE = "private" CORE = "odoo/addons" +ENTERPRISE = "enterprise" PRIVATE_DIR = os.path.join(SRC_DIR, PRIVATE) CORE_DIR = os.path.join(SRC_DIR, CORE) ODOO_DIR = os.path.join(SRC_DIR, "odoo") diff --git a/tests/__init__.py b/tests/__init__.py index 7da46192..fb9b83b5 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -121,6 +121,12 @@ def test_addons_filtered(self): "-xc", 'test "$(addons list -dw private_addon -W dummy_addon)" == base,website', ), + ("bash", "-xc", 'test "$(addons list -nd)" == base,iap',), + ( + "bash", + "-xc", + 'test "$(addons list --enterprise)" == make_odoo_rich', + ), ) self.compose_test( project_dir, diff --git a/tests/scaffoldings/dotd/custom/src/addons.yaml b/tests/scaffoldings/dotd/custom/src/addons.yaml index 5e19da66..10da6de1 100644 --- a/tests/scaffoldings/dotd/custom/src/addons.yaml +++ b/tests/scaffoldings/dotd/custom/src/addons.yaml @@ -2,6 +2,8 @@ other-doodba/odoo/src/private: - absent_addon - dummy_addon - product +enterprise: + - make_odoo_rich --- ONLY: PGDATABASE: diff --git a/tests/scaffoldings/dotd/custom/src/enterprise/make_odoo_rich/__openerp__.py b/tests/scaffoldings/dotd/custom/src/enterprise/make_odoo_rich/__openerp__.py new file mode 100644 index 00000000..cc1ba263 --- /dev/null +++ b/tests/scaffoldings/dotd/custom/src/enterprise/make_odoo_rich/__openerp__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +{"name": "make_odoo_rich", "depends": ["iap"]} From 710b5f4a4acb62b06cdae7a76425f94131f1d2a8 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Tue, 24 Dec 2019 11:16:25 +0500 Subject: [PATCH 086/255] fix link in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9eb1c0c4..cdec7cb6 100644 --- a/README.md +++ b/README.md @@ -751,7 +751,7 @@ Once you fixed everything needed, run it with: ###### Global inverse proxy -For [production][] and [test][] templates to work fine, you need to have a +For [production][] and [testing][] templates to work fine, you need to have a working [Traefik][] inverse proxy in each node. To have it, use this `inverseproxy.yaml` file: From 3839b2edb59c77654f2795e722a8b5c3130084fe Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Tue, 24 Dec 2019 12:14:06 +0500 Subject: [PATCH 087/255] make "restart odoo" README section up-to-date --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cdec7cb6..156a874e 100644 --- a/README.md +++ b/README.md @@ -969,11 +969,9 @@ execute an arbitrary command in a running container. You will need to restart it whenever any Python code changes, so to do that: - docker-compose restart -t0 odoo + docker-compose restart odoo -In production: - - docker-compose restart odoo https +In development mode odoo restarts by itself thanks to `--dev=reload` option. ##### Run unit tests for some addon From 4a5117b06ef6daeab595846b65da7a691c365b30 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 31 Dec 2019 12:40:41 +0000 Subject: [PATCH 088/255] Document new RELAY_PASSWORD variable This breaking change will follow https://github.com/Tecnativa/doodba-scaffolding/pull/56. @Tecnativa TT20505 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 156a874e..3c4be464 100644 --- a/README.md +++ b/README.md @@ -740,7 +740,7 @@ safe: - `./.docker/odoo.env` must define `ADMIN_PASSWORD`. - `./.docker/db-access.env` must define `PGPASSWORD`. - `./.docker/db-creation.env` must define `POSTGRES_PASSWORD` (must be equal to `PGPASSWORD` above). -- `./.docker/smtp.env` must define `MAIL_RELAY_PASS` (password to access the real SMTP relay). +- `./.docker/smtp.env` must define `RELAY_PASSWORD` (password to access the real SMTP relay). - `./.docker/backup.env` must define `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` (obtained from S3 provider) and `PASSPHRASE` (to encrypt backup archives). ###### Booting production From 31b338c20f4fb4c1bb052c99fb2e9ff9f6e267e4 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Tue, 24 Dec 2019 11:21:22 +0500 Subject: [PATCH 089/255] suggest better command to connect via psql --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c4be464..d963daa4 100644 --- a/README.md +++ b/README.md @@ -470,7 +470,7 @@ Usage: Environment variables are there so that if you need to connect with the database, you just need to execute: - docker exec -it your_container psql + docker-compose run -l traefik.enable=false --rm odoo psql The same is true for any other [Postgres client applications][]. From 824ac9d4eee53f1683f2b67a528b0b6b8930b60f Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Thu, 9 Jan 2020 15:07:41 +0100 Subject: [PATCH 090/255] add test for mac os uids Co-authored-by: Jairo Llopis --- tests/__init__.py | 29 ++++++++++++++++ tests/scaffoldings/uids_mac_os/Dockerfile | 2 ++ .../uids_mac_os/custom/src/addons.yaml | 0 .../uids_mac_os/docker-compose.yaml | 33 +++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 tests/scaffoldings/uids_mac_os/Dockerfile create mode 100644 tests/scaffoldings/uids_mac_os/custom/src/addons.yaml create mode 100644 tests/scaffoldings/uids_mac_os/docker-compose.yaml diff --git a/tests/__init__.py b/tests/__init__.py index fb9b83b5..fa8bb825 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -424,6 +424,35 @@ def test_modified_uids(self): ), ) + def test_uids_mac_os(self): + """tests if we can build an image with a custom uid and gid of odoo""" + uids_dir = join(SCAFFOLDINGS_DIR, "uids_mac_os") + for sub_env in matrix(): + self.compose_test( + uids_dir, + sub_env, + # verify that odoo user has the given ids + ("bash", "-c", 'test "$(id -u)" == "501"'), + ("bash", "-c", 'test "$(id -g)" == "20"'), + ("bash", "-c", 'test "$(id -u -n)" == "odoo"'), + # all those directories need to belong to odoo (user or group odoo/dialout) + ( + "bash", + "-c", + 'test "$(stat -c \'%U:%g\' /var/lib/odoo)" == "odoo:20"', + ), + ( + "bash", + "-c", + 'test "$(stat -c \'%U:%g\' /opt/odoo/auto/addons)" == "root:20"', + ), + ( + "bash", + "-c", + 'test "$(stat -c \'%U:%g\' /opt/odoo/custom/src)" == "root:20"', + ), + ) + def test_default_uids(self): uids_dir = join(SCAFFOLDINGS_DIR, "uids_default") for sub_env in matrix(): diff --git a/tests/scaffoldings/uids_mac_os/Dockerfile b/tests/scaffoldings/uids_mac_os/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/uids_mac_os/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/uids_mac_os/custom/src/addons.yaml b/tests/scaffoldings/uids_mac_os/custom/src/addons.yaml new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/uids_mac_os/docker-compose.yaml b/tests/scaffoldings/uids_mac_os/docker-compose.yaml new file mode 100644 index 00000000..a6d22af9 --- /dev/null +++ b/tests/scaffoldings/uids_mac_os/docker-compose.yaml @@ -0,0 +1,33 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + PIP_INSTALL_ODOO: "false" + WITHOUT_DEMO: "false" + UID: 501 + GID: 20 + + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + volumes: + - filestore:/var/lib/odoo:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: From d9bf7f4a92a7754e880e27c83ec2e73a80120368 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Thu, 9 Jan 2020 13:44:20 +0100 Subject: [PATCH 091/255] enable creating odoo group with duplicate id for mac os compatiblity --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 13.0.Dockerfile | 2 +- 8.0.Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 9d410ee2..51e7b449 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -191,7 +191,7 @@ ONBUILD ARG UID=1000 ONBUILD ARG GID=1000 # Enable Odoo user and filestore -ONBUILD RUN groupadd -g $GID odoo \ +ONBUILD RUN groupadd -g $GID odoo -o \ && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ && mkdir -p /var/lib/odoo \ && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 49f27d7e..a9347a24 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -187,7 +187,7 @@ ONBUILD ARG UID=1000 ONBUILD ARG GID=1000 # Enable Odoo user and filestore -ONBUILD RUN groupadd -g $GID odoo \ +ONBUILD RUN groupadd -g $GID odoo -o \ && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ && mkdir -p /var/lib/odoo \ && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 820db2e7..466d660a 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -197,7 +197,7 @@ ONBUILD ARG UID=1000 ONBUILD ARG GID=1000 # Enable Odoo user and filestore -ONBUILD RUN groupadd -g $GID odoo \ +ONBUILD RUN groupadd -g $GID odoo -o \ && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ && mkdir -p /var/lib/odoo \ && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 202a053c..37103d92 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -189,7 +189,7 @@ ONBUILD ARG UID=1000 ONBUILD ARG GID=1000 # Enable Odoo user and filestore -ONBUILD RUN groupadd -g $GID odoo \ +ONBUILD RUN groupadd -g $GID odoo -o \ && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ && mkdir -p /var/lib/odoo \ && chown -R odoo:odoo /var/lib/odoo /qa/artifacts\ From 5a5d94dc42e6afa7d1b29eb2ab16c11ed83924ee Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 14 Jan 2020 10:29:31 +0100 Subject: [PATCH 092/255] Change no addons found exit code to 4 It turns out that an arguments syntax error exits with 0x2, which is the same exit code I chose to indicate there are no addons. This way, there's no way to know if there was a real error or there were simply no addons found. So I change the exit code for addons not found to 0x4. https://github.com/Tecnativa/doodba-qa/pull/17 won't be able to complete without this patch. TT21246 --- .vscode/settings.json | 1 + bin/addons | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 3735fa28..d36f98a7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,7 @@ "python.autoComplete.extraPaths": ["./lib", "./tests"], "editor.formatOnSaveTimeout": 1000, "python.formatting.provider": "black", + "python.formatting.blackArgs": [], "python.linting.flake8Args": ["--max-line-length=88"], "python.linting.flake8Enabled": true, "python.linting.pylintEnabled": true, diff --git a/bin/addons b/bin/addons index 616a79ea..5be5f1d3 100755 --- a/bin/addons +++ b/bin/addons @@ -19,6 +19,9 @@ from doodbalib import ( logger, ) +# Exit codes +EXIT_NO_ADDONS = 0x4 + # Define CLI options parser = ArgumentParser(description="Install addons in current environment") parser.add_argument( @@ -127,7 +130,7 @@ addons -= without # Do the required action if not addons: print("No addons found", file=sys.stderr) - sys.exit(2) + sys.exit(EXIT_NO_ADDONS) addons = args.separator.join(sorted(addons)) if args.action == "list": print(addons) From c7058f6d6f9ac7f51adeb74fe47bc80bc2a33680 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Mon, 20 Jan 2020 22:34:24 +0500 Subject: [PATCH 093/255] Clarify production documentation to avoid network error Running production before creating inverseproxy leads to following error ERROR: Network inverseproxy_shared declared as external, but could not be found. Please create the network manually using `docker network create inverseproxy_shared` and try again. --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d963daa4..89b97218 100644 --- a/README.md +++ b/README.md @@ -743,12 +743,6 @@ safe: - `./.docker/smtp.env` must define `RELAY_PASSWORD` (password to access the real SMTP relay). - `./.docker/backup.env` must define `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` (obtained from S3 provider) and `PASSPHRASE` (to encrypt backup archives). -###### Booting production - -Once you fixed everything needed, run it with: - - docker-compose -f prod.yaml up --build --remove-orphans - ###### Global inverse proxy For [production][] and [testing][] templates to work fine, you need to have a @@ -843,6 +837,12 @@ This allows you to: - Have multiple Odoo instances in each node. - Add an SSL layer automatically and for free. +###### Booting production + +Once you fixed everything needed and started [global inverse proxy](#global-inverse-proxy), run the production environment with: + + docker-compose -f prod.yaml up --build --remove-orphans + ##### Testing A good rule of thumb is test in testing before uploading to production, so this @@ -856,13 +856,12 @@ but _removing possible pollution points_: - It is [isolated](#network-isolation). To use it, you need to [add secrets files just like for production](#adding-secrets), although secrets for smtp and backup containers are not needed because those don't exist here. +Also, start [global inverse proxy](#global-inverse-proxy) before running the test environment. Test it in your machine with: docker-compose -f test.yaml up --build -This environment also needs a [global inverse proxy](#global-inverse-proxy). - ###### Global whitelist Since the testing environment is [network-isolated](#network-isolation), From 67fde4049d386123b892b3dbc20f4dd3cf63af3c Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 31 Jan 2020 09:01:43 +0000 Subject: [PATCH 094/255] Make prettier wrap prose This helps keeping a more consistent README code. Includes the change and it execution. --- .prettierrc.yml | 6 + README.md | 567 +++++++++++++++++++++++------------------------- 2 files changed, 283 insertions(+), 290 deletions(-) create mode 100644 .prettierrc.yml diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 00000000..6f6302fc --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1,6 @@ +# Defaults for all prettier-supported languages +bracketSpacing: false +printWidth: 88 +proseWrap: always +semi: true +trailingComma: "es5" diff --git a/README.md b/README.md index 89b97218..c61d6f13 100644 --- a/README.md +++ b/README.md @@ -7,17 +7,15 @@ [![](https://api.travis-ci.org/Tecnativa/doodba.svg)](https://travis-ci.org/Tecnativa/doodba) -**Doodba** stands for **Do**cker **Od**oo **Ba**se, and it is a -highly opinionated image ready to put [Odoo](https://www.odoo.com) inside it, -but **without Odoo**. +**Doodba** stands for **Do**cker **Od**oo **Ba**se, and it is a highly opinionated image +ready to put [Odoo](https://www.odoo.com) inside it, but **without Odoo**. ## What? -Yes, the purpose of this is to serve as a base for you to build your own Odoo -project, because most of them end up requiring a big amount of custom patches, -merges, repositories, etc. With this image, you have a collection of good -practices and tools to enable your team to have a standard Odoo project -structure. +Yes, the purpose of this is to serve as a base for you to build your own Odoo project, +because most of them end up requiring a big amount of custom patches, merges, +repositories, etc. With this image, you have a collection of good practices and tools to +enable your team to have a standard Odoo project structure. BTW, we use [Debian][]. I hope you like that. @@ -25,12 +23,12 @@ BTW, we use [Debian][]. I hope you like that. ## Why? -Because developing Odoo is hard. You need lots of customizations, dependencies, -and if you want to move from one version to another, it's a pain. +Because developing Odoo is hard. You need lots of customizations, dependencies, and if +you want to move from one version to another, it's a pain. -Also because nobody wants Odoo as it comes from upstream, you most likely will -need to add custom patches and addons, at least, so we need a way to put all -together and make it work anywhere quickly. +Also because nobody wants Odoo as it comes from upstream, you most likely will need to +add custom patches and addons, at least, so we need a way to put all together and make +it work anywhere quickly. ## How? @@ -38,8 +36,8 @@ You can start working with this straight away with our [scaffolding][]. ## Image usage -Basically, every directory you have to worry about is found inside `/opt/odoo`. -This is its structure: +Basically, every directory you have to worry about is found inside `/opt/odoo`. This is +its structure: custom/ entrypoint.d/ @@ -79,15 +77,15 @@ Here you will put everything related to your project. #### `/opt/odoo/custom/entrypoint.d` -Any executables found here will be run when you launch your container, before -running the command you ask. +Any executables found here will be run when you launch your container, before running +the command you ask. #### `/opt/odoo/custom/build.d` Executables here will be aggregated with those in `/opt/odoo/common/build.d`. -The resulting set of executables will then be sorted alphabetically (ascending) -and then subsequently run. +The resulting set of executables will then be sorted alphabetically (ascending) and then +subsequently run. #### `/opt/odoo/custom/conf.d` @@ -96,42 +94,40 @@ Files here will be environment-variable-expanded and concatenated in #### `/opt/odoo/custom/ssh` -It must follow the same structure as a standard `~/.ssh` directory, including -`config` and `known_hosts` files. In fact, it is completely equivalent to -`~root/.ssh`. +It must follow the same structure as a standard `~/.ssh` directory, including `config` +and `known_hosts` files. In fact, it is completely equivalent to `~root/.ssh`. -The `config` file can contain `IdentityFile` keys to represent the private -key that should be used for that host. Unless specified otherwise, this -defaults to `identity[.pub]`, `id_rsa[.pub]` or `id_dsa[.pub]` files found in -this same directory. +The `config` file can contain `IdentityFile` keys to represent the private key that +should be used for that host. Unless specified otherwise, this defaults to +`identity[.pub]`, `id_rsa[.pub]` or `id_dsa[.pub]` files found in this same directory. -This is very useful **to use deployment keys** that grant git access to your -private repositories. +This is very useful **to use deployment keys** that grant git access to your private +repositories. -Example - a private key file in the `ssh` folder named `my_private_key` for -the host `repo.example.com` would have a `config` entry similar to the below: +Example - a private key file in the `ssh` folder named `my_private_key` for the host +`repo.example.com` would have a `config` entry similar to the below: ``` Host repo.example.com IdentityFile ~/.ssh/my_private_key ``` -Or you could just drop the key in `id_rsa` and `id_rsa.pub` files and it should -work by default without the need of adding a `config` file. +Or you could just drop the key in `id_rsa` and `id_rsa.pub` files and it should work by +default without the need of adding a `config` file. -Host key checking is enabled by default, which means that you also need to -provide a `known_hosts` file for any repos that you wish to access via SSH. +Host key checking is enabled by default, which means that you also need to provide a +`known_hosts` file for any repos that you wish to access via SSH. -In order to disable host key checks for a repo, your config would look something -like this: +In order to disable host key checks for a repo, your config would look something like +this: ``` Host repo.example.com StrictHostKeyChecking no ``` -For additional information regarding this directory, take a look at this -[Digital Ocean Article][ssh-conf]. +For additional information regarding this directory, take a look at this [Digital Ocean +Article][ssh-conf]. #### `/opt/odoo/custom/src` @@ -142,9 +138,9 @@ When putting code here, you can either: - Use [`repos.yaml`][], that will fill anything at build time. - Directly copy all there. -Recommendation: use [`repos.yaml`][] for everything except for [`private`][], -and ignore in your `.gitignore` and `.dockerignore` files every folder here -except [`private`][], with rules like these: +Recommendation: use [`repos.yaml`][] for everything except for [`private`][], and ignore +in your `.gitignore` and `.dockerignore` files every folder here except [`private`][], +with rules like these: odoo/custom/src/* !odoo/custom/src/private @@ -159,11 +155,11 @@ You can choose your Odoo version, and even merge PRs from many of them using - [Original Odoo][], by [Odoo S.A.][]. -- [OCB][] (Odoo Community Backports), by [OCA][]. - The original + some features - some stability strictness. +- [OCB][] (Odoo Community Backports), by [OCA][]. The original + some features - some + stability strictness. -- [OpenUpgrade][], by [OCA][]. - The original, frozen at new version launch time + migration scripts. +- [OpenUpgrade][], by [OCA][]. The original, frozen at new version launch time + + migration scripts. ##### `/opt/odoo/custom/src/private` @@ -209,21 +205,19 @@ web: ###### Automatic download of repos -Doodba is smart enough to download automatically git repositories even if they -are missing in `repos.yaml`. It will happen if it is used in [`addons.yaml`][], -except for the special [`private`][] repo. This will help you keep your -deployment definitions DRY. +Doodba is smart enough to download automatically git repositories even if they are +missing in `repos.yaml`. It will happen if it is used in [`addons.yaml`][], except for +the special [`private`][] repo. This will help you keep your deployment definitions DRY. -You can configure this behavior with these environment variables (default -values shown): +You can configure this behavior with these environment variables (default values shown): - `DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git"` - `DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git"` -As you probably guessed, we use something like `str.format(repo_basename)` -on top of those variables to compute the default remote origin. If, i.e., -you want to use your own repositories as default remotes, just add these -build arguments to your `docker-compose.yaml` file: +As you probably guessed, we use something like `str.format(repo_basename)` on top of +those variables to compute the default remote origin. If, i.e., you want to use your own +repositories as default remotes, just add these build arguments to your +`docker-compose.yaml` file: ```yaml # [...] @@ -236,16 +230,16 @@ services: # [...] ``` -So, for example, if your [`repos.yaml`][] file is empty and -your [`addons.yaml`][] contains this: +So, for example, if your [`repos.yaml`][] file is empty and your [`addons.yaml`][] +contains this: ```yaml server-tools: - module_auto_update ``` -A `/opt/odoo/auto/repos.yaml` file with this will be generated and used to -download git code: +A `/opt/odoo/auto/repos.yaml` file with this will be generated and used to download git +code: ```yaml /opt/odoo/custom/src/odoo: @@ -266,8 +260,8 @@ download git code: - origin $ODOO_VERSION ``` -All of this means that, you only need to define the git aggregator -spec in [`repos.yaml`][] if anything diverges from the standard: +All of this means that, you only need to define the git aggregator spec in +[`repos.yaml`][] if anything diverges from the standard: - You need special merges. - You need a special origin. @@ -289,30 +283,29 @@ web: Advanced features: -- You can bundle [several YAML documents][] if you want to logically group your - addons and some repos are repeated among groups, by separating each document - with `---`. +- You can bundle [several YAML documents][] if you want to logically group your addons + and some repos are repeated among groups, by separating each document with `---`. -- Addons under `private` and `odoo/addons` are linked automatically unless you - specify them. +- Addons under `private` and `odoo/addons` are linked automatically unless you specify + them. -- You can use `ONLY` to supply a dictionary of environment variables and a - list of possible values to enable that document in the matching environments. +- You can use `ONLY` to supply a dictionary of environment variables and a list of + possible values to enable that document in the matching environments. -- You can use `ENV` to supply a dictionary of environment variables to be used - on downloading repositories. Following variables are supported: +- You can use `ENV` to supply a dictionary of environment variables to be used on + downloading repositories. Following variables are supported: - `DEFAULT_REPO_PATTERN` - `DEFAULT_REPO_PATTERN_ODOO` - `DEPTH_DEFAULT` - `ODOO_VERSION` - can be used as repository branch -- If an addon is found in several places at the same time, it will get linked - according to this priority table: +- If an addon is found in several places at the same time, it will get linked according + to this priority table: 1. Addons in [`private`][]. - 2. Addons in other repositories (in case one is matched in several, it will - be random, BEWARE!). Better have no duplicated names if possible. + 2. Addons in other repositories (in case one is matched in several, it will be random, + BEWARE!). Better have no duplicated names if possible. 3. Core Odoo addons from [`odoo/addons`][`odoo`]. - If an addon is specified but not available at runtime, it will fail silently. @@ -364,26 +357,24 @@ some-repo: # Cloned from https://github.com/Tecnativa/some-repo.git branch 13.0- ##### `/opt/odoo/custom/dependencies/*.txt` -Files to indicate dependencies of your subimage, one for each of the supported -package managers: +Files to indicate dependencies of your subimage, one for each of the supported package +managers: -- `apt_build.txt`: build-time dependencies, installed before any others and - removed after all the others too. Usually these would include Debian packages - such as `build-essential` or `python-dev`. From Doodba 11.0, this is most - likely not needed, as build dependencies are shipped with the image, and - local python develpment headers should be used instead of those downloaded - from apt. +- `apt_build.txt`: build-time dependencies, installed before any others and removed + after all the others too. Usually these would include Debian packages such as + `build-essential` or `python-dev`. From Doodba 11.0, this is most likely not needed, + as build dependencies are shipped with the image, and local python develpment headers + should be used instead of those downloaded from apt. - `apt.txt`: run-time dependencies installed by apt. - `gem.txt`: run-time dependencies installed by gem. - `npm.txt`: run-time dependencies installed by npm. -- `pip.txt`: a normal [pip `requirements.txt`][] file, for run-time - dependencies too. It will get executed with `--update` flag, just in case - you want to overwrite any of the pre-bundled dependencies. +- `pip.txt`: a normal [pip `requirements.txt`][] file, for run-time dependencies too. It + will get executed with `--update` flag, just in case you want to overwrite any of the + pre-bundled dependencies. ### `/opt/odoo/common`: The useful one -This folder is full of magic. I'll document it some day. For now, just look at -the code. +This folder is full of magic. I'll document it some day. For now, just look at the code. Only some notes: @@ -407,68 +398,64 @@ It will have the result of merging all configurations under ## The `Dockerfile` -I will document all build arguments and environment variables some day, but for -now keep this in mind: +I will document all build arguments and environment variables some day, but for now keep +this in mind: -- This is just a base image, full of tools. **You need to build your project - subimage** from this one, even if your project's `Dockerfile` only contains - these 2 lines: +- This is just a base image, full of tools. **You need to build your project subimage** + from this one, even if your project's `Dockerfile` only contains these 2 lines: FROM tecnativa/doodba MAINTAINER Me -- The above sentence becomes true because we have a lot of `ONBUILD` sentences - here, so at least **your project must have a `./custom` folder** along with - its `Dockerfile` for it to work. +- The above sentence becomes true because we have a lot of `ONBUILD` sentences here, so + at least **your project must have a `./custom` folder** along with its `Dockerfile` + for it to work. -- All should be magic if you adhere to our opinions here. Just put the code - where it should go, and relax. +- All should be magic if you adhere to our opinions here. Just put the code where it + should go, and relax. ## Bundled tools -There is a good collections of tools available in the image that help dealing -with Odoo and its peculiarities: +There is a good collections of tools available in the image that help dealing with Odoo +and its peculiarities: ### `addons` -A handy CLI tool to automate addon management based on the current environment. -It allows you to install, update, test and/or list private, extra and/or core -addons available to current container, based on current [`addons.yaml`][] -configuration. +A handy CLI tool to automate addon management based on the current environment. It +allows you to install, update, test and/or list private, extra and/or core addons +available to current container, based on current [`addons.yaml`][] configuration. Call `addons --help` for usage instructions. ### `click-odoo` and related scripts -The great [`click-odoo`][] scripting framework and the collection of scripts -found in [`click-odoo-contrib`][] are included. Refer to their sites to know -how to use them. +The great [`click-odoo`][] scripting framework and the collection of scripts found in +[`click-odoo-contrib`][] are included. Refer to their sites to know how to use them. \* Note: This replaces the deprecated `python-odoo-shell` binary. ### [`nano`][] -The CLI text editor we all know, just in case you need to inspect some bug in -hot deployments. +The CLI text editor we all know, just in case you need to inspect some bug in hot +deployments. ### `log` -Just a little shell script that you can use to add logs to your build or -entrypoint scripts: +Just a little shell script that you can use to add logs to your build or entrypoint +scripts: log INFO I'm informing ### `pot` -Little shell shortcut for exporting a translation template from any addon(s). -Usage: +Little shell shortcut for exporting a translation template from any addon(s). Usage: pot my_addon,my_other_addon ### [`psql`](https://www.postgresql.org/docs/current/app-psql.html) -Environment variables are there so that if you need to connect with the -database, you just need to execute: +Environment variables are there so that if you need to connect with the database, you +just need to execute: docker-compose run -l traefik.enable=false --rm odoo psql @@ -476,8 +463,8 @@ The same is true for any other [Postgres client applications][]. ### [`ptvsd`](https://github.com/DonJayamanne/pythonVSCode) -[VSCode][] debugger. If you use this editor with its python module, you will -find it useful. +[VSCode][] debugger. If you use this editor with its python module, you will find it +useful. To debug at a certain point of the code, add this Python code somewhere: @@ -488,9 +475,8 @@ print("ptvsd waiting...") ptvsd.wait_for_attach() ``` -To start Odoo within a ptvsd environment, which will obey the breakpoints -established in your IDE (but will work slowly), just add `-e PTVSD_ENABLE=1` -to your odoo container. +To start Odoo within a ptvsd environment, which will obey the breakpoints established in +your IDE (but will work slowly), just add `-e PTVSD_ENABLE=1` to your odoo container. If you use the official [scaffolding][], you can boot it in ptvsd mode with: @@ -499,9 +485,8 @@ export DOODBA_PTVSD_ENABLE=1 docker-compose -f devel.yaml up -d ``` -Of course, you need to have properly configured your [VSCode][]. To do so, make -sure in your project there is a `.vscode/launch.json` file with these minimal -contents: +Of course, you need to have properly configured your [VSCode][]. To do so, make sure in +your project there is a `.vscode/launch.json` file with these minimal contents: ```json { @@ -528,8 +513,8 @@ Then, execute that configuration as usual. ### [`pudb`](https://github.com/inducer/pudb) -This is another great debugger that includes remote debugging via telnet, which -can be useful for some cases, or for people that prefer it over [wdb](#wdb). +This is another great debugger that includes remote debugging via telnet, which can be +useful for some cases, or for people that prefer it over [wdb](#wdb). To use it, inject this in any Python script: @@ -540,21 +525,20 @@ pudb.remote.set_trace(term_size=(80, 24)) Then open a telnet connection to it (running in `0.0.0.0:6899` by default). -It is safe to use in [production][] environments **if you know what you are -doing and do not expose the debugging port to attackers**. Usage: +It is safe to use in [production][] environments **if you know what you are doing and do +not expose the debugging port to attackers**. Usage: docker-compose exec odoo telnet localhost 6899 ### [`git-aggregator`](https://pypi.python.org/pypi/git-aggregator) -We found this one to be the most useful tool for downlading code, merging it -and placing it somewhere. +We found this one to be the most useful tool for downlading code, merging it and placing +it somewhere. ### `autoaggregate` -This little script wraps `git-aggregator` to make it work fine and -automatically with this image. Used in the [scaffolding][]'s `setup-devel.yaml` -step. +This little script wraps `git-aggregator` to make it work fine and automatically with +this image. Used in the [scaffolding][]'s `setup-devel.yaml` step. #### Example [`repos.yaml`][] file @@ -580,12 +564,12 @@ This example merges [several sources][`odoo`]: ### [`odoo`](https://www.odoo.com/documentation/10.0/reference/cmdline.html) -We set an `$OPENERP_SERVER` environment variable pointing to [the autogenerated -configuration file](#optodooautoodooconf) so you don't have to worry about -it. Just execute `odoo` and it will work fine. +We set an `$OPENERP_SERVER` environment variable pointing to +[the autogenerated configuration file](#optodooautoodooconf) so you don't have to worry +about it. Just execute `odoo` and it will work fine. -Note that version 9.0 has an `odoo` binary to provide forward compatibility -(but it has the `odoo.py` one too). +Note that version 9.0 has an `odoo` binary to provide forward compatibility (but it has +the `odoo.py` one too). ## Scaffolding @@ -594,12 +578,11 @@ Get up and running quickly with the provided ### Skip the boring parts -You will need these tools, so install them locally (and learn how to use them, -check their docs, Doodba is not the place to learn them šŸ˜‰): +You will need these tools, so install them locally (and learn how to use them, check +their docs, Doodba is not the place to learn them šŸ˜‰): - [Git](https://git-scm.com/do) -- [Docker Engine](https://www.docker.com/products/docker-engine) - (running locally) +- [Docker Engine](https://www.docker.com/products/docker-engine) (running locally) - [Docker Compose](https://docs.docker.com/compose/overview/) Then run these Bash commands: @@ -615,8 +598,8 @@ docker-compose -f setup-devel.yaml run --rm odoo docker-compose up ``` -And if you don't want to have a chance to do a `git pull` and get possible -future scaffolding updates merged in your project's `git log`: +And if you don't want to have a chance to do a `git pull` and get possible future +scaffolding updates merged in your project's `git log`: ```bash rm -Rf .git @@ -625,19 +608,19 @@ git init ### Tell me the boring parts -The scaffolding provides you a boilerplate-ready project to start developing -Odoo in no time. +The scaffolding provides you a boilerplate-ready project to start developing Odoo in no +time. #### Environments -This scaffolding comes with some environment configurations, ready for you to -extend them. Each of them is a [Docker Compose -file](https://docs.docker.com/compose/compose-file/) almost ready to work out -of the box (or almost), but that will assume that you understand it and will +This scaffolding comes with some environment configurations, ready for you to extend +them. Each of them is a +[Docker Compose file](https://docs.docker.com/compose/compose-file/) almost ready to +work out of the box (or almost), but that will assume that you understand it and will modify it. -After you clone the scaffolding, **search for `XXX` comments**, they will help -you on making it work. +After you clone the scaffolding, **search for `XXX` comments**, they will help you on +making it work. ##### Development @@ -650,22 +633,21 @@ Once finished, you can start using Odoo with: docker-compose -f devel.yaml up --build -This allows you to track only what Git needs to track and provides faster -Docker builds. +This allows you to track only what Git needs to track and provides faster Docker builds. You might consider adding this line to your `~/.bashrc`: export UID GID="$(id -g $USER)" UMASK="$(umask)" -To browse Odoo go to `http://localhost:${ODOO_MAJOR}069` -(i.e. for Odoo 11.0 this would be `http://localhost:11069`). +To browse Odoo go to `http://localhost:${ODOO_MAJOR}069` (i.e. for Odoo 11.0 this would +be `http://localhost:11069`). This environment has several special features: ###### [`wdb`](https://github.com/Kozea/wdb/) -This is one of the greatest Python debugger available, and even more for -Docker-based development, so here you have it preinstalled. +This is one of the greatest Python debugger available, and even more for Docker-based +development, so here you have it preinstalled. I told you, this image is opinionated. :wink: @@ -676,23 +658,23 @@ import wdb wdb.set_trace() ``` -It's available by default on the [development][] environment, -where you can browse http://localhost:1984 to use it. +It's available by default on the [development][] environment, where you can browse +http://localhost:1984 to use it. **DO NOT USE IT IN PRODUCTION ENVIRONMENTS.** (I had to say it). ###### [MailHog](https://github.com/mailhog/MailHog) -It provides a fake SMTP server that intercepts all mail sent by Odoo and -displays a simple interface that lets you see and debug all that mail -comfortably, including headers sent, attachments, etc. +It provides a fake SMTP server that intercepts all mail sent by Odoo and displays a +simple interface that lets you see and debug all that mail comfortably, including +headers sent, attachments, etc. - For [development][], it's in http://localhost:8025 - For [testing][], it's in http://$DOMAIN_TEST/smtpfake/ - For [production][], it's not used. -All environments are configured by default to use the bundled SMTP relay. -They are configured by these environment variables: +All environments are configured by default to use the bundled SMTP relay. They are +configured by these environment variables: - `SMTP_SERVER` - `SMTP_PORT` @@ -701,22 +683,20 @@ They are configured by these environment variables: - `SMTP_SSL` - `EMAIL_FROM` -For them to be useful, you need to remove any `ir.mail_server` records in your -database. +For them to be useful, you need to remove any `ir.mail_server` records in your database. ###### Network isolation -The Docker network is in `--internal` mode, which means that it has -no access to the Internet. This feature protects you in cases where -a [production][] database is restored and Odoo tries to connect to -SMTP/IMAP/POP3 servers to send or receive emails. Also when you are -using [connectors](https://github.com/OCA/connector), -[mail trackers](https://www.odoo.com/apps/modules/browse?search=mail_tracking) -or any API sync/calls. +The Docker network is in `--internal` mode, which means that it has no access to the +Internet. This feature protects you in cases where a [production][] database is restored +and Odoo tries to connect to SMTP/IMAP/POP3 servers to send or receive emails. Also when +you are using [connectors](https://github.com/OCA/connector), +[mail trackers](https://www.odoo.com/apps/modules/browse?search=mail_tracking) or any +API sync/calls. -If you still need to have public access, set `internal: false` in the -environment file, detach all containers from that network, remove the network, -reatach all containers to it, and possibly restart them. You can also just do: +If you still need to have public access, set `internal: false` in the environment file, +detach all containers from that network, remove the network, reatach all containers to +it, and possibly restart them. You can also just do: docker-compose down docker-compose up -d @@ -726,27 +706,29 @@ Usually a better option is ##### Production -This environment is just a template. **It is not production-ready**. You must -change many things inside it, it's just a guideline. +This environment is just a template. **It is not production-ready**. You must change +many things inside it, it's just a guideline. It includes pluggable `smtp` and `backup` services. ###### Adding secrets -Before booting this environment, you need to create a few files, which are -excluded in Git and contain some secrets, needed to make this environment -safe: +Before booting this environment, you need to create a few files, which are excluded in +Git and contain some secrets, needed to make this environment safe: - `./.docker/odoo.env` must define `ADMIN_PASSWORD`. - `./.docker/db-access.env` must define `PGPASSWORD`. -- `./.docker/db-creation.env` must define `POSTGRES_PASSWORD` (must be equal to `PGPASSWORD` above). -- `./.docker/smtp.env` must define `RELAY_PASSWORD` (password to access the real SMTP relay). -- `./.docker/backup.env` must define `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` (obtained from S3 provider) and `PASSPHRASE` (to encrypt backup archives). +- `./.docker/db-creation.env` must define `POSTGRES_PASSWORD` (must be equal to + `PGPASSWORD` above). +- `./.docker/smtp.env` must define `RELAY_PASSWORD` (password to access the real SMTP + relay). +- `./.docker/backup.env` must define `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` + (obtained from S3 provider) and `PASSPHRASE` (to encrypt backup archives). ###### Global inverse proxy -For [production][] and [testing][] templates to work fine, you need to have a -working [Traefik][] inverse proxy in each node. +For [production][] and [testing][] templates to work fine, you need to have a working +[Traefik][] inverse proxy in each node. To have it, use this `inverseproxy.yaml` file: @@ -822,14 +804,13 @@ Then boot it up with: docker-compose -p inverseproxy -f inverseproxy.yaml up -d -This will intercept all requests coming from port 80 (`http`) and redirect them -to port 443 (`https`), it will download and install required SSL certificates -from [Let's Encrypt][] whenever you boot a new [production][] instance, add the -required proxy headers to the request, and then redirect all traffic to/from -odoo automatically. +This will intercept all requests coming from port 80 (`http`) and redirect them to port +443 (`https`), it will download and install required SSL certificates from [Let's +Encrypt][] whenever you boot a new [production][] instance, add the required proxy +headers to the request, and then redirect all traffic to/from odoo automatically. -It includes [a security-enhaced proxy][docker-socket-proxy] to reduce attack -surface when listening to the Docker socket. +It includes [a security-enhaced proxy][docker-socket-proxy] to reduce attack surface +when listening to the Docker socket. This allows you to: @@ -839,15 +820,16 @@ This allows you to: ###### Booting production -Once you fixed everything needed and started [global inverse proxy](#global-inverse-proxy), run the production environment with: +Once you fixed everything needed and started +[global inverse proxy](#global-inverse-proxy), run the production environment with: docker-compose -f prod.yaml up --build --remove-orphans ##### Testing A good rule of thumb is test in testing before uploading to production, so this -environment tries to imitate the [production][] one in everything, -but _removing possible pollution points_: +environment tries to imitate the [production][] one in everything, but _removing +possible pollution points_: - It has a fake `smtp` service based on [MailHog][]. @@ -855,8 +837,10 @@ but _removing possible pollution points_: - It is [isolated](#network-isolation). -To use it, you need to [add secrets files just like for production](#adding-secrets), although secrets for smtp and backup containers are not needed because those don't exist here. -Also, start [global inverse proxy](#global-inverse-proxy) before running the test environment. +To use it, you need to [add secrets files just like for production](#adding-secrets), +although secrets for smtp and backup containers are not needed because those don't exist +here. Also, start [global inverse proxy](#global-inverse-proxy) before running the test +environment. Test it in your machine with: @@ -864,16 +848,16 @@ Test it in your machine with: ###### Global whitelist -Since the testing environment is [network-isolated](#network-isolation), -this can change some deadlocks or big timeouts in code chunks that are not -ready for such situation. Odoo happens to have some of them. +Since the testing environment is [network-isolated](#network-isolation), this can change +some deadlocks or big timeouts in code chunks that are not ready for such situation. +Odoo happens to have some of them. -The [development][] environment includes the default recommended whitelist -proxies, but for [testing][], it is recommended to have a separate docker -compose project running along in the same server that provides a -`globalwhitelist_default` network where all whitelist proxies exist. This is -a better practice for a testing environment where many services might coexist, -because it will let you save lots of processing power and IP addresses. +The [development][] environment includes the default recommended whitelist proxies, but +for [testing][], it is recommended to have a separate docker compose project running +along in the same server that provides a `globalwhitelist_default` network where all +whitelist proxies exist. This is a better practice for a testing environment where many +services might coexist, because it will let you save lots of processing power and IP +addresses. The recommended `globalwhitelist/docker-compose.yaml` file should contain: @@ -953,12 +937,12 @@ services: #### Other usage scenarios -In examples below I will skip the `-f .yaml` part and assume you -know which environment you want to use. +In examples below I will skip the `-f .yaml` part and assume you know which +environment you want to use. -Also, we recommend to use `run` subcommand to create a new container with same -settings and volumes. Sometimes you may prefer to use `exec` instead, to -execute an arbitrary command in a running container. +Also, we recommend to use `run` subcommand to create a new container with same settings +and volumes. Sometimes you may prefer to use `exec` instead, to execute an arbitrary +command in a running container. ##### Inspect the database @@ -1015,8 +999,8 @@ docker-compose run --rm odoo click-odoo-update --watcher-max-seconds 30 This script is part of [`click-odoo-contrib`][]; check it for more details. \* Note: `--watcher-max-seconds` is available because we ship a -[patched](https://github.com/acsone/click-odoo-contrib/pull/38) -version. Check that PR for docs. +[patched](https://github.com/acsone/click-odoo-contrib/pull/38) version. Check that PR +for docs. \* Note: This replaces the old deprecated `autoupdate` script. @@ -1040,25 +1024,25 @@ Then open `http://localhost:$SomeFreePort`. ### Will there be not retrocompatible changes on the image? -This image is production-ready, but it is constantly evolving too, so some new -features can break some old ones, or conflict with them, and some old features -might get deprecated and removed at some point. +This image is production-ready, but it is constantly evolving too, so some new features +can break some old ones, or conflict with them, and some old features might get +deprecated and removed at some point. -The best you can do is to [subscribe to the compatibility breakage -announcements issue][retrobreak]. +The best you can do is to [subscribe to the compatibility breakage announcements +issue][retrobreak]. ### How to have good QA and test in my CI with Doodba? -Inside this image, there's the `/qa` folder, which provides some necessary -plumbing to perform quality assurance and continous integration if you use -[doodba-qa][], which is a separate (but related) project with that purpose. +Inside this image, there's the `/qa` folder, which provides some necessary plumbing to +perform quality assurance and continous integration if you use [doodba-qa][], which is a +separate (but related) project with that purpose. Go there to get more instructions. ### I need to force addition or removal of `www.` prefix in production -These instructions assume you use the official [scaffolding][]. -To **remove** the `www.` prefix, set these params in the `.env` file: +These instructions assume you use the official [scaffolding][]. To **remove** the `www.` +prefix, set these params in the `.env` file: DOMAIN_PROD=example.com DOMAIN_PROD_ALT=www.example.com @@ -1068,8 +1052,8 @@ To **add** the `www.` prefix, it is almost the same: DOMAIN_PROD=www.example.com DOMAIN_PROD_ALT=example.com -Of course, both domains should point to the same machine before booting, or -Let's Encrypt might ban your server for some time. +Of course, both domains should point to the same machine before booting, or Let's +Encrypt might ban your server for some time. ### How to run a parallel Odoo container without crashing Traefik? @@ -1087,8 +1071,8 @@ In `.env`, set `DOMAIN_PROD` to `host1.com,host2.com,www.host1.com`, etc. ### How to choose initial DB creation language? -This image includes a hack that will set the initial language to load when -Odoo creates its database for the first time. These conditions must match: +This image includes a hack that will set the initial language to load when Odoo creates +its database for the first time. These conditions must match: - `$PGDATABASE` is set. - That database does not yet exist. @@ -1103,8 +1087,8 @@ Do: set -x GID (id -g $USER) set -x UMASK (umask) -You can make those variables universal (available in all terminals you open -from now on) by using `set -Ux` instead of `set -x`. +You can make those variables universal (available in all terminals you open from now on) +by using `set -Ux` instead of `set -x`. ### When I boot `devel.yaml` for the first time, Odoo crashes @@ -1118,16 +1102,15 @@ Most likely you are using versions `8.0` or `9.0` of the image. If so: ### How can I run a Posbox/IoT box service for development? -Posbox has special needs that are not useful for most projects, and is quite -tightly related to specific hardware and peripherals, so it makes not much -sense to ship it by default in Doodba and its [scaffolding][]. +Posbox has special needs that are not useful for most projects, and is quite tightly +related to specific hardware and peripherals, so it makes not much sense to ship it by +default in Doodba and its [scaffolding][]. -However, for testing connection issues, developing, etc., you might want to -boot a resource-limited posbox instance imitation. +However, for testing connection issues, developing, etc., you might want to boot a +resource-limited posbox instance imitation. -The best you can do is buy a Posbox/IoT box and peripherals and use it, but -for quick tests that do not involve specific hardware, you can boot it with -Doodba by: +The best you can do is buy a Posbox/IoT box and peripherals and use it, but for quick +tests that do not involve specific hardware, you can boot it with Doodba by: - Add the `apt` dependency `usbutils` (which contains `lsusb` binary). - Add the `pip` dependencies `evdev` and `netifaces`. @@ -1201,8 +1184,8 @@ Once you apply those changes, to use it: 1. Install `point_of_sale` in Odoo. 1. Configure the POS in Odoo to connect to Posbox in `localhost:8070`. -Of course this won't be fully functional, but it will give you an overview -on the posbox stuff. +Of course this won't be fully functional, but it will give you an overview on the posbox +stuff. [Beware about possible mixed content errors][mixed-content-posbox]. @@ -1217,47 +1200,47 @@ It runs triggers when doing the automatic build in the Docker Hub. ### Can I have my own [scaffolding][]? -You probably **should**, and rebase on our updates. However, if you are -planning on a general update to it that you find interesting for the -general-purpose one, please send us a pull request. +You probably **should**, and rebase on our updates. However, if you are planning on a +general update to it that you find interesting for the general-purpose one, please send +us a pull request. ### Can I skip the `-f .yaml` part for `docker-compose` commands? -Let's suppose you want to use [`test.yaml`][testing] environment by default, -no matter where you clone the project: +Let's suppose you want to use [`test.yaml`][testing] environment by default, no matter +where you clone the project: ln -s test.yaml docker-compose.yaml git add docker-compose.yaml git commit -Let's suppose you only want to use `devel.yaml` in your local development -machine by default: +Let's suppose you only want to use `devel.yaml` in your local development machine by +default: ln -s devel.yaml docker-compose.yml -Notice the difference in the prefix (`.yaml` vs. `.yml`). Docker Compose will -use the `.yml` one if both are found, so that's the one we considered you -should use in your local clones, and that's the one that will be git-ignored by -default by the scaffolding `.gitignore` file. +Notice the difference in the prefix (`.yaml` vs. `.yml`). Docker Compose will use the +`.yml` one if both are found, so that's the one we considered you should use in your +local clones, and that's the one that will be git-ignored by default by the scaffolding +`.gitignore` file. As a design choice, the scaffolding defaults to being explicit. ### How can I pin an image version? -Version-pinning is a good idea to keep your code from differing among image -updates. It's the best way to ensure no updates got in between the last time -you checked the image and the time you deploy it to production. +Version-pinning is a good idea to keep your code from differing among image updates. +It's the best way to ensure no updates got in between the last time you checked the +image and the time you deploy it to production. You can do it through **its sha256 code**. -Get any image's code through inspect, running from a computer where the correct -image version is downloaded: +Get any image's code through inspect, running from a computer where the correct image +version is downloaded: docker image inspect --format='{{.RepoDigests}}' tecnativa/doodba:10.0-onbuild -Alternatively, you can browse [this image's builds][builds], click on the one -you know it works fine for you, and search for the `digest` word using your -browser's _search in page_ system (Ctrl+F usually). +Alternatively, you can browse [this image's builds][builds], click on the one you know +it works fine for you, and search for the `digest` word using your browser's _search in +page_ system (Ctrl+F usually). You will find lines similar to: @@ -1269,8 +1252,8 @@ You will find lines similar to: 9.0: digest: sha256:33a540eca6441b950d633d3edc77d2cc46586717410f03d51c054ce348b2e977 size: 4508 [...] -Once you find them, you can use that pinned version in your builds, using a -Dockerfile similar to this one: +Once you find them, you can use that pinned version in your builds, using a Dockerfile +similar to this one: ```Dockerfile # Hash-pinned version of tecnativa/doodba:10.0-onbuild @@ -1284,16 +1267,16 @@ Make sure there's a `ir.config_parameter` called `report.url` with the value ### How to change report fonts? -Doodba ships [Liberation fonts](https://wikipedia.org/wiki/Liberation_fonts) -as defaults. +Doodba ships [Liberation fonts](https://wikipedia.org/wiki/Liberation_fonts) as +defaults. If you want to make another font package _available_, just add it to -[`apt.txt`][dependencies] (if it's a normal Debian package) or install it in -a [custom build script][build.d] called i.e. `build.d/200-custom-fonts` -(if you need to install it in a more complex way). +[`apt.txt`][dependencies] (if it's a normal Debian package) or install it in a [custom +build script][build.d] called i.e. `build.d/200-custom-fonts` (if you need to install it +in a more complex way). -If, in addition to that, you want those fonts to be the _defaults_, then add -one (or more) of these build arguments: +If, in addition to that, you want those fonts to be the _defaults_, then add one (or +more) of these build arguments: - `FONT_MONO` - `FONT_SANS` @@ -1301,42 +1284,43 @@ one (or more) of these build arguments: ### How can I whitelist a service and allow external access to it? -This can become useful when you have isolated environments -(like in `devel.yaml` and `test.yaml` by default) but you need to allow -some external API access for them. I.e., you could use -Google Fonts API for your customer's reports, and those reports -would take forever and end up rendering badly in staging environments. +This can become useful when you have isolated environments (like in `devel.yaml` and +`test.yaml` by default) but you need to allow some external API access for them. I.e., +you could use Google Fonts API for your customer's reports, and those reports would take +forever and end up rendering badly in staging environments. In such case, we recommend using the -[tecnativa/whitelist](https://hub.docker.com/r/tecnativa/whitelist/) image. -Read its docs there. +[tecnativa/whitelist](https://hub.docker.com/r/tecnativa/whitelist/) image. Read its +docs there. ### How can I help? -Just [head to our project](https://github.com/Tecnativa/doodba) and -open an issue or pull request. +Just [head to our project](https://github.com/Tecnativa/doodba) and open an issue or +pull request. -If you plan to open a pull request, remember that you will usually have to open -two of them: +If you plan to open a pull request, remember that you will usually have to open two of +them: -1. Targeting the `master` branch, from which the main images are built. - This pull request must include tests. -2. Targeting the `scaffolding` branch, which serves as the base for projects - using this base image. This one is not always required. +1. Targeting the `master` branch, from which the main images are built. This pull + request must include tests. +2. Targeting the `scaffolding` branch, which serves as the base for projects using this + base image. This one is not always required. -If you need to add a feature or fix for `scaffolding`, before merging that PR, -we need tests that ensure that backwards compatibility with previous -scaffolding versions is preserved. +If you need to add a feature or fix for `scaffolding`, before merging that PR, we need +tests that ensure that backwards compatibility with previous scaffolding versions is +preserved. ## Related Projects - [QA tools for Doodba-based projects][doodba-qa] - [Ansible role for automated deployment / update from Le Filament](https://github.com/remi-filament/ansible_role_odoo_docker) -- Find others by searching [GitHub projects tagged with `#doodba`](https://github.com/topics/doodba) +- Find others by searching + [GitHub projects tagged with `#doodba`](https://github.com/topics/doodba) [`/opt/odoo/auto/addons`]: #optodooautoaddons [`addons.yaml`]: #optodoocustomsrcaddonsyaml -[`compose_file` environment variable]: https://docs.docker.com/compose/reference/envvars/#/composefile +[`compose_file` environment variable]: + https://docs.docker.com/compose/reference/envvars/#/composefile [`nano`]: https://www.nano-editor.org/ [`odoo.conf`]: #optodooautoodooconf [`odoo`]: #optodoocustomsrcodoo @@ -1361,13 +1345,16 @@ scaffolding versions is preserved. [odoo s.a.]: https://www.odoo.com [openupgrade]: https://github.com/OCA/OpenUpgrade/ [original odoo]: https://github.com/odoo/odoo -[pip `requirements.txt`]: https://pip.readthedocs.io/en/latest/user_guide/#requirements-files -[postgres client applications]: https://www.postgresql.org/docs/current/static/reference-client.html +[pip `requirements.txt`]: + https://pip.readthedocs.io/en/latest/user_guide/#requirements-files +[postgres client applications]: + https://www.postgresql.org/docs/current/static/reference-client.html [production]: #production [retrobreak]: https://github.com/Tecnativa/doodba/issues/67 [scaffolding]: #scaffolding [several yaml documents]: http://www.yaml.org/spec/1.2/spec.html#id2760395 -[ssh-conf]: https://www.digitalocean.com/community/tutorials/how-to-configure-custom-connection-options-for-your-ssh-client +[ssh-conf]: + https://www.digitalocean.com/community/tutorials/how-to-configure-custom-connection-options-for-your-ssh-client [testing]: #testing [traefik]: https://traefik.io/ [vscode]: https://code.visualstudio.com/ From c3c3d9d3bc01b38ca77febdb7e59bfb647a79b4e Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Fri, 7 Feb 2020 17:06:16 +0500 Subject: [PATCH 095/255] add toc (#286) * Fix headers * use direct link when entire header is a link * don't use links in header otherwise it's a workaround for toc generator bug * add toc closes #280 --- .pre-commit-config.yaml | 5 +++ README.md | 94 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 92 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c47fe8b..775122ff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,3 +31,8 @@ repos: rev: 1.19.1 hooks: - id: prettier + - repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs + rev: v1.1.0 + hooks: + - id: markdown-toc + args: [--bullets=-, -i] diff --git a/README.md b/README.md index c61d6f13..92e92112 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,87 @@ it work anywhere quickly. You can start working with this straight away with our [scaffolding][]. + + +- [Image usage](#image-usage) + - [`/opt/odoo/custom`: The important one](#optodoocustom-the-important-one) + - [`/opt/odoo/custom/entrypoint.d`](#optodoocustomentrypointd) + - [`/opt/odoo/custom/build.d`](#optodoocustombuildd) + - [`/opt/odoo/custom/conf.d`](#optodoocustomconfd) + - [`/opt/odoo/custom/ssh`](#optodoocustomssh) + - [`/opt/odoo/custom/src`](#optodoocustomsrc) + - [`/opt/odoo/custom/src/odoo`](#optodoocustomsrcodoo) + - [`/opt/odoo/custom/src/private`](#optodoocustomsrcprivate) + - [`/opt/odoo/custom/src/repos.yaml`](#optodoocustomsrcreposyaml) + - [Automatic download of repos](#automatic-download-of-repos) + - [`/opt/odoo/custom/src/addons.yaml`](#optodoocustomsrcaddonsyaml) + - [`/opt/odoo/custom/dependencies/*.txt`](#optodoocustomdependenciestxt) + - [`/opt/odoo/common`: The useful one](#optodoocommon-the-useful-one) + - [`/opt/odoo/auto`: The automatic one](#optodooauto-the-automatic-one) + - [`/opt/odoo/auto/addons`](#optodooautoaddons) + - [`/opt/odoo/auto/odoo.conf`](#optodooautoodooconf) +- [The `Dockerfile`](#the-dockerfile) +- [Bundled tools](#bundled-tools) + - [`addons`](#addons) + - [`click-odoo` and related scripts](#click-odoo-and-related-scripts) + - [`nano`](#nano) + - [`log`](#log) + - [`pot`](#pot) + - [`psql`](#psql) + - [`ptvsd`](#ptvsd) + - [`pudb`](#pudb) + - [`git-aggregator`](#git-aggregator) + - [`autoaggregate`](#autoaggregate) + - [Example `repos.yaml` file](#example-reposyaml-file) + - [`odoo`](#odoo) +- [Scaffolding](#scaffolding) + - [Skip the boring parts](#skip-the-boring-parts) + - [Tell me the boring parts](#tell-me-the-boring-parts) + - [Environments](#environments) + - [Development](#development) + - [`wdb`](#wdb) + - [MailHog](#mailhog) + - [Network isolation](#network-isolation) + - [Production](#production) + - [Adding secrets](#adding-secrets) + - [Global inverse proxy](#global-inverse-proxy) + - [Booting production](#booting-production) + - [Testing](#testing) + - [Global whitelist](#global-whitelist) + - [Other usage scenarios](#other-usage-scenarios) + - [Inspect the database](#inspect-the-database) + - [Restart Odoo](#restart-odoo) + - [Run unit tests for some addon](#run-unit-tests-for-some-addon) + - [Reading the logs](#reading-the-logs) + - [Install some addon without stopping current running process](#install-some-addon-without-stopping-current-running-process) + - [Update some addon without stopping current running process](#update-some-addon-without-stopping-current-running-process) + - [Update changed addons only](#update-changed-addons-only) + - [Export some addon's translations to stdout](#export-some-addons-translations-to-stdout) + - [Open an odoo shell](#open-an-odoo-shell) + - [Open another UI instance linked to same filestore and database](#open-another-ui-instance-linked-to-same-filestore-and-database) +- [FAQ](#faq) + - [Will there be not retrocompatible changes on the image?](#will-there-be-not-retrocompatible-changes-on-the-image) + - [How to have good QA and test in my CI with Doodba?](#how-to-have-good-qa-and-test-in-my-ci-with-doodba) + - [I need to force addition or removal of `www.` prefix in production](#i-need-to-force-addition-or-removal-of-www-prefix-in-production) + - [How to run a parallel Odoo container without crashing Traefik?](#how-to-run-a-parallel-odoo-container-without-crashing-traefik) + - [How to allow access from several host names?](#how-to-allow-access-from-several-host-names) + - [How to choose initial DB creation language?](#how-to-choose-initial-db-creation-language) + - [I use Fish shell, how to export needed variables?](#i-use-fish-shell-how-to-export-needed-variables) + - [When I boot `devel.yaml` for the first time, Odoo crashes](#when-i-boot-develyaml-for-the-first-time-odoo-crashes) + - [How can I run a Posbox/IoT box service for development?](#how-can-i-run-a-posboxiot-box-service-for-development) + - [This project is too opinionated, but can I question any of those opinions?](#this-project-is-too-opinionated-but-can-i-question-any-of-those-opinions) + - [What's this `hooks` folder here?](#whats-this-hooks-folder-here) + - [Can I have my own scaffolding?](#can-i-have-my-own-scaffolding) + - [Can I skip the `-f .yaml` part for `docker-compose` commands?](#can-i-skip-the--f-yaml-part-for-docker-compose-commands) + - [How can I pin an image version?](#how-can-i-pin-an-image-version) + - [How to get proper assets when printing reports?](#how-to-get-proper-assets-when-printing-reports) + - [How to change report fonts?](#how-to-change-report-fonts) + - [How can I whitelist a service and allow external access to it?](#how-can-i-whitelist-a-service-and-allow-external-access-to-it) + - [How can I help?](#how-can-i-help) +- [Related Projects](#related-projects) + + + ## Image usage Basically, every directory you have to worry about is found inside `/opt/odoo`. This is @@ -434,7 +515,7 @@ The great [`click-odoo`][] scripting framework and the collection of scripts fou \* Note: This replaces the deprecated `python-odoo-shell` binary. -### [`nano`][] +### [`nano`](https://www.nano-editor.org/) The CLI text editor we all know, just in case you need to inspect some bug in hot deployments. @@ -540,9 +621,9 @@ it somewhere. This little script wraps `git-aggregator` to make it work fine and automatically with this image. Used in the [scaffolding][]'s `setup-devel.yaml` step. -#### Example [`repos.yaml`][] file +#### Example `repos.yaml` file -This example merges [several sources][`odoo`]: +This [`repos.yaml`][] example merges [several sources][`odoo`]: ```yaml ./odoo: @@ -1079,9 +1160,9 @@ its database for the first time. These conditions must match: - `$INITIAL_LANG` is set to any Odoo lang code. I.e. `es_ES`. - Odoo is booted. -### I use [Fish][], how to export needed variables? +### I use Fish shell, how to export needed variables? -Do: +In [Fish][] you need to do following: set -x UID (id -u $USER) set -x GID (id -g $USER) @@ -1198,7 +1279,7 @@ Of course. There's no guarantee that we will like it, but please do it. :wink: It runs triggers when doing the automatic build in the Docker Hub. [Check this](https://hub.docker.com/r/thibaultdelor/testautobuildhooks/). -### Can I have my own [scaffolding][]? +### Can I have my own scaffolding? You probably **should**, and rebase on our updates. However, if you are planning on a general update to it that you find interesting for the general-purpose one, please send @@ -1321,7 +1402,6 @@ preserved. [`addons.yaml`]: #optodoocustomsrcaddonsyaml [`compose_file` environment variable]: https://docs.docker.com/compose/reference/envvars/#/composefile -[`nano`]: https://www.nano-editor.org/ [`odoo.conf`]: #optodooautoodooconf [`odoo`]: #optodoocustomsrcodoo [`private`]: #optodoocustomsrcprivate From 968c1990107734ff2f4b9ac20a1e750073ded6a6 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Wed, 22 Jan 2020 18:00:09 +0000 Subject: [PATCH 096/255] add doc how to make backups manually and how to restore --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/README.md b/README.md index 92e92112..568a0537 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ You can start working with this straight away with our [scaffolding][]. - [Adding secrets](#adding-secrets) - [Global inverse proxy](#global-inverse-proxy) - [Booting production](#booting-production) + - [Backups](#backups) - [Testing](#testing) - [Global whitelist](#global-whitelist) - [Other usage scenarios](#other-usage-scenarios) @@ -906,6 +907,55 @@ Once you fixed everything needed and started docker-compose -f prod.yaml up --build --remove-orphans +###### Backups + +Backups are only available in the production environment. They are provided by +[tecnativa/duplicity:postgres-s3](https://github.com/Tecnativa/docker-duplicity). The +structure of the backed up folder: + +``` +ā”œā”€ā”€ prod.sql +└── odoo/ + ā”œā”€ā”€ addons/ + └── filestore/ + └── prod/ + ā”œā”€ā”€ ... + └── ... +``` + +To make backup immediatly execute following command: + +```sh +# Executes all jobs scheduled for daily run. +# With default configuration it's equal to making full backup +docker-compose exec backup /etc/periodic/daily/jobrunner +``` + +To restore backup: + +```sh +# stop odoo if it's running +docker-compose stop odoo + +# start backup and db +docker-compose up -d backup + +# switch to some version +docker-compose exec backup restore --time TIME_IN_BACKUP_NAME --force + +# āš ļø DELETE PRODUCTION database +#docker-compose backup dropdb + +# create new empty database +docker-compose exec backup createdb + +# restore database +docker-compose exec backup sh -c 'psql -f $SRC/$PGDATABASE.sql' + +# start odoo +docker-compose up -d +``` + ##### Testing A good rule of thumb is test in testing before uploading to production, so this From 416a249cde1ae4d869856af4bc5ebb5b8ca2a0c4 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Wed, 12 Feb 2020 17:43:53 +0100 Subject: [PATCH 097/255] fix: wdb for Odoo v9.0 needs simplejson installed to work --- 8.0.Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 37103d92..ba0b23ee 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -81,6 +81,7 @@ RUN pip install \ pudb \ virtualenv \ wdb \ + simplejson \ && sync COPY bin-deprecated/* bin/* /usr/local/bin/ COPY lib/doodbalib /usr/local/lib/python2.7/dist-packages/doodbalib From dbaaa2782a2d00e093063ebee3478c1d4093def3 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 14 Feb 2020 09:03:36 +0000 Subject: [PATCH 098/255] Update Python 3 version in v11 and v12 Python 3.5 is flawed. It affects Odoo badly as shown in https://github.com/odoo/odoo/issues/20158. Odoo claims to have included a workaround for that in their code, but that simply doesn't work according to real world tests. The only fix is to update Python version, so here's the update. @Tecnativa TT21841 --- 11.0.Dockerfile | 12 ++++++------ 12.0.Dockerfile | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 51e7b449..a1308696 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.5-stretch AS base +FROM python:3.7-stretch AS base EXPOSE 8069 8072 @@ -80,9 +80,9 @@ RUN pip install \ wdb \ && sync COPY bin-deprecated/* bin/* /usr/local/bin/ -COPY lib/doodbalib /usr/local/lib/python3.5/site-packages/doodbalib -RUN ln -s /usr/local/lib/python3.5/site-packages/doodbalib \ - /usr/local/lib/python3.5/site-packages/odoobaselib +COPY lib/doodbalib /usr/local/lib/python3.7/site-packages/doodbalib +RUN ln -s /usr/local/lib/python3.7/site-packages/doodbalib \ + /usr/local/lib/python3.7/site-packages/odoobaselib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d @@ -90,7 +90,7 @@ RUN mkdir -p auto/addons custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ - && chmod -R a+rX /usr/local/lib/python3.5/site-packages/doodbalib \ + && chmod -R a+rX /usr/local/lib/python3.7/site-packages/doodbalib \ && sync # Doodba-QA dependencies in a separate virtualenv @@ -119,7 +119,7 @@ RUN debs="libldap2-dev libsasl2-dev" \ && apt-get install -yqq --no-install-recommends $debs \ && pip install \ -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ - && (python3 -m compileall -q /usr/local/lib/python3.5/ || true) \ + && (python3 -m compileall -q /usr/local/lib/python3.7/ || true) \ && apt-get purge -yqq $debs \ && rm -Rf /var/lib/apt/lists/* /tmp/* diff --git a/12.0.Dockerfile b/12.0.Dockerfile index a9347a24..d57aeb13 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.5-stretch AS base +FROM python:3.7-stretch AS base EXPOSE 8069 8072 @@ -76,7 +76,7 @@ RUN pip install \ wdb \ && sync COPY bin-deprecated/* bin/* /usr/local/bin/ -COPY lib/doodbalib /usr/local/lib/python3.5/site-packages/doodbalib +COPY lib/doodbalib /usr/local/lib/python3.7/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d @@ -84,7 +84,7 @@ RUN mkdir -p auto/addons custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ - && chmod -R a+rX /usr/local/lib/python3.5/site-packages/doodbalib \ + && chmod -R a+rX /usr/local/lib/python3.7/site-packages/doodbalib \ && sync # Doodba-QA dependencies in a separate virtualenv @@ -115,7 +115,7 @@ RUN debs="libldap2-dev libsasl2-dev" \ -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ phonenumbers \ 'websocket-client~=0.53' \ - && (python3 -m compileall -q /usr/local/lib/python3.5/ || true) \ + && (python3 -m compileall -q /usr/local/lib/python3.7/ || true) \ && apt-get purge -yqq $debs \ && rm -Rf /var/lib/apt/lists/* /tmp/* From 86254ae253ef11d1cc2116c1e11e533a8ea3c9f0 Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev Date: Tue, 17 Mar 2020 14:40:15 +0500 Subject: [PATCH 099/255] add --with to addons command command "addons" doesn't accept modules as positional arguments. Example: $ docker-compose run --rm odoo addons init --test web_debranding doodba INFO: Executing addons init --test web_debranding usage: addons [-h] [-c] [-d] [-e] [-f] [-i] [-n] [-p] [-s SEPARATOR] [-t] [-x] [-w WITH_] [-W WITHOUT] {init,update,list} addons: error: unrecognized arguments: web_debranding --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 568a0537..6bf59f44 100644 --- a/README.md +++ b/README.md @@ -1092,11 +1092,11 @@ In development mode odoo restarts by itself thanks to `--dev=reload` option. ```bash modules=addon1,addon2 # Install their dependencies first -docker-compose run --rm odoo addons init --dependencies $modules +docker-compose run --rm odoo addons init --dependencies --with $modules # Test them at install -docker-compose run --rm odoo addons init --test $modules +docker-compose run --rm odoo addons init --test --with $modules # Test them again at update -docker-compose run --rm odoo addons update --test $modules +docker-compose run --rm odoo addons update --test --with $modules ``` \* Note: This replaces the old deprecated `unittest` script. From 5f2d5a0c475f6877b6bfffd850a3470ee9955e30 Mon Sep 17 00:00:00 2001 From: Andreas Perhab <38032588+ap-wtioit@users.noreply.github.com> Date: Tue, 17 Mar 2020 13:20:07 +0100 Subject: [PATCH 100/255] implement geoip installation with account id and license key (#275) * implement geoip installation with account id and license key * fix, use curl instead of wget (wget is not available in 10.0 and 13.0) * skip geoip test if no credentials provided in environment * fix, follow redirects in curl * fix, correct output parameter for curl * fix: always install geoipupdater in base image * enable configuring geoip in build and environment * fix test for unconfigured geoipupdate * use log instead of echo in shell scripts * fix, remove unused onbuild args and env, declare env variables * fix: install geoip2 pip dependency for all versions * Move geoip script to plumbum * fix readme * move ARG and ENV to suggested places This also installs plumbum by default inside doodba and checks its presence. See https://github.com/Tecnativa/doodba/issues/7#issuecomment-466002984. Co-authored-by: Jairo Llopis --- 11.0.Dockerfile | 13 +++- 12.0.Dockerfile | 13 +++- 13.0.Dockerfile | 14 +++- 8.0.Dockerfile | 13 +++- README.md | 72 +++++++++++++++++++ conf.d/60-geoip.conf | 2 + entrypoint.d/45-geoip | 37 ++++++++++ tests/__init__.py | 41 +++++++++++ tests/scaffoldings/geoip/Dockerfile | 2 + .../scaffoldings/geoip/custom/src/addons.yaml | 0 tests/scaffoldings/geoip/docker-compose.yaml | 35 +++++++++ 11 files changed, 238 insertions(+), 4 deletions(-) create mode 100644 conf.d/60-geoip.conf create mode 100755 entrypoint.d/45-geoip create mode 100644 tests/scaffoldings/geoip/Dockerfile create mode 100644 tests/scaffoldings/geoip/custom/src/addons.yaml create mode 100644 tests/scaffoldings/geoip/docker-compose.yaml diff --git a/11.0.Dockerfile b/11.0.Dockerfile index a1308696..9efb3e15 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -2,6 +2,7 @@ FROM python:3.7-stretch AS base EXPOSE 8069 8072 +ARG GEOIP_UPDATER_VERSION=4.1.5 ARG MQT=https://github.com/OCA/maintainer-quality-tools.git ARG WKHTMLTOPDF_VERSION=0.12.5 ARG WKHTMLTOPDF_CHECKSUM='1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb' @@ -9,6 +10,8 @@ ENV DB_FILTER=.* \ DEPTH_DEFAULT=1 \ DEPTH_MERGE=100 \ EMAIL=https://hub.docker.com/r/tecnativa/odoo \ + GEOIP_ACCOUNT_ID="" \ + GEOIP_LICENSE_KEY="" \ GIT_AUTHOR_NAME=docker-odoo \ INITIAL_LANG="" \ LC_ALL=C.UTF-8 \ @@ -56,6 +59,9 @@ RUN apt-get -qq update \ && apt-get install -yqq --no-install-recommends ./wkhtmltox.deb \ && rm wkhtmltox.deb \ && wkhtmltopdf --version \ + && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ && rm -Rf /var/lib/apt/lists/* /tmp/* # Special case to get latest Less and PhantomJS @@ -74,10 +80,12 @@ RUN pip install \ click-odoo-contrib \ git-aggregator \ pg_activity \ + plumbum \ ptvsd \ pudb \ watchdog \ wdb \ + geoip2 \ && sync COPY bin-deprecated/* bin/* /usr/local/bin/ COPY lib/doodbalib /usr/local/lib/python3.7/site-packages/doodbalib @@ -86,11 +94,14 @@ RUN ln -s /usr/local/lib/python3.7/site-packages/doodbalib \ COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d -RUN mkdir -p auto/addons custom/src/private \ +RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ && chmod -R a+rX /usr/local/lib/python3.7/site-packages/doodbalib \ + && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ + && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ + && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ && sync # Doodba-QA dependencies in a separate virtualenv diff --git a/12.0.Dockerfile b/12.0.Dockerfile index d57aeb13..668e40fe 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -2,6 +2,7 @@ FROM python:3.7-stretch AS base EXPOSE 8069 8072 +ARG GEOIP_UPDATER_VERSION=4.1.5 ARG MQT=https://github.com/OCA/maintainer-quality-tools.git ARG WKHTMLTOPDF_VERSION=0.12.5 ARG WKHTMLTOPDF_CHECKSUM='1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb' @@ -9,6 +10,8 @@ ENV DB_FILTER=.* \ DEPTH_DEFAULT=1 \ DEPTH_MERGE=100 \ EMAIL=https://hub.docker.com/r/tecnativa/odoo \ + GEOIP_ACCOUNT_ID="" \ + GEOIP_LICENSE_KEY="" \ GIT_AUTHOR_NAME=docker-odoo \ INITIAL_LANG="" \ LC_ALL=C.UTF-8 \ @@ -56,6 +59,9 @@ RUN apt-get -qq update \ && apt-get install -yqq --no-install-recommends ./wkhtmltox.deb \ && rm wkhtmltox.deb \ && wkhtmltopdf --version \ + && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ && rm -Rf /var/lib/apt/lists/* /tmp/* # Special case to get latest Less @@ -70,21 +76,26 @@ RUN pip install \ click-odoo-contrib \ git-aggregator \ pg_activity \ + plumbum \ ptvsd \ pudb \ watchdog \ wdb \ + geoip2 \ && sync COPY bin-deprecated/* bin/* /usr/local/bin/ COPY lib/doodbalib /usr/local/lib/python3.7/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d -RUN mkdir -p auto/addons custom/src/private \ +RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ && chmod -R a+rX /usr/local/lib/python3.7/site-packages/doodbalib \ + && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ + && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ + && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ && sync # Doodba-QA dependencies in a separate virtualenv diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 466d660a..f006c23e 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -2,6 +2,7 @@ FROM python:3.7-slim-buster AS base EXPOSE 8069 8072 +ARG GEOIP_UPDATER_VERSION=4.1.5 ARG MQT=https://github.com/OCA/maintainer-quality-tools.git ARG WKHTMLTOPDF_VERSION=0.12.5 ARG WKHTMLTOPDF_CHECKSUM='1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb' @@ -9,6 +10,8 @@ ENV DB_FILTER=.* \ DEPTH_DEFAULT=1 \ DEPTH_MERGE=100 \ EMAIL=https://hub.docker.com/r/tecnativa/odoo \ + GEOIP_ACCOUNT_ID="" \ + GEOIP_LICENSE_KEY="" \ GIT_AUTHOR_NAME=docker-odoo \ INITIAL_LANG="" \ LC_ALL=C.UTF-8 \ @@ -55,6 +58,9 @@ RUN apt-get -qq update \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ && apt-get install -yqq --no-install-recommends postgresql-client \ + && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ && apt-get autopurge -yqq \ && rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \ && sync @@ -65,11 +71,14 @@ COPY lib/doodbalib /usr/local/lib/python3.7/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d -RUN mkdir -p auto/addons custom/src/private \ +RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ && chmod -R a+rX /usr/local/lib/python3.7/site-packages/doodbalib \ + && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ + && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ + && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ && sync # Doodba-QA dependencies in a separate virtualenv @@ -120,10 +129,12 @@ RUN build_deps=" \ click-odoo-contrib \ pg_activity \ phonenumbers \ + plumbum \ ptvsd \ pudb \ watchdog \ wdb \ + geoip2 \ && (python3 -m compileall -q /usr/local/lib/python3.7/ || true) \ && apt-get purge -yqq $build_deps \ && apt-get autopurge -yqq \ @@ -171,6 +182,7 @@ ONBUILD ARG PGPASSWORD=odoopassword ONBUILD ARG PGHOST=db ONBUILD ARG PGPORT=5432 ONBUILD ARG PGDATABASE=prod + # Config variables ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index ba0b23ee..80a43d88 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -2,6 +2,7 @@ FROM debian:8 AS base EXPOSE 8069 8072 +ARG GEOIP_UPDATER_VERSION=4.1.5 ARG MQT=https://github.com/OCA/maintainer-quality-tools.git ARG WKHTMLTOPDF_VERSION=0.12.5 ARG WKHTMLTOPDF_CHECKSUM='2583399a865d7604726da166ee7cec656b87ae0a6016e6bce7571dcd3045f98b' @@ -9,6 +10,8 @@ ENV DB_FILTER=.* \ DEPTH_DEFAULT=1 \ DEPTH_MERGE=100 \ EMAIL=https://hub.docker.com/r/tecnativa/odoo \ + GEOIP_ACCOUNT_ID="" \ + GEOIP_LICENSE_KEY="" \ GIT_AUTHOR_NAME=docker-odoo \ INITIAL_LANG="" \ LC_ALL=C.UTF-8 \ @@ -54,6 +57,9 @@ RUN sed -Ei 's@(^deb http://deb.debian.org/debian jessie-updates main$)@#\1@' /e && apt-get install -yqq --no-install-recommends --fix-broken \ && rm fonts-liberation2.deb wkhtmltox.deb \ && wkhtmltopdf --version \ + && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ && rm -Rf /var/lib/apt/lists/* # Special case to get latest PostgreSQL client @@ -77,11 +83,13 @@ WORKDIR /opt/odoo RUN pip install \ click-odoo-contrib \ git-aggregator \ + plumbum \ ptvsd \ pudb \ virtualenv \ wdb \ simplejson \ + geoip2 \ && sync COPY bin-deprecated/* bin/* /usr/local/bin/ COPY lib/doodbalib /usr/local/lib/python2.7/dist-packages/doodbalib @@ -90,11 +98,14 @@ RUN ln -s /usr/local/lib/python2.7/dist-packages/doodbalib \ COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d -RUN mkdir -p auto/addons custom/src/private \ +RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ && chmod -R a+rX /usr/local/lib/python2.7/dist-packages/doodbalib \ + && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ + && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ + && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ && sync # Doodba-QA dependencies in a separate virtualenv diff --git a/README.md b/README.md index 6bf59f44..10b14501 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ You can start working with this straight away with our [scaffolding][]. - [`autoaggregate`](#autoaggregate) - [Example `repos.yaml` file](#example-reposyaml-file) - [`odoo`](#odoo) + - [GeoLite2](#geolite2) - [Scaffolding](#scaffolding) - [Skip the boring parts](#skip-the-boring-parts) - [Tell me the boring parts](#tell-me-the-boring-parts) @@ -653,6 +654,65 @@ about it. Just execute `odoo` and it will work fine. Note that version 9.0 has an `odoo` binary to provide forward compatibility (but it has the `odoo.py` one too). +### GeoLite2 + +To enable geoip support for Odoo you need to signup for a Maxmind account for GeoLite2: +https://www.maxmind.com/en/geolite2/signup + +Create a license key in your maxmind account and provide your account id and license key +on build to the scaffolding. + +The `GEOIP_ACCOUNT_ID` environment variable should hold the account id and +`GEOIP_LICENSE_KEY` the license key. Both are visible on the "My License Key" page under +your [account](https://www.maxmind.com/en/account) when you create the license key. + +Example config (docker-compose.yml) + +```yaml +services: + odoo: + environment: + ... + # This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com + GEOIP_ACCOUNT_ID: 1234 + GEOIP_LICENSE_KEY: aBcDeF + ... +``` + +When booting you should see a message `Activating GeoIP/GeoLite2 updates`. + +Upon (re)start the container will perform the updates as requested by the +[eula](https://www.maxmind.com/en/geolite2/eula). You also can update the database by +calling `geoipupdate` inside the running container. + +When you run geoip in an isolated environment (odoo is only able to access whitelisted +addresses) make sure odoo is able to access `updates.maxmind.com`. You could do so by +adding the whitelist proxy like this to your docker-compose.yml: + +```yaml + odoo: + ... + depends_on: + ... + - maxmind_proxy + ... + ... + ... + + maxmind_proxy: + image: tecnativa/whitelist + networks: + default: + aliases: + - updates.maxmind.com + public: + environment: + TARGET: updates.maxmind.com + PRE_RESOLVE: 1 + ... + +``` + ## Scaffolding Get up and running quickly with the provided @@ -1064,6 +1124,18 @@ services: environment: TARGET: "www.gravatar.com" PRE_RESOLVE: 1 + + updates_maxmind_com: + image: tecnativa/whitelist + restart: unless-stopped + networks: + public: + shared: + aliases: + - "updates.maxmind.com" + environment: + TARGET: "updates.maxmind.com" + PRE_RESOLVE: 1 ``` #### Other usage scenarios diff --git a/conf.d/60-geoip.conf b/conf.d/60-geoip.conf new file mode 100644 index 00000000..1665f2c0 --- /dev/null +++ b/conf.d/60-geoip.conf @@ -0,0 +1,2 @@ +[options] +geoip_database = /opt/odoo/auto/geoip/GeoLite2-City.mmdb diff --git a/entrypoint.d/45-geoip b/entrypoint.d/45-geoip new file mode 100755 index 00000000..8d6256dd --- /dev/null +++ b/entrypoint.d/45-geoip @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import re +import sys + +from doodbalib import logger + +from plumbum import BG, local +from plumbum.cmd import geoipupdate + +GEOIP_ACCOUNT_ID = local.env["GEOIP_ACCOUNT_ID"] +GEOIP_LICENSE_KEY = local.env["GEOIP_LICENSE_KEY"] + +if GEOIP_ACCOUNT_ID not in {"", "0"} and GEOIP_LICENSE_KEY not in {"", "0"}: + # see https://dev.maxmind.com/geoip/geoipupdate/ + logger.info("Activating GeoIP/GeoLite2 updates") + logger.info( + "This product includes GeoLite2 data created by MaxMind, " + "available from https://www.maxmind.com" + ) + # Obtain current GeoIP configuration + geoip_file = local.path("/opt/odoo/auto/geoip/GeoIP.conf") + geoip_conf = geoip_file.read() + # Patch it with provided account and license keys + geoip_conf = re.sub( + r"(^|\n)AccountID\s*[^\n]*(\n|$)", + "\\1AccountID {}\\2".format(GEOIP_ACCOUNT_ID), + geoip_conf, + ) + geoip_conf = re.sub( + r"(^|\n)LicenseKey\s*[^\n]*(\n|$)", + "\\1LicenseKey {}\\2".format(GEOIP_LICENSE_KEY), + geoip_conf, + ) + geoip_file.write(geoip_conf) + # run geoip update in background to make sure it doesn't block odoo startup + geoipupdate & BG(stdout=sys.stdout, stderr=sys.stderr) diff --git a/tests/__init__.py b/tests/__init__.py index fa8bb825..cdf329a0 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -20,6 +20,9 @@ ) PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "12").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") +GEIOP_CREDENTIALS_PROVIDED = environ.get("GEOIP_LICENSE_KEY", False) and environ.get( + "GEOIP_ACCOUNT_ID", False +) # This decorator skips tests that will fail until some branches and/or addons # are migrated to the next release. It is used in situations where Doodba is @@ -275,8 +278,13 @@ def test_smallest(self): ("pg_activity", "--version"), ("psql", "--version"), ("ssh", "-V"), + ("python", "-c", "import plumbum"), # We are able to dump ("pg_dump", "-f/var/lib/odoo/prod.sql", "prod"), + # Geoip should not be activated + ("bash", "-xc", 'test "$(which geoipupdate)" != ""'), + ("test", "!", "-e", "/usr/share/GeoIP/GeoLite2-City.mmdb"), + ("bash", "-xc", "! geoipupdate"), ) smallest_dir = join(SCAFFOLDINGS_DIR, "smallest") for sub_env in matrix(odoo_skip={"7.0", "8.0"}): @@ -481,6 +489,39 @@ def test_default_uids(self): ), ) + @unittest.skipIf( + not GEIOP_CREDENTIALS_PROVIDED, "GeoIP credentials missing in environment" + ) + def test_geoip(self): + geoip_dir = join(SCAFFOLDINGS_DIR, "geoip") + for sub_env in matrix(): + self.compose_test( + geoip_dir, + sub_env, + # verify that geoipupdate works after waiting for entrypoint to finish its update + ( + "bash", + "-c", + "timeout 60s bash -c 'while (ls -l /proc/*/exe 2>&1 | grep geoipupdate); do sleep 1; done' &&" + " geoipupdate", + ), + # verify that geoip database exists after entrypoint finished its update + # using ls and /proc because ps is missing in image for 13.0 + ( + "bash", + "-c", + "timeout 60s bash -c 'while (ls -l /proc/*/exe 2>&1 | grep geoipupdate); do sleep 1; done' &&" + " test -e /opt/odoo/auto/geoip/GeoLite2-City.mmdb", + ), + # verify that geoip database is configured + ( + "grep", + "-R", + "geoip_database = /opt/odoo/auto/geoip/GeoLite2-City.mmdb", + "/opt/odoo/auto/odoo.conf", + ), + ) + if __name__ == "__main__": unittest.main() diff --git a/tests/scaffoldings/geoip/Dockerfile b/tests/scaffoldings/geoip/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/geoip/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/geoip/custom/src/addons.yaml b/tests/scaffoldings/geoip/custom/src/addons.yaml new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/geoip/docker-compose.yaml b/tests/scaffoldings/geoip/docker-compose.yaml new file mode 100644 index 00000000..066f961d --- /dev/null +++ b/tests/scaffoldings/geoip/docker-compose.yaml @@ -0,0 +1,35 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + PIP_INSTALL_ODOO: "false" + WITHOUT_DEMO: "false" + + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + + # This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com + GEOIP_ACCOUNT_ID: $GEOIP_ACCOUNT_ID + GEOIP_LICENSE_KEY: $GEOIP_LICENSE_KEY + volumes: + - filestore:/var/lib/odoo:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: From ab0afda59d5b219d87a7b75f8d9b72d6b4c9be4d Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 14 Apr 2020 10:56:10 +0100 Subject: [PATCH 101/255] Remove some docs These are moved now to https://github.com/Tecnativa/doodba-copier-template/pull/32. This way, no more remainders of doodba-scaffolding exist anymore. --- README.md | 855 +----------------------------------------------------- 1 file changed, 12 insertions(+), 843 deletions(-) diff --git a/README.md b/README.md index 10b14501..5f676dc7 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ it work anywhere quickly. ## How? -You can start working with this straight away with our [scaffolding][]. +You can start working with this straight away with our [template][]. @@ -67,51 +67,12 @@ You can start working with this straight away with our [scaffolding][]. - [`autoaggregate`](#autoaggregate) - [Example `repos.yaml` file](#example-reposyaml-file) - [`odoo`](#odoo) - - [GeoLite2](#geolite2) -- [Scaffolding](#scaffolding) - - [Skip the boring parts](#skip-the-boring-parts) - - [Tell me the boring parts](#tell-me-the-boring-parts) - - [Environments](#environments) - - [Development](#development) - - [`wdb`](#wdb) - - [MailHog](#mailhog) - - [Network isolation](#network-isolation) - - [Production](#production) - - [Adding secrets](#adding-secrets) - - [Global inverse proxy](#global-inverse-proxy) - - [Booting production](#booting-production) - - [Backups](#backups) - - [Testing](#testing) - - [Global whitelist](#global-whitelist) - - [Other usage scenarios](#other-usage-scenarios) - - [Inspect the database](#inspect-the-database) - - [Restart Odoo](#restart-odoo) - - [Run unit tests for some addon](#run-unit-tests-for-some-addon) - - [Reading the logs](#reading-the-logs) - - [Install some addon without stopping current running process](#install-some-addon-without-stopping-current-running-process) - - [Update some addon without stopping current running process](#update-some-addon-without-stopping-current-running-process) - - [Update changed addons only](#update-changed-addons-only) - - [Export some addon's translations to stdout](#export-some-addons-translations-to-stdout) - - [Open an odoo shell](#open-an-odoo-shell) - - [Open another UI instance linked to same filestore and database](#open-another-ui-instance-linked-to-same-filestore-and-database) +- [Subproject template](#subproject-template) - [FAQ](#faq) - [Will there be not retrocompatible changes on the image?](#will-there-be-not-retrocompatible-changes-on-the-image) - - [How to have good QA and test in my CI with Doodba?](#how-to-have-good-qa-and-test-in-my-ci-with-doodba) - - [I need to force addition or removal of `www.` prefix in production](#i-need-to-force-addition-or-removal-of-www-prefix-in-production) - - [How to run a parallel Odoo container without crashing Traefik?](#how-to-run-a-parallel-odoo-container-without-crashing-traefik) - - [How to allow access from several host names?](#how-to-allow-access-from-several-host-names) - - [How to choose initial DB creation language?](#how-to-choose-initial-db-creation-language) - - [I use Fish shell, how to export needed variables?](#i-use-fish-shell-how-to-export-needed-variables) - - [When I boot `devel.yaml` for the first time, Odoo crashes](#when-i-boot-develyaml-for-the-first-time-odoo-crashes) - - [How can I run a Posbox/IoT box service for development?](#how-can-i-run-a-posboxiot-box-service-for-development) - [This project is too opinionated, but can I question any of those opinions?](#this-project-is-too-opinionated-but-can-i-question-any-of-those-opinions) - [What's this `hooks` folder here?](#whats-this-hooks-folder-here) - - [Can I have my own scaffolding?](#can-i-have-my-own-scaffolding) - - [Can I skip the `-f .yaml` part for `docker-compose` commands?](#can-i-skip-the--f-yaml-part-for-docker-compose-commands) - [How can I pin an image version?](#how-can-i-pin-an-image-version) - - [How to get proper assets when printing reports?](#how-to-get-proper-assets-when-printing-reports) - - [How to change report fonts?](#how-to-change-report-fonts) - - [How can I whitelist a service and allow external access to it?](#how-can-i-whitelist-a-service-and-allow-external-access-to-it) - [How can I help?](#how-can-i-help) - [Related Projects](#related-projects) @@ -561,7 +522,7 @@ ptvsd.wait_for_attach() To start Odoo within a ptvsd environment, which will obey the breakpoints established in your IDE (but will work slowly), just add `-e PTVSD_ENABLE=1` to your odoo container. -If you use the official [scaffolding][], you can boot it in ptvsd mode with: +If you use the official [template][], you can boot it in ptvsd mode with: ```bash export DOODBA_PTVSD_ENABLE=1 @@ -621,7 +582,7 @@ it somewhere. ### `autoaggregate` This little script wraps `git-aggregator` to make it work fine and automatically with -this image. Used in the [scaffolding][]'s `setup-devel.yaml` step. +this image. Used in the [template][]'s `setup-devel.yaml` step. #### Example `repos.yaml` file @@ -654,574 +615,13 @@ about it. Just execute `odoo` and it will work fine. Note that version 9.0 has an `odoo` binary to provide forward compatibility (but it has the `odoo.py` one too). -### GeoLite2 +## Subproject template -To enable geoip support for Odoo you need to signup for a Maxmind account for GeoLite2: -https://www.maxmind.com/en/geolite2/signup +That's a big structure! Get it up and running quickly using the +[copier template](https://github.com/Tecnativa/doodba-copier-template) we provide to +help you generate your subproject. -Create a license key in your maxmind account and provide your account id and license key -on build to the scaffolding. - -The `GEOIP_ACCOUNT_ID` environment variable should hold the account id and -`GEOIP_LICENSE_KEY` the license key. Both are visible on the "My License Key" page under -your [account](https://www.maxmind.com/en/account) when you create the license key. - -Example config (docker-compose.yml) - -```yaml -services: - odoo: - environment: - ... - # This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com - GEOIP_ACCOUNT_ID: 1234 - GEOIP_LICENSE_KEY: aBcDeF - ... -``` - -When booting you should see a message `Activating GeoIP/GeoLite2 updates`. - -Upon (re)start the container will perform the updates as requested by the -[eula](https://www.maxmind.com/en/geolite2/eula). You also can update the database by -calling `geoipupdate` inside the running container. - -When you run geoip in an isolated environment (odoo is only able to access whitelisted -addresses) make sure odoo is able to access `updates.maxmind.com`. You could do so by -adding the whitelist proxy like this to your docker-compose.yml: - -```yaml - odoo: - ... - depends_on: - ... - - maxmind_proxy - ... - ... - ... - - maxmind_proxy: - image: tecnativa/whitelist - networks: - default: - aliases: - - updates.maxmind.com - public: - environment: - TARGET: updates.maxmind.com - PRE_RESOLVE: 1 - ... - -``` - -## Scaffolding - -Get up and running quickly with the provided -[scaffolding](https://github.com/Tecnativa/doodba-scaffolding). - -### Skip the boring parts - -You will need these tools, so install them locally (and learn how to use them, check -their docs, Doodba is not the place to learn them šŸ˜‰): - -- [Git](https://git-scm.com/do) -- [Docker Engine](https://www.docker.com/products/docker-engine) (running locally) -- [Docker Compose](https://docs.docker.com/compose/overview/) - -Then run these Bash commands: - -```bash -git clone https://github.com/Tecnativa/doodba-scaffolding.git myproject -cd myproject -ln -s devel.yaml docker-compose.yml -chmod -R ug+rwX odoo/auto -export UID GID="$(id -g $USER)" UMASK="$(umask)" -docker-compose build --pull -docker-compose -f setup-devel.yaml run --rm odoo -docker-compose up -``` - -And if you don't want to have a chance to do a `git pull` and get possible future -scaffolding updates merged in your project's `git log`: - -```bash -rm -Rf .git -git init -``` - -### Tell me the boring parts - -The scaffolding provides you a boilerplate-ready project to start developing Odoo in no -time. - -#### Environments - -This scaffolding comes with some environment configurations, ready for you to extend -them. Each of them is a -[Docker Compose file](https://docs.docker.com/compose/compose-file/) almost ready to -work out of the box (or almost), but that will assume that you understand it and will -modify it. - -After you clone the scaffolding, **search for `XXX` comments**, they will help you on -making it work. - -##### Development - -Set it up with: - - export UID GID="$(id -g $USER)" UMASK="$(umask)" - docker-compose -f setup-devel.yaml run --rm odoo - -Once finished, you can start using Odoo with: - - docker-compose -f devel.yaml up --build - -This allows you to track only what Git needs to track and provides faster Docker builds. - -You might consider adding this line to your `~/.bashrc`: - - export UID GID="$(id -g $USER)" UMASK="$(umask)" - -To browse Odoo go to `http://localhost:${ODOO_MAJOR}069` (i.e. for Odoo 11.0 this would -be `http://localhost:11069`). - -This environment has several special features: - -###### [`wdb`](https://github.com/Kozea/wdb/) - -This is one of the greatest Python debugger available, and even more for Docker-based -development, so here you have it preinstalled. - -I told you, this image is opinionated. :wink: - -To use it, write this in any Python script: - -```python -import wdb -wdb.set_trace() -``` - -It's available by default on the [development][] environment, where you can browse -http://localhost:1984 to use it. - -**DO NOT USE IT IN PRODUCTION ENVIRONMENTS.** (I had to say it). - -###### [MailHog](https://github.com/mailhog/MailHog) - -It provides a fake SMTP server that intercepts all mail sent by Odoo and displays a -simple interface that lets you see and debug all that mail comfortably, including -headers sent, attachments, etc. - -- For [development][], it's in http://localhost:8025 -- For [testing][], it's in http://$DOMAIN_TEST/smtpfake/ -- For [production][], it's not used. - -All environments are configured by default to use the bundled SMTP relay. They are -configured by these environment variables: - -- `SMTP_SERVER` -- `SMTP_PORT` -- `SMTP_USER` -- `SMTP_PASSWORD` -- `SMTP_SSL` -- `EMAIL_FROM` - -For them to be useful, you need to remove any `ir.mail_server` records in your database. - -###### Network isolation - -The Docker network is in `--internal` mode, which means that it has no access to the -Internet. This feature protects you in cases where a [production][] database is restored -and Odoo tries to connect to SMTP/IMAP/POP3 servers to send or receive emails. Also when -you are using [connectors](https://github.com/OCA/connector), -[mail trackers](https://www.odoo.com/apps/modules/browse?search=mail_tracking) or any -API sync/calls. - -If you still need to have public access, set `internal: false` in the environment file, -detach all containers from that network, remove the network, reatach all containers to -it, and possibly restart them. You can also just do: - - docker-compose down - docker-compose up -d - -Usually a better option is -[whitelisting](#how-can-i-whitelist-a-service-and-allow-external-access-to-it). - -##### Production - -This environment is just a template. **It is not production-ready**. You must change -many things inside it, it's just a guideline. - -It includes pluggable `smtp` and `backup` services. - -###### Adding secrets - -Before booting this environment, you need to create a few files, which are excluded in -Git and contain some secrets, needed to make this environment safe: - -- `./.docker/odoo.env` must define `ADMIN_PASSWORD`. -- `./.docker/db-access.env` must define `PGPASSWORD`. -- `./.docker/db-creation.env` must define `POSTGRES_PASSWORD` (must be equal to - `PGPASSWORD` above). -- `./.docker/smtp.env` must define `RELAY_PASSWORD` (password to access the real SMTP - relay). -- `./.docker/backup.env` must define `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` - (obtained from S3 provider) and `PASSPHRASE` (to encrypt backup archives). - -###### Global inverse proxy - -For [production][] and [testing][] templates to work fine, you need to have a working -[Traefik][] inverse proxy in each node. - -To have it, use this `inverseproxy.yaml` file: - -```yaml -version: "2.1" - -services: - proxy: - image: traefik:1.6-alpine - networks: - shared: - private: - public: - volumes: - - acme:/etc/traefik/acme:rw,Z - ports: - - "80:80" - - "443:443" - depends_on: - - dockersocket - restart: unless-stopped - privileged: true - tty: true - command: - - --ACME.ACMELogging - - --ACME.Email=you@example.com - - --ACME.EntryPoint=https - - --ACME.HTTPChallenge.entryPoint=http - - --ACME.OnHostRule - - --ACME.Storage=/etc/traefik/acme/acme.json - - --DefaultEntryPoints=http,https - - --EntryPoints=Name:http Address::80 Redirect.EntryPoint:https - - --EntryPoints=Name:https Address::443 TLS - - --LogLevel=INFO - - --Docker - - --Docker.EndPoint=http://dockersocket:2375 - - --Docker.ExposedByDefault=false - - --Docker.Watch - - dockersocket: - image: tecnativa/docker-socket-proxy - privileged: true - networks: - private: - volumes: - - /var/run/docker.sock:/var/run/docker.sock - environment: - CONTAINERS: 1 - NETWORKS: 1 - SERVICES: 1 - SWARM: 1 - TASKS: 1 - restart: unless-stopped - -networks: - shared: - internal: true - driver_opts: - encrypted: 1 - - private: - internal: true - driver_opts: - encrypted: 1 - - public: - -volumes: - acme: -``` - -Then boot it up with: - - docker-compose -p inverseproxy -f inverseproxy.yaml up -d - -This will intercept all requests coming from port 80 (`http`) and redirect them to port -443 (`https`), it will download and install required SSL certificates from [Let's -Encrypt][] whenever you boot a new [production][] instance, add the required proxy -headers to the request, and then redirect all traffic to/from odoo automatically. - -It includes [a security-enhaced proxy][docker-socket-proxy] to reduce attack surface -when listening to the Docker socket. - -This allows you to: - -- Have multiple domains for each Odoo instance. -- Have multiple Odoo instances in each node. -- Add an SSL layer automatically and for free. - -###### Booting production - -Once you fixed everything needed and started -[global inverse proxy](#global-inverse-proxy), run the production environment with: - - docker-compose -f prod.yaml up --build --remove-orphans - -###### Backups - -Backups are only available in the production environment. They are provided by -[tecnativa/duplicity:postgres-s3](https://github.com/Tecnativa/docker-duplicity). The -structure of the backed up folder: - -``` -ā”œā”€ā”€ prod.sql -└── odoo/ - ā”œā”€ā”€ addons/ - └── filestore/ - └── prod/ - ā”œā”€ā”€ ... - └── ... -``` - -To make backup immediatly execute following command: - -```sh -# Executes all jobs scheduled for daily run. -# With default configuration it's equal to making full backup -docker-compose exec backup /etc/periodic/daily/jobrunner -``` - -To restore backup: - -```sh -# stop odoo if it's running -docker-compose stop odoo - -# start backup and db -docker-compose up -d backup - -# switch to some version -docker-compose exec backup restore --time TIME_IN_BACKUP_NAME --force - -# āš ļø DELETE PRODUCTION database -#docker-compose backup dropdb - -# create new empty database -docker-compose exec backup createdb - -# restore database -docker-compose exec backup sh -c 'psql -f $SRC/$PGDATABASE.sql' - -# start odoo -docker-compose up -d -``` - -##### Testing - -A good rule of thumb is test in testing before uploading to production, so this -environment tries to imitate the [production][] one in everything, but _removing -possible pollution points_: - -- It has a fake `smtp` service based on [MailHog][]. - -- It has no `backup` service. - -- It is [isolated](#network-isolation). - -To use it, you need to [add secrets files just like for production](#adding-secrets), -although secrets for smtp and backup containers are not needed because those don't exist -here. Also, start [global inverse proxy](#global-inverse-proxy) before running the test -environment. - -Test it in your machine with: - - docker-compose -f test.yaml up --build - -###### Global whitelist - -Since the testing environment is [network-isolated](#network-isolation), this can change -some deadlocks or big timeouts in code chunks that are not ready for such situation. -Odoo happens to have some of them. - -The [development][] environment includes the default recommended whitelist proxies, but -for [testing][], it is recommended to have a separate docker compose project running -along in the same server that provides a `globalwhitelist_default` network where all -whitelist proxies exist. This is a better practice for a testing environment where many -services might coexist, because it will let you save lots of processing power and IP -addresses. - -The recommended `globalwhitelist/docker-compose.yaml` file should contain: - -```yaml -version: "2.1" - -networks: - public: - driver_opts: - encrypted: 1 - shared: - internal: true - driver_opts: - encrypted: 1 - -services: - cdnjs_cloudflare_com: - image: tecnativa/whitelist - restart: unless-stopped - networks: - public: - shared: - aliases: - - "cdnjs.cloudflare.com" - environment: - TARGET: "cdnjs.cloudflare.com" - PRE_RESOLVE: 1 - - fonts_googleapis_com: - image: tecnativa/whitelist - restart: unless-stopped - networks: - public: - shared: - aliases: - - "fonts.googleapis.com" - environment: - TARGET: "fonts.googleapis.com" - PRE_RESOLVE: 1 - - fonts_gstatic_com: - image: tecnativa/whitelist - restart: unless-stopped - networks: - public: - shared: - aliases: - - "fonts.gstatic.com" - environment: - TARGET: "fonts.gstatic.com" - PRE_RESOLVE: 1 - - www_google_com: - image: tecnativa/whitelist - restart: unless-stopped - networks: - public: - shared: - aliases: - - "www.google.com" - environment: - TARGET: "www.google.com" - PRE_RESOLVE: 1 - - www_gravatar_com: - image: tecnativa/whitelist - restart: unless-stopped - networks: - public: - shared: - aliases: - - "www.gravatar.com" - environment: - TARGET: "www.gravatar.com" - PRE_RESOLVE: 1 - - updates_maxmind_com: - image: tecnativa/whitelist - restart: unless-stopped - networks: - public: - shared: - aliases: - - "updates.maxmind.com" - environment: - TARGET: "updates.maxmind.com" - PRE_RESOLVE: 1 -``` - -#### Other usage scenarios - -In examples below I will skip the `-f .yaml` part and assume you know which -environment you want to use. - -Also, we recommend to use `run` subcommand to create a new container with same settings -and volumes. Sometimes you may prefer to use `exec` instead, to execute an arbitrary -command in a running container. - -##### Inspect the database - - docker-compose run --rm odoo psql - -##### Restart Odoo - -You will need to restart it whenever any Python code changes, so to do that: - - docker-compose restart odoo - -In development mode odoo restarts by itself thanks to `--dev=reload` option. - -##### Run unit tests for some addon - -```bash -modules=addon1,addon2 -# Install their dependencies first -docker-compose run --rm odoo addons init --dependencies --with $modules -# Test them at install -docker-compose run --rm odoo addons init --test --with $modules -# Test them again at update -docker-compose run --rm odoo addons update --test --with $modules -``` - -\* Note: This replaces the old deprecated `unittest` script. - -##### Reading the logs - -For all services in the environment: - - docker-compose logs -f --tail 10 - -Only Odoo's: - - docker-compose logs -f --tail 10 odoo - -##### Install some addon without stopping current running process - - docker-compose run --rm odoo odoo -i addon1,addon2 --stop-after-init - -##### Update some addon without stopping current running process - - docker-compose run --rm odoo odoo -u addon1,addon2 --stop-after-init - -##### Update changed addons only - -Just run: - -```bash -docker-compose run --rm odoo click-odoo-update --watcher-max-seconds 30 -``` - -This script is part of [`click-odoo-contrib`][]; check it for more details. - -\* Note: `--watcher-max-seconds` is available because we ship a -[patched](https://github.com/acsone/click-odoo-contrib/pull/38) version. Check that PR -for docs. - -\* Note: This replaces the old deprecated `autoupdate` script. - -##### Export some addon's translations to stdout - - docker-compose run --rm odoo pot addon1[,addon2] - -Now copy the relevant parts to your `addon1.pot` file. - -##### Open an odoo shell - - docker-compose run --rm odoo odoo shell - -##### Open another UI instance linked to same filestore and database - - docker-compose run --rm -p 127.0.0.1:$SomeFreePort:8069 odoo - -Then open `http://localhost:$SomeFreePort`. +Check its docs to know how to use it. ## FAQ @@ -1234,164 +634,6 @@ deprecated and removed at some point. The best you can do is to [subscribe to the compatibility breakage announcements issue][retrobreak]. -### How to have good QA and test in my CI with Doodba? - -Inside this image, there's the `/qa` folder, which provides some necessary plumbing to -perform quality assurance and continous integration if you use [doodba-qa][], which is a -separate (but related) project with that purpose. - -Go there to get more instructions. - -### I need to force addition or removal of `www.` prefix in production - -These instructions assume you use the official [scaffolding][]. To **remove** the `www.` -prefix, set these params in the `.env` file: - - DOMAIN_PROD=example.com - DOMAIN_PROD_ALT=www.example.com - -To **add** the `www.` prefix, it is almost the same: - - DOMAIN_PROD=www.example.com - DOMAIN_PROD_ALT=example.com - -Of course, both domains should point to the same machine before booting, or Let's -Encrypt might ban your server for some time. - -### How to run a parallel Odoo container without crashing Traefik? - -Just run it in this fashion: - -```bash -docker-compose run --rm -l traefik.enable=false odoo bash -``` - -With that label, Traefik will ignore that container. - -### How to allow access from several host names? - -In `.env`, set `DOMAIN_PROD` to `host1.com,host2.com,www.host1.com`, etc. - -### How to choose initial DB creation language? - -This image includes a hack that will set the initial language to load when Odoo creates -its database for the first time. These conditions must match: - -- `$PGDATABASE` is set. -- That database does not yet exist. -- `$INITIAL_LANG` is set to any Odoo lang code. I.e. `es_ES`. -- Odoo is booted. - -### I use Fish shell, how to export needed variables? - -In [Fish][] you need to do following: - - set -x UID (id -u $USER) - set -x GID (id -g $USER) - set -x UMASK (umask) - -You can make those variables universal (available in all terminals you open from now on) -by using `set -Ux` instead of `set -x`. - -### When I boot `devel.yaml` for the first time, Odoo crashes - -Most likely you are using versions `8.0` or `9.0` of the image. If so: - -1. Edit `devel.yaml`. -2. Search for the line that starts with `command:` in the `odoo` service. -3. Change it for a command that actually works with your version: - - `odoo --workers 0` for Odoo 8.0. - - `odoo --workers 0 --dev` for Odoo 9.0. - -### How can I run a Posbox/IoT box service for development? - -Posbox has special needs that are not useful for most projects, and is quite tightly -related to specific hardware and peripherals, so it makes not much sense to ship it by -default in Doodba and its [scaffolding][]. - -However, for testing connection issues, developing, etc., you might want to boot a -resource-limited posbox instance imitation. - -The best you can do is buy a Posbox/IoT box and peripherals and use it, but for quick -tests that do not involve specific hardware, you can boot it with Doodba by: - -- Add the `apt` dependency `usbutils` (which contains `lsusb` binary). -- Add the `pip` dependencies `evdev` and `netifaces`. -- Add a `posbox` container, which: - - Can read usb devices, privileged. - - Loads at boot all required `hw_*` addons, except for `hw_posbox_upgrade`. - - Exposes a port that doesn't conflict with Odoo, such as `8070` i.e. - -
-Example patch for official scaffolding - -```diff -diff --git a/devel.yaml b/devel.yaml -index e029d48..2f800de 100644 ---- a/devel.yaml -+++ b/devel.yaml -@@ -15,7 +15,7 @@ services: - PORT: "6899 8069" - TARGET: odoo - -- odoo: -+ odoo: &odoo - extends: - file: common.yaml - service: odoo -@@ -53,6 +53,21 @@ services: - # XXX Odoo v8 has no `--dev` mode; Odoo v9 has no parameters - - --dev=reload,qweb,werkzeug,xml - -+ posbox: -+ <<: *odoo -+ ports: -+ - "127.0.0.1:8070:8069" -+ privileged: true -+ networks: *public -+ volumes: -+ - ./odoo/custom:/opt/odoo/custom:ro,z -+ - ./odoo/auto/addons:/opt/odoo/auto/addons:rw,z -+ - /dev/bus/usb -+ command: -+ - odoo -+ - --workers=0 -+ - --load=web,hw_proxy,hw_posbox_homepage,hw_scale,hw_scanner,hw_escpos,hw_blackbox_be,hw_screen -+ - db: - extends: - file: common.yaml -diff --git a/odoo/custom/dependencies/apt.txt b/odoo/custom/dependencies/apt.txt -index 8b13789..e32891b 100644 ---- a/odoo/custom/dependencies/apt.txt -+++ b/odoo/custom/dependencies/apt.txt -@@ -1 +1 @@ -+usbutils -diff --git a/odoo/custom/dependencies/pip.txt b/odoo/custom/dependencies/pip.txt -index e69de29..6eef737 100644 ---- a/odoo/custom/dependencies/pip.txt -+++ b/odoo/custom/dependencies/pip.txt -@@ -0,0 +1,2 @@ -+evdev -+netifaces -``` - -
- -Once you apply those changes, to use it: - -1. `docker-compose build` to install the new dependencies. -1. `docker-compose up -d` to start all services. -1. Visit `http://localhost:8070` to see the posbox running. -1. Visit `http://localhost:${ODOO_MAJOR}069` to see Odoo. -1. Install `point_of_sale` in Odoo. -1. Configure the POS in Odoo to connect to Posbox in `localhost:8070`. - -Of course this won't be fully functional, but it will give you an overview on the posbox -stuff. - -[Beware about possible mixed content errors][mixed-content-posbox]. - ### This project is too opinionated, but can I question any of those opinions? Of course. There's no guarantee that we will like it, but please do it. :wink: @@ -1401,33 +643,6 @@ Of course. There's no guarantee that we will like it, but please do it. :wink: It runs triggers when doing the automatic build in the Docker Hub. [Check this](https://hub.docker.com/r/thibaultdelor/testautobuildhooks/). -### Can I have my own scaffolding? - -You probably **should**, and rebase on our updates. However, if you are planning on a -general update to it that you find interesting for the general-purpose one, please send -us a pull request. - -### Can I skip the `-f .yaml` part for `docker-compose` commands? - -Let's suppose you want to use [`test.yaml`][testing] environment by default, no matter -where you clone the project: - - ln -s test.yaml docker-compose.yaml - git add docker-compose.yaml - git commit - -Let's suppose you only want to use `devel.yaml` in your local development machine by -default: - - ln -s devel.yaml docker-compose.yml - -Notice the difference in the prefix (`.yaml` vs. `.yml`). Docker Compose will use the -`.yml` one if both are found, so that's the one we considered you should use in your -local clones, and that's the one that will be git-ignored by default by the scaffolding -`.gitignore` file. - -As a design choice, the scaffolding defaults to being explicit. - ### How can I pin an image version? Version-pinning is a good idea to keep your code from differing among image updates. @@ -1463,58 +678,15 @@ similar to this one: FROM tecnativa/doodba@sha256:fba69478f9b0616561aa3aba4d18e4bcc2f728c9568057946c98d5d3817699e1 ``` -### How to get proper assets when printing reports? - -Make sure there's a `ir.config_parameter` called `report.url` with the value -`http://localhost:8069`. - -### How to change report fonts? - -Doodba ships [Liberation fonts](https://wikipedia.org/wiki/Liberation_fonts) as -defaults. - -If you want to make another font package _available_, just add it to -[`apt.txt`][dependencies] (if it's a normal Debian package) or install it in a [custom -build script][build.d] called i.e. `build.d/200-custom-fonts` (if you need to install it -in a more complex way). - -If, in addition to that, you want those fonts to be the _defaults_, then add one (or -more) of these build arguments: - -- `FONT_MONO` -- `FONT_SANS` -- `FONT_SERIF` - -### How can I whitelist a service and allow external access to it? - -This can become useful when you have isolated environments (like in `devel.yaml` and -`test.yaml` by default) but you need to allow some external API access for them. I.e., -you could use Google Fonts API for your customer's reports, and those reports would take -forever and end up rendering badly in staging environments. - -In such case, we recommend using the -[tecnativa/whitelist](https://hub.docker.com/r/tecnativa/whitelist/) image. Read its -docs there. - ### How can I help? Just [head to our project](https://github.com/Tecnativa/doodba) and open an issue or pull request. -If you plan to open a pull request, remember that you will usually have to open two of -them: - -1. Targeting the `master` branch, from which the main images are built. This pull - request must include tests. -2. Targeting the `scaffolding` branch, which serves as the base for projects using this - base image. This one is not always required. - -If you need to add a feature or fix for `scaffolding`, before merging that PR, we need -tests that ensure that backwards compatibility with previous scaffolding versions is -preserved. - ## Related Projects +- Of course, + [the Doodba Copier Template](https://github.com/Tecnativa/doodba-copier-template). - [QA tools for Doodba-based projects][doodba-qa] - [Ansible role for automated deployment / update from Le Filament](https://github.com/remi-filament/ansible_role_odoo_docker) - Find others by searching @@ -1535,13 +707,10 @@ preserved. [builds]: https://hub.docker.com/r/tecnativa/doodba/builds/ [dependencies]: #optodoocustomdependenciestxt [development]: #development -[docker-socket-proxy]: https://hub.docker.com/r/tecnativa/docker-socket-proxy/ [doodba-qa]: https://github.com/Tecnativa/doodba-qa [fish]: http://fishshell.com/ [glob]: https://docs.python.org/3/library/glob.html -[let's encrypt]: https://letsencrypt.org/ [mailhog]: #mailhog -[mixed-content-posbox]: https://github.com/odoo/odoo/issues/3156#issuecomment-443727760 [oca]: https://odoo-community.org/ [ocb]: https://github.com/OCA/OCB [odoo s.a.]: https://www.odoo.com @@ -1553,7 +722,7 @@ preserved. https://www.postgresql.org/docs/current/static/reference-client.html [production]: #production [retrobreak]: https://github.com/Tecnativa/doodba/issues/67 -[scaffolding]: #scaffolding +[template]: #subproject-template [several yaml documents]: http://www.yaml.org/spec/1.2/spec.html#id2760395 [ssh-conf]: https://www.digitalocean.com/community/tutorials/how-to-configure-custom-connection-options-for-your-ssh-client From 578f66c1119ddb0ac73bca8ec11c9ce2b22cabde Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 14 May 2020 10:20:59 +0100 Subject: [PATCH 102/255] Make msgmerge CLI tool available This is a requirement to be able to use click-odoo-makepot @Tecnativa TT23467 --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 13.0.Dockerfile | 2 +- 8.0.Dockerfile | 2 +- tests/__init__.py | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 9efb3e15..48e15220 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -39,7 +39,7 @@ RUN apt-get -qq update \ && apt-get install -yqq --no-install-recommends \ chromium \ fonts-liberation2 \ - gettext-base \ + gettext \ gnupg2 \ locales-all \ ruby-compass \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 668e40fe..be5a966b 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -40,7 +40,7 @@ RUN apt-get -qq update \ chromium \ ffmpeg \ fonts-liberation2 \ - gettext-base \ + gettext \ gnupg2 \ locales-all \ nano \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index f006c23e..5cc117c0 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -44,7 +44,7 @@ RUN apt-get -qq update \ chromium \ ffmpeg \ fonts-liberation2 \ - gettext-base \ + gettext \ git \ gnupg2 \ locales-all \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 80a43d88..1afedace 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -44,7 +44,7 @@ RUN sed -Ei 's@(^deb http://deb.debian.org/debian jessie-updates main$)@#\1@' /e libfreetype6 liblcms2-2 libopenjpeg5 libtiff5 tk tcl libpq5 \ libldap-2.4-2 libsasl2-2 libx11-6 libxext6 libxrender1 \ locales-all zlibc \ - bzip2 ca-certificates curl gettext-base git nano \ + bzip2 ca-certificates curl gettext git nano \ openssh-client telnet xz-utils \ && curl https://bootstrap.pypa.io/get-pip.py | python /dev/stdin \ && curl -sL https://deb.nodesource.com/setup_6.x | bash - \ diff --git a/tests/__init__.py b/tests/__init__.py index cdf329a0..260b5e41 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -277,6 +277,7 @@ def test_smallest(self): ("git", "--version"), ("pg_activity", "--version"), ("psql", "--version"), + ("msgmerge", "--version"), ("ssh", "-V"), ("python", "-c", "import plumbum"), # We are able to dump From 46add91018c0bce7fc61abbb6b1718d0a54e9391 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 14 May 2020 11:19:30 +0100 Subject: [PATCH 103/255] Fix CI It seems the tested module `web_debranding` was removed from it-projects-llc/misc-addons repo (which is renamed now, BTW), so I hack the `ODOO_VERSION` env variable to use it as a commit which contains that module. Also I'm pinning eslint<7 for v12, or it uses unsupported syntax and fails the test. --- 12.0.Dockerfile | 2 +- tests/__init__.py | 5 +++-- tests/scaffoldings/addons_env/custom/src/addons.yaml | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/12.0.Dockerfile b/12.0.Dockerfile index be5a966b..b3922ddf 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -108,7 +108,7 @@ RUN python -m venv --system-site-packages /qa/venv \ flake8 \ pylint-odoo \ six \ - && npm install --loglevel error --prefix /qa eslint \ + && npm install --loglevel error --prefix /qa 'eslint@<7' \ && deactivate \ && mkdir -p /qa/artifacts \ && git clone --depth 1 $MQT /qa/mqt diff --git a/tests/__init__.py b/tests/__init__.py index 260b5e41..de5db49d 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -303,8 +303,9 @@ def test_smallest(self): def test_addons_env(self): """Test environment variables in addons.yaml""" - # 7.0 is skiped because the module is absent in that branch - for sub_env in matrix(odoo_skip={"7.0"}): + # Old versions are skiped because they don't support __manifest__.py, + # and the test is hacking ODOO_VERSION to pin a commit + for sub_env in matrix(odoo_skip={"7.0", "8.0", "9.0"}): self.compose_test( join(SCAFFOLDINGS_DIR, "addons_env"), sub_env, diff --git a/tests/scaffoldings/addons_env/custom/src/addons.yaml b/tests/scaffoldings/addons_env/custom/src/addons.yaml index 948e520b..50e07c04 100644 --- a/tests/scaffoldings/addons_env/custom/src/addons.yaml +++ b/tests/scaffoldings/addons_env/custom/src/addons.yaml @@ -8,7 +8,7 @@ odoo/addons: - sale --- ENV: - DEFAULT_REPO_PATTERN: https://github.com/it-projects-llc/{}.git - DEPTH_DEFAULT: 2 + DEFAULT_REPO_PATTERN: https://github.com/itpp-labs/{}.git + ODOO_VERSION: 554222498d5101ef59fc4d3e1059e2b407dffd6f misc-addons: - web_debranding From 5fb0ce7b760b992fff26302418ec5ebcd437bde6 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 15 May 2020 12:23:16 +0100 Subject: [PATCH 104/255] Use github actions Travis, for some weird reason, stopped pushing images to the Docker Hub like 2 months ago. Its syntax is awful and it's faster for me to dump it than fix it. BTW this will fix #295. @Tecnativa TT23467 --- .github/workflows/ci.yaml | 81 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 68 -------------------------------- .vscode/settings.json | 5 ++- hooks/pre_build | 3 -- hooks/push | 17 ++++++-- 5 files changed, 97 insertions(+), 77 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .travis.yml delete mode 100755 hooks/pre_build diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..bbf9ff95 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,81 @@ +name: ci + +on: + pull_request: + push: + branches: + - master + schedule: + # See https://crontab.guru/weekly + - cron: 0 0 * * 0 + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v1 + - name: Set PY + run: + echo "::set-env name=PY::$(python -c 'import hashlib, + sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" + - uses: actions/cache@v1 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + - uses: pre-commit/action@v1.0.1 + + build-test-push: + runs-on: ubuntu-latest + needs: pre-commit + strategy: + matrix: + # Test modern Odoo versions with latest Postgres version + pg_version: ["12"] + odoo_version: + - "13.0" + - "12.0" + - "11.0" + - "10.0" + # Test older Odoo versions with older Postgres versions + include: + - odoo_version: "9.0" + pg_version: "11" + - odoo_version: "8.0" + pg_version: "10" + - odoo_version: "7.0" + pg_version: "9.6" + env: + # Indicates what's the equivalent to tecnativa/doodba:latest image + LATEST_RELEASE: "13.0" + # Variables found by default in Docker Hub builder + DOCKER_REPO: tecnativa/doodba + DOCKER_TAG: ${{ matrix.odoo_version }} + GIT_SHA1: ${{ github.sha }} + # Other variables to configure tests and execution environment + DOCKER_BUILDKIT: 1 + PG_VERSIONS: ${{ matrix.pg_version }} + steps: + # Prepare + - uses: actions/checkout@v2 + - uses: actions/setup-python@v1 + - run: pip install -r requirements-ci.txt + # Build images + - run: ./hooks/build + # Test + - run: python -m unittest -v tests + # Push + - name: push to docker hub + if: github.repository == 'Tecnativa/doodba' && github.ref == 'master' + env: + REGISTRY_HOST: docker.io + REGISTRY_PASSWORD: ${{ secrets.dockerhub_password }} + REGISTRY_USERNAME: ${{ secrets.dockerhub_username }} + run: ./hooks/push + - name: push to github registry + if: github.repository == 'Tecnativa/doodba' && github.ref == 'master' + env: + REGISTRY_HOST: docker.pkg.github.com + REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + REGISTRY_USERNAME: ${{ github.actor }} + run: ./hooks/push diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 74f08c39..00000000 --- a/.travis.yml +++ /dev/null @@ -1,68 +0,0 @@ -os: linux - -language: python - -python: - - "3.6" - -services: - - docker - -git: - depth: 1 - -cache: - directories: - - $HOME/.cache/pip - - $HOME/.cache/pre-commit - -branches: - only: - - master - -stages: - - name: lint - - name: test - -env: - global: - # Indicates what's the equivalent to tecnativa/doodba:latest image - - LATEST_RELEASE=13.0 - # Variables found by default in Docker Hub builder - - DOCKER_REPO=tecnativa/doodba - jobs: - - DOCKER_TAG=13.0 - - DOCKER_TAG=12.0 - - DOCKER_TAG=11.0 - - DOCKER_TAG=10.0 PG_VERSIONS=12 - - DOCKER_TAG=9.0 PG_VERSIONS=11 - - DOCKER_TAG=8.0 PG_VERSIONS=10 - - DOCKER_TAG=7.0 PG_VERSIONS=9.6 - -jobs: - include: - stage: lint - install: [] - script: - - pre-commit run --all --show-diff-on-failure - -before_install: - - sudo apt-get update - - sudo apt-get -y -o Dpkg::Options::=--force-confnew install docker-ce - - ./hooks/pre_build - -install: - - chown -R $USER:$USER . - - chmod -R +r . - - ./hooks/build - -script: - - python -m unittest -v tests - -deploy: - provider: script - script: ./hooks/push - on: - branch: master - condition: - - $TRAVIS_BUILD_STAGE_NAME = Test diff --git a/.vscode/settings.json b/.vscode/settings.json index d36f98a7..d3cbe582 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,8 +7,9 @@ "python.linting.flake8Enabled": true, "python.linting.pylintEnabled": true, "python.pythonPath": "python3", + "editor.formatOnSave": true, - "[python]": { - "editor.formatOnSave": true + "[dockerfile]": { + "editor.formatOnSave": false } } diff --git a/hooks/pre_build b/hooks/pre_build deleted file mode 100755 index 83269c43..00000000 --- a/hooks/pre_build +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -set -ex -pip install -r "$(dirname $0)/../requirements-ci.txt" diff --git a/hooks/push b/hooks/push index 74634c15..fd37876f 100755 --- a/hooks/push +++ b/hooks/push @@ -3,6 +3,7 @@ from plumbum import FG, local from plumbum.cmd import docker # noqa pylint: disable=import-error +REGISTRY = local.env["REGISTRY_USERNAME"] REPO = local.env["DOCKER_REPO"] VERSION = local.env["DOCKER_TAG"] @@ -13,13 +14,21 @@ docker["image", "ls", "--digests", REPO] & FG docker( "login", "--username", - local.env["DOCKER_HUB_USERNAME"], + REGISTRY, "--password", - local.env["DOCKER_HUB_TOKEN"], + local.env["REGISTRY_TOKEN"], + local.env["REGISTRY_HOST"], ) # Push built images for suffix in ("", "-onbuild"): - docker["image", "push", "%s:%s%s" % (REPO, VERSION, suffix)] & FG + # Prefix images with registry + local_tag = f"{REPO}:{VERSION}{suffix}" + public_tag = f"{REGISTRY}/{local_tag}" + docker["image", "tag", local_tag, public_tag] & FG + # Push to registry + docker["image", "push", public_tag] & FG if VERSION == local.env.get("LATEST_RELEASE"): - docker["image", "push", "%s:latest%s" % (REPO, suffix)] & FG + public_latest_tag = f"{REGISTRY}/{REPO}:latest{suffix}" + docker["image", "tag", local_tag, public_latest_tag] & FG + docker["image", "push", public_latest_tag] & FG From ffa89872293d46238382ba1bf58a4569c9124965 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 21 May 2020 10:41:02 +0100 Subject: [PATCH 105/255] Fix CI badge and ref detection --- .github/workflows/ci.yaml | 4 ++-- README.md | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bbf9ff95..75fbad73 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -66,14 +66,14 @@ jobs: - run: python -m unittest -v tests # Push - name: push to docker hub - if: github.repository == 'Tecnativa/doodba' && github.ref == 'master' + if: github.repository == 'Tecnativa/doodba' && github.ref == 'refs/heads/master' env: REGISTRY_HOST: docker.io REGISTRY_PASSWORD: ${{ secrets.dockerhub_password }} REGISTRY_USERNAME: ${{ secrets.dockerhub_username }} run: ./hooks/push - name: push to github registry - if: github.repository == 'Tecnativa/doodba' && github.ref == 'master' + if: github.repository == 'Tecnativa/doodba' && github.ref == 'refs/heads/master' env: REGISTRY_HOST: docker.pkg.github.com REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 5f676dc7..07cc4719 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,11 @@ # [Doodba](https://hub.docker.com/r/tecnativa/doodba) +![ci](https://github.com/Tecnativa/doodba/workflows/ci/badge.svg) [![](https://images.microbadger.com/badges/version/tecnativa/doodba:latest.svg)](https://microbadger.com/images/tecnativa/doodba:latest "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/image/tecnativa/doodba:latest.svg)](https://microbadger.com/images/tecnativa/doodba:latest "Get your own image badge on microbadger.com") [![](https://images.microbadger.com/badges/commit/tecnativa/doodba:latest.svg)](https://microbadger.com/images/tecnativa/doodba:latest "Get your own commit badge on microbadger.com") [![](https://images.microbadger.com/badges/license/tecnativa/doodba.svg)](https://microbadger.com/images/tecnativa/doodba "Get your own license badge on microbadger.com") -[![](https://api.travis-ci.org/Tecnativa/doodba.svg)](https://travis-ci.org/Tecnativa/doodba) - **Doodba** stands for **Do**cker **Od**oo **Ba**se, and it is a highly opinionated image ready to put [Odoo](https://www.odoo.com) inside it, but **without Odoo**. From 0f5626e88aaf91e7f66998786110779e09a8d3b1 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 21 May 2020 11:18:39 +0100 Subject: [PATCH 106/255] Fix push script --- hooks/push | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hooks/push b/hooks/push index fd37876f..64577dee 100755 --- a/hooks/push +++ b/hooks/push @@ -3,7 +3,7 @@ from plumbum import FG, local from plumbum.cmd import docker # noqa pylint: disable=import-error -REGISTRY = local.env["REGISTRY_USERNAME"] +REGISTRY = local.env["REGISTRY_HOST"] REPO = local.env["DOCKER_REPO"] VERSION = local.env["DOCKER_TAG"] @@ -14,10 +14,10 @@ docker["image", "ls", "--digests", REPO] & FG docker( "login", "--username", - REGISTRY, + local.env["REGISTRY_USERNAME"], "--password", - local.env["REGISTRY_TOKEN"], - local.env["REGISTRY_HOST"], + local.env["REGISTRY_PASSWORD"], + REGISTRY, ) # Push built images From 742f78edf823defdc63f40dc3f121c917db96fe6 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 21 May 2020 13:44:00 +0100 Subject: [PATCH 107/255] Fix push to Github Fix #295 --- .github/workflows/ci.yaml | 1 + hooks/push | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 75fbad73..052dc943 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -75,6 +75,7 @@ jobs: - name: push to github registry if: github.repository == 'Tecnativa/doodba' && github.ref == 'refs/heads/master' env: + DOCKER_REPO_SUFFIX: /stable REGISTRY_HOST: docker.pkg.github.com REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} REGISTRY_USERNAME: ${{ github.actor }} diff --git a/hooks/push b/hooks/push index 64577dee..d71bc724 100755 --- a/hooks/push +++ b/hooks/push @@ -5,6 +5,7 @@ from plumbum.cmd import docker # noqa pylint: disable=import-error REGISTRY = local.env["REGISTRY_HOST"] REPO = local.env["DOCKER_REPO"] +REPO_SUFFIX = local.env.get("DOCKER_REPO_SUFFIX", "") VERSION = local.env["DOCKER_TAG"] # Log all locally available images; will help to pin images @@ -24,11 +25,11 @@ docker( for suffix in ("", "-onbuild"): # Prefix images with registry local_tag = f"{REPO}:{VERSION}{suffix}" - public_tag = f"{REGISTRY}/{local_tag}" + public_tag = f"{REGISTRY}/{REPO}{REPO_SUFFIX}:{VERSION}{suffix}" docker["image", "tag", local_tag, public_tag] & FG # Push to registry docker["image", "push", public_tag] & FG if VERSION == local.env.get("LATEST_RELEASE"): - public_latest_tag = f"{REGISTRY}/{REPO}:latest{suffix}" + public_latest_tag = f"{REGISTRY}/{REPO}{REPO_SUFFIX}:latest{suffix}" docker["image", "tag", local_tag, public_latest_tag] & FG docker["image", "push", public_latest_tag] & FG From fcdba5775c324167af74c3d33614de920cd18d01 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 21 May 2020 13:46:11 +0100 Subject: [PATCH 108/255] Do not fail fast builds and pushes If one build fails, I still want to know what happened with others, as problems can be completely different. Also if pushing to Github fails, pushing to Docker Hub for other tags shouldn't be aborted. --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 052dc943..b299af20 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -29,6 +29,7 @@ jobs: runs-on: ubuntu-latest needs: pre-commit strategy: + fail-fast: false matrix: # Test modern Odoo versions with latest Postgres version pg_version: ["12"] From 4401ddd310ae370acc9fbe822e58c5dc1542949b Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 25 May 2020 12:06:49 +0100 Subject: [PATCH 109/255] Rename doodba image to doodba MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems you cannot have a "stable" image if any other repo in your ORG has a "stable" image. Cool... šŸ¤¦ā€ --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b299af20..84c36fe6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -76,7 +76,7 @@ jobs: - name: push to github registry if: github.repository == 'Tecnativa/doodba' && github.ref == 'refs/heads/master' env: - DOCKER_REPO_SUFFIX: /stable + DOCKER_REPO_SUFFIX: /doodba REGISTRY_HOST: docker.pkg.github.com REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} REGISTRY_USERNAME: ${{ github.actor }} From ab9c74d1650b27c4d8bfb26d14d203be1844547f Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 27 May 2020 12:24:35 +0100 Subject: [PATCH 110/255] Revert "Update Python 3 version in v11 and v12" This reverts commit dbaaa2782a2d00e093063ebee3478c1d4093def3 from https://github.com/Tecnativa/doodba/pull/290. Also reverts v13 to oldest supported python version (3.6 per the docs). I had to change $PIP_NO_CACHE_DIR in v13. See https://github.com/pypa/pip/issues/5735. @Tecnativa TT23435 --- 11.0.Dockerfile | 12 ++++++------ 12.0.Dockerfile | 8 ++++---- 13.0.Dockerfile | 12 +++++++----- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 48e15220..d50d96b4 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7-stretch AS base +FROM python:3.5-stretch AS base EXPOSE 8069 8072 @@ -88,9 +88,9 @@ RUN pip install \ geoip2 \ && sync COPY bin-deprecated/* bin/* /usr/local/bin/ -COPY lib/doodbalib /usr/local/lib/python3.7/site-packages/doodbalib -RUN ln -s /usr/local/lib/python3.7/site-packages/doodbalib \ - /usr/local/lib/python3.7/site-packages/odoobaselib +COPY lib/doodbalib /usr/local/lib/python3.5/site-packages/doodbalib +RUN ln -s /usr/local/lib/python3.5/site-packages/doodbalib \ + /usr/local/lib/python3.5/site-packages/odoobaselib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d @@ -98,7 +98,7 @@ RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ - && chmod -R a+rX /usr/local/lib/python3.7/site-packages/doodbalib \ + && chmod -R a+rX /usr/local/lib/python3.5/site-packages/doodbalib \ && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ @@ -130,7 +130,7 @@ RUN debs="libldap2-dev libsasl2-dev" \ && apt-get install -yqq --no-install-recommends $debs \ && pip install \ -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ - && (python3 -m compileall -q /usr/local/lib/python3.7/ || true) \ + && (python3 -m compileall -q /usr/local/lib/python3.5/ || true) \ && apt-get purge -yqq $debs \ && rm -Rf /var/lib/apt/lists/* /tmp/* diff --git a/12.0.Dockerfile b/12.0.Dockerfile index b3922ddf..9d6be3ba 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7-stretch AS base +FROM python:3.5-stretch AS base EXPOSE 8069 8072 @@ -84,7 +84,7 @@ RUN pip install \ geoip2 \ && sync COPY bin-deprecated/* bin/* /usr/local/bin/ -COPY lib/doodbalib /usr/local/lib/python3.7/site-packages/doodbalib +COPY lib/doodbalib /usr/local/lib/python3.5/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d @@ -92,7 +92,7 @@ RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ - && chmod -R a+rX /usr/local/lib/python3.7/site-packages/doodbalib \ + && chmod -R a+rX /usr/local/lib/python3.5/site-packages/doodbalib \ && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ @@ -126,7 +126,7 @@ RUN debs="libldap2-dev libsasl2-dev" \ -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ phonenumbers \ 'websocket-client~=0.53' \ - && (python3 -m compileall -q /usr/local/lib/python3.7/ || true) \ + && (python3 -m compileall -q /usr/local/lib/python3.5/ || true) \ && apt-get purge -yqq $debs \ && rm -Rf /var/lib/apt/lists/* /tmp/* diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 5cc117c0..2b6451eb 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7-slim-buster AS base +FROM python:3.6-slim-buster AS base EXPOSE 8069 8072 @@ -19,7 +19,7 @@ ENV DB_FILTER=.* \ NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \ OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ PATH="/home/odoo/.local/bin:$PATH" \ - PIP_NO_CACHE_DIR=1 \ + PIP_NO_CACHE_DIR=0 \ PTVSD_ARGS="--host 0.0.0.0 --port 6899 --wait --multiprocess" \ PTVSD_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ @@ -67,7 +67,7 @@ RUN apt-get -qq update \ WORKDIR /opt/odoo COPY bin/* /usr/local/bin/ -COPY lib/doodbalib /usr/local/lib/python3.7/site-packages/doodbalib +COPY lib/doodbalib /usr/local/lib/python3.6/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d @@ -75,7 +75,7 @@ RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ - && chmod -R a+rX /usr/local/lib/python3.7/site-packages/doodbalib \ + && chmod -R a+rX /usr/local/lib/python3.6/site-packages/doodbalib \ && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ @@ -115,6 +115,8 @@ RUN build_deps=" \ libsasl2-dev \ libtiff5-dev \ libwebp-dev \ + libxml2-dev \ + libxslt-dev \ tcl-dev \ tk-dev \ zlib1g-dev \ @@ -135,7 +137,7 @@ RUN build_deps=" \ watchdog \ wdb \ geoip2 \ - && (python3 -m compileall -q /usr/local/lib/python3.7/ || true) \ + && (python3 -m compileall -q /usr/local/lib/python3.6/ || true) \ && apt-get purge -yqq $build_deps \ && apt-get autopurge -yqq \ && rm -Rf /var/lib/apt/lists/* /tmp/* From fd5513d52d3e9e4fd3c0fb6b910a41ca60236fe3 Mon Sep 17 00:00:00 2001 From: Karl Southern Date: Sat, 30 May 2020 21:43:04 +0100 Subject: [PATCH 111/255] Implement inotify support --- 11.0.Dockerfile | 1 + 12.0.Dockerfile | 1 + 13.0.Dockerfile | 1 + README.md | 15 +++++++++++++++ 4 files changed, 18 insertions(+) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index d50d96b4..937a0c00 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -86,6 +86,7 @@ RUN pip install \ watchdog \ wdb \ geoip2 \ + inotify \ && sync COPY bin-deprecated/* bin/* /usr/local/bin/ COPY lib/doodbalib /usr/local/lib/python3.5/site-packages/doodbalib diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 9d6be3ba..abd7f19d 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -82,6 +82,7 @@ RUN pip install \ watchdog \ wdb \ geoip2 \ + inotify \ && sync COPY bin-deprecated/* bin/* /usr/local/bin/ COPY lib/doodbalib /usr/local/lib/python3.5/site-packages/doodbalib diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 2b6451eb..ab7e7c37 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -137,6 +137,7 @@ RUN build_deps=" \ watchdog \ wdb \ geoip2 \ + inotify \ && (python3 -m compileall -q /usr/local/lib/python3.6/ || true) \ && apt-get purge -yqq $build_deps \ && apt-get autopurge -yqq \ diff --git a/README.md b/README.md index 07cc4719..8a4c9421 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ You can start working with this straight away with our [template][]. - [`log`](#log) - [`pot`](#pot) - [`psql`](#psql) + - [`inotify`](#inotify) - [`ptvsd`](#ptvsd) - [`pudb`](#pudb) - [`git-aggregator`](#git-aggregator) @@ -504,6 +505,20 @@ just need to execute: The same is true for any other [Postgres client applications][]. +### [`inotify`](https://github.com/dsoprea/PyInotify) + +Enables hot code reloading when odoo is started with `--dev` and passed `reload` or +`all` as an argument. + +[copier template](https://github.com/Tecnativa/doodba-copier-template) enables this by +default in the development environment. + +Doodba supports this feature under; + +- [11.0](https://www.odoo.com/documentation/11.0/reference/cmdline.html#cmdoption-odoo-bin-dev) +- [12.0](https://www.odoo.com/documentation/12.0/reference/cmdline.html#developer-features) +- [13.0](https://www.odoo.com/documentation/13.0/reference/cmdline.html#developer-features) + ### [`ptvsd`](https://github.com/DonJayamanne/pythonVSCode) [VSCode][] debugger. If you use this editor with its python module, you will find it From 6b0a0050fe20645dd18c25d97e4ac6f4ed71c2be Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 16 Jun 2020 08:36:54 +0100 Subject: [PATCH 112/255] Configure screenshots and screencasts dir This new v13+ feature helps debugging JS tests. It makes sense to ship a default location for these things. Settings won't hurt on lower versions. Since Odoo automatically generates the `$dir/$PGDATABASE/{screencasts,screenshots}` structure, both items will be stored in a single `test-artifacts` folder. --- conf.d/00-base.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf.d/00-base.conf b/conf.d/00-base.conf index f3dcbe04..5f59459b 100644 --- a/conf.d/00-base.conf +++ b/conf.d/00-base.conf @@ -3,3 +3,7 @@ admin_passwd = $ADMIN_PASSWORD data_dir = /var/lib/odoo unaccent = $UNACCENT + +; Used in v13+ devel mode only +screencasts = /opt/odoo/auto/test-artifacts +screenshots = /opt/odoo/auto/test-artifacts From a094342f8c31ff8532cda6e31d6bf61782e8977a Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 3 Aug 2020 08:42:48 +0100 Subject: [PATCH 113/255] Install older autoprefixer-rails dependency [Last weekly build][1] failed with: ``` #8 [base 5/18] RUN gem install --no-rdoc --no-ri --no-update-sources bootst... #8 4.129 ERROR: Error installing bootstrap-sass: #8 4.129 autoprefixer-rails requires Ruby version >= 2.4. #8 4.147 Successfully installed execjs-2.7.0 #8 ERROR: executor failed running [/bin/sh -c gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version '<3.4' && rm -Rf ~/.gem /var/lib/gems/*/cache/]: runc did not terminate sucessfully ``` [Second to last build][2] passed with: ``` #7 [base 4/16] RUN gem install --no-rdoc --no-ri --no-update-sources bootst... #7 1.419 Successfully installed execjs-2.7.0 #7 1.419 Successfully installed autoprefixer-rails-9.8.5 #7 1.419 Successfully installed bootstrap-sass-3.3.7 #7 1.419 3 gems installed #7 DONE 1.5s ``` So, it seems like latest update for `autoprefixer-rails` doesn't support our old ruby version. Thus, forcing install of older version to fix builds. [1]: https://github.com/Tecnativa/doodba/actions/runs/191647681 [2]: https://github.com/Tecnativa/doodba/actions/runs/182679943 --- 11.0.Dockerfile | 3 ++- 8.0.Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 937a0c00..d783d394 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -70,7 +70,8 @@ RUN ln -s /usr/bin/nodejs /usr/local/bin/node \ && rm -Rf ~/.npm /tmp/* # Special case to get bootstrap-sass, required by Odoo for Sass assets -RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version '<3.4' \ +RUN gem install --no-rdoc --no-ri --no-update-sources autoprefixer-rails --version '<9.8.6' \ + && gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version '<3.4' \ && rm -Rf ~/.gem /var/lib/gems/*/cache/ # Other facilities diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 1afedace..5da31aa5 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -75,7 +75,8 @@ RUN ln -s /usr/bin/nodejs /usr/local/bin/node \ && rm -Rf ~/.npm /tmp/* # Special case to get bootstrap-sass, required by Odoo for Sass assets -RUN gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version '<3.4' \ +RUN gem install --no-rdoc --no-ri --no-update-sources autoprefixer-rails --version '<9.8.6' \ + && gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version '<3.4' \ && rm -Rf ~/.gem /var/lib/gems/*/cache/ # Other facilities From 1143ecc54a07bc9fc76d8226924b9134a71d611d Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 24 Sep 2020 08:02:44 +0200 Subject: [PATCH 114/255] Fix autoaggregate in python 2 versions Recently Python 2 builds (Odoo <= v10) started failing due to https://github.com/acsone/git-aggregator/issues/47. Here's the fix. --- bin/autoaggregate | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/autoaggregate b/bin/autoaggregate index 3a74f9df..9a8c0295 100755 --- a/bin/autoaggregate +++ b/bin/autoaggregate @@ -48,6 +48,7 @@ def aggregate(config): log_level, "--jobs", str(cpu_count() or 1), + "aggregate", ], cwd=SRC_DIR, stderr=sys.stderr, From 2fbc9d6518c4388dea6a8dc8567d63fd41461845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Thu, 1 Oct 2020 13:09:50 +0100 Subject: [PATCH 115/255] Update ptvsd -> debugpy (#324) * Update ptvsd -> debugpy debugpy is the recommended library for debugging Python with VSCode, so it makes sense to make this transition. https://code.visualstudio.com/docs/python/debugging#_debugging-by-attaching-over-a-network-connection https://github.com/microsoft/debugpy This updates the container, but it is still needed to update the template under copier. TT25875 * Add backwards support for ptvsd * correct debugpy instructions * style fixes --- 11.0.Dockerfile | 3 +++ 12.0.Dockerfile | 3 +++ 13.0.Dockerfile | 3 +++ 8.0.Dockerfile | 3 +++ README.md | 23 +++++++++++++---------- bin/direxec | 16 +++++++++++++++- 6 files changed, 40 insertions(+), 11 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index d783d394..9d26c2c3 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -22,6 +22,8 @@ ENV DB_FILTER=.* \ PIP_NO_CACHE_DIR=0 \ PTVSD_ARGS="--host 0.0.0.0 --port 6899 --wait --multiprocess" \ PTVSD_ENABLE=0 \ + DEBUGPY_ARGS="--listen 0.0.0.0:6899 --wait-for-client" \ + DEBUGPY_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ PYTHONOPTIMIZE=1 \ @@ -83,6 +85,7 @@ RUN pip install \ pg_activity \ plumbum \ ptvsd \ + debugpy \ pudb \ watchdog \ wdb \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index abd7f19d..1c5f6c98 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -22,6 +22,8 @@ ENV DB_FILTER=.* \ PIP_NO_CACHE_DIR=0 \ PTVSD_ARGS="--host 0.0.0.0 --port 6899 --wait --multiprocess" \ PTVSD_ENABLE=0 \ + DEBUGPY_ARGS="--listen 0.0.0.0:6899 --wait-for-client" \ + DEBUGPY_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ PYTHONOPTIMIZE=1 \ @@ -78,6 +80,7 @@ RUN pip install \ pg_activity \ plumbum \ ptvsd \ + debugpy \ pudb \ watchdog \ wdb \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index ab7e7c37..7ea12756 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -22,6 +22,8 @@ ENV DB_FILTER=.* \ PIP_NO_CACHE_DIR=0 \ PTVSD_ARGS="--host 0.0.0.0 --port 6899 --wait --multiprocess" \ PTVSD_ENABLE=0 \ + DEBUGPY_ARGS="--listen 0.0.0.0:6899 --wait-for-client" \ + DEBUGPY_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ PYTHONOPTIMIZE=1 \ @@ -133,6 +135,7 @@ RUN build_deps=" \ phonenumbers \ plumbum \ ptvsd \ + debugpy \ pudb \ watchdog \ wdb \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 5da31aa5..9e063a37 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -22,6 +22,8 @@ ENV DB_FILTER=.* \ PIP_NO_CACHE_DIR=0 \ PTVSD_ARGS="--host 0.0.0.0 --port 6899 --wait --multiprocess" \ PTVSD_ENABLE=0 \ + DEBUGPY_ARGS="--listen 0.0.0.0:6899 --wait-for-client" \ + DEBUGPY_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ PYTHONOPTIMIZE=1 \ @@ -86,6 +88,7 @@ RUN pip install \ git-aggregator \ plumbum \ ptvsd \ + debugpy \ pudb \ virtualenv \ wdb \ diff --git a/README.md b/README.md index 8a4c9421..20f0ff00 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ You can start working with this straight away with our [template][]. - [`pot`](#pot) - [`psql`](#psql) - [`inotify`](#inotify) - - [`ptvsd`](#ptvsd) + - [`debugpy`](#debugpy) - [`pudb`](#pudb) - [`git-aggregator`](#git-aggregator) - [`autoaggregate`](#autoaggregate) @@ -519,7 +519,7 @@ Doodba supports this feature under; - [12.0](https://www.odoo.com/documentation/12.0/reference/cmdline.html#developer-features) - [13.0](https://www.odoo.com/documentation/13.0/reference/cmdline.html#developer-features) -### [`ptvsd`](https://github.com/DonJayamanne/pythonVSCode) +### [`debugpy`](https://github.com/microsoft/vscode-python) [VSCode][] debugger. If you use this editor with its python module, you will find it useful. @@ -527,19 +527,22 @@ useful. To debug at a certain point of the code, add this Python code somewhere: ```python -import ptvsd -ptvsd.enable_attach("doodba-rocks", address=("0.0.0.0", 6899)) -print("ptvsd waiting...") -ptvsd.wait_for_attach() +import debugpy +debugpy.listen(6899) +print("Waiting for debugger attach") +debugpy.wait_for_client() +debugpy.breakpoint() +print('break on this line') ``` -To start Odoo within a ptvsd environment, which will obey the breakpoints established in -your IDE (but will work slowly), just add `-e PTVSD_ENABLE=1` to your odoo container. +To start Odoo within a debugpy environment, which will obey the breakpoints established +in your IDE (but will work slowly), just add `-e DEBUGPY_ENABLE=1` to your odoo +container. -If you use the official [template][], you can boot it in ptvsd mode with: +If you use the official [template][], you can boot it in debugpy mode with: ```bash -export DOODBA_PTVSD_ENABLE=1 +export DOODBA_DEBUGPY_ENABLE=1 docker-compose -f devel.yaml up -d ``` diff --git a/bin/direxec b/bin/direxec index a9cdf4e7..11b44997 100755 --- a/bin/direxec +++ b/bin/direxec @@ -4,7 +4,7 @@ import os import subprocess import sys -from logging import DEBUG, INFO +from logging import DEBUG, INFO, WARNING from doodbalib import logger, which @@ -46,6 +46,12 @@ if extra_command: # No DB exists, set initial language extra_command += ["--load-language", os.environ["INITIAL_LANG"]] if os.environ["PTVSD_ENABLE"] == "1": + # Warn deprecation + logger.log( + WARNING, + "ptvsd has beed deprecated for python debugging. " + "Please use debugpy (see https://github.com/Tecnativa/doodba#debugpy)", + ) # See `python -m ptvsd -h` to understand this extra_command[0] = os.path.realpath(which(extra_command[0])) extra_command = ( @@ -53,6 +59,14 @@ if extra_command: + os.environ["PTVSD_ARGS"].split() + extra_command ) + elif os.environ["DEBUGPY_ENABLE"] == "1": + # See `python -m debugpy -h` to understand this + extra_command[0] = os.path.realpath(which(extra_command[0])) + extra_command = ( + ["python", "-m", "debugpy"] + + os.environ["DEBUGPY_ARGS"].split() + + extra_command + ) logger.log( DEBUG if extra_command[0] == "/qa/insider" else INFO, "Executing %s", From 98b476accdbcddfe7616a78d6f9b05e774eaf351 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 1 Oct 2020 10:19:30 +0100 Subject: [PATCH 116/255] Add Odoo 14.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Make it `:latest`. - Fix the common prerelease-failing tests. - Fix some tests that were testing deprecated features in versions where those were no longer available. - Remove ptvsd and use only debugpy (will work only after #324 is merged). - Fix bug when `$PTVSD_ENABLE` was missing. TT22772 Co-authored-by: JoĆ£o Marques --- .github/workflows/ci.yaml | 3 +- .isort.cfg | 2 +- 14.0.Dockerfile | 228 ++++++++++++++++++ README.md | 12 +- bin/direxec | 4 +- tests/__init__.py | 24 +- .../custom/build.d/150-conditional-ruby | 14 ++ .../dependencies/custom/src/addons.yaml | 2 +- .../settings/custom/scripts/test_settings.py | 32 ++- .../test_settings_python_odoo_shell.py | 18 ++ 10 files changed, 306 insertions(+), 33 deletions(-) create mode 100644 14.0.Dockerfile create mode 100755 tests/scaffoldings/dependencies/custom/build.d/150-conditional-ruby create mode 100755 tests/scaffoldings/settings/custom/scripts/test_settings_python_odoo_shell.py diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 84c36fe6..83211d76 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -34,6 +34,7 @@ jobs: # Test modern Odoo versions with latest Postgres version pg_version: ["12"] odoo_version: + - "14.0" - "13.0" - "12.0" - "11.0" @@ -48,7 +49,7 @@ jobs: pg_version: "9.6" env: # Indicates what's the equivalent to tecnativa/doodba:latest image - LATEST_RELEASE: "13.0" + LATEST_RELEASE: "14.0" # Variables found by default in Docker Hub builder DOCKER_REPO: tecnativa/doodba DOCKER_TAG: ${{ matrix.odoo_version }} diff --git a/.isort.cfg b/.isort.cfg index a3773794..b732c289 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -9,4 +9,4 @@ line_length=88 known_odoo=odoo known_odoo_addons=odoo.addons sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER -known_third_party=doodbalib,yaml +known_third_party=click,click_odoo,doodbalib,yaml diff --git a/14.0.Dockerfile b/14.0.Dockerfile new file mode 100644 index 00000000..3f059823 --- /dev/null +++ b/14.0.Dockerfile @@ -0,0 +1,228 @@ +FROM python:3.6-slim-buster AS base + +EXPOSE 8069 8072 + +ARG GEOIP_UPDATER_VERSION=4.3.0 +ARG WKHTMLTOPDF_VERSION=0.12.5 +ARG WKHTMLTOPDF_CHECKSUM='1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb' +ENV DB_FILTER=.* \ + DEPTH_DEFAULT=1 \ + DEPTH_MERGE=100 \ + EMAIL=https://hub.docker.com/r/tecnativa/odoo \ + GEOIP_ACCOUNT_ID="" \ + GEOIP_LICENSE_KEY="" \ + GIT_AUTHOR_NAME=docker-odoo \ + INITIAL_LANG="" \ + LC_ALL=C.UTF-8 \ + LIST_DB=false \ + NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \ + OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ + PATH="/home/odoo/.local/bin:$PATH" \ + PIP_NO_CACHE_DIR=0 \ + DEBUGPY_ARGS="--listen 0.0.0.0:6899 --wait-for-client" \ + DEBUGPY_ENABLE=0 \ + PUDB_RDB_HOST=0.0.0.0 \ + PUDB_RDB_PORT=6899 \ + PYTHONOPTIMIZE=1 \ + UNACCENT=true \ + WAIT_DB=true \ + WDB_NO_BROWSER_AUTO_OPEN=True \ + WDB_SOCKET_SERVER=wdb \ + WDB_WEB_PORT=1984 \ + WDB_WEB_SERVER=localhost + +# Other requirements and recommendations +# See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control +RUN apt-get -qq update \ + && apt-get install -yqq --no-install-recommends \ + curl \ + && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.stretch_amd64.deb \ + && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ + && apt-get install -yqq --no-install-recommends \ + ./wkhtmltox.deb \ + chromium \ + ffmpeg \ + fonts-liberation2 \ + gettext \ + git \ + gnupg2 \ + locales-all \ + nano \ + npm \ + openssh-client \ + telnet \ + vim \ + zlibc \ + && echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && apt-get update \ + && apt-get install -yqq --no-install-recommends postgresql-client \ + && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && apt-get autopurge -yqq \ + && rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \ + && sync + +WORKDIR /opt/odoo +COPY bin/* /usr/local/bin/ +COPY lib/doodbalib /usr/local/lib/python3.6/site-packages/doodbalib +COPY build.d common/build.d +COPY conf.d common/conf.d +COPY entrypoint.d common/entrypoint.d +RUN mkdir -p auto/addons auto/geoip custom/src/private \ + && ln /usr/local/bin/direxec common/entrypoint \ + && ln /usr/local/bin/direxec common/build \ + && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ + && chmod -R a+rX /usr/local/lib/python3.6/site-packages/doodbalib \ + && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ + && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ + && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ + && sync + +# Doodba-QA dependencies in a separate virtualenv +COPY qa /qa +RUN python -m venv --system-site-packages /qa/venv \ + && . /qa/venv/bin/activate \ + && pip install \ + click \ + coverage \ + flake8 \ + pylint-odoo \ + six \ + && npm install --loglevel error --prefix /qa eslint \ + && deactivate \ + && mkdir -p /qa/artifacts + +ARG ODOO_SOURCE=OCA/OCB +ARG ODOO_VERSION=14.0 +ENV ODOO_VERSION="$ODOO_VERSION" + +# Install Odoo hard & soft dependencies, and Doodba utilities +RUN build_deps=" \ + build-essential \ + libfreetype6-dev \ + libfribidi-dev \ + libghc-zlib-dev \ + libharfbuzz-dev \ + libjpeg-dev \ + liblcms2-dev \ + libldap2-dev \ + libopenjp2-7-dev \ + libpq-dev \ + libsasl2-dev \ + libtiff5-dev \ + libwebp-dev \ + libxml2-dev \ + libxslt-dev \ + tcl-dev \ + tk-dev \ + zlib1g-dev \ + " \ + && apt-get update \ + && apt-get install -yqq --no-install-recommends $build_deps \ + && pip install \ + -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + 'websocket-client~=0.56' \ + astor \ + click-odoo-contrib \ + debugpy \ + geoip2 \ + git-aggregator \ + inotify \ + pg_activity \ + phonenumbers \ + plumbum \ + pudb \ + watchdog \ + wdb \ + && (python3 -m compileall -q /usr/local/lib/python3.6/ || true) \ + && apt-get purge -yqq $build_deps \ + && apt-get autopurge -yqq \ + && rm -Rf /var/lib/apt/lists/* /tmp/* + +# Metadata +ARG VCS_REF +ARG BUILD_DATE +ARG VERSION +LABEL org.label-schema.schema-version="$VERSION" \ + org.label-schema.vendor=Tecnativa \ + org.label-schema.license=Apache-2.0 \ + org.label-schema.build-date="$BUILD_DATE" \ + org.label-schema.vcs-ref="$VCS_REF" \ + org.label-schema.vcs-url="https://github.com/Tecnativa/doodba" + +# Onbuild version, with all the magic +FROM base AS onbuild + +# Subimage triggers +ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] +ONBUILD CMD ["/usr/local/bin/odoo"] +ONBUILD ARG AGGREGATE=true +ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" +ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" +ONBUILD ARG DEPTH_DEFAULT=1 +ONBUILD ARG DEPTH_MERGE=100 +ONBUILD ARG CLEAN=true +ONBUILD ARG COMPILE=true +ONBUILD ARG FONT_MONO="Liberation Mono" +ONBUILD ARG FONT_SANS="Liberation Sans" +ONBUILD ARG FONT_SERIF="Liberation Serif" +ONBUILD ARG PIP_INSTALL_ODOO=true +ONBUILD ARG ADMIN_PASSWORD=admin +ONBUILD ARG SMTP_SERVER=smtp +ONBUILD ARG SMTP_PORT=25 +ONBUILD ARG SMTP_USER=false +ONBUILD ARG SMTP_PASSWORD=false +ONBUILD ARG SMTP_SSL=false +ONBUILD ARG EMAIL_FROM="" +ONBUILD ARG PROXY_MODE=false +ONBUILD ARG WITHOUT_DEMO=all +ONBUILD ARG PGUSER=odoo +ONBUILD ARG PGPASSWORD=odoopassword +ONBUILD ARG PGHOST=db +ONBUILD ARG PGPORT=5432 +ONBUILD ARG PGDATABASE=prod + +# Config variables +ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ + DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \ + DEFAULT_REPO_PATTERN_ODOO="$DEFAULT_REPO_PATTERN_ODOO" \ + UNACCENT="$UNACCENT" \ + PGUSER="$PGUSER" \ + PGPASSWORD="$PGPASSWORD" \ + PGHOST="$PGHOST" \ + PGPORT=$PGPORT \ + PGDATABASE="$PGDATABASE" \ + PROXY_MODE="$PROXY_MODE" \ + SMTP_SERVER="$SMTP_SERVER" \ + SMTP_PORT=$SMTP_PORT \ + SMTP_USER="$SMTP_USER" \ + SMTP_PASSWORD="$SMTP_PASSWORD" \ + SMTP_SSL="$SMTP_SSL" \ + EMAIL_FROM="$EMAIL_FROM" \ + WITHOUT_DEMO="$WITHOUT_DEMO" +ONBUILD ARG LOCAL_CUSTOM_DIR=./custom +ONBUILD COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom + +# Enable setting custom uids for odoo user during build of scaffolds +ONBUILD ARG UID=1000 +ONBUILD ARG GID=1000 + +# Enable Odoo user and filestore +ONBUILD RUN groupadd -g $GID odoo -o \ + && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && sync + +# https://docs.python.org/3/library/logging.html#levels +ONBUILD ARG LOG_LEVEL=INFO +ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ + && ln -s /opt/odoo/custom/ssh ~root/.ssh \ + && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ + && sync +ONBUILD RUN /opt/odoo/common/build && sync +ONBUILD VOLUME ["/var/lib/odoo"] +ONBUILD USER odoo diff --git a/README.md b/README.md index 20f0ff00..f525634c 100644 --- a/README.md +++ b/README.md @@ -394,8 +394,8 @@ server-tools: # Custom repositories ENV: DEFAULT_REPO_PATTERN: https://github.com/Tecnativa/{}.git - ODOO_VERSION: 13.0-new-feature -some-repo: # Cloned from https://github.com/Tecnativa/some-repo.git branch 13.0-new-feature + ODOO_VERSION: 14.0-new-feature +some-repo: # Cloned from https://github.com/Tecnativa/some-repo.git branch 14.0-new-feature - some_custom_module ``` @@ -513,11 +513,9 @@ Enables hot code reloading when odoo is started with `--dev` and passed `reload` [copier template](https://github.com/Tecnativa/doodba-copier-template) enables this by default in the development environment. -Doodba supports this feature under; - -- [11.0](https://www.odoo.com/documentation/11.0/reference/cmdline.html#cmdoption-odoo-bin-dev) -- [12.0](https://www.odoo.com/documentation/12.0/reference/cmdline.html#developer-features) -- [13.0](https://www.odoo.com/documentation/13.0/reference/cmdline.html#developer-features) +Doodba supports this feature under versions 11.0 and later. Check +[CLI docs](https://www.odoo.com/documentation/13.0/reference/cmdline.html#developer-features) +for details. ### [`debugpy`](https://github.com/microsoft/vscode-python) diff --git a/bin/direxec b/bin/direxec index 11b44997..3fe1bc97 100755 --- a/bin/direxec +++ b/bin/direxec @@ -45,7 +45,7 @@ if extra_command: except OperationalError: # No DB exists, set initial language extra_command += ["--load-language", os.environ["INITIAL_LANG"]] - if os.environ["PTVSD_ENABLE"] == "1": + if os.environ.get("PTVSD_ENABLE") == "1": # Warn deprecation logger.log( WARNING, @@ -56,7 +56,7 @@ if extra_command: extra_command[0] = os.path.realpath(which(extra_command[0])) extra_command = ( ["python", "-m", "ptvsd"] - + os.environ["PTVSD_ARGS"].split() + + os.environ.get("PTVSD_ARGS", "").split() + extra_command ) elif os.environ["DEBUGPY_ENABLE"] == "1": diff --git a/tests/__init__.py b/tests/__init__.py index de5db49d..424abf3b 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -16,9 +16,9 @@ DIR = dirname(__file__) ODOO_PREFIX = ("odoo", "--stop-after-init", "--workers=0") ODOO_VERSIONS = frozenset( - environ.get("DOCKER_TAG", "7.0 8.0 9.0 10.0 11.0 12.0 13.0").split() + environ.get("DOCKER_TAG", "7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0").split() ) -PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "12").split()) +PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "13").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") GEIOP_CREDENTIALS_PROVIDED = environ.get("GEOIP_LICENSE_KEY", False) and environ.get( "GEOIP_ACCOUNT_ID", False @@ -29,7 +29,7 @@ # preparing the pre-release for the next version of Odoo, which hasn't been # released yet. prerelease_skip = unittest.skipIf( - ODOO_VERSIONS == {"13.0"}, "Tests not supported in pre-release" + ODOO_VERSIONS == {"14.0"}, "Tests not supported in pre-release" ) @@ -220,7 +220,13 @@ def test_settings(self): # Odoo settings work ("./custom/scripts/test_settings.py",), ) - # Odoo 8.0 has no shell, and --load-language doesn't work fine in 9.0 + if ODOO_VERSIONS & {"9.0", "10.0", "11.0"}: + commands += ( + # Check Odoo settings using python-odoo-shell, which is available + # only for Odoo 9-11 (for 8 too, but it had no built-in shell) + ("./custom/scripts/test_settings_python_odoo_shell.py",), + ) + # --load-language doesn't work fine in Odoo 9.0 for sub_env in matrix(odoo={"9.0"}): self.compose_test(folder, sub_env, *commands) # Extra tests for versions >= 10.0, that support --load-language fine @@ -301,6 +307,9 @@ def test_smallest(self): *commands, ) + # HACK https://github.com/itpp-labs/misc-addons/issues/1014 + # TODO Remove decorator + @prerelease_skip def test_addons_env(self): """Test environment variables in addons.yaml""" # Old versions are skiped because they don't support __manifest__.py, @@ -355,8 +364,7 @@ def test_dotd(self): ("--version",), ) - # TODO Remove decorator when OCB 13.0 is released and server-tools 13.0 - # has a valid module to test + # TODO Remove decorator when base_search_fuzzy is migrated to 14.0 @prerelease_skip def test_dependencies(self): """Test dependencies installation.""" @@ -369,8 +377,8 @@ def test_dependencies(self): ("test", "!", "-f", "custom/dependencies/gem.txt"), ("test", "!", "-f", "custom/dependencies/npm.txt"), ("test", "!", "-f", "custom/dependencies/pip.txt"), - # It should have module_auto_update available - ("test", "-d", "custom/src/server-tools/module_auto_update"), + # It should have base_search_fuzzy available + ("test", "-d", "custom/src/server-tools/base_search_fuzzy"), # Patched Werkzeug version ( "bash", diff --git a/tests/scaffoldings/dependencies/custom/build.d/150-conditional-ruby b/tests/scaffoldings/dependencies/custom/build.d/150-conditional-ruby new file mode 100755 index 00000000..e9959230 --- /dev/null +++ b/tests/scaffoldings/dependencies/custom/build.d/150-conditional-ruby @@ -0,0 +1,14 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +"""Add ruby as a conditional dependency.""" + +import os + +from doodbalib import ODOO_VERSION + +if float(ODOO_VERSION) >= 13: + # These Doodba versions still can use the ruby gem autoinstaller, but + # need ruby to be manually installed because it is not in the base image + # by default (it was until Odoo 12.0) + with open("/opt/odoo/custom/dependencies/000-apt-ruby.txt", "w") as fd: + fd.writelines(["ruby"]) diff --git a/tests/scaffoldings/dependencies/custom/src/addons.yaml b/tests/scaffoldings/dependencies/custom/src/addons.yaml index 36de1f73..1c8ff89e 100644 --- a/tests/scaffoldings/dependencies/custom/src/addons.yaml +++ b/tests/scaffoldings/dependencies/custom/src/addons.yaml @@ -1,2 +1,2 @@ server-tools: - - module_auto_update + - base_search_fuzzy diff --git a/tests/scaffoldings/settings/custom/scripts/test_settings.py b/tests/scaffoldings/settings/custom/scripts/test_settings.py index 213b7e23..84ebb98d 100755 --- a/tests/scaffoldings/settings/custom/scripts/test_settings.py +++ b/tests/scaffoldings/settings/custom/scripts/test_settings.py @@ -1,16 +1,22 @@ -#!/usr/local/bin/python-odoo-shell +#!/usr/bin/env python # -*- coding: utf-8 -*- -try: - from odoo.tools import config -except ImportError: - from openerp.tools import config +from click import command +from click_odoo import env_options, odoo -assert config.get("email_from") == "test@example.com" -assert config.get("limit_memory_soft") == 2097152000 -assert config.get("smtp_password") is False -assert config.get("smtp_port") == 1025 -assert config.get("smtp_server") == "mailhog" -assert config.get("smtp_ssl") is False -assert config.get("smtp_user") is False -assert config.get("dbfilter") == ".*" +@command() +@env_options(default_log_level="error") +def main(env): + config = odoo.tools.config + assert config.get("email_from") == "test@example.com" + assert config.get("limit_memory_soft") == 2097152000 + assert config.get("smtp_password") is False + assert config.get("smtp_port") == 1025 + assert config.get("smtp_server") == "mailhog" + assert config.get("smtp_ssl") is False + assert config.get("smtp_user") is False + assert config.get("dbfilter") == ".*" + + +if __name__ == "__main__": + main() diff --git a/tests/scaffoldings/settings/custom/scripts/test_settings_python_odoo_shell.py b/tests/scaffoldings/settings/custom/scripts/test_settings_python_odoo_shell.py new file mode 100755 index 00000000..6daf0033 --- /dev/null +++ b/tests/scaffoldings/settings/custom/scripts/test_settings_python_odoo_shell.py @@ -0,0 +1,18 @@ +#!/usr/local/bin/python-odoo-shell +# -*- coding: utf-8 -*- + +# python-odoo-shell is deprecated + +try: + from odoo.tools import config +except ImportError: + from openerp.tools import config + +assert config.get("email_from") == "test@example.com" +assert config.get("limit_memory_soft") == 2097152000 +assert config.get("smtp_password") is False +assert config.get("smtp_port") == 1025 +assert config.get("smtp_server") == "mailhog" +assert config.get("smtp_ssl") is False +assert config.get("smtp_user") is False +assert config.get("dbfilter") == ".*" From 9bbb8f24fcdbb65b15c5a10d34435f506c00164d Mon Sep 17 00:00:00 2001 From: Ivan Yelizariev // IEL Date: Sun, 11 Oct 2020 14:25:28 +0200 Subject: [PATCH 117/255] upgrade to to new github api > The `set-env` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 83211d76..222b468c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,8 +17,9 @@ jobs: - uses: actions/setup-python@v1 - name: Set PY run: - echo "::set-env name=PY::$(python -c 'import hashlib, + echo "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" + >> $GITHUB_ENV - uses: actions/cache@v1 with: path: ~/.cache/pre-commit From e1699a12dad34e87b3c7ed63d9b683ead1172bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Tue, 20 Oct 2020 08:13:45 +0100 Subject: [PATCH 118/255] Update 14.0 Dockerfile to use Python 3.8, as in Odoo.sh and runbots TT26297 --- 14.0.Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/14.0.Dockerfile b/14.0.Dockerfile index 3f059823..671b10ff 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.6-slim-buster AS base +FROM python:3.8-slim-buster AS base EXPOSE 8069 8072 @@ -66,7 +66,7 @@ RUN apt-get -qq update \ WORKDIR /opt/odoo COPY bin/* /usr/local/bin/ -COPY lib/doodbalib /usr/local/lib/python3.6/site-packages/doodbalib +COPY lib/doodbalib /usr/local/lib/python3.8/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d @@ -74,7 +74,7 @@ RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ - && chmod -R a+rX /usr/local/lib/python3.6/site-packages/doodbalib \ + && chmod -R a+rX /usr/local/lib/python3.8/site-packages/doodbalib \ && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ @@ -136,7 +136,7 @@ RUN build_deps=" \ pudb \ watchdog \ wdb \ - && (python3 -m compileall -q /usr/local/lib/python3.6/ || true) \ + && (python3 -m compileall -q /usr/local/lib/python3.8/ || true) \ && apt-get purge -yqq $build_deps \ && apt-get autopurge -yqq \ && rm -Rf /var/lib/apt/lists/* /tmp/* From 4fa82ccfb99ddb6f06e745ecfc3d6dccd2add861 Mon Sep 17 00:00:00 2001 From: Graeme Gellatly Date: Wed, 21 Oct 2020 21:01:59 +1300 Subject: [PATCH 119/255] Add pydevd-odoo plugin This plugin enables recordset debug collection in Doodba and is compatible with all IDE's supporting pydevd including VSCode and pycharm. --- 11.0.Dockerfile | 1 + 12.0.Dockerfile | 1 + 13.0.Dockerfile | 1 + 14.0.Dockerfile | 1 + 8.0.Dockerfile | 1 + 5 files changed, 5 insertions(+) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 9d26c2c3..5ba36e01 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -86,6 +86,7 @@ RUN pip install \ plumbum \ ptvsd \ debugpy \ + pydevd-odoo \ pudb \ watchdog \ wdb \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 1c5f6c98..6a30b7ab 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -81,6 +81,7 @@ RUN pip install \ plumbum \ ptvsd \ debugpy \ + pydevd-odoo \ pudb \ watchdog \ wdb \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 7ea12756..55e88fb2 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -136,6 +136,7 @@ RUN build_deps=" \ plumbum \ ptvsd \ debugpy \ + pydevd-odoo \ pudb \ watchdog \ wdb \ diff --git a/14.0.Dockerfile b/14.0.Dockerfile index 671b10ff..d2f9e5c9 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -127,6 +127,7 @@ RUN build_deps=" \ astor \ click-odoo-contrib \ debugpy \ + pydevd-odoo \ geoip2 \ git-aggregator \ inotify \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 9e063a37..2d93dec0 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -89,6 +89,7 @@ RUN pip install \ plumbum \ ptvsd \ debugpy \ + pydevd-odoo \ pudb \ virtualenv \ wdb \ From ced07c3a99af9f75849c305ae442baf95dbb96cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Fri, 30 Oct 2020 09:05:21 +0000 Subject: [PATCH 120/255] Remove pydevd-odoo for Odoo <= v10 Partially reverts https://github.com/Tecnativa/doodba/commit/4fa82ccfb99ddb6f06e745ecfc3d6dccd2add861 Pydevd-odoo introduces Syntax Error for python < 3 https://github.com/trinhanhngoc/pydevd-odoo/blob/master/pydevd_plugins/extensions/pydevd_plugin_odoo.py#L37 This eliminates pydevd-odoo functionality but keeps debugging working TT26189 --- 8.0.Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 2d93dec0..9e063a37 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -89,7 +89,6 @@ RUN pip install \ plumbum \ ptvsd \ debugpy \ - pydevd-odoo \ pudb \ virtualenv \ wdb \ From 86323b027b032a8dfaaeba30e85e7fd71dc5495f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Wed, 4 Nov 2020 10:47:43 +0000 Subject: [PATCH 121/255] Always regenerate odoo.conf file TT26597 --- entrypoint.d/50-config-generate | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/entrypoint.d/50-config-generate b/entrypoint.d/50-config-generate index d7f8f89a..93b3da4c 100755 --- a/entrypoint.d/50-config-generate +++ b/entrypoint.d/50-config-generate @@ -1,8 +1,5 @@ #!/bin/bash -if [ -f "${OPENERP_SERVER}" ]; then - log INFO File $OPENERP_SERVER exists, skipping config generation - exit 0 -fi +log INFO Generating $OPENERP_SERVER file. Overriding any existing... config-generate From 76d2940ae0338f1eba99add805d5e0b79347ca6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Tue, 10 Nov 2020 09:43:32 +0000 Subject: [PATCH 122/255] FIX: Temporarily remove pydevd-odoo Introduces error in Python 3.8 (used in v14): https://github.com/trinhanhngoc/pydevd-odoo/issues/3 Removing until issue is fixed --- 14.0.Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/14.0.Dockerfile b/14.0.Dockerfile index d2f9e5c9..bd683d7e 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -99,6 +99,8 @@ ARG ODOO_VERSION=14.0 ENV ODOO_VERSION="$ODOO_VERSION" # Install Odoo hard & soft dependencies, and Doodba utilities +# TODO: Add back pydevd-odoo once +# https://github.com/trinhanhngoc/pydevd-odoo/issues/3 is fixed RUN build_deps=" \ build-essential \ libfreetype6-dev \ @@ -127,7 +129,6 @@ RUN build_deps=" \ astor \ click-odoo-contrib \ debugpy \ - pydevd-odoo \ geoip2 \ git-aggregator \ inotify \ From f223677c5e92375ec1af59a622561caa9569b6b7 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 18 Nov 2020 09:49:01 +0000 Subject: [PATCH 123/255] Notify about discussions --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f525634c..bd164c30 100644 --- a/README.md +++ b/README.md @@ -695,8 +695,8 @@ FROM tecnativa/doodba@sha256:fba69478f9b0616561aa3aba4d18e4bcc2f728c9568057946c9 ### How can I help? -Just [head to our project](https://github.com/Tecnativa/doodba) and open an issue or -pull request. +Just [head to our project](https://github.com/Tecnativa/doodba) and open a discussion, +issue or pull request. ## Related Projects From aabf54255b37e06542455d8de100d371db0dd213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Tue, 24 Nov 2020 10:25:05 +0000 Subject: [PATCH 124/255] Migrate from GitHub Packages Docker registry to GitHub Container Registry --- .github/workflows/ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 222b468c..78781620 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -75,11 +75,11 @@ jobs: REGISTRY_PASSWORD: ${{ secrets.dockerhub_password }} REGISTRY_USERNAME: ${{ secrets.dockerhub_username }} run: ./hooks/push - - name: push to github registry + - name: push to github container registry if: github.repository == 'Tecnativa/doodba' && github.ref == 'refs/heads/master' env: DOCKER_REPO_SUFFIX: /doodba - REGISTRY_HOST: docker.pkg.github.com - REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - REGISTRY_USERNAME: ${{ github.actor }} + REGISTRY_HOST: ghcr.io + REGISTRY_PASSWORD: ${{ secrets.GHCR_PASSWORD }} + REGISTRY_USERNAME: ${{ secrets.GHCR_USERNAME }} run: ./hooks/push From e410c74ef9ab9c041b08a43724ccf4b7221ba0fb Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 25 Nov 2020 09:39:40 +0000 Subject: [PATCH 125/255] Use bot credentials --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 78781620..d2690699 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -80,6 +80,6 @@ jobs: env: DOCKER_REPO_SUFFIX: /doodba REGISTRY_HOST: ghcr.io - REGISTRY_PASSWORD: ${{ secrets.GHCR_PASSWORD }} - REGISTRY_USERNAME: ${{ secrets.GHCR_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.BOT_TOKEN }} + REGISTRY_USERNAME: ${{ secrets.BOT_LOGIN }} run: ./hooks/push From 536c444bb12e8342c642c57757ba86ba41992297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Wed, 25 Nov 2020 10:17:45 +0000 Subject: [PATCH 126/255] Remove extra DOCKER_REPO_SUFFIX when publishing package --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d2690699..95bd7231 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -78,7 +78,6 @@ jobs: - name: push to github container registry if: github.repository == 'Tecnativa/doodba' && github.ref == 'refs/heads/master' env: - DOCKER_REPO_SUFFIX: /doodba REGISTRY_HOST: ghcr.io REGISTRY_PASSWORD: ${{ secrets.BOT_TOKEN }} REGISTRY_USERNAME: ${{ secrets.BOT_LOGIN }} From 878ac3ea43f8f31046151060a24fcc616b1ba10a Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 26 Nov 2020 09:32:29 +0000 Subject: [PATCH 127/255] Update secrets --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 95bd7231..259cd5ad 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -72,8 +72,8 @@ jobs: if: github.repository == 'Tecnativa/doodba' && github.ref == 'refs/heads/master' env: REGISTRY_HOST: docker.io - REGISTRY_PASSWORD: ${{ secrets.dockerhub_password }} - REGISTRY_USERNAME: ${{ secrets.dockerhub_username }} + REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} run: ./hooks/push - name: push to github container registry if: github.repository == 'Tecnativa/doodba' && github.ref == 'refs/heads/master' From 44c4091f3fbfb92ae3385777ab63b2eed09e6f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Wed, 16 Dec 2020 11:29:47 +0000 Subject: [PATCH 128/255] Update tests to use numpy instead of cfssl The latest was causing pip errors when installing for having a manifest with version 0.0.0 and only beta releases in pypi --- tests/__init__.py | 2 +- .../scaffoldings/dotd/custom/build.d/201-assert-dependencies | 2 +- tests/scaffoldings/dotd/custom/dependencies/pip.txt | 4 ++-- .../scaffoldings/dotd/custom/entrypoint.d/check-requirements | 2 +- .../scaffoldings/dotd/custom/src/dummy_repo/requirements.txt | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt diff --git a/tests/__init__.py b/tests/__init__.py index 424abf3b..014abf9b 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -349,7 +349,7 @@ def test_dotd(self): ("python", "-xc", "import Crypto; print(Crypto.__version__)"), ("sh", "-xc", "rst2html.py --version | grep 'Docutils 0.14'"), # ``requirements.txt`` from addon repos were processed - ("python", "-c", "import cfssl"), + ("python", "-c", "import numpy"), # Local executable binaries found in $PATH ("sh", "-xc", "pip install --user -q flake8 && which flake8"), # Addon cleanup works correctly diff --git a/tests/scaffoldings/dotd/custom/build.d/201-assert-dependencies b/tests/scaffoldings/dotd/custom/build.d/201-assert-dependencies index c4a56a52..fff7bbc0 100755 --- a/tests/scaffoldings/dotd/custom/build.d/201-assert-dependencies +++ b/tests/scaffoldings/dotd/custom/build.d/201-assert-dependencies @@ -4,4 +4,4 @@ set -ex which busybox aloha_world node -e "require('test-npm-install')" -python -c "import cfssl, Crypto" +python -c "import numpy, Crypto" diff --git a/tests/scaffoldings/dotd/custom/dependencies/pip.txt b/tests/scaffoldings/dotd/custom/dependencies/pip.txt index bc8535dd..0bbb6fb5 100644 --- a/tests/scaffoldings/dotd/custom/dependencies/pip.txt +++ b/tests/scaffoldings/dotd/custom/dependencies/pip.txt @@ -2,5 +2,5 @@ pycrypto==2.6.1 --no-binary :all: # Odoo pins docutils==0.12, so let's check it gets upgraded docutils==0.14 -# External dependency files can be included too; example: cfssl --r https://raw.githubusercontent.com/Tecnativa/doodba/f1d5b4e65d463eb25b1bece981bc806e9237310f/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt +# External dependency files can be included too; example: numpy +-r https://raw.githubusercontent.com/Tecnativa/doodba/master/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt diff --git a/tests/scaffoldings/dotd/custom/entrypoint.d/check-requirements b/tests/scaffoldings/dotd/custom/entrypoint.d/check-requirements index 85ebce78..a2aedbeb 100755 --- a/tests/scaffoldings/dotd/custom/entrypoint.d/check-requirements +++ b/tests/scaffoldings/dotd/custom/entrypoint.d/check-requirements @@ -1,3 +1,3 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from cfssl import CFSSL +import numpy diff --git a/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt b/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt new file mode 100644 index 00000000..24ce15ab --- /dev/null +++ b/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt @@ -0,0 +1 @@ +numpy From d01adb45222bbf73ee12ad9336042a5a441127b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Wed, 16 Dec 2020 11:34:48 +0000 Subject: [PATCH 129/255] Init poetry usage Start using poetry for local development and dependecy solving In the future, migrate in the tests as well --- poetry.lock | 663 +++++++++++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 17 ++ 2 files changed, 680 insertions(+) create mode 100644 poetry.lock create mode 100644 pyproject.toml diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 00000000..295bd9b7 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,663 @@ +[[package]] +name = "appdirs" +version = "1.4.4" +description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "attrs" +version = "20.3.0" +description = "Classes Without Boilerplate" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.extras] +dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "furo", "sphinx", "pre-commit"] +docs = ["furo", "sphinx", "zope.interface"] +tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] +tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"] + +[[package]] +name = "bcrypt" +version = "3.2.0" +description = "Modern password hashing for your software and your servers" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +cffi = ">=1.1" +six = ">=1.4.1" + +[package.extras] +tests = ["pytest (>=3.2.1,!=3.3.0)"] +typecheck = ["mypy"] + +[[package]] +name = "cached-property" +version = "1.5.2" +description = "A decorator for caching properties in classes." +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "certifi" +version = "2020.12.5" +description = "Python package for providing Mozilla's CA Bundle." +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "cffi" +version = "1.14.4" +description = "Foreign Function Interface for Python calling C code." +category = "dev" +optional = false +python-versions = "*" + +[package.dependencies] +pycparser = "*" + +[[package]] +name = "cfgv" +version = "3.2.0" +description = "Validate configuration and produce human readable error messages." +category = "dev" +optional = false +python-versions = ">=3.6.1" + +[[package]] +name = "chardet" +version = "3.0.4" +description = "Universal encoding detector for Python 2 and 3" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "colorama" +version = "0.4.4" +description = "Cross-platform colored terminal text." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "cryptography" +version = "3.3.1" +description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." +category = "dev" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*" + +[package.dependencies] +cffi = ">=1.12" +six = ">=1.4.1" + +[package.extras] +docs = ["sphinx (>=1.6.5,!=1.8.0,!=3.1.0,!=3.1.1)", "sphinx-rtd-theme"] +docstest = ["doc8", "pyenchant (>=1.6.11)", "twine (>=1.12.0)", "sphinxcontrib-spelling (>=4.0.1)"] +pep8test = ["black", "flake8", "flake8-import-order", "pep8-naming"] +ssh = ["bcrypt (>=3.1.5)"] +test = ["pytest (>=3.6.0,!=3.9.0,!=3.9.1,!=3.9.2)", "pretend", "iso8601", "pytz", "hypothesis (>=1.11.4,!=3.79.2)"] + +[[package]] +name = "distlib" +version = "0.3.1" +description = "Distribution utilities" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "distro" +version = "1.5.0" +description = "Distro - an OS platform information API" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "docker" +version = "4.4.0" +description = "A Python library for the Docker Engine API." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[package.dependencies] +paramiko = {version = ">=2.4.2", optional = true, markers = "extra == \"ssh\""} +pywin32 = {version = "227", markers = "sys_platform == \"win32\""} +requests = ">=2.14.2,<2.18.0 || >2.18.0" +six = ">=1.4.0" +websocket-client = ">=0.32.0" + +[package.extras] +ssh = ["paramiko (>=2.4.2)"] +tls = ["pyOpenSSL (>=17.5.0)", "cryptography (>=1.3.4)", "idna (>=2.0.0)"] + +[[package]] +name = "docker-compose" +version = "1.27.4" +description = "Multi-container orchestration for Docker" +category = "dev" +optional = false +python-versions = ">=3.4" + +[package.dependencies] +cached-property = ">=1.2.0,<2" +colorama = {version = ">=0.4,<1", markers = "sys_platform == \"win32\""} +distro = ">=1.5.0,<2" +docker = {version = ">=4.3.1,<5", extras = ["ssh"]} +dockerpty = ">=0.4.1,<1" +docopt = ">=0.6.1,<1" +jsonschema = ">=2.5.1,<4" +python-dotenv = ">=0.13.0,<1" +PyYAML = ">=3.10,<6" +requests = ">=2.20.0,<3" +texttable = ">=0.9.0,<2" +websocket-client = ">=0.32.0,<1" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7,<2)"] +tests = ["ddt (>=1.2.2,<2)", "pytest (<6)"] + +[[package]] +name = "dockerpty" +version = "0.4.1" +description = "Python library to use the pseudo-tty of a docker container" +category = "dev" +optional = false +python-versions = "*" + +[package.dependencies] +six = ">=1.3.0" + +[[package]] +name = "docopt" +version = "0.6.2" +description = "Pythonic argument parser, that will make you smile" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "filelock" +version = "3.0.12" +description = "A platform independent file lock." +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "identify" +version = "1.5.10" +description = "File identification library for Python" +category = "dev" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" + +[package.extras] +license = ["editdistance"] + +[[package]] +name = "idna" +version = "2.10" +description = "Internationalized Domain Names in Applications (IDNA)" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "jsonschema" +version = "3.2.0" +description = "An implementation of JSON Schema validation for Python" +category = "dev" +optional = false +python-versions = "*" + +[package.dependencies] +attrs = ">=17.4.0" +pyrsistent = ">=0.14.0" +six = ">=1.11.0" + +[package.extras] +format = ["idna", "jsonpointer (>1.13)", "rfc3987", "strict-rfc3339", "webcolors"] +format_nongpl = ["idna", "jsonpointer (>1.13)", "webcolors", "rfc3986-validator (>0.1.0)", "rfc3339-validator"] + +[[package]] +name = "nodeenv" +version = "1.5.0" +description = "Node.js virtual environment builder" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "paramiko" +version = "2.7.2" +description = "SSH2 protocol library" +category = "dev" +optional = false +python-versions = "*" + +[package.dependencies] +bcrypt = ">=3.1.3" +cryptography = ">=2.5" +pynacl = ">=1.0.1" + +[package.extras] +all = ["pyasn1 (>=0.1.7)", "pynacl (>=1.0.1)", "bcrypt (>=3.1.3)", "invoke (>=1.3)", "gssapi (>=1.4.1)", "pywin32 (>=2.1.8)"] +ed25519 = ["pynacl (>=1.0.1)", "bcrypt (>=3.1.3)"] +gssapi = ["pyasn1 (>=0.1.7)", "gssapi (>=1.4.1)", "pywin32 (>=2.1.8)"] +invoke = ["invoke (>=1.3)"] + +[[package]] +name = "plumbum" +version = "1.6.9" +description = "Plumbum: shell combinators library" +category = "dev" +optional = false +python-versions = ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" + +[[package]] +name = "pre-commit" +version = "2.9.3" +description = "A framework for managing and maintaining multi-language pre-commit hooks." +category = "dev" +optional = false +python-versions = ">=3.6.1" + +[package.dependencies] +cfgv = ">=2.0.0" +identify = ">=1.0.0" +nodeenv = ">=0.11.1" +pyyaml = ">=5.1" +toml = "*" +virtualenv = ">=20.0.8" + +[[package]] +name = "pycparser" +version = "2.20" +description = "C parser in Python" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "pynacl" +version = "1.4.0" +description = "Python binding to the Networking and Cryptography (NaCl) library" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.dependencies] +cffi = ">=1.4.1" +six = "*" + +[package.extras] +docs = ["sphinx (>=1.6.5)", "sphinx-rtd-theme"] +tests = ["pytest (>=3.2.1,!=3.3.0)", "hypothesis (>=3.27.0)"] + +[[package]] +name = "pyrsistent" +version = "0.17.3" +description = "Persistent/Functional/Immutable data structures" +category = "dev" +optional = false +python-versions = ">=3.5" + +[[package]] +name = "python-dotenv" +version = "0.15.0" +description = "Add .env support to your django/flask apps in development and deployments" +category = "dev" +optional = false +python-versions = "*" + +[package.extras] +cli = ["click (>=5.0)"] + +[[package]] +name = "pywin32" +version = "227" +description = "Python for Window Extensions" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "pyyaml" +version = "5.3.1" +description = "YAML parser and emitter for Python" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "requests" +version = "2.25.0" +description = "Python HTTP for Humans." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[package.dependencies] +certifi = ">=2017.4.17" +chardet = ">=3.0.2,<4" +idna = ">=2.5,<3" +urllib3 = ">=1.21.1,<1.27" + +[package.extras] +security = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)"] +socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] + +[[package]] +name = "six" +version = "1.15.0" +description = "Python 2 and 3 compatibility utilities" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "texttable" +version = "1.6.3" +description = "module for creating simple ASCII tables" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +category = "dev" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "urllib3" +version = "1.26.2" +description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" + +[package.extras] +brotli = ["brotlipy (>=0.6.0)"] +secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"] +socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] + +[[package]] +name = "virtualenv" +version = "20.2.2" +description = "Virtual Python Environment builder" +category = "dev" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" + +[package.dependencies] +appdirs = ">=1.4.3,<2" +distlib = ">=0.3.1,<1" +filelock = ">=3.0.0,<4" +six = ">=1.9.0,<2" + +[package.extras] +docs = ["proselint (>=0.10.2)", "sphinx (>=3)", "sphinx-argparse (>=0.2.5)", "sphinx-rtd-theme (>=0.4.3)", "towncrier (>=19.9.0rc1)"] +testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", "pytest (>=4)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.1)", "pytest-mock (>=2)", "pytest-randomly (>=1)", "pytest-timeout (>=1)", "pytest-xdist (>=1.31.0)", "packaging (>=20.0)", "xonsh (>=0.9.16)"] + +[[package]] +name = "websocket-client" +version = "0.57.0" +description = "WebSocket client for Python. hybi13 is supported." +category = "dev" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.dependencies] +six = "*" + +[metadata] +lock-version = "1.1" +python-versions = "^3.9" +content-hash = "b4edd7e09296f18061bf1dea5d0b6fb53a988c6f0ea8b754712650048e65a8af" + +[metadata.files] +appdirs = [ + {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, + {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, +] +attrs = [ + {file = "attrs-20.3.0-py2.py3-none-any.whl", hash = "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6"}, + {file = "attrs-20.3.0.tar.gz", hash = "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700"}, +] +bcrypt = [ + {file = "bcrypt-3.2.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:c95d4cbebffafcdd28bd28bb4e25b31c50f6da605c81ffd9ad8a3d1b2ab7b1b6"}, + {file = "bcrypt-3.2.0-cp36-abi3-manylinux1_x86_64.whl", hash = "sha256:63d4e3ff96188e5898779b6057878fecf3f11cfe6ec3b313ea09955d587ec7a7"}, + {file = "bcrypt-3.2.0-cp36-abi3-manylinux2010_x86_64.whl", hash = "sha256:cd1ea2ff3038509ea95f687256c46b79f5fc382ad0aa3664d200047546d511d1"}, + {file = "bcrypt-3.2.0-cp36-abi3-manylinux2014_aarch64.whl", hash = "sha256:cdcdcb3972027f83fe24a48b1e90ea4b584d35f1cc279d76de6fc4b13376239d"}, + {file = "bcrypt-3.2.0-cp36-abi3-win32.whl", hash = "sha256:a67fb841b35c28a59cebed05fbd3e80eea26e6d75851f0574a9273c80f3e9b55"}, + {file = "bcrypt-3.2.0-cp36-abi3-win_amd64.whl", hash = "sha256:81fec756feff5b6818ea7ab031205e1d323d8943d237303baca2c5f9c7846f34"}, + {file = "bcrypt-3.2.0.tar.gz", hash = "sha256:5b93c1726e50a93a033c36e5ca7fdcd29a5c7395af50a6892f5d9e7c6cfbfb29"}, +] +cached-property = [ + {file = "cached-property-1.5.2.tar.gz", hash = "sha256:9fa5755838eecbb2d234c3aa390bd80fbd3ac6b6869109bfc1b499f7bd89a130"}, + {file = "cached_property-1.5.2-py2.py3-none-any.whl", hash = "sha256:df4f613cf7ad9a588cc381aaf4a512d26265ecebd5eb9e1ba12f1319eb85a6a0"}, +] +certifi = [ + {file = "certifi-2020.12.5-py2.py3-none-any.whl", hash = "sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830"}, + {file = "certifi-2020.12.5.tar.gz", hash = "sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"}, +] +cffi = [ + {file = "cffi-1.14.4-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:ebb253464a5d0482b191274f1c8bf00e33f7e0b9c66405fbffc61ed2c839c775"}, + {file = "cffi-1.14.4-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:2c24d61263f511551f740d1a065eb0212db1dbbbbd241db758f5244281590c06"}, + {file = "cffi-1.14.4-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9f7a31251289b2ab6d4012f6e83e58bc3b96bd151f5b5262467f4bb6b34a7c26"}, + {file = "cffi-1.14.4-cp27-cp27m-win32.whl", hash = "sha256:5cf4be6c304ad0b6602f5c4e90e2f59b47653ac1ed9c662ed379fe48a8f26b0c"}, + {file = "cffi-1.14.4-cp27-cp27m-win_amd64.whl", hash = "sha256:f60567825f791c6f8a592f3c6e3bd93dd2934e3f9dac189308426bd76b00ef3b"}, + {file = "cffi-1.14.4-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:c6332685306b6417a91b1ff9fae889b3ba65c2292d64bd9245c093b1b284809d"}, + {file = "cffi-1.14.4-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:d9efd8b7a3ef378dd61a1e77367f1924375befc2eba06168b6ebfa903a5e59ca"}, + {file = "cffi-1.14.4-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:51a8b381b16ddd370178a65360ebe15fbc1c71cf6f584613a7ea08bfad946698"}, + {file = "cffi-1.14.4-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:1d2c4994f515e5b485fd6d3a73d05526aa0fcf248eb135996b088d25dfa1865b"}, + {file = "cffi-1.14.4-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:af5c59122a011049aad5dd87424b8e65a80e4a6477419c0c1015f73fb5ea0293"}, + {file = "cffi-1.14.4-cp35-cp35m-win32.whl", hash = "sha256:594234691ac0e9b770aee9fcdb8fa02c22e43e5c619456efd0d6c2bf276f3eb2"}, + {file = "cffi-1.14.4-cp35-cp35m-win_amd64.whl", hash = "sha256:64081b3f8f6f3c3de6191ec89d7dc6c86a8a43911f7ecb422c60e90c70be41c7"}, + {file = "cffi-1.14.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f803eaa94c2fcda012c047e62bc7a51b0bdabda1cad7a92a522694ea2d76e49f"}, + {file = "cffi-1.14.4-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:105abaf8a6075dc96c1fe5ae7aae073f4696f2905fde6aeada4c9d2926752362"}, + {file = "cffi-1.14.4-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0638c3ae1a0edfb77c6765d487fee624d2b1ee1bdfeffc1f0b58c64d149e7eec"}, + {file = "cffi-1.14.4-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:7c6b1dece89874d9541fc974917b631406233ea0440d0bdfbb8e03bf39a49b3b"}, + {file = "cffi-1.14.4-cp36-cp36m-win32.whl", hash = "sha256:155136b51fd733fa94e1c2ea5211dcd4c8879869008fc811648f16541bf99668"}, + {file = "cffi-1.14.4-cp36-cp36m-win_amd64.whl", hash = "sha256:6bc25fc545a6b3d57b5f8618e59fc13d3a3a68431e8ca5fd4c13241cd70d0009"}, + {file = "cffi-1.14.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a7711edca4dcef1a75257b50a2fbfe92a65187c47dab5a0f1b9b332c5919a3fb"}, + {file = "cffi-1.14.4-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:00e28066507bfc3fe865a31f325c8391a1ac2916219340f87dfad602c3e48e5d"}, + {file = "cffi-1.14.4-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:798caa2a2384b1cbe8a2a139d80734c9db54f9cc155c99d7cc92441a23871c03"}, + {file = "cffi-1.14.4-cp37-cp37m-win32.whl", hash = "sha256:00a1ba5e2e95684448de9b89888ccd02c98d512064b4cb987d48f4b40aa0421e"}, + {file = "cffi-1.14.4-cp37-cp37m-win_amd64.whl", hash = "sha256:9cc46bc107224ff5b6d04369e7c595acb700c3613ad7bcf2e2012f62ece80c35"}, + {file = "cffi-1.14.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:df5169c4396adc04f9b0a05f13c074df878b6052430e03f50e68adf3a57aa28d"}, + {file = "cffi-1.14.4-cp38-cp38-manylinux1_i686.whl", hash = "sha256:9ffb888f19d54a4d4dfd4b3f29bc2c16aa4972f1c2ab9c4ab09b8ab8685b9c2b"}, + {file = "cffi-1.14.4-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8d6603078baf4e11edc4168a514c5ce5b3ba6e3e9c374298cb88437957960a53"}, + {file = "cffi-1.14.4-cp38-cp38-win32.whl", hash = "sha256:b4e248d1087abf9f4c10f3c398896c87ce82a9856494a7155823eb45a892395d"}, + {file = "cffi-1.14.4-cp38-cp38-win_amd64.whl", hash = "sha256:ec80dc47f54e6e9a78181ce05feb71a0353854cc26999db963695f950b5fb375"}, + {file = "cffi-1.14.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:840793c68105fe031f34d6a086eaea153a0cd5c491cde82a74b420edd0a2b909"}, + {file = "cffi-1.14.4-cp39-cp39-manylinux1_i686.whl", hash = "sha256:b18e0a9ef57d2b41f5c68beefa32317d286c3d6ac0484efd10d6e07491bb95dd"}, + {file = "cffi-1.14.4-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:045d792900a75e8b1e1b0ab6787dd733a8190ffcf80e8c8ceb2fb10a29ff238a"}, + {file = "cffi-1.14.4-cp39-cp39-win32.whl", hash = "sha256:ba4e9e0ae13fc41c6b23299545e5ef73055213e466bd107953e4a013a5ddd7e3"}, + {file = "cffi-1.14.4-cp39-cp39-win_amd64.whl", hash = "sha256:f032b34669220030f905152045dfa27741ce1a6db3324a5bc0b96b6c7420c87b"}, + {file = "cffi-1.14.4.tar.gz", hash = "sha256:1a465cbe98a7fd391d47dce4b8f7e5b921e6cd805ef421d04f5f66ba8f06086c"}, +] +cfgv = [ + {file = "cfgv-3.2.0-py2.py3-none-any.whl", hash = "sha256:32e43d604bbe7896fe7c248a9c2276447dbef840feb28fe20494f62af110211d"}, + {file = "cfgv-3.2.0.tar.gz", hash = "sha256:cf22deb93d4bcf92f345a5c3cd39d3d41d6340adc60c78bbbd6588c384fda6a1"}, +] +chardet = [ + {file = "chardet-3.0.4-py2.py3-none-any.whl", hash = "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"}, + {file = "chardet-3.0.4.tar.gz", hash = "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"}, +] +colorama = [ + {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, + {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, +] +cryptography = [ + {file = "cryptography-3.3.1-cp27-cp27m-macosx_10_10_x86_64.whl", hash = "sha256:c366df0401d1ec4e548bebe8f91d55ebcc0ec3137900d214dd7aac8427ef3030"}, + {file = "cryptography-3.3.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9f6b0492d111b43de5f70052e24c1f0951cb9e6022188ebcb1cc3a3d301469b0"}, + {file = "cryptography-3.3.1-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:a69bd3c68b98298f490e84519b954335154917eaab52cf582fa2c5c7efc6e812"}, + {file = "cryptography-3.3.1-cp27-cp27m-win32.whl", hash = "sha256:84ef7a0c10c24a7773163f917f1cb6b4444597efd505a8aed0a22e8c4780f27e"}, + {file = "cryptography-3.3.1-cp27-cp27m-win_amd64.whl", hash = "sha256:594a1db4511bc4d960571536abe21b4e5c3003e8750ab8365fafce71c5d86901"}, + {file = "cryptography-3.3.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:0003a52a123602e1acee177dc90dd201f9bb1e73f24a070db7d36c588e8f5c7d"}, + {file = "cryptography-3.3.1-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:83d9d2dfec70364a74f4e7c70ad04d3ca2e6a08b703606993407bf46b97868c5"}, + {file = "cryptography-3.3.1-cp36-abi3-macosx_10_10_x86_64.whl", hash = "sha256:dc42f645f8f3a489c3dd416730a514e7a91a59510ddaadc09d04224c098d3302"}, + {file = "cryptography-3.3.1-cp36-abi3-manylinux1_x86_64.whl", hash = "sha256:788a3c9942df5e4371c199d10383f44a105d67d401fb4304178020142f020244"}, + {file = "cryptography-3.3.1-cp36-abi3-manylinux2010_x86_64.whl", hash = "sha256:69e836c9e5ff4373ce6d3ab311c1a2eed274793083858d3cd4c7d12ce20d5f9c"}, + {file = "cryptography-3.3.1-cp36-abi3-manylinux2014_aarch64.whl", hash = "sha256:9e21301f7a1e7c03dbea73e8602905a4ebba641547a462b26dd03451e5769e7c"}, + {file = "cryptography-3.3.1-cp36-abi3-win32.whl", hash = "sha256:b4890d5fb9b7a23e3bf8abf5a8a7da8e228f1e97dc96b30b95685df840b6914a"}, + {file = "cryptography-3.3.1-cp36-abi3-win_amd64.whl", hash = "sha256:0e85aaae861d0485eb5a79d33226dd6248d2a9f133b81532c8f5aae37de10ff7"}, + {file = "cryptography-3.3.1.tar.gz", hash = "sha256:7e177e4bea2de937a584b13645cab32f25e3d96fc0bc4a4cf99c27dc77682be6"}, +] +distlib = [ + {file = "distlib-0.3.1-py2.py3-none-any.whl", hash = "sha256:8c09de2c67b3e7deef7184574fc060ab8a793e7adbb183d942c389c8b13c52fb"}, + {file = "distlib-0.3.1.zip", hash = "sha256:edf6116872c863e1aa9d5bb7cb5e05a022c519a4594dc703843343a9ddd9bff1"}, +] +distro = [ + {file = "distro-1.5.0-py2.py3-none-any.whl", hash = "sha256:df74eed763e18d10d0da624258524ae80486432cd17392d9c3d96f5e83cd2799"}, + {file = "distro-1.5.0.tar.gz", hash = "sha256:0e58756ae38fbd8fc3020d54badb8eae17c5b9dcbed388b17bb55b8a5928df92"}, +] +docker = [ + {file = "docker-4.4.0-py2.py3-none-any.whl", hash = "sha256:317e95a48c32de8c1aac92a48066a5b73e218ed096e03758bcdd799a7130a1a1"}, + {file = "docker-4.4.0.tar.gz", hash = "sha256:cffc771d4ea1389fc66bc95cb72d304aa41d1a1563482a9a000fba3a84ed5071"}, +] +docker-compose = [ + {file = "docker-compose-1.27.4.tar.gz", hash = "sha256:5a5690f24c27d4b43dcbe6b3fae91ba680713208e99ee863352b3bae37bcaa83"}, + {file = "docker_compose-1.27.4-py2.py3-none-any.whl", hash = "sha256:84ca2edad226435e3a378ea24ca2ca4e1a77cc7c8de057e2812124c6dcb55147"}, +] +dockerpty = [ + {file = "dockerpty-0.4.1.tar.gz", hash = "sha256:69a9d69d573a0daa31bcd1c0774eeed5c15c295fe719c61aca550ed1393156ce"}, +] +docopt = [ + {file = "docopt-0.6.2.tar.gz", hash = "sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"}, +] +filelock = [ + {file = "filelock-3.0.12-py3-none-any.whl", hash = "sha256:929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"}, + {file = "filelock-3.0.12.tar.gz", hash = "sha256:18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59"}, +] +identify = [ + {file = "identify-1.5.10-py2.py3-none-any.whl", hash = "sha256:cc86e6a9a390879dcc2976cef169dd9cc48843ed70b7380f321d1b118163c60e"}, + {file = "identify-1.5.10.tar.gz", hash = "sha256:943cd299ac7f5715fcb3f684e2fc1594c1e0f22a90d15398e5888143bd4144b5"}, +] +idna = [ + {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, + {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, +] +jsonschema = [ + {file = "jsonschema-3.2.0-py2.py3-none-any.whl", hash = "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163"}, + {file = "jsonschema-3.2.0.tar.gz", hash = "sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"}, +] +nodeenv = [ + {file = "nodeenv-1.5.0-py2.py3-none-any.whl", hash = "sha256:5304d424c529c997bc888453aeaa6362d242b6b4631e90f3d4bf1b290f1c84a9"}, + {file = "nodeenv-1.5.0.tar.gz", hash = "sha256:ab45090ae383b716c4ef89e690c41ff8c2b257b85b309f01f3654df3d084bd7c"}, +] +paramiko = [ + {file = "paramiko-2.7.2-py2.py3-none-any.whl", hash = "sha256:4f3e316fef2ac628b05097a637af35685183111d4bc1b5979bd397c2ab7b5898"}, + {file = "paramiko-2.7.2.tar.gz", hash = "sha256:7f36f4ba2c0d81d219f4595e35f70d56cc94f9ac40a6acdf51d6ca210ce65035"}, +] +plumbum = [ + {file = "plumbum-1.6.9-py2.py3-none-any.whl", hash = "sha256:91418dcc66b58ab9d2e3b04b3d1e0d787dc45923154fb8b4a826bd9316dba0d6"}, + {file = "plumbum-1.6.9.tar.gz", hash = "sha256:16b9e19d96c80f2e9d051ef5f04927b834a6ac0ce5d2768eb8662b5cd53e43df"}, +] +pre-commit = [ + {file = "pre_commit-2.9.3-py2.py3-none-any.whl", hash = "sha256:6c86d977d00ddc8a60d68eec19f51ef212d9462937acf3ea37c7adec32284ac0"}, + {file = "pre_commit-2.9.3.tar.gz", hash = "sha256:ee784c11953e6d8badb97d19bc46b997a3a9eded849881ec587accd8608d74a4"}, +] +pycparser = [ + {file = "pycparser-2.20-py2.py3-none-any.whl", hash = "sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705"}, + {file = "pycparser-2.20.tar.gz", hash = "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0"}, +] +pynacl = [ + {file = "PyNaCl-1.4.0-cp27-cp27m-macosx_10_10_x86_64.whl", hash = "sha256:ea6841bc3a76fa4942ce00f3bda7d436fda21e2d91602b9e21b7ca9ecab8f3ff"}, + {file = "PyNaCl-1.4.0-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:d452a6746f0a7e11121e64625109bc4468fc3100452817001dbe018bb8b08514"}, + {file = "PyNaCl-1.4.0-cp27-cp27m-win32.whl", hash = "sha256:2fe0fc5a2480361dcaf4e6e7cea00e078fcda07ba45f811b167e3f99e8cff574"}, + {file = "PyNaCl-1.4.0-cp27-cp27m-win_amd64.whl", hash = "sha256:f8851ab9041756003119368c1e6cd0b9c631f46d686b3904b18c0139f4419f80"}, + {file = "PyNaCl-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:7757ae33dae81c300487591c68790dfb5145c7d03324000433d9a2c141f82af7"}, + {file = "PyNaCl-1.4.0-cp35-abi3-macosx_10_10_x86_64.whl", hash = "sha256:757250ddb3bff1eecd7e41e65f7f833a8405fede0194319f87899690624f2122"}, + {file = "PyNaCl-1.4.0-cp35-abi3-manylinux1_x86_64.whl", hash = "sha256:30f9b96db44e09b3304f9ea95079b1b7316b2b4f3744fe3aaecccd95d547063d"}, + {file = "PyNaCl-1.4.0-cp35-abi3-win32.whl", hash = "sha256:4e10569f8cbed81cb7526ae137049759d2a8d57726d52c1a000a3ce366779634"}, + {file = "PyNaCl-1.4.0-cp35-abi3-win_amd64.whl", hash = "sha256:c914f78da4953b33d4685e3cdc7ce63401247a21425c16a39760e282075ac4a6"}, + {file = "PyNaCl-1.4.0-cp35-cp35m-win32.whl", hash = "sha256:06cbb4d9b2c4bd3c8dc0d267416aaed79906e7b33f114ddbf0911969794b1cc4"}, + {file = "PyNaCl-1.4.0-cp35-cp35m-win_amd64.whl", hash = "sha256:511d269ee845037b95c9781aa702f90ccc36036f95d0f31373a6a79bd8242e25"}, + {file = "PyNaCl-1.4.0-cp36-cp36m-win32.whl", hash = "sha256:11335f09060af52c97137d4ac54285bcb7df0cef29014a1a4efe64ac065434c4"}, + {file = "PyNaCl-1.4.0-cp36-cp36m-win_amd64.whl", hash = "sha256:cd401ccbc2a249a47a3a1724c2918fcd04be1f7b54eb2a5a71ff915db0ac51c6"}, + {file = "PyNaCl-1.4.0-cp37-cp37m-win32.whl", hash = "sha256:8122ba5f2a2169ca5da936b2e5a511740ffb73979381b4229d9188f6dcb22f1f"}, + {file = "PyNaCl-1.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:537a7ccbea22905a0ab36ea58577b39d1fa9b1884869d173b5cf111f006f689f"}, + {file = "PyNaCl-1.4.0-cp38-cp38-win32.whl", hash = "sha256:9c4a7ea4fb81536c1b1f5cc44d54a296f96ae78c1ebd2311bd0b60be45a48d96"}, + {file = "PyNaCl-1.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:7c6092102219f59ff29788860ccb021e80fffd953920c4a8653889c029b2d420"}, + {file = "PyNaCl-1.4.0.tar.gz", hash = "sha256:54e9a2c849c742006516ad56a88f5c74bf2ce92c9f67435187c3c5953b346505"}, +] +pyrsistent = [ + {file = "pyrsistent-0.17.3.tar.gz", hash = "sha256:2e636185d9eb976a18a8a8e96efce62f2905fea90041958d8cc2a189756ebf3e"}, +] +python-dotenv = [ + {file = "python-dotenv-0.15.0.tar.gz", hash = "sha256:587825ed60b1711daea4832cf37524dfd404325b7db5e25ebe88c495c9f807a0"}, + {file = "python_dotenv-0.15.0-py2.py3-none-any.whl", hash = "sha256:0c8d1b80d1a1e91717ea7d526178e3882732420b03f08afea0406db6402e220e"}, +] +pywin32 = [ + {file = "pywin32-227-cp27-cp27m-win32.whl", hash = "sha256:371fcc39416d736401f0274dd64c2302728c9e034808e37381b5e1b22be4a6b0"}, + {file = "pywin32-227-cp27-cp27m-win_amd64.whl", hash = "sha256:4cdad3e84191194ea6d0dd1b1b9bdda574ff563177d2adf2b4efec2a244fa116"}, + {file = "pywin32-227-cp35-cp35m-win32.whl", hash = "sha256:f4c5be1a293bae0076d93c88f37ee8da68136744588bc5e2be2f299a34ceb7aa"}, + {file = "pywin32-227-cp35-cp35m-win_amd64.whl", hash = "sha256:a929a4af626e530383a579431b70e512e736e9588106715215bf685a3ea508d4"}, + {file = "pywin32-227-cp36-cp36m-win32.whl", hash = "sha256:300a2db938e98c3e7e2093e4491439e62287d0d493fe07cce110db070b54c0be"}, + {file = "pywin32-227-cp36-cp36m-win_amd64.whl", hash = "sha256:9b31e009564fb95db160f154e2aa195ed66bcc4c058ed72850d047141b36f3a2"}, + {file = "pywin32-227-cp37-cp37m-win32.whl", hash = "sha256:47a3c7551376a865dd8d095a98deba954a98f326c6fe3c72d8726ca6e6b15507"}, + {file = "pywin32-227-cp37-cp37m-win_amd64.whl", hash = "sha256:31f88a89139cb2adc40f8f0e65ee56a8c585f629974f9e07622ba80199057511"}, + {file = "pywin32-227-cp38-cp38-win32.whl", hash = "sha256:7f18199fbf29ca99dff10e1f09451582ae9e372a892ff03a28528a24d55875bc"}, + {file = "pywin32-227-cp38-cp38-win_amd64.whl", hash = "sha256:7c1ae32c489dc012930787f06244426f8356e129184a02c25aef163917ce158e"}, + {file = "pywin32-227-cp39-cp39-win32.whl", hash = "sha256:c054c52ba46e7eb6b7d7dfae4dbd987a1bb48ee86debe3f245a2884ece46e295"}, + {file = "pywin32-227-cp39-cp39-win_amd64.whl", hash = "sha256:f27cec5e7f588c3d1051651830ecc00294f90728d19c3bf6916e6dba93ea357c"}, +] +pyyaml = [ + {file = "PyYAML-5.3.1-cp27-cp27m-win32.whl", hash = "sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f"}, + {file = "PyYAML-5.3.1-cp27-cp27m-win_amd64.whl", hash = "sha256:240097ff019d7c70a4922b6869d8a86407758333f02203e0fc6ff79c5dcede76"}, + {file = "PyYAML-5.3.1-cp35-cp35m-win32.whl", hash = "sha256:4f4b913ca1a7319b33cfb1369e91e50354d6f07a135f3b901aca02aa95940bd2"}, + {file = "PyYAML-5.3.1-cp35-cp35m-win_amd64.whl", hash = "sha256:cc8955cfbfc7a115fa81d85284ee61147059a753344bc51098f3ccd69b0d7e0c"}, + {file = "PyYAML-5.3.1-cp36-cp36m-win32.whl", hash = "sha256:7739fc0fa8205b3ee8808aea45e968bc90082c10aef6ea95e855e10abf4a37b2"}, + {file = "PyYAML-5.3.1-cp36-cp36m-win_amd64.whl", hash = "sha256:69f00dca373f240f842b2931fb2c7e14ddbacd1397d57157a9b005a6a9942648"}, + {file = "PyYAML-5.3.1-cp37-cp37m-win32.whl", hash = "sha256:d13155f591e6fcc1ec3b30685d50bf0711574e2c0dfffd7644babf8b5102ca1a"}, + {file = "PyYAML-5.3.1-cp37-cp37m-win_amd64.whl", hash = "sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf"}, + {file = "PyYAML-5.3.1-cp38-cp38-win32.whl", hash = "sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97"}, + {file = "PyYAML-5.3.1-cp38-cp38-win_amd64.whl", hash = "sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee"}, + {file = "PyYAML-5.3.1-cp39-cp39-win32.whl", hash = "sha256:ad9c67312c84def58f3c04504727ca879cb0013b2517c85a9a253f0cb6380c0a"}, + {file = "PyYAML-5.3.1-cp39-cp39-win_amd64.whl", hash = "sha256:6034f55dab5fea9e53f436aa68fa3ace2634918e8b5994d82f3621c04ff5ed2e"}, + {file = "PyYAML-5.3.1.tar.gz", hash = "sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d"}, +] +requests = [ + {file = "requests-2.25.0-py2.py3-none-any.whl", hash = "sha256:e786fa28d8c9154e6a4de5d46a1d921b8749f8b74e28bde23768e5e16eece998"}, + {file = "requests-2.25.0.tar.gz", hash = "sha256:7f1a0b932f4a60a1a65caa4263921bb7d9ee911957e0ae4a23a6dd08185ad5f8"}, +] +six = [ + {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, + {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"}, +] +texttable = [ + {file = "texttable-1.6.3-py2.py3-none-any.whl", hash = "sha256:f802f2ef8459058736264210f716c757cbf85007a30886d8541aa8c3404f1dda"}, + {file = "texttable-1.6.3.tar.gz", hash = "sha256:ce0faf21aa77d806bbff22b107cc22cce68dc9438f97a2df32c93e9afa4ce436"}, +] +toml = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] +urllib3 = [ + {file = "urllib3-1.26.2-py2.py3-none-any.whl", hash = "sha256:d8ff90d979214d7b4f8ce956e80f4028fc6860e4431f731ea4a8c08f23f99473"}, + {file = "urllib3-1.26.2.tar.gz", hash = "sha256:19188f96923873c92ccb987120ec4acaa12f0461fa9ce5d3d0772bc965a39e08"}, +] +virtualenv = [ + {file = "virtualenv-20.2.2-py2.py3-none-any.whl", hash = "sha256:54b05fc737ea9c9ee9f8340f579e5da5b09fb64fd010ab5757eb90268616907c"}, + {file = "virtualenv-20.2.2.tar.gz", hash = "sha256:b7a8ec323ee02fb2312f098b6b4c9de99559b462775bc8fe3627a73706603c1b"}, +] +websocket-client = [ + {file = "websocket_client-0.57.0-py2.py3-none-any.whl", hash = "sha256:0fc45c961324d79c781bab301359d5a1b00b13ad1b10415a4780229ef71a5549"}, + {file = "websocket_client-0.57.0.tar.gz", hash = "sha256:d735b91d6d1692a6a181f2a8c9e0238e5f6373356f561bb9dc4c7af36f452010"}, +] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..12c6d5ee --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,17 @@ +[tool.poetry] +name = "doodba" +version = "0.0.0" +description = "Docker Odoo Base, a highly opinionated image ready to put Odoo inside it, but without Odoo" +authors = ["Tecnativa"] + +[tool.poetry.dependencies] +python = "^3.9" + +[tool.poetry.dev-dependencies] +docker-compose = "^1.27.4" +plumbum = "^1.6.9" +pre-commit = "^2.9.3" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" From 1546381a03e5d7032c931bb76ecaeec6fe6c82be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Wed, 16 Dec 2020 12:13:16 +0000 Subject: [PATCH 130/255] Fix file reference --- tests/scaffoldings/dotd/custom/dependencies/pip.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scaffoldings/dotd/custom/dependencies/pip.txt b/tests/scaffoldings/dotd/custom/dependencies/pip.txt index 0bbb6fb5..8a08fee1 100644 --- a/tests/scaffoldings/dotd/custom/dependencies/pip.txt +++ b/tests/scaffoldings/dotd/custom/dependencies/pip.txt @@ -3,4 +3,4 @@ pycrypto==2.6.1 --no-binary :all: # Odoo pins docutils==0.12, so let's check it gets upgraded docutils==0.14 # External dependency files can be included too; example: numpy --r https://raw.githubusercontent.com/Tecnativa/doodba/master/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt +-r https://raw.githubusercontent.com/Tecnativa/doodba/6cec8ea6eefa9d8de8cff103cfca6e373f8fe910/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt From bb9e8c7a64fad36cf193f5870120275e25af38bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Wed, 16 Dec 2020 12:19:40 +0000 Subject: [PATCH 131/255] Use poetry in tests --- .github/workflows/ci.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 259cd5ad..47586d71 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -62,11 +62,15 @@ jobs: # Prepare - uses: actions/checkout@v2 - uses: actions/setup-python@v1 - - run: pip install -r requirements-ci.txt + # Install dev and test dependencies + - run: pip install poetry + - name: Patch $PATH + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - run: poetry install # Build images - - run: ./hooks/build + - run: poetry run ./hooks/build # Test - - run: python -m unittest -v tests + - run: poetry run python -m unittest -v tests # Push - name: push to docker hub if: github.repository == 'Tecnativa/doodba' && github.ref == 'refs/heads/master' From 4dc6846ac404f162e9a182631caf0316f0a1e418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Fri, 18 Dec 2020 11:42:06 +0000 Subject: [PATCH 132/255] Fix push action to run on poetry env As done before with build action, now use the poetry env instead of installing everything with pip --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 47586d71..62145cc9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -78,11 +78,11 @@ jobs: REGISTRY_HOST: docker.io REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} - run: ./hooks/push + run: poetry run ./hooks/push - name: push to github container registry if: github.repository == 'Tecnativa/doodba' && github.ref == 'refs/heads/master' env: REGISTRY_HOST: ghcr.io REGISTRY_PASSWORD: ${{ secrets.BOT_TOKEN }} REGISTRY_USERNAME: ${{ secrets.BOT_LOGIN }} - run: ./hooks/push + run: poetry run ./hooks/push From bfdfe5fc31b61b9009b3e4d95533e1c56074d593 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Tue, 22 Dec 2020 15:30:49 +0100 Subject: [PATCH 133/255] image: enable defining postgres client version on build --- 11.0.Dockerfile | 3 +- 12.0.Dockerfile | 3 +- 13.0.Dockerfile | 3 +- 14.0.Dockerfile | 2 +- 8.0.Dockerfile | 6 ++-- bin/direxec | 4 +-- build.d/250-postgres-client | 9 ++++++ tests/__init__.py | 32 +++++++++++++++++++ .../postgres_client_version/Dockerfile | 2 ++ .../custom/src/addons.yaml | 0 .../docker-compose.yaml | 31 ++++++++++++++++++ 11 files changed, 85 insertions(+), 10 deletions(-) create mode 100755 build.d/250-postgres-client create mode 100644 tests/scaffoldings/postgres_client_version/Dockerfile create mode 100644 tests/scaffoldings/postgres_client_version/custom/src/addons.yaml create mode 100644 tests/scaffoldings/postgres_client_version/docker-compose.yaml diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 5ba36e01..e62502ad 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -55,7 +55,7 @@ RUN apt-get -qq update \ && curl https://bootstrap.pypa.io/get-pip.py | python3 /dev/stdin \ && curl -sL https://deb.nodesource.com/setup_6.x | bash - \ && apt-get update \ - && apt-get install -yqq --no-install-recommends nodejs postgresql-client \ + && apt-get install -yqq --no-install-recommends nodejs \ && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.stretch_amd64.deb \ && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ && apt-get install -yqq --no-install-recommends ./wkhtmltox.deb \ @@ -221,6 +221,7 @@ ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ && ln -s /opt/odoo/custom/ssh ~root/.ssh \ && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ && sync +ONBUILD ARG DB_VERSION=latest ONBUILD RUN /opt/odoo/common/build && sync ONBUILD VOLUME ["/var/lib/odoo"] ONBUILD USER odoo diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 6a30b7ab..2924572c 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -55,7 +55,7 @@ RUN apt-get -qq update \ && curl https://bootstrap.pypa.io/get-pip.py | python3 /dev/stdin \ && curl -sL https://deb.nodesource.com/setup_8.x | bash - \ && apt-get update \ - && apt-get install -yqq --no-install-recommends nodejs postgresql-client \ + && apt-get install -yqq --no-install-recommends nodejs \ && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.stretch_amd64.deb \ && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ && apt-get install -yqq --no-install-recommends ./wkhtmltox.deb \ @@ -216,6 +216,7 @@ ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ && ln -s /opt/odoo/custom/ssh ~root/.ssh \ && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ && sync +ONBUILD ARG DB_VERSION=latest ONBUILD RUN /opt/odoo/common/build && sync ONBUILD VOLUME ["/var/lib/odoo"] ONBUILD USER odoo diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 55e88fb2..62c789f5 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -59,7 +59,7 @@ RUN apt-get -qq update \ && echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ - && apt-get install -yqq --no-install-recommends postgresql-client \ + && apt-get install -yqq --no-install-recommends \ && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ @@ -229,6 +229,7 @@ ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ && ln -s /opt/odoo/custom/ssh ~root/.ssh \ && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ && sync +ONBUILD ARG DB_VERSION=latest ONBUILD RUN /opt/odoo/common/build && sync ONBUILD VOLUME ["/var/lib/odoo"] ONBUILD USER odoo diff --git a/14.0.Dockerfile b/14.0.Dockerfile index bd683d7e..7dfc3445 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -56,7 +56,6 @@ RUN apt-get -qq update \ && echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ - && apt-get install -yqq --no-install-recommends postgresql-client \ && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ @@ -225,6 +224,7 @@ ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ && ln -s /opt/odoo/custom/ssh ~root/.ssh \ && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ && sync +ONBUILD ARG DB_VERSION=latest ONBUILD RUN /opt/odoo/common/build && sync ONBUILD VOLUME ["/var/lib/odoo"] ONBUILD USER odoo diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 9e063a37..0f58847b 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -64,12 +64,9 @@ RUN sed -Ei 's@(^deb http://deb.debian.org/debian jessie-updates main$)@#\1@' /e && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ && rm -Rf /var/lib/apt/lists/* -# Special case to get latest PostgreSQL client +# Special case to get latest PostgreSQL client in 250-postgres-client RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ - && apt-get update \ - && apt-get install -y --no-install-recommends postgresql-client \ - && rm -Rf /var/lib/apt/lists/* /tmp/* # Special case to get latest Less and PhantomJS RUN ln -s /usr/bin/nodejs /usr/local/bin/node \ @@ -218,6 +215,7 @@ ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ && ln -s /opt/odoo/custom/ssh ~root/.ssh \ && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ && sync +ONBUILD ARG DB_VERSION=latest ONBUILD RUN /opt/odoo/common/build && sync ONBUILD VOLUME ["/var/lib/odoo"] ONBUILD USER odoo diff --git a/bin/direxec b/bin/direxec index 3fe1bc97..adecba7b 100755 --- a/bin/direxec +++ b/bin/direxec @@ -8,8 +8,6 @@ from logging import DEBUG, INFO, WARNING from doodbalib import logger, which -from psycopg2 import OperationalError, connect - # Call this file linked from another file called `build` or `entrypoint` mode = os.path.basename(__file__) @@ -39,6 +37,8 @@ if extra_command: # Set the DB creation language, if needed if extra_command[0] in {"odoo", "/usr/local/bin/odoo"}: if os.environ.get("INITIAL_LANG"): + from psycopg2 import OperationalError, connect + try: connection = connect(dbname=os.environ.get("PGDATABASE")) connection.close() diff --git a/build.d/250-postgres-client b/build.d/250-postgres-client new file mode 100755 index 00000000..b96f7bec --- /dev/null +++ b/build.d/250-postgres-client @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +apt-get update +if [[ "$DB_VERSION" != "latest" ]] ; then + apt-get install -yqq postgresql-client-$DB_VERSION +else + apt-get install -yqq postgresql-client +fi diff --git a/tests/__init__.py b/tests/__init__.py index 014abf9b..894a8792 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -532,6 +532,38 @@ def test_geoip(self): ), ) + def test_postgres_client_version(self): + postgres_client_version_dir = join(SCAFFOLDINGS_DIR, "postgres_client_version") + for sub_env in matrix(): + self.compose_test( + postgres_client_version_dir, + sub_env, + ("psql", "--version"), + # verify that psql --version is as expected + ( + "bash", + "-c", + '[[ "$(psql --version)" == "psql (PostgreSQL) %s."* ]]' + % sub_env["DB_VERSION"], + ), + ("pg_dump", "--version"), + # verify that pg_dump --version is as expected + ( + "bash", + "-c", + '[[ "$(pg_dump --version)" == "pg_dump (PostgreSQL) %s."* ]]' + % sub_env["DB_VERSION"], + ), + ("pg_restore", "--version"), + # verify that pg_restore --version is as expected + ( + "bash", + "-c", + '[[ "$(pg_restore --version)" == "pg_restore (PostgreSQL) %s."* ]]' + % sub_env["DB_VERSION"], + ), + ) + if __name__ == "__main__": unittest.main() diff --git a/tests/scaffoldings/postgres_client_version/Dockerfile b/tests/scaffoldings/postgres_client_version/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/postgres_client_version/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/postgres_client_version/custom/src/addons.yaml b/tests/scaffoldings/postgres_client_version/custom/src/addons.yaml new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/postgres_client_version/docker-compose.yaml b/tests/scaffoldings/postgres_client_version/docker-compose.yaml new file mode 100644 index 00000000..f3241e6a --- /dev/null +++ b/tests/scaffoldings/postgres_client_version/docker-compose.yaml @@ -0,0 +1,31 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + PIP_INSTALL_ODOO: "false" + WITHOUT_DEMO: "false" + DB_VERSION: ${DB_VERSION} + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + volumes: + - filestore:/var/lib/odoo:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: From 25657f97736fc688045d8b87eff979b14adfcfd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Tue, 12 Jan 2021 13:22:18 +0000 Subject: [PATCH 134/255] Add option to have multiple addons versions defined in different environments Checking for duplicates in `doodbalib` was impeding having the same addon defined more than once in `addons.yaml`, even if when it was for different environments. This moves that check to the entrypoint, to be executed only when symlinking the addons. Also add tests for that situation TT27711 --- lib/doodbalib/__init__.py | 5 ++-- tests/__init__.py | 29 ++++++++++++++++++ .../scaffoldings/addons_env_double/Dockerfile | 2 ++ .../addons_env_double/custom/src/addons.yaml | 12 ++++++++ .../addons_env_double/custom/src/repos.yaml | 25 ++++++++++++++++ .../addons_env_double/docker-compose.yaml | 30 +++++++++++++++++++ 6 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 tests/scaffoldings/addons_env_double/Dockerfile create mode 100644 tests/scaffoldings/addons_env_double/custom/src/addons.yaml create mode 100644 tests/scaffoldings/addons_env_double/custom/src/repos.yaml create mode 100644 tests/scaffoldings/addons_env_double/docker-compose.yaml diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index ac536b78..959cabe6 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -159,11 +159,12 @@ def addons_config(filtered=True, strict=False): continue repos.discard(CORE) # Other addons fall in between - if len(repos) != 1: + if filtered and len(repos) != 1: raise AddonsConfigError( u"Addon {} defined in several repos {}".format(addon, repos) ) - yield addon, repos.pop() + for repo in repos: + yield addon, repo try: diff --git a/tests/__init__.py b/tests/__init__.py index 894a8792..c2be449e 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -327,6 +327,35 @@ def test_addons_env(self): ("test", "-d", "auto/addons/crm/migrations"), ) + # HACK https://github.com/itpp-labs/misc-addons/issues/1014 + # TODO Remove decorator + @prerelease_skip + def test_addons_env_double(self): + """Test double addon reference in addons.yaml""" + common_tests = ( + ("test", "-d", "custom/src/rma-old/rma"), + ("test", "!", "-d", "custom/src/rma-old/rma_sale"), + ("test", "-d", "custom/src/rma-new/rma"), + ("test", "!", "-d", "custom/src/rma-new/rma_sale"), + ) + # Old versions are skiped because they don't support __manifest__.py, + # and the test is hacking ODOO_VERSION to pin a commit + for sub_env in matrix(odoo_skip={"7.0", "8.0", "9.0"}): + self.compose_test( + join(SCAFFOLDINGS_DIR, "addons_env_double"), + dict(sub_env, DOODBA_ENVIRONMENT="test"), + *common_tests, + # Check version is 12.0.1.6.1 + ("grep", "-q", "12.0.1.6.1", "auto/addons/rma/__manifest__.py"), + ) + self.compose_test( + join(SCAFFOLDINGS_DIR, "addons_env_double"), + dict(sub_env, DOODBA_ENVIRONMENT="prod"), + *common_tests, + # Check version is 12.0.2.0.0 + ("grep", "-q", "12.0.2.0.0", "auto/addons/rma/__manifest__.py"), + ) + def test_dotd(self): """Test environment with common ``*.d`` directories.""" for sub_env in matrix(): diff --git a/tests/scaffoldings/addons_env_double/Dockerfile b/tests/scaffoldings/addons_env_double/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/addons_env_double/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/addons_env_double/custom/src/addons.yaml b/tests/scaffoldings/addons_env_double/custom/src/addons.yaml new file mode 100644 index 00000000..226028fc --- /dev/null +++ b/tests/scaffoldings/addons_env_double/custom/src/addons.yaml @@ -0,0 +1,12 @@ +--- +ONLY: + DOODBA_ENVIRONMENT: + - test +rma-old: # rma should have version 12.0.1.6.1 + - rma +--- +ONLY: + DOODBA_ENVIRONMENT: + - prod +rma-new: # rma should have version 12.0.2.0.0 + - rma diff --git a/tests/scaffoldings/addons_env_double/custom/src/repos.yaml b/tests/scaffoldings/addons_env_double/custom/src/repos.yaml new file mode 100644 index 00000000..e3c00dac --- /dev/null +++ b/tests/scaffoldings/addons_env_double/custom/src/repos.yaml @@ -0,0 +1,25 @@ +# Odoo is always required +./odoo: + defaults: + # Shallow repositores are faster & thinner + depth: $DEPTH_DEFAULT + remotes: + ocb: https://github.com/OCA/OCB.git + odoo: https://github.com/odoo/odoo.git + target: ocb $ODOO_VERSION + merges: + - ocb $ODOO_VERSION + +rma-old: + remotes: + origin: https://github.com/OCA/rma.git + target: origin _merged_branch + merges: + - origin 242b7e21a174e48f713459f836794560e68290de # rma v12.0.1.6.1 + +rma-new: + remotes: + origin: https://github.com/OCA/rma.git + target: origin _merged_branch + merges: + - origin 96d2081987292ae02efda9826cbe5ba1ad84d6c3 # rma v12.0.2.0.0 diff --git a/tests/scaffoldings/addons_env_double/docker-compose.yaml b/tests/scaffoldings/addons_env_double/docker-compose.yaml new file mode 100644 index 00000000..bccd0a99 --- /dev/null +++ b/tests/scaffoldings/addons_env_double/docker-compose.yaml @@ -0,0 +1,30 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + WITHOUT_DEMO: "false" + tty: true + depends_on: + - db + environment: + DOODBA_ENVIRONMENT: "$DOODBA_ENVIRONMENT" + PYTHONOPTIMIZE: "" + UNACCENT: "false" + volumes: + - filestore:/var/lib/odoo:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: From cef920824470763030f208e53848fa9132ed5dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Mon, 1 Feb 2021 12:13:08 +0000 Subject: [PATCH 135/255] Fix builds for pip bootstrap https://bootstrap.pypa.io/ started using python >3.5 syntax for the get-pip.py script. It is, then, necessary to fetch the correct version for each image. Fixes latest build errors: https://github.com/Tecnativa/doodba/runs/1799238330?check_suite_focus=true#step:7:1000 --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 8.0.Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index e62502ad..fa5afad7 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -52,7 +52,7 @@ RUN apt-get -qq update \ zlibc \ && echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ - && curl https://bootstrap.pypa.io/get-pip.py | python3 /dev/stdin \ + && curl https://bootstrap.pypa.io/3.5/get-pip.py | python3 /dev/stdin \ && curl -sL https://deb.nodesource.com/setup_6.x | bash - \ && apt-get update \ && apt-get install -yqq --no-install-recommends nodejs \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 2924572c..920aa2f3 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -52,7 +52,7 @@ RUN apt-get -qq update \ zlibc \ && echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ - && curl https://bootstrap.pypa.io/get-pip.py | python3 /dev/stdin \ + && curl https://bootstrap.pypa.io/3.5/get-pip.py | python3 /dev/stdin \ && curl -sL https://deb.nodesource.com/setup_8.x | bash - \ && apt-get update \ && apt-get install -yqq --no-install-recommends nodejs \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 0f58847b..b2dc08e9 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -48,7 +48,7 @@ RUN sed -Ei 's@(^deb http://deb.debian.org/debian jessie-updates main$)@#\1@' /e locales-all zlibc \ bzip2 ca-certificates curl gettext git nano \ openssh-client telnet xz-utils \ - && curl https://bootstrap.pypa.io/get-pip.py | python /dev/stdin \ + && curl https://bootstrap.pypa.io/2.7/get-pip.py | python /dev/stdin \ && curl -sL https://deb.nodesource.com/setup_6.x | bash - \ && apt-get install -yqq nodejs \ && curl -SLo fonts-liberation2.deb http://ftp.debian.org/debian/pool/main/f/fonts-liberation2/fonts-liberation2_2.00.1-3_all.deb \ From 841cf3fb43e897b9f6ae8c7b01b1b3d3a7b1f030 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 8 Mar 2021 08:04:10 +0100 Subject: [PATCH 136/255] [FIX] pip: pip for python 3.5 (and 2.7) url has changed ``` Hi there! The URL you are using to fetch this script has changed, and this one will no longer work. Please use get-pip.py from the following URL instead: https://bootstrap.pypa.io/pip/3.5/get-pip.py Sorry if this change causes any inconvenience for you! We don't have a good mechanism to make more gradual changes here, and this renaming is a part of an effort to make it easier to us to update these scripts, when there's a pip release. It's also essential for improving how we handle the `get-pip.py` scripts, when pip drops support for a Python minor version. There are no more renames/URL changes planned, and we don't expect that a need would arise to do this again in the near future. Thanks for understanding! - Pradyun, on behalf of the volunteers who maintain pip. ``` --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 8.0.Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index fa5afad7..53fa020f 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -52,7 +52,7 @@ RUN apt-get -qq update \ zlibc \ && echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ - && curl https://bootstrap.pypa.io/3.5/get-pip.py | python3 /dev/stdin \ + && curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3 /dev/stdin \ && curl -sL https://deb.nodesource.com/setup_6.x | bash - \ && apt-get update \ && apt-get install -yqq --no-install-recommends nodejs \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 920aa2f3..ebf86642 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -52,7 +52,7 @@ RUN apt-get -qq update \ zlibc \ && echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ - && curl https://bootstrap.pypa.io/3.5/get-pip.py | python3 /dev/stdin \ + && curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3 /dev/stdin \ && curl -sL https://deb.nodesource.com/setup_8.x | bash - \ && apt-get update \ && apt-get install -yqq --no-install-recommends nodejs \ diff --git a/8.0.Dockerfile b/8.0.Dockerfile index b2dc08e9..b8eb32a4 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -48,7 +48,7 @@ RUN sed -Ei 's@(^deb http://deb.debian.org/debian jessie-updates main$)@#\1@' /e locales-all zlibc \ bzip2 ca-certificates curl gettext git nano \ openssh-client telnet xz-utils \ - && curl https://bootstrap.pypa.io/2.7/get-pip.py | python /dev/stdin \ + && curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python /dev/stdin \ && curl -sL https://deb.nodesource.com/setup_6.x | bash - \ && apt-get install -yqq nodejs \ && curl -SLo fonts-liberation2.deb http://ftp.debian.org/debian/pool/main/f/fonts-liberation2/fonts-liberation2_2.00.1-3_all.deb \ From 8d438c4a95b595f618775e84d6ff55febb8ac3c0 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 8 Mar 2021 10:32:51 +0100 Subject: [PATCH 137/255] [FIX] tests: replace yanked aloha_world by hello-world to test gem install --- tests/__init__.py | 9 +++++++-- .../dependencies/custom/dependencies/270-gem.txt | 2 +- .../dotd/custom/build.d/201-assert-dependencies | 2 +- tests/scaffoldings/dotd/custom/dependencies/gem.txt | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index c2be449e..a7552b9a 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -374,7 +374,12 @@ def test_dotd(self): ("busybox", "whoami"), ("bash", "-xc", "echo $NODE_PATH"), ("node", "-e", "require('test-npm-install')"), - ("aloha_world",), + ("hello-world",), + ( + "bash", + "-c", + 'test "$(hello-world)" == "this is executable hello-world"', + ), ("python", "-xc", "import Crypto; print(Crypto.__version__)"), ("sh", "-xc", "rst2html.py --version | grep 'Docutils 0.14'"), # ``requirements.txt`` from addon repos were processed @@ -439,7 +444,7 @@ def test_dependencies(self): ("sh", "-xc", "rst2html.py --version | grep 'Docutils 0.14'"), # 270-gem.txt ("test", "-f", "custom/dependencies/270-gem.txt"), - ("aloha_world",), + ("hello-world",), ) def test_modified_uids(self): diff --git a/tests/scaffoldings/dependencies/custom/dependencies/270-gem.txt b/tests/scaffoldings/dependencies/custom/dependencies/270-gem.txt index fd48e218..ce51ab87 100644 --- a/tests/scaffoldings/dependencies/custom/dependencies/270-gem.txt +++ b/tests/scaffoldings/dependencies/custom/dependencies/270-gem.txt @@ -1,2 +1,2 @@ # This line should be ignored -aloha_world +hello-world diff --git a/tests/scaffoldings/dotd/custom/build.d/201-assert-dependencies b/tests/scaffoldings/dotd/custom/build.d/201-assert-dependencies index fff7bbc0..04d2692d 100755 --- a/tests/scaffoldings/dotd/custom/build.d/201-assert-dependencies +++ b/tests/scaffoldings/dotd/custom/build.d/201-assert-dependencies @@ -2,6 +2,6 @@ # Dependencies are processed at step 200 set -ex which busybox -aloha_world +hello-world node -e "require('test-npm-install')" python -c "import numpy, Crypto" diff --git a/tests/scaffoldings/dotd/custom/dependencies/gem.txt b/tests/scaffoldings/dotd/custom/dependencies/gem.txt index fd48e218..ce51ab87 100644 --- a/tests/scaffoldings/dotd/custom/dependencies/gem.txt +++ b/tests/scaffoldings/dotd/custom/dependencies/gem.txt @@ -1,2 +1,2 @@ # This line should be ignored -aloha_world +hello-world From f239fc68b769a09a33ad8facf30975f7775ee0a7 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 8 Mar 2021 14:06:38 +0100 Subject: [PATCH 138/255] [FIX] autoaggrate: do not chown symlinks when chowning symlinks, os.chown modifies the target instead of the symlink as the target (if under SRC_DIR) should be chowned separately it's ok to skip chowning symlinks. this prevents unclear error messages where it looks like the symlink does not exist (when in fact it's the target file) and gives the same result as if we are chowning targets via symlinks twice. --- bin/autoaggregate | 8 ++++- tests/__init__.py | 32 +++++++++++++++++++ tests/scaffoldings/symlinks/Dockerfile | 2 ++ .../symlinks/custom/src/addons.yaml | 2 ++ .../custom/src/repo_with_links/addon_alias | 1 + .../src/repo_with_links/broken_addon_link | 1 + .../custom/src/repo_with_links/danger/date | 1 + .../scaffoldings/symlinks/docker-compose.yaml | 29 +++++++++++++++++ 8 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 tests/scaffoldings/symlinks/Dockerfile create mode 100644 tests/scaffoldings/symlinks/custom/src/addons.yaml create mode 120000 tests/scaffoldings/symlinks/custom/src/repo_with_links/addon_alias create mode 120000 tests/scaffoldings/symlinks/custom/src/repo_with_links/broken_addon_link create mode 120000 tests/scaffoldings/symlinks/custom/src/repo_with_links/danger/date create mode 100644 tests/scaffoldings/symlinks/docker-compose.yaml diff --git a/bin/autoaggregate b/bin/autoaggregate index 9a8c0295..737b7f2f 100755 --- a/bin/autoaggregate +++ b/bin/autoaggregate @@ -63,7 +63,13 @@ def aggregate(config): for root, dirs, files in os.walk(SRC_DIR): for target in dirs + files: try: - os.chown(os.path.join(root, target), UID, GID) + target_path = os.path.join(root, target) + if not os.path.islink(target_path): + # if target_path is a link we would only chown the + # target, as the target should be chowned separately + # we can skip all symlinks and prevent showing + # unclear errors + os.chown(target_path, UID, GID) except Exception: logger.debug( "Error trying to chown on file. Skipping...", exc_info=True diff --git a/tests/__init__.py b/tests/__init__.py index a7552b9a..4019fc2e 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -598,6 +598,38 @@ def test_postgres_client_version(self): ), ) + def test_symlinks(self): + symlink_dir = join(SCAFFOLDINGS_DIR, "symlinks") + for sub_env in matrix(): + self.compose_test( + symlink_dir, + sub_env, + # there should be no addon for broken symlinks + ("test", "!", "-e", "/opt/odoo/auto/addons/broken_addon_link"), + # there should be an addon for working symlinks + ("test", "-e", "/opt/odoo/auto/addons/addon_alias"), + # and the addon should have a manifest (this addon link would probably not work in odoo, + # we are just testing filesystem here) + ( + "test", + "-e", + "/opt/odoo/auto/addons/addon_alias/__manifest__.py", + "-o", + "-e", + "/opt/odoo/auto/addons/addon_alias/__openerp__.py", + ), + # verify that symlinking outside the src directory doesn't enable changing permission of important stuff + ("bash", "-c", '[[ "$(stat -c %U:%G /bin/date)" == "root:root" ]]',), + # verify that everything in src dir (except symlinks) is accessible by odoo + ( + "bash", + "-c", + "files=$(find /opt/odoo/custom/src -not -group odoo -and -not -type l " + " | wc -l) &&" + " [[ $files == 0 ]]", + ), + ) + if __name__ == "__main__": unittest.main() diff --git a/tests/scaffoldings/symlinks/Dockerfile b/tests/scaffoldings/symlinks/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/symlinks/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/symlinks/custom/src/addons.yaml b/tests/scaffoldings/symlinks/custom/src/addons.yaml new file mode 100644 index 00000000..38fb777f --- /dev/null +++ b/tests/scaffoldings/symlinks/custom/src/addons.yaml @@ -0,0 +1,2 @@ +./repo_with_links: + - addon_alias diff --git a/tests/scaffoldings/symlinks/custom/src/repo_with_links/addon_alias b/tests/scaffoldings/symlinks/custom/src/repo_with_links/addon_alias new file mode 120000 index 00000000..85ff76ca --- /dev/null +++ b/tests/scaffoldings/symlinks/custom/src/repo_with_links/addon_alias @@ -0,0 +1 @@ +../odoo/addons/web \ No newline at end of file diff --git a/tests/scaffoldings/symlinks/custom/src/repo_with_links/broken_addon_link b/tests/scaffoldings/symlinks/custom/src/repo_with_links/broken_addon_link new file mode 120000 index 00000000..8681f8b8 --- /dev/null +++ b/tests/scaffoldings/symlinks/custom/src/repo_with_links/broken_addon_link @@ -0,0 +1 @@ +base \ No newline at end of file diff --git a/tests/scaffoldings/symlinks/custom/src/repo_with_links/danger/date b/tests/scaffoldings/symlinks/custom/src/repo_with_links/danger/date new file mode 120000 index 00000000..884ba3e7 --- /dev/null +++ b/tests/scaffoldings/symlinks/custom/src/repo_with_links/danger/date @@ -0,0 +1 @@ +/bin/date \ No newline at end of file diff --git a/tests/scaffoldings/symlinks/docker-compose.yaml b/tests/scaffoldings/symlinks/docker-compose.yaml new file mode 100644 index 00000000..5cb154cd --- /dev/null +++ b/tests/scaffoldings/symlinks/docker-compose.yaml @@ -0,0 +1,29 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + WITHOUT_DEMO: "false" + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + volumes: + - filestore:/var/lib/odoo:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: From 02283864c451d087de40676751eeda78cebdc926 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Wed, 10 Mar 2021 11:51:05 +0100 Subject: [PATCH 139/255] [FIX] pg_activity: use max version 2.0.3 (2.1.0 is not working with <=13.0 image psycopg2 dependency) --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 13.0.Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 53fa020f..01d28612 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -82,7 +82,7 @@ RUN pip install \ astor \ click-odoo-contrib \ git-aggregator \ - pg_activity \ + "pg_activity<=2.0.3" \ plumbum \ ptvsd \ debugpy \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index ebf86642..403b8c26 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -77,7 +77,7 @@ RUN pip install \ astor \ click-odoo-contrib \ git-aggregator \ - pg_activity \ + "pg_activity<=2.0.3" \ plumbum \ ptvsd \ debugpy \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 62c789f5..7d91ef18 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -131,7 +131,7 @@ RUN build_deps=" \ astor \ git-aggregator \ click-odoo-contrib \ - pg_activity \ + "pg_activity<=2.0.3" \ phonenumbers \ plumbum \ ptvsd \ From 9154e397e79017cf8dcc68a8670c23511d6c0867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Wed, 31 Mar 2021 12:39:28 +0100 Subject: [PATCH 140/255] Add preparedb script Prepopulates DB with helpful simple data Add tests TT27635 --- bin/preparedb | 18 ++++++++++++++++++ tests/__init__.py | 3 +++ .../scripts/test_ir_config_parameters.py | 16 ++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100755 bin/preparedb create mode 100755 tests/scaffoldings/settings/custom/scripts/test_ir_config_parameters.py diff --git a/bin/preparedb b/bin/preparedb new file mode 100755 index 00000000..b8a06634 --- /dev/null +++ b/bin/preparedb @@ -0,0 +1,18 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Script to prepare the database with initial data + +import click +import click_odoo + + +@click.command() +@click_odoo.env_options(default_log_level="info", database_must_exist=True) +def main(env): + """Set report.url in the database to be pointing at localhost.""" + env["ir.config_parameter"].set_param("report.url", "http://localhost:8069") + env.cr.commit() + + +if __name__ == "__main__": + main() diff --git a/tests/__init__.py b/tests/__init__.py index 4019fc2e..d88ede56 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -238,6 +238,9 @@ def test_settings(self): """test "$(psql -Atqc "SELECT code FROM res_lang WHERE active = TRUE")" == es_ES""", ), + # If `preparedb` is executed, we should have `report.url` set + ("preparedb",), + ("./custom/scripts/test_ir_config_parameters.py",), ) for sub_env in matrix(odoo_skip={"7.0", "8.0", "9.0"}): self.compose_test(folder, sub_env, *commands) diff --git a/tests/scaffoldings/settings/custom/scripts/test_ir_config_parameters.py b/tests/scaffoldings/settings/custom/scripts/test_ir_config_parameters.py new file mode 100755 index 00000000..ff4a74e7 --- /dev/null +++ b/tests/scaffoldings/settings/custom/scripts/test_ir_config_parameters.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import click +import click_odoo + + +@click.command() +@click_odoo.env_options(default_log_level="error") +def main(env): + """Set report.url in the database to be pointing at localhost.""" + assert env["ir.config_parameter"].get_param("report.url") == "http://localhost:8069" + + +if __name__ == "__main__": + main() From 20dfe8a42487ce00f8220d56e06263c296bfd6db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Thu, 1 Apr 2021 13:19:13 +0100 Subject: [PATCH 141/255] Remove images bellow v11 from CI As builds fail, don't build or test in CI --- .github/workflows/ci.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 62145cc9..dee6b05d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,15 +39,6 @@ jobs: - "13.0" - "12.0" - "11.0" - - "10.0" - # Test older Odoo versions with older Postgres versions - include: - - odoo_version: "9.0" - pg_version: "11" - - odoo_version: "8.0" - pg_version: "10" - - odoo_version: "7.0" - pg_version: "9.6" env: # Indicates what's the equivalent to tecnativa/doodba:latest image LATEST_RELEASE: "14.0" From 1cd64e87fbd64df9a0eaaf0c07de5760775f5ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Mon, 5 Apr 2021 11:01:14 +0100 Subject: [PATCH 142/255] Remove tests for older versions --- tests/__init__.py | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index d88ede56..41e26ae3 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -15,9 +15,7 @@ DIR = dirname(__file__) ODOO_PREFIX = ("odoo", "--stop-after-init", "--workers=0") -ODOO_VERSIONS = frozenset( - environ.get("DOCKER_TAG", "7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0").split() -) +ODOO_VERSIONS = frozenset(environ.get("DOCKER_TAG", "11.0 12.0 13.0 14.0").split()) PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "13").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") GEIOP_CREDENTIALS_PROVIDED = environ.get("GEOIP_LICENSE_KEY", False) and environ.get( @@ -153,8 +151,6 @@ def test_addons_filtered(self): ("bash", "-xc", 'test -z "$(addons list -p)"'), ("bash", "-xc", 'test "$(addons list -c)" == crm,sale'), ) - # Skip Odoo versions that don't support __manifest__.py files - for sub_env in matrix(odoo_skip={"7.0", "8.0", "9.0"}): self.compose_test( project_dir, dict(sub_env, DBNAME="prod"), @@ -220,16 +216,12 @@ def test_settings(self): # Odoo settings work ("./custom/scripts/test_settings.py",), ) - if ODOO_VERSIONS & {"9.0", "10.0", "11.0"}: + if "11.0" in ODOO_VERSIONS: commands += ( # Check Odoo settings using python-odoo-shell, which is available # only for Odoo 9-11 (for 8 too, but it had no built-in shell) ("./custom/scripts/test_settings_python_odoo_shell.py",), ) - # --load-language doesn't work fine in Odoo 9.0 - for sub_env in matrix(odoo={"9.0"}): - self.compose_test(folder, sub_env, *commands) - # Extra tests for versions >= 10.0, that support --load-language fine commands += ( # DB was created with the correct language ( @@ -242,7 +234,7 @@ def test_settings(self): ("preparedb",), ("./custom/scripts/test_ir_config_parameters.py",), ) - for sub_env in matrix(odoo_skip={"7.0", "8.0", "9.0"}): + for sub_env in matrix(): self.compose_test(folder, sub_env, *commands) def test_smallest(self): @@ -297,27 +289,18 @@ def test_smallest(self): ("bash", "-xc", "! geoipupdate"), ) smallest_dir = join(SCAFFOLDINGS_DIR, "smallest") - for sub_env in matrix(odoo_skip={"7.0", "8.0"}): + for sub_env in matrix(): self.compose_test( smallest_dir, sub_env, *commands, ("python", "-c", "import watchdog") ) - for sub_env in matrix(odoo={"8.0"}): - self.compose_test( - smallest_dir, - sub_env, - # Odoo <= 8.0 does not autocreate the database - ("createdb",), - *commands, - ) # HACK https://github.com/itpp-labs/misc-addons/issues/1014 # TODO Remove decorator @prerelease_skip def test_addons_env(self): """Test environment variables in addons.yaml""" - # Old versions are skiped because they don't support __manifest__.py, - # and the test is hacking ODOO_VERSION to pin a commit - for sub_env in matrix(odoo_skip={"7.0", "8.0", "9.0"}): + # The test is hacking ODOO_VERSION to pin a commit + for sub_env in matrix(): self.compose_test( join(SCAFFOLDINGS_DIR, "addons_env"), sub_env, @@ -341,9 +324,8 @@ def test_addons_env_double(self): ("test", "-d", "custom/src/rma-new/rma"), ("test", "!", "-d", "custom/src/rma-new/rma_sale"), ) - # Old versions are skiped because they don't support __manifest__.py, - # and the test is hacking ODOO_VERSION to pin a commit - for sub_env in matrix(odoo_skip={"7.0", "8.0", "9.0"}): + # The test is hacking ODOO_VERSION to pin a commit + for sub_env in matrix(): self.compose_test( join(SCAFFOLDINGS_DIR, "addons_env_double"), dict(sub_env, DOODBA_ENVIRONMENT="test"), @@ -406,7 +388,7 @@ def test_dotd(self): def test_dependencies(self): """Test dependencies installation.""" dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies") - for sub_env in matrix(odoo_skip={"7.0"}): + for sub_env in matrix(): self.compose_test( dependencies_dir, sub_env, From 1ad4dfc2b88523cabc260872b40d8832217178d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Mon, 5 Apr 2021 11:08:46 +0100 Subject: [PATCH 143/255] Remove old dockerfiles and version specific scripts --- 10.0.Dockerfile | 1 - 7.0.Dockerfile | 1 - 8.0.Dockerfile | 223 -------------------------------------- 9.0.Dockerfile | 1 - bin-deprecated/install.sh | 56 ---------- bin/config-generate | 4 +- build.d/700-odoo-install | 18 --- lib/doodbalib/__init__.py | 2 - 8 files changed, 1 insertion(+), 305 deletions(-) delete mode 120000 10.0.Dockerfile delete mode 120000 7.0.Dockerfile delete mode 100644 8.0.Dockerfile delete mode 120000 9.0.Dockerfile delete mode 100755 bin-deprecated/install.sh diff --git a/10.0.Dockerfile b/10.0.Dockerfile deleted file mode 120000 index 04c2b0a4..00000000 --- a/10.0.Dockerfile +++ /dev/null @@ -1 +0,0 @@ -8.0.Dockerfile \ No newline at end of file diff --git a/7.0.Dockerfile b/7.0.Dockerfile deleted file mode 120000 index 04c2b0a4..00000000 --- a/7.0.Dockerfile +++ /dev/null @@ -1 +0,0 @@ -8.0.Dockerfile \ No newline at end of file diff --git a/8.0.Dockerfile b/8.0.Dockerfile deleted file mode 100644 index b8eb32a4..00000000 --- a/8.0.Dockerfile +++ /dev/null @@ -1,223 +0,0 @@ -FROM debian:8 AS base - -EXPOSE 8069 8072 - -ARG GEOIP_UPDATER_VERSION=4.1.5 -ARG MQT=https://github.com/OCA/maintainer-quality-tools.git -ARG WKHTMLTOPDF_VERSION=0.12.5 -ARG WKHTMLTOPDF_CHECKSUM='2583399a865d7604726da166ee7cec656b87ae0a6016e6bce7571dcd3045f98b' -ENV DB_FILTER=.* \ - DEPTH_DEFAULT=1 \ - DEPTH_MERGE=100 \ - EMAIL=https://hub.docker.com/r/tecnativa/odoo \ - GEOIP_ACCOUNT_ID="" \ - GEOIP_LICENSE_KEY="" \ - GIT_AUTHOR_NAME=docker-odoo \ - INITIAL_LANG="" \ - LC_ALL=C.UTF-8 \ - LIST_DB=false \ - NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \ - OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ - PATH="/home/odoo/.local/bin:$PATH" \ - PIP_NO_CACHE_DIR=0 \ - PTVSD_ARGS="--host 0.0.0.0 --port 6899 --wait --multiprocess" \ - PTVSD_ENABLE=0 \ - DEBUGPY_ARGS="--listen 0.0.0.0:6899 --wait-for-client" \ - DEBUGPY_ENABLE=0 \ - PUDB_RDB_HOST=0.0.0.0 \ - PUDB_RDB_PORT=6899 \ - PYTHONOPTIMIZE=1 \ - UNACCENT=true \ - WAIT_DB=true \ - WDB_NO_BROWSER_AUTO_OPEN=True \ - WDB_SOCKET_SERVER=wdb \ - WDB_WEB_PORT=1984 \ - WDB_WEB_SERVER=localhost - -# Other requirements and recommendations to run Odoo -# See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control -RUN sed -Ei 's@(^deb http://deb.debian.org/debian jessie-updates main$)@#\1@' /etc/apt/sources.list \ - && apt-get update \ - && apt-get -y upgrade \ - && apt-get install -y --no-install-recommends \ - python ruby-compass \ - fontconfig libfreetype6 libxml2 libxslt1.1 libjpeg62-turbo zlib1g \ - fonts-liberation \ - libfreetype6 liblcms2-2 libopenjpeg5 libtiff5 tk tcl libpq5 \ - libldap-2.4-2 libsasl2-2 libx11-6 libxext6 libxrender1 \ - locales-all zlibc \ - bzip2 ca-certificates curl gettext git nano \ - openssh-client telnet xz-utils \ - && curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python /dev/stdin \ - && curl -sL https://deb.nodesource.com/setup_6.x | bash - \ - && apt-get install -yqq nodejs \ - && curl -SLo fonts-liberation2.deb http://ftp.debian.org/debian/pool/main/f/fonts-liberation2/fonts-liberation2_2.00.1-3_all.deb \ - && dpkg --install fonts-liberation2.deb \ - && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.jessie_amd64.deb \ - && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ - && (dpkg --install wkhtmltox.deb || true) \ - && apt-get install -yqq --no-install-recommends --fix-broken \ - && rm fonts-liberation2.deb wkhtmltox.deb \ - && wkhtmltopdf --version \ - && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ - && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ - && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ - && rm -Rf /var/lib/apt/lists/* - -# Special case to get latest PostgreSQL client in 250-postgres-client -RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ - && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ - -# Special case to get latest Less and PhantomJS -RUN ln -s /usr/bin/nodejs /usr/local/bin/node \ - && npm install -g less@2 less-plugin-clean-css@1 phantomjs-prebuilt@2 \ - && rm -Rf ~/.npm /tmp/* - -# Special case to get bootstrap-sass, required by Odoo for Sass assets -RUN gem install --no-rdoc --no-ri --no-update-sources autoprefixer-rails --version '<9.8.6' \ - && gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version '<3.4' \ - && rm -Rf ~/.gem /var/lib/gems/*/cache/ - -# Other facilities -WORKDIR /opt/odoo -RUN pip install \ - click-odoo-contrib \ - git-aggregator \ - plumbum \ - ptvsd \ - debugpy \ - pudb \ - virtualenv \ - wdb \ - simplejson \ - geoip2 \ - && sync -COPY bin-deprecated/* bin/* /usr/local/bin/ -COPY lib/doodbalib /usr/local/lib/python2.7/dist-packages/doodbalib -RUN ln -s /usr/local/lib/python2.7/dist-packages/doodbalib \ - /usr/local/lib/python2.7/dist-packages/odoobaselib -COPY build.d common/build.d -COPY conf.d common/conf.d -COPY entrypoint.d common/entrypoint.d -RUN mkdir -p auto/addons auto/geoip custom/src/private \ - && ln /usr/local/bin/direxec common/entrypoint \ - && ln /usr/local/bin/direxec common/build \ - && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ - && chmod -R a+rX /usr/local/lib/python2.7/dist-packages/doodbalib \ - && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ - && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ - && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ - && sync - -# Doodba-QA dependencies in a separate virtualenv -COPY qa /qa -RUN virtualenv --system-site-packages /qa/venv \ - && . /qa/venv/bin/activate \ - && pip install --no-cache-dir \ - click \ - coverage \ - flake8 \ - pylint-odoo \ - six \ - && npm install --loglevel error --prefix /qa 'eslint@<6' \ - && deactivate \ - && mkdir -p /qa/artifacts \ - && git clone --depth 1 $MQT /qa/mqt - -# Execute installation script by Odoo version -# This is at the end to benefit from cache at build time -# https://docs.docker.com/engine/reference/builder/#/impact-on-build-caching -ARG ODOO_SOURCE=OCA/OCB -ARG ODOO_VERSION=10.0 -ENV ODOO_VERSION="$ODOO_VERSION" -RUN install.sh -RUN pip install pg_activity - -# Metadata -ARG VCS_REF -ARG BUILD_DATE -ARG VERSION -LABEL org.label-schema.schema-version="$VERSION" \ - org.label-schema.vendor=Tecnativa \ - org.label-schema.license=Apache-2.0 \ - org.label-schema.build-date="$BUILD_DATE" \ - org.label-schema.vcs-ref="$VCS_REF" \ - org.label-schema.vcs-url="https://github.com/Tecnativa/doodba" - -# Onbuild version, with all the magic -FROM base AS onbuild - -# Subimage triggers -ONBUILD USER root -ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] -ONBUILD CMD ["/usr/local/bin/odoo"] -ONBUILD ARG AGGREGATE=true -ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" -ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" -ONBUILD ARG DEPTH_DEFAULT=1 -ONBUILD ARG DEPTH_MERGE=100 -ONBUILD ARG CLEAN=true -ONBUILD ARG COMPILE=true -ONBUILD ARG FONT_MONO="Liberation Mono" -ONBUILD ARG FONT_SANS="Liberation Sans" -ONBUILD ARG FONT_SERIF="Liberation Serif" -ONBUILD ARG PIP_INSTALL_ODOO=true -ONBUILD ARG ADMIN_PASSWORD=admin -ONBUILD ARG SMTP_SERVER=smtp -ONBUILD ARG SMTP_PORT=25 -ONBUILD ARG SMTP_USER=false -ONBUILD ARG SMTP_PASSWORD=false -ONBUILD ARG SMTP_SSL=false -ONBUILD ARG EMAIL_FROM="" -ONBUILD ARG PROXY_MODE=false -ONBUILD ARG WITHOUT_DEMO=all -ONBUILD ARG PGUSER=odoo -ONBUILD ARG PGPASSWORD=odoopassword -ONBUILD ARG PGHOST=db -ONBUILD ARG PGPORT=5432 -ONBUILD ARG PGDATABASE=prod -# Config variables -ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ - DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \ - DEFAULT_REPO_PATTERN_ODOO="$DEFAULT_REPO_PATTERN_ODOO" \ - UNACCENT="$UNACCENT" \ - PGUSER="$PGUSER" \ - PGPASSWORD="$PGPASSWORD" \ - PGHOST="$PGHOST" \ - PGPORT=$PGPORT \ - PGDATABASE="$PGDATABASE" \ - PROXY_MODE="$PROXY_MODE" \ - SMTP_SERVER="$SMTP_SERVER" \ - SMTP_PORT=$SMTP_PORT \ - SMTP_USER="$SMTP_USER" \ - SMTP_PASSWORD="$SMTP_PASSWORD" \ - SMTP_SSL="$SMTP_SSL" \ - EMAIL_FROM="$EMAIL_FROM" \ - WITHOUT_DEMO="$WITHOUT_DEMO" -ONBUILD ARG LOCAL_CUSTOM_DIR=./custom -ONBUILD COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom - -# Enable setting custom uids for odoo user during build of scaffolds -ONBUILD ARG UID=1000 -ONBUILD ARG GID=1000 - -# Enable Odoo user and filestore -ONBUILD RUN groupadd -g $GID odoo -o \ - && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ - && mkdir -p /var/lib/odoo \ - && chown -R odoo:odoo /var/lib/odoo /qa/artifacts\ - && chmod a=rwX /qa/artifacts \ - && sync - -# https://docs.python.org/2.7/library/logging.html#levels -ONBUILD ARG LOG_LEVEL=INFO -ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ - && ln -s /opt/odoo/custom/ssh ~root/.ssh \ - && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ - && sync -ONBUILD ARG DB_VERSION=latest -ONBUILD RUN /opt/odoo/common/build && sync -ONBUILD VOLUME ["/var/lib/odoo"] -ONBUILD USER odoo -# HACK Special case for Werkzeug -ONBUILD RUN pip install --user Werkzeug==0.14.1 diff --git a/9.0.Dockerfile b/9.0.Dockerfile deleted file mode 120000 index 04c2b0a4..00000000 --- a/9.0.Dockerfile +++ /dev/null @@ -1 +0,0 @@ -8.0.Dockerfile \ No newline at end of file diff --git a/bin-deprecated/install.sh b/bin-deprecated/install.sh deleted file mode 100755 index d7cd792b..00000000 --- a/bin-deprecated/install.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# Notice that this file is only used in odoo v7-10 -set -ex - -reqs=https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt -if [ "$ODOO_VERSION" == "7.0" ]; then - # V7 has no requirements file, but almost matches v8 - reqs=https://raw.githubusercontent.com/$ODOO_SOURCE/8.0/requirements.txt - # These are the only differences - pip install python-chart 'pywebdav<0.9.8' -fi -apt_deps="python-dev build-essential" -apt-get update - -# lxml -apt_deps="$apt_deps libxml2-dev libxslt1-dev" -# Pillow -apt_deps="$apt_deps libjpeg-dev libfreetype6-dev - liblcms2-dev libopenjpeg-dev libtiff5-dev tk-dev tcl-dev" -# psutil -apt_deps="$apt_deps linux-headers-amd64" -# psycopg2 -apt_deps="$apt_deps libpq-dev" -# python-ldap -apt_deps="$apt_deps libldap2-dev libsasl2-dev" - -apt-get install -y --no-install-recommends $apt_deps - -# Download requirements file to be able to patch it -curl -SLo /tmp/requirements.txt $reqs -reqs=/tmp/requirements.txt - -if [ "$ODOO_VERSION" == "8.0" ]; then - # Packages already installed that conflict with others - sed -ir 's/pyparsing|six/#\0/' $reqs - # Extra dependencies for Odoo at runtime - apt-get install -y --no-install-recommends file - # Extra dependencies for 'document' (doc & pdf support) - apt-get install -y --no-install-recommends antiword poppler-utils - # Extra dependencies for Workflow reports - apt-get install -y --no-install-recommends graphviz ghostscript -fi - -# Build and install Odoo dependencies with pip -pip install --requirement $reqs -if [ "$ODOO_VERSION" == "9.0" -o "$ODOO_VERSION" == "10.0" ]; then - pip install watchdog -fi -if [ "$ODOO_VERSION" == "10.0" ]; then - pip install astor -fi - -# Remove all installed garbage -apt-get -y purge $apt_deps -apt-get -y autoremove -rm -Rf /var/lib/apt/lists/* /tmp/* || true diff --git a/bin/config-generate b/bin/config-generate index 88e33d71..7865890d 100755 --- a/bin/config-generate +++ b/bin/config-generate @@ -25,9 +25,7 @@ except ImportError: parser = RawConfigParser() ODOO_VERSION = os.environ.get("ODOO_VERSION") -TARGET_FILE = os.environ.get("OPENERP_SERVER", "/opt/odoo/auto/odoo.conf") -if ODOO_VERSION not in {"8.0", "9.0"}: - TARGET_FILE = os.environ.get("ODOO_RC", TARGET_FILE) +TARGET_FILE = os.environ.get("ODOO_RC", "/opt/odoo/auto/odoo.conf") CONFIG_DIRS = ("/opt/odoo/common/conf.d", "/opt/odoo/custom/conf.d") CONFIG_FILES = [] diff --git a/build.d/700-odoo-install b/build.d/700-odoo-install index ef245fde..b895a35a 100755 --- a/build.d/700-odoo-install +++ b/build.d/700-odoo-install @@ -7,29 +7,11 @@ log INFO Installing Odoo from $src # For development you could want to avoid installing Odoo to speed up build if [ "$PIP_INSTALL_ODOO" == true ]; then args="--no-cache-dir" - # Odoo <= v8 dependencies could crash at install, so we don't use them - if [ "$ODOO_VERSION" == "7.0" -o "$ODOO_VERSION" == "8.0" ]; then - args="$args --no-deps" - fi pip install $args --editable $src - - # Make versions 7.0 to 9.0 have an `odoo` executable - if [ "$ODOO_VERSION" == "7.0" ]; then - ln -s /usr/local/bin/openerp-server $dst - elif [ "$ODOO_VERSION" == "8.0" -o "$ODOO_VERSION" == "9.0" ]; then - ln -s $dst.py $dst - fi else log WARNING Blindly symlinking odoo executable bin=$src/odoo-bin # Cannot check for scripts existence and link all: they probably do not # exist yet at build time! Just check Odoo version and act properly. - if [ "$ODOO_VERSION" == "7.0" ]; then - bin=$src/openerp-server - ln -s /opt/odoo/custom/src/odoo/openerp-server /usr/local/bin/ - elif [ "$ODOO_VERSION" == "8.0" -o "$ODOO_VERSION" == "9.0" ]; then - bin=$src/odoo.py - ln -s /opt/odoo/custom/src/odoo/openerp-{gevent,server} /usr/local/bin/ - fi ln -s $bin $dst fi diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index 959cabe6..e0264c80 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -42,8 +42,6 @@ ODOO_DIR = os.path.join(SRC_DIR, "odoo") ODOO_VERSION = os.environ["ODOO_VERSION"] MANIFESTS = ("__manifest__.py", "__openerp__.py") -if ODOO_VERSION in {"8.0", "9.0"}: - MANIFESTS = MANIFESTS[1:] # Customize logging for build logger = logging.getLogger("doodba") From d7b6e764d10def08baaa03e9f492ad4a2756897a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Fri, 16 Apr 2021 10:24:10 +0100 Subject: [PATCH 144/255] Add issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 29 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 5 ++++ .github/ISSUE_TEMPLATE/feature_request.md | 18 ++++++++++++++ .pre-commit-config.yaml | 4 ++-- 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..7ced7084 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,29 @@ +--- +name: Bug report +about: Report a bug +title: "" +labels: bug +assignees: "" +--- + + + +## Describe the bug + +A clear and concise description of what the bug is. + +## To Reproduce + +**Affected versions**: + +Steps to reproduce the behavior: + +1. +2. +3. + +**Expected behavior** A clear and concise description of what you expected to happen. + +**Additional context** Add any other context about the problem here. (e.g. OS, Docker +version, ...) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..14ada72c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Question or general talk + url: https://github.com/Tecnativa/doodba/discussions + about: Please ask and answer questions here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..5be53c3b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,18 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "" +labels: enhancement +assignees: "" +--- + +**Is your feature request related to a problem?** If so, please provide clear and +concise description of what the problem is. + +**Describe the solution you'd like** A clear and concise description of what you want to +happen. + +**Describe alternatives you've considered** A clear and concise description of any +alternative solutions or features you've considered. + +**Additional context** Add any other context about the feature request here. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 775122ff..1f4b4a10 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,8 +27,8 @@ repos: rev: v4.3.21 hooks: - id: isort - - repo: https://github.com/prettier/prettier - rev: 1.19.1 + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.2.1 hooks: - id: prettier - repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs From 68fd24eade92a0b63936b43f25573980bab2f1a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Tue, 20 Apr 2021 07:46:45 +0100 Subject: [PATCH 145/255] Fix pylint-odoo installation Install version from https://github.com/OCA/pylint-odoo/pull/329 with a more modern packaging method, avoiding errors with setuptools --- 11.0.Dockerfile | 4 +++- 12.0.Dockerfile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 01d28612..19821593 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -114,11 +114,13 @@ RUN mkdir -p auto/addons auto/geoip custom/src/private \ COPY qa /qa RUN python -m venv --system-site-packages /qa/venv \ && . /qa/venv/bin/activate \ + # HACK: Upgrade pip: higher version needed to install pyproject.toml based packages + && pip install -U pip \ && pip install --no-cache-dir \ click \ coverage \ flake8 \ - pylint-odoo \ + git+https://github.com/OCA/pylint-odoo.git@refs/pull/329/head \ six \ && npm install --loglevel error --prefix /qa 'eslint@<6' \ && deactivate \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 403b8c26..2ef88aaf 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -107,11 +107,13 @@ RUN mkdir -p auto/addons auto/geoip custom/src/private \ COPY qa /qa RUN python -m venv --system-site-packages /qa/venv \ && . /qa/venv/bin/activate \ + # HACK: Upgrade pip: higher version needed to install pyproject.toml based packages + && pip install -U pip \ && pip install --no-cache-dir \ click \ coverage \ flake8 \ - pylint-odoo \ + git+https://github.com/OCA/pylint-odoo.git@refs/pull/329/head \ six \ && npm install --loglevel error --prefix /qa 'eslint@<7' \ && deactivate \ From 59264de9a71501cd57dd864825b79ccbda609d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Tue, 20 Apr 2021 09:01:39 +0100 Subject: [PATCH 146/255] Install click-odoo from acsone/click-odoo-contrib#93 to fix DB hash --- 11.0.Dockerfile | 3 ++- 12.0.Dockerfile | 3 ++- 13.0.Dockerfile | 3 ++- 14.0.Dockerfile | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 19821593..f4818124 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -80,7 +80,8 @@ RUN gem install --no-rdoc --no-ri --no-update-sources autoprefixer-rails --versi WORKDIR /opt/odoo RUN pip install \ astor \ - click-odoo-contrib \ + # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 + git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ git-aggregator \ "pg_activity<=2.0.3" \ plumbum \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 2ef88aaf..2652d0ea 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -75,7 +75,8 @@ RUN ln -s /usr/bin/nodejs /usr/local/bin/node \ WORKDIR /opt/odoo RUN pip install \ astor \ - click-odoo-contrib \ + # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 + git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ git-aggregator \ "pg_activity<=2.0.3" \ plumbum \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 7d91ef18..50813e52 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -130,7 +130,8 @@ RUN build_deps=" \ 'websocket-client~=0.56' \ astor \ git-aggregator \ - click-odoo-contrib \ + # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 + git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ "pg_activity<=2.0.3" \ phonenumbers \ plumbum \ diff --git a/14.0.Dockerfile b/14.0.Dockerfile index 7dfc3445..3b45c9a3 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -126,7 +126,8 @@ RUN build_deps=" \ -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ 'websocket-client~=0.56' \ astor \ - click-odoo-contrib \ + # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 + git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ debugpy \ geoip2 \ git-aggregator \ From ce4966cbec3e539e00648b1846b8b955f9b59bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Thu, 6 May 2021 10:04:41 +0100 Subject: [PATCH 147/255] Pin pg_activity version to avoid psycopg2 problems (#422) Follow up of 02283864c451d087de40676751eeda78cebdc926 --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 13.0.Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index f4818124..b239f2e7 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -83,7 +83,7 @@ RUN pip install \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ git-aggregator \ - "pg_activity<=2.0.3" \ + "pg_activity<2.0.0" \ plumbum \ ptvsd \ debugpy \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 2652d0ea..8738cb69 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -78,7 +78,7 @@ RUN pip install \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ git-aggregator \ - "pg_activity<=2.0.3" \ + "pg_activity<2.0.0" \ plumbum \ ptvsd \ debugpy \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 50813e52..8594d84c 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -132,7 +132,7 @@ RUN build_deps=" \ git-aggregator \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ - "pg_activity<=2.0.3" \ + "pg_activity<2.0.0" \ phonenumbers \ plumbum \ ptvsd \ From 03f3eaf4472745630d40c5a73e8515ed2b7a23e6 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 8 Mar 2021 11:12:24 +0100 Subject: [PATCH 148/255] [IMP] permissions: use fewer chmod and chown by executing checkout with correct permissions and using consistent fix permissions script --- 11.0.Dockerfile | 26 +++++----- 12.0.Dockerfile | 26 +++++----- 13.0.Dockerfile | 26 +++++----- 14.0.Dockerfile | 26 +++++----- bin/autoaggregate | 98 +++++++++++++++++++++---------------- build.d/100-repos-aggregate | 12 +++++ build.d/800-permissions | 13 ++++- 7 files changed, 130 insertions(+), 97 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index b239f2e7..036943a9 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -157,6 +157,18 @@ LABEL org.label-schema.schema-version="$VERSION" \ # Onbuild version, with all the magic FROM base AS onbuild +# Enable setting custom uids for odoo user during build of scaffolds +ONBUILD ARG UID=1000 +ONBUILD ARG GID=1000 + +# Enable Odoo user and filestore +ONBUILD RUN groupadd -g $GID odoo -o \ + && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && sync + # Subimage triggers ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] @@ -204,19 +216,7 @@ ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ EMAIL_FROM="$EMAIL_FROM" \ WITHOUT_DEMO="$WITHOUT_DEMO" ONBUILD ARG LOCAL_CUSTOM_DIR=./custom -ONBUILD COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom - -# Enable setting custom uids for odoo user during build of scaffolds -ONBUILD ARG UID=1000 -ONBUILD ARG GID=1000 - -# Enable Odoo user and filestore -ONBUILD RUN groupadd -g $GID odoo -o \ - && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ - && mkdir -p /var/lib/odoo \ - && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ - && chmod a=rwX /qa/artifacts \ - && sync +ONBUILD COPY --chown=root:odoo $LOCAL_CUSTOM_DIR /opt/odoo/custom # https://docs.python.org/3/library/logging.html#levels ONBUILD ARG LOG_LEVEL=INFO diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 8738cb69..5484a4ae 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -152,6 +152,18 @@ LABEL org.label-schema.schema-version="$VERSION" \ # Onbuild version, with all the magic FROM base AS onbuild +# Enable setting custom uids for odoo user during build of scaffolds +ONBUILD ARG UID=1000 +ONBUILD ARG GID=1000 + +# Enable Odoo user and filestore +ONBUILD RUN groupadd -g $GID odoo -o \ + && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && sync + # Subimage triggers ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] @@ -199,19 +211,7 @@ ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ EMAIL_FROM="$EMAIL_FROM" \ WITHOUT_DEMO="$WITHOUT_DEMO" ONBUILD ARG LOCAL_CUSTOM_DIR=./custom -ONBUILD COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom - -# Enable setting custom uids for odoo user during build of scaffolds -ONBUILD ARG UID=1000 -ONBUILD ARG GID=1000 - -# Enable Odoo user and filestore -ONBUILD RUN groupadd -g $GID odoo -o \ - && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ - && mkdir -p /var/lib/odoo \ - && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ - && chmod a=rwX /qa/artifacts \ - && sync +ONBUILD COPY --chown=root:odoo $LOCAL_CUSTOM_DIR /opt/odoo/custom # https://docs.python.org/3/library/logging.html#levels ONBUILD ARG LOG_LEVEL=INFO diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 8594d84c..f42cf937 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -162,6 +162,18 @@ LABEL org.label-schema.schema-version="$VERSION" \ # Onbuild version, with all the magic FROM base AS onbuild +# Enable setting custom uids for odoo user during build of scaffolds +ONBUILD ARG UID=1000 +ONBUILD ARG GID=1000 + +# Enable Odoo user and filestore +ONBUILD RUN groupadd -g $GID odoo -o \ + && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && sync + # Subimage triggers ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] @@ -210,19 +222,7 @@ ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ EMAIL_FROM="$EMAIL_FROM" \ WITHOUT_DEMO="$WITHOUT_DEMO" ONBUILD ARG LOCAL_CUSTOM_DIR=./custom -ONBUILD COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom - -# Enable setting custom uids for odoo user during build of scaffolds -ONBUILD ARG UID=1000 -ONBUILD ARG GID=1000 - -# Enable Odoo user and filestore -ONBUILD RUN groupadd -g $GID odoo -o \ - && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ - && mkdir -p /var/lib/odoo \ - && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ - && chmod a=rwX /qa/artifacts \ - && sync +ONBUILD COPY --chown=root:odoo $LOCAL_CUSTOM_DIR /opt/odoo/custom # https://docs.python.org/3/library/logging.html#levels ONBUILD ARG LOG_LEVEL=INFO diff --git a/14.0.Dockerfile b/14.0.Dockerfile index 3b45c9a3..831187fc 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -157,6 +157,18 @@ LABEL org.label-schema.schema-version="$VERSION" \ # Onbuild version, with all the magic FROM base AS onbuild +# Enable setting custom uids for odoo user during build of scaffolds +ONBUILD ARG UID=1000 +ONBUILD ARG GID=1000 + +# Enable Odoo user and filestore +ONBUILD RUN groupadd -g $GID odoo -o \ + && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && sync + # Subimage triggers ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] @@ -205,19 +217,7 @@ ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ EMAIL_FROM="$EMAIL_FROM" \ WITHOUT_DEMO="$WITHOUT_DEMO" ONBUILD ARG LOCAL_CUSTOM_DIR=./custom -ONBUILD COPY $LOCAL_CUSTOM_DIR /opt/odoo/custom - -# Enable setting custom uids for odoo user during build of scaffolds -ONBUILD ARG UID=1000 -ONBUILD ARG GID=1000 - -# Enable Odoo user and filestore -ONBUILD RUN groupadd -g $GID odoo -o \ - && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ - && mkdir -p /var/lib/odoo \ - && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ - && chmod a=rwX /qa/artifacts \ - && sync +ONBUILD COPY --chown=root:odoo $LOCAL_CUSTOM_DIR /opt/odoo/custom # https://docs.python.org/3/library/logging.html#levels ONBUILD ARG LOG_LEVEL=INFO diff --git a/bin/autoaggregate b/bin/autoaggregate index 737b7f2f..0e79f486 100755 --- a/bin/autoaggregate +++ b/bin/autoaggregate @@ -10,7 +10,6 @@ from doodbalib import ( ADDONS_YAML, AUTO_REPOS_YAML, CORE, - LOG_LEVELS, ODOO_DIR, PRIVATE, REPOS_YAML, @@ -18,7 +17,9 @@ from doodbalib import ( logger, ) -UMASK = os.environ.get("UMASK") +# if the umask matches the `chmod -R u+rwX,g+rX-w,o= /opt/odoo` command the build is faster as we don't need to fix as +# many permissions after auto aggregation +UMASK = os.environ.get("UMASK") or "0027" UID = int(os.environ.get("UID") or -1) GID = int(os.environ.get("GID") or -1) DEFAULT_REPO_PATTERN = os.environ.get("DEFAULT_REPO_PATTERN") @@ -33,47 +34,58 @@ def aggregate(config): Path where to find the ``repos.yaml`` file. """ logger.info("Running gitaggregate with %s", config) - old_umask = None - try: - # Download git code with the specified umask, if any - if UMASK: - old_umask = os.umask(int(UMASK)) - check_call( - [ - "gitaggregate", - "--expand-env", - "--config", - config, - "--log-level", - log_level, - "--jobs", - str(cpu_count() or 1), - "aggregate", - ], - cwd=SRC_DIR, - stderr=sys.stderr, - stdout=sys.stdout, - ) - finally: - # Restore umask, if changed - if old_umask is not None: - os.umask(old_umask) - # Chown recursively, if UID or GID are specified - if ~UID or ~GID: - for root, dirs, files in os.walk(SRC_DIR): - for target in dirs + files: - try: - target_path = os.path.join(root, target) - if not os.path.islink(target_path): - # if target_path is a link we would only chown the - # target, as the target should be chowned separately - # we can skip all symlinks and prevent showing - # unclear errors - os.chown(target_path, UID, GID) - except Exception: - logger.debug( - "Error trying to chown on file. Skipping...", exc_info=True - ) + + def pre_exec_umask(): + # Download git code with the specified umask, if set, otherwise use "0027" + os.umask(int(UMASK, 8)) + + pre_execs = [pre_exec_umask] + + def pre_exec(): + for _exec in pre_execs: + try: + _exec() + except Exception as e: + logger.error("Error in %s: %s" % (_exec, e)) + logger.exception(e) + raise + + if ~GID: + + def pre_exec_gid(): + # execute git with GID + os.setgid(GID) + + pre_execs.append(pre_exec_gid) + + if ~UID: + + def pre_exec_uid(): + # execute git with UID + os.setuid(UID) + # set odoo home directory + # (git checks if user has a config in $HOME, and we cannot read /root as odoo user) + os.environ["HOME"] = "/home/odoo" + + pre_execs.append(pre_exec_uid) + + check_call( + [ + "gitaggregate", + "--expand-env", + "--config", + config, + "--log-level", + log_level, + "--jobs", + str(cpu_count() or 1), + "aggregate", + ], + cwd=SRC_DIR, + stderr=sys.stderr, + stdout=sys.stdout, + preexec_fn=pre_exec, + ) def origin_for( diff --git a/build.d/100-repos-aggregate b/build.d/100-repos-aggregate index d7f41c01..67508d2a 100755 --- a/build.d/100-repos-aggregate +++ b/build.d/100-repos-aggregate @@ -1,9 +1,21 @@ #!/bin/bash set -e +# make sure odoo has a user.name configured, as merges would not succeed otherwise +# (even if GIT_AUTHOR_NAME and EMAIL are set and should be used, it seems gitaggregate is not passing them to git) +su --shell="$SHELL" odoo -c 'git config user.name 1>/dev/null || git config --global user.name "'"$GIT_AUTHOR_NAME"'"' + +# copy ssh directory to odoo user as well (gitaggregate may also be run as odoo user) +if [[ ! -e ~odoo/.ssh ]] ; then + cp -a /opt/odoo/custom/ssh ~odoo/.ssh +fi + if [ "$AGGREGATE" != true ]; then log WARNING Not aggregating code repositories exit 0 fi +# during build checkout sources for root:odoo +# to checkout sources as odoo:odoo set AGGREGATE to false for build and execute autoaggregate during runtime +export UID=0 GID=$GID UMASK=0027 exec autoaggregate diff --git a/build.d/800-permissions b/build.d/800-permissions index 3e5f1713..9c256c22 100755 --- a/build.d/800-permissions +++ b/build.d/800-permissions @@ -1,8 +1,17 @@ #!/bin/bash set -e -chown -R root:odoo /opt/odoo -chmod -R u+rwX,g+rX-w,o= /opt/odoo + +# find all files where group or user are not odoo that are not a symlink, and fix permissions for those +# we use find and xargs because chown -R can be very slow on certain systems: https://github.com/docker/for-linux/issues/388 +find /opt/odoo \( -not -user root -or -not -group odoo \) -and -not -type l -print0 | xargs -0 --no-run-if-empty chown root:odoo +find /opt/odoo \( -type d -not -perm u=rwx,g=rx,o= \) -o \( -type f -not -perm u=rw,g=r,o= -not -perm u=rwx,g=rx,o= \) -print0 | xargs -0 --no-run-if-empty chmod u+rwX,g+rX-w,o= + chmod -R g+w /opt/odoo/auto + if [ -d /opt/odoo/custom/ssh ]; then chmod -R u=rwX,go= /opt/odoo/custom/ssh fi +if [ -d ~odoo/.ssh ]; then + chown -R odoo:odoo ~odoo/.ssh + chmod -R u=rwX,go= ~odoo/.ssh +fi From 163ecb0f80b04605ed3b601bba441c7612f8564c Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 12 Apr 2021 15:49:25 +0200 Subject: [PATCH 149/255] [IMP] tests: add a test for non ff merges we force a non fast forward merge of ocb and ocb^1 to test if git is correctly configured for autoaggregate --- tests/__init__.py | 24 +++++++++++++++ tests/scaffoldings/repo_merge/Dockerfile | 2 ++ .../custom/build.d/099-git_merge_no_ff | 10 +++++++ .../repo_merge/custom/src/addons.yaml | 0 .../repo_merge/custom/src/repos.yaml | 12 ++++++++ .../repo_merge/docker-compose.yaml | 29 +++++++++++++++++++ 6 files changed, 77 insertions(+) create mode 100644 tests/scaffoldings/repo_merge/Dockerfile create mode 100755 tests/scaffoldings/repo_merge/custom/build.d/099-git_merge_no_ff create mode 100644 tests/scaffoldings/repo_merge/custom/src/addons.yaml create mode 100644 tests/scaffoldings/repo_merge/custom/src/repos.yaml create mode 100644 tests/scaffoldings/repo_merge/docker-compose.yaml diff --git a/tests/__init__.py b/tests/__init__.py index 41e26ae3..49401fd1 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -615,6 +615,30 @@ def test_symlinks(self): ), ) + def test_repo_merge(self): + symlink_dir = join(SCAFFOLDINGS_DIR, "repo_merge") + for sub_env in matrix(): + self.compose_test( + symlink_dir, + sub_env, + ( + "git", + "--git-dir=/opt/odoo/custom/src/odoo/.git", + "--no-pager", + "log", + "-n", + "2", + ), + # make sure the git log contains a merge commit signed by $GIT_AUTHOR_NAME (otherwise ff was enabled + # and we did not test the merge commits) + ( + "bash", + "-c", + "git --git-dir=/opt/odoo/custom/src/odoo/.git log -n 1" + " | grep 'docker-odoo '", + ), + ) + if __name__ == "__main__": unittest.main() diff --git a/tests/scaffoldings/repo_merge/Dockerfile b/tests/scaffoldings/repo_merge/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/repo_merge/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/repo_merge/custom/build.d/099-git_merge_no_ff b/tests/scaffoldings/repo_merge/custom/build.d/099-git_merge_no_ff new file mode 100755 index 00000000..6e6ecc63 --- /dev/null +++ b/tests/scaffoldings/repo_merge/custom/build.d/099-git_merge_no_ff @@ -0,0 +1,10 @@ +#!/bin/bash +set -e +# configure git for odoo to merge without fast forward to test config for merge commits in autoaggregate +su --shell="$SHELL" odoo -c 'git config --global merge.ff false' +su --shell="$SHELL" odoo -c 'git config --global pull.ff false' + +# prepare a forced merge by using an OCB version that is one commit behind the ODOO_VERSION branch +OCB_VERSION_ONE_BEHIND=$(curl -s "https://api.github.com/repos/OCA/OCB/commits?page=2&per_page=1&sha=$ODOO_VERSION" | python -c 'import json, sys; print(json.loads("".join([l for l in sys.stdin]))[0]["sha"])') +# shellcheck disable=SC2016 +sed -i 's/\$ODOO_VERSION^1/'"$OCB_VERSION_ONE_BEHIND"'/' /opt/odoo/custom/src/repos.yaml diff --git a/tests/scaffoldings/repo_merge/custom/src/addons.yaml b/tests/scaffoldings/repo_merge/custom/src/addons.yaml new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/repo_merge/custom/src/repos.yaml b/tests/scaffoldings/repo_merge/custom/src/repos.yaml new file mode 100644 index 00000000..c04e6692 --- /dev/null +++ b/tests/scaffoldings/repo_merge/custom/src/repos.yaml @@ -0,0 +1,12 @@ +# Odoo is always required +./odoo: + defaults: + depth: $DEPTH_MERGE + remotes: + ocb: https://github.com/OCA/OCB.git + target: ocb $ODOO_VERSION + merges: + # $ODOO_VERSION^1 gets replaced by commit sha that is one behind $ODOO_VERSION in OCB repo by 099-git_merge_no_ff + # in this test, to force gitaggregate creating a merge request + - ocb $ODOO_VERSION^1 + - ocb $ODOO_VERSION diff --git a/tests/scaffoldings/repo_merge/docker-compose.yaml b/tests/scaffoldings/repo_merge/docker-compose.yaml new file mode 100644 index 00000000..5cb154cd --- /dev/null +++ b/tests/scaffoldings/repo_merge/docker-compose.yaml @@ -0,0 +1,29 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + WITHOUT_DEMO: "false" + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + volumes: + - filestore:/var/lib/odoo:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: From e8e2f29922647f88cc5e4a816c1c51506d84d8a9 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 19 Apr 2021 09:53:11 +0200 Subject: [PATCH 150/255] [IMP] tests: add test for executing autoaggregate during runtime --- tests/__init__.py | 13 ++++++++++ .../aggregate_permissions/.dockerignore | 1 + .../aggregate_permissions/.gitignore | 1 + .../aggregate_permissions/Dockerfile | 2 ++ .../custom/src/addons.yaml | 0 .../aggregate_permissions/docker-compose.yaml | 25 +++++++++++++++++++ 6 files changed, 42 insertions(+) create mode 100644 tests/scaffoldings/aggregate_permissions/.dockerignore create mode 100644 tests/scaffoldings/aggregate_permissions/.gitignore create mode 100644 tests/scaffoldings/aggregate_permissions/Dockerfile create mode 100644 tests/scaffoldings/aggregate_permissions/custom/src/addons.yaml create mode 100644 tests/scaffoldings/aggregate_permissions/docker-compose.yaml diff --git a/tests/__init__.py b/tests/__init__.py index 49401fd1..0825a377 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -5,6 +5,7 @@ Each test must be a valid docker-compose.yaml file with a ``odoo`` service. """ import logging +import os import unittest from itertools import product from os import environ @@ -639,6 +640,18 @@ def test_repo_merge(self): ), ) + def test_aggregate_permissions(self): + symlink_dir = join(SCAFFOLDINGS_DIR, "aggregate_permissions") + for sub_env in matrix(): + self.compose_test( + symlink_dir, + dict(sub_env, UID=str(os.getuid()), GID=str(os.getgid())), + ("autoaggregate",), + # test that permissions are set in a way that enables a second autoaggregation after the first one + # e.g. when used in dev we update the source code sometimes/daily + ("autoaggregate",), + ) + if __name__ == "__main__": unittest.main() diff --git a/tests/scaffoldings/aggregate_permissions/.dockerignore b/tests/scaffoldings/aggregate_permissions/.dockerignore new file mode 100644 index 00000000..a0d46fd2 --- /dev/null +++ b/tests/scaffoldings/aggregate_permissions/.dockerignore @@ -0,0 +1 @@ +custom/src/odoo diff --git a/tests/scaffoldings/aggregate_permissions/.gitignore b/tests/scaffoldings/aggregate_permissions/.gitignore new file mode 100644 index 00000000..a0d46fd2 --- /dev/null +++ b/tests/scaffoldings/aggregate_permissions/.gitignore @@ -0,0 +1 @@ +custom/src/odoo diff --git a/tests/scaffoldings/aggregate_permissions/Dockerfile b/tests/scaffoldings/aggregate_permissions/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/aggregate_permissions/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/aggregate_permissions/custom/src/addons.yaml b/tests/scaffoldings/aggregate_permissions/custom/src/addons.yaml new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/aggregate_permissions/docker-compose.yaml b/tests/scaffoldings/aggregate_permissions/docker-compose.yaml new file mode 100644 index 00000000..00ceb8ce --- /dev/null +++ b/tests/scaffoldings/aggregate_permissions/docker-compose.yaml @@ -0,0 +1,25 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + AGGREGATE: "false" + CLEAN: "false" + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + PIP_INSTALL_ODOO: "false" + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + UID: "${UID:-1000}" + GID: "${GID:-1000}" + UMASK: "$UMASK" + user: root + entrypoint: "" # we are calling autoaggregate inside of the tests + volumes: + - ./custom/src/:/opt/odoo/custom/src:rw,z + - filestore:/var/lib/odoo:z + +volumes: + filestore: From 484c4953f97f56a6b8f56e470ecc6185557e7d52 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Wed, 16 Jun 2021 14:49:01 +0200 Subject: [PATCH 151/255] [IMP] tests: autoaggregate as odoo user with merges to check odoo git settings --- tests/__init__.py | 33 +++++++++++++++++++ .../aggregate_permissions/docker-compose.yaml | 2 +- .../repo_merge/docker-compose.yaml | 13 +------- .../scaffoldings/repo_merge/setup-devel.yaml | 25 ++++++++++++++ 4 files changed, 60 insertions(+), 13 deletions(-) create mode 100644 tests/scaffoldings/repo_merge/setup-devel.yaml diff --git a/tests/__init__.py b/tests/__init__.py index 0825a377..5d96f8c1 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -640,6 +640,39 @@ def test_repo_merge(self): ), ) + def test_repo_merge_aggregate_permissions(self): + symlink_dir = join(SCAFFOLDINGS_DIR, "repo_merge") + for sub_env in matrix(): + self.compose_test( + symlink_dir, + dict( + sub_env, + COMPOSE_FILE="setup-devel.yaml", + UID=str(os.getuid()), + GID=str(os.getgid()), + ), + # prepare repos.yaml to be non fast forward + ("/opt/odoo/custom/build.d/099-git_merge_no_ff",), + # autoaggregate as odoo:odoo to check if merges also work + ("autoaggregate",), + ( + "git", + "--git-dir=/opt/odoo/custom/src/odoo/.git", + "--no-pager", + "log", + "-n", + "2", + ), + # make sure the git log contains a merge commit signed by $GIT_AUTHOR_NAME (otherwise ff was enabled + # and we did not test the merge commits) + ( + "bash", + "-c", + "git --git-dir=/opt/odoo/custom/src/odoo/.git log -n 1" + " | grep 'docker-odoo '", + ), + ) + def test_aggregate_permissions(self): symlink_dir = join(SCAFFOLDINGS_DIR, "aggregate_permissions") for sub_env in matrix(): diff --git a/tests/scaffoldings/aggregate_permissions/docker-compose.yaml b/tests/scaffoldings/aggregate_permissions/docker-compose.yaml index 00ceb8ce..b5c3c5b4 100644 --- a/tests/scaffoldings/aggregate_permissions/docker-compose.yaml +++ b/tests/scaffoldings/aggregate_permissions/docker-compose.yaml @@ -16,7 +16,7 @@ services: GID: "${GID:-1000}" UMASK: "$UMASK" user: root - entrypoint: "" # we are calling autoaggregate inside of the tests + entrypoint: "" # we are calling autoaggregate inside the tests volumes: - ./custom/src/:/opt/odoo/custom/src:rw,z - filestore:/var/lib/odoo:z diff --git a/tests/scaffoldings/repo_merge/docker-compose.yaml b/tests/scaffoldings/repo_merge/docker-compose.yaml index 5cb154cd..de4ff6b2 100644 --- a/tests/scaffoldings/repo_merge/docker-compose.yaml +++ b/tests/scaffoldings/repo_merge/docker-compose.yaml @@ -7,23 +7,12 @@ services: COMPILE: "false" ODOO_VERSION: $ODOO_MINOR WITHOUT_DEMO: "false" - tty: true - depends_on: - - db environment: PYTHONOPTIMIZE: "" UNACCENT: "false" + entrypoint: "" # we are not using odoo but only checking the repo state here, this skips starting the db volumes: - filestore:/var/lib/odoo:z - db: - image: postgres:${DB_VERSION}-alpine - environment: - POSTGRES_USER: odoo - POSTGRES_PASSWORD: odoopassword - volumes: - - db:/var/lib/postgresql/data:z - volumes: - db: filestore: diff --git a/tests/scaffoldings/repo_merge/setup-devel.yaml b/tests/scaffoldings/repo_merge/setup-devel.yaml new file mode 100644 index 00000000..50620cc1 --- /dev/null +++ b/tests/scaffoldings/repo_merge/setup-devel.yaml @@ -0,0 +1,25 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + AGGREGATE: "false" + CLEAN: "false" + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + PIP_INSTALL_ODOO: "false" + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + UID: "${UID:-1000}" + GID: "${GID:-1000}" + UMASK: "$UMASK" + user: root + entrypoint: "" # we are only calling autoaggregate inside the tests + volumes: + - ./custom/src/:/opt/odoo/custom/src:rw,z + - filestore:/var/lib/odoo:z + +volumes: + filestore: From 7a414a6da542875aae8bafb08e2258f3b7f370b8 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Wed, 16 Jun 2021 16:47:37 +0200 Subject: [PATCH 152/255] [FIX] permissions: refactor to plumbum --- build.d/800-permissions | 80 ++++++++++++++++++++++++++++++++++------- 1 file changed, 68 insertions(+), 12 deletions(-) diff --git a/build.d/800-permissions b/build.d/800-permissions index 9c256c22..a34dc176 100755 --- a/build.d/800-permissions +++ b/build.d/800-permissions @@ -1,17 +1,73 @@ -#!/bin/bash -set -e +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import os.path + +from doodbalib import AUTO_DIR, CUSTOM_DIR + +from plumbum import FG, local + +find, xargs, chmod, chown = ( + local.cmd.find, + local.cmd.xargs, + local.cmd.chmod, + local.cmd.chown, +) # find all files where group or user are not odoo that are not a symlink, and fix permissions for those # we use find and xargs because chown -R can be very slow on certain systems: https://github.com/docker/for-linux/issues/388 -find /opt/odoo \( -not -user root -or -not -group odoo \) -and -not -type l -print0 | xargs -0 --no-run-if-empty chown root:odoo -find /opt/odoo \( -type d -not -perm u=rwx,g=rx,o= \) -o \( -type f -not -perm u=rw,g=r,o= -not -perm u=rwx,g=rx,o= \) -print0 | xargs -0 --no-run-if-empty chmod u+rwX,g+rX-w,o= +( + find[ + "/opt/odoo", + "(", + "-not", + "-user", + "root", + "-or", + "-not", + "-group", + "odoo", + ")", + "-and", + "-not", + "-type", + "l", + "-print0", + ] + | xargs["-0", "--no-run-if-empty", "chown", "root:odoo"] +) & FG +( + find[ + "/opt/odoo", + "(", + "-type", + "d", + "-not", + "-perm", + "u=rwx,g=rx,o=", + ")", + "-o", + "(", + "-type", + "f", + "-not", + "-perm", + "u=rw,g=r,o=", + "-not", + "-perm", + "u=rwx,g=rx,o=", + ")", + "-print0", + ] + | xargs["-0", "--no-run-if-empty", "chmod", "u+rwX,g+rX-w,o="] +) & FG + +chmod["-R", "g+w", AUTO_DIR] & FG -chmod -R g+w /opt/odoo/auto +custom_ssh_dir = os.path.join(CUSTOM_DIR, "ssh") +if os.path.isdir(custom_ssh_dir): + chmod["-R", "u=rwx,go=", custom_ssh_dir] & FG -if [ -d /opt/odoo/custom/ssh ]; then - chmod -R u=rwX,go= /opt/odoo/custom/ssh -fi -if [ -d ~odoo/.ssh ]; then - chown -R odoo:odoo ~odoo/.ssh - chmod -R u=rwX,go= ~odoo/.ssh -fi +odoo_ssh_dir = "/home/odoo/.ssh" +if os.path.isdir(odoo_ssh_dir): + chown["-R", "odoo:odoo", odoo_ssh_dir] & FG + chmod["-R", "u=rwx,go=", odoo_ssh_dir] & FG From f782736afad4d09f53b4fb3d217cc321887978ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Mon, 23 Aug 2021 11:25:40 +0100 Subject: [PATCH 153/255] Add pdfminer.six Made optional after https://github.com/odoo/odoo/commit/6fa4dbf2047f5e531257876c14a419da67df3f79 --- 14.0.Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/14.0.Dockerfile b/14.0.Dockerfile index 831187fc..cecb3629 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -132,6 +132,7 @@ RUN build_deps=" \ geoip2 \ git-aggregator \ inotify \ + pdfminer.six \ pg_activity \ phonenumbers \ plumbum \ From 2332a53a3c87d6d7496df76a327aaec08040fe43 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 24 Aug 2021 08:06:53 +0100 Subject: [PATCH 154/255] Add python-magic Improves Odoo mime type detection out of the box. See https://github.com/odoo/odoo/blob/2dfa8fd0022b0a1fc97b721b3b8c3dd4f28889b3/odoo/tools/mimetypes.py#L164-L173 and the full story from https://github.com/OCA/dms/pull/131. --- 12.0.Dockerfile | 1 + 13.0.Dockerfile | 1 + 14.0.Dockerfile | 1 + 3 files changed, 3 insertions(+) diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 5484a4ae..3dbfbd39 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -84,6 +84,7 @@ RUN pip install \ debugpy \ pydevd-odoo \ pudb \ + python-magic \ watchdog \ wdb \ geoip2 \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index f42cf937..aef33c77 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -139,6 +139,7 @@ RUN build_deps=" \ debugpy \ pydevd-odoo \ pudb \ + python-magic \ watchdog \ wdb \ geoip2 \ diff --git a/14.0.Dockerfile b/14.0.Dockerfile index cecb3629..bddec265 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -137,6 +137,7 @@ RUN build_deps=" \ phonenumbers \ plumbum \ pudb \ + python-magic \ watchdog \ wdb \ && (python3 -m compileall -q /usr/local/lib/python3.8/ || true) \ From 944d1d35dec35ac274c968c5acb3cb0729dbf2de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Mon, 11 Oct 2021 16:37:07 +0100 Subject: [PATCH 155/255] Update package installation For WKHTMLTOPDF and Postgres packages, install Debian buster version instead of stretch As checksums are not available for buster packages, remove that check. Remove QA dependencies that are no longer needed --- 13.0.Dockerfile | 11 ++++------- 14.0.Dockerfile | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/13.0.Dockerfile b/13.0.Dockerfile index aef33c77..9a89ec1b 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -5,7 +5,7 @@ EXPOSE 8069 8072 ARG GEOIP_UPDATER_VERSION=4.1.5 ARG MQT=https://github.com/OCA/maintainer-quality-tools.git ARG WKHTMLTOPDF_VERSION=0.12.5 -ARG WKHTMLTOPDF_CHECKSUM='1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb' +ARG WKHTMLTOPDF_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd' ENV DB_FILTER=.* \ DEPTH_DEFAULT=1 \ DEPTH_MERGE=100 \ @@ -39,8 +39,8 @@ ENV DB_FILTER=.* \ RUN apt-get -qq update \ && apt-get install -yqq --no-install-recommends \ curl \ - && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.stretch_amd64.deb \ - && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ + && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.buster_amd64.deb \ + && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ && apt-get install -yqq --no-install-recommends \ ./wkhtmltox.deb \ chromium \ @@ -56,7 +56,7 @@ RUN apt-get -qq update \ telnet \ vim \ zlibc \ - && echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + && echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ && apt-get install -yqq --no-install-recommends \ @@ -90,10 +90,7 @@ RUN python -m venv --system-site-packages /qa/venv \ && pip install \ click \ coverage \ - flake8 \ - pylint-odoo \ six \ - && npm install --loglevel error --prefix /qa eslint \ && deactivate \ && mkdir -p /qa/artifacts \ && git clone --depth 1 $MQT /qa/mqt diff --git a/14.0.Dockerfile b/14.0.Dockerfile index bddec265..cd03d583 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -4,7 +4,7 @@ EXPOSE 8069 8072 ARG GEOIP_UPDATER_VERSION=4.3.0 ARG WKHTMLTOPDF_VERSION=0.12.5 -ARG WKHTMLTOPDF_CHECKSUM='1140b0ab02aa6e17346af2f14ed0de807376de475ba90e1db3975f112fbd20bb' +ARG WKHTMLTOPDF_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd' ENV DB_FILTER=.* \ DEPTH_DEFAULT=1 \ DEPTH_MERGE=100 \ @@ -36,8 +36,8 @@ ENV DB_FILTER=.* \ RUN apt-get -qq update \ && apt-get install -yqq --no-install-recommends \ curl \ - && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.stretch_amd64.deb \ - && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ + && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.buster_amd64.deb \ + && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ && apt-get install -yqq --no-install-recommends \ ./wkhtmltox.deb \ chromium \ @@ -53,7 +53,7 @@ RUN apt-get -qq update \ telnet \ vim \ zlibc \ - && echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + && echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ @@ -86,10 +86,7 @@ RUN python -m venv --system-site-packages /qa/venv \ && pip install \ click \ coverage \ - flake8 \ - pylint-odoo \ six \ - && npm install --loglevel error --prefix /qa eslint \ && deactivate \ && mkdir -p /qa/artifacts From 3083d71c0b1c26bd3e750c5908e7f01e7fad5ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Mon, 11 Oct 2021 15:35:10 +0100 Subject: [PATCH 156/255] Add Odoo 15.0 - Make it `:latest`. - Fix the common prerelease-failing tests. TT31709 Co-authored-by: Andreas Perhab --- .github/workflows/ci.yaml | 3 +- 15.0.Dockerfile | 228 ++++++++++++++++++++++++++++++++++++++ README.md | 4 +- tests/__init__.py | 4 +- 4 files changed, 234 insertions(+), 5 deletions(-) create mode 100644 15.0.Dockerfile diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dee6b05d..1e9e79e6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,13 +35,14 @@ jobs: # Test modern Odoo versions with latest Postgres version pg_version: ["12"] odoo_version: + - "15.0" - "14.0" - "13.0" - "12.0" - "11.0" env: # Indicates what's the equivalent to tecnativa/doodba:latest image - LATEST_RELEASE: "14.0" + LATEST_RELEASE: "15.0" # Variables found by default in Docker Hub builder DOCKER_REPO: tecnativa/doodba DOCKER_TAG: ${{ matrix.odoo_version }} diff --git a/15.0.Dockerfile b/15.0.Dockerfile new file mode 100644 index 00000000..4852e7a0 --- /dev/null +++ b/15.0.Dockerfile @@ -0,0 +1,228 @@ +FROM python:3.8-slim-bullseye AS base + +EXPOSE 8069 8072 + +ARG GEOIP_UPDATER_VERSION=4.3.0 +ARG WKHTMLTOPDF_VERSION=0.12.5 +ARG WKHTMLTOPDF_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd' +ENV DB_FILTER=.* \ + DEPTH_DEFAULT=1 \ + DEPTH_MERGE=100 \ + EMAIL=https://hub.docker.com/r/tecnativa/odoo \ + GEOIP_ACCOUNT_ID="" \ + GEOIP_LICENSE_KEY="" \ + GIT_AUTHOR_NAME=docker-odoo \ + INITIAL_LANG="" \ + LC_ALL=C.UTF-8 \ + LIST_DB=false \ + NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \ + OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ + PATH="/home/odoo/.local/bin:$PATH" \ + PIP_NO_CACHE_DIR=0 \ + DEBUGPY_ARGS="--listen 0.0.0.0:6899 --wait-for-client" \ + DEBUGPY_ENABLE=0 \ + PUDB_RDB_HOST=0.0.0.0 \ + PUDB_RDB_PORT=6899 \ + PYTHONOPTIMIZE=1 \ + UNACCENT=true \ + WAIT_DB=true \ + WDB_NO_BROWSER_AUTO_OPEN=True \ + WDB_SOCKET_SERVER=wdb \ + WDB_WEB_PORT=1984 \ + WDB_WEB_SERVER=localhost + +# Other requirements and recommendations +# See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control +RUN apt-get -qq update \ + && apt-get install -yqq --no-install-recommends \ + curl \ + && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.buster_amd64.deb \ + && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ + && apt-get install -yqq --no-install-recommends \ + ./wkhtmltox.deb \ + chromium \ + ffmpeg \ + fonts-liberation2 \ + gettext \ + git \ + gnupg2 \ + locales-all \ + nano \ + npm \ + openssh-client \ + telnet \ + vim \ + && echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && apt-get update \ + && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && apt-get autopurge -yqq \ + && rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \ + && sync + +WORKDIR /opt/odoo +COPY bin/* /usr/local/bin/ +COPY lib/doodbalib /usr/local/lib/python3.8/site-packages/doodbalib +COPY build.d common/build.d +COPY conf.d common/conf.d +COPY entrypoint.d common/entrypoint.d +RUN mkdir -p auto/addons auto/geoip custom/src/private \ + && ln /usr/local/bin/direxec common/entrypoint \ + && ln /usr/local/bin/direxec common/build \ + && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ + && chmod -R a+rX /usr/local/lib/python3.8/site-packages/doodbalib \ + && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ + && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ + && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ + && sync + +# Doodba-QA dependencies in a separate virtualenv +COPY qa /qa +RUN python -m venv --system-site-packages /qa/venv \ + && . /qa/venv/bin/activate \ + && pip install \ + click \ + coverage \ + && deactivate \ + && mkdir -p /qa/artifacts + +ARG ODOO_SOURCE=OCA/OCB +ARG ODOO_VERSION=15.0 +ENV ODOO_VERSION="$ODOO_VERSION" + +# Install Odoo hard & soft dependencies, and Doodba utilities +# TODO: Add back pydevd-odoo once +# https://github.com/trinhanhngoc/pydevd-odoo/issues/3 is fixed +RUN build_deps=" \ + build-essential \ + libfreetype6-dev \ + libfribidi-dev \ + libghc-zlib-dev \ + libharfbuzz-dev \ + libjpeg-dev \ + liblcms2-dev \ + libldap2-dev \ + libopenjp2-7-dev \ + libpq-dev \ + libsasl2-dev \ + libtiff5-dev \ + libwebp-dev \ + libxml2-dev \ + libxslt-dev \ + tcl-dev \ + tk-dev \ + zlib1g-dev \ + " \ + && apt-get update \ + && apt-get install -yqq --no-install-recommends $build_deps \ + && pip install \ + -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + 'websocket-client~=0.56' \ + astor \ + # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 + git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ + debugpy \ + geoip2 \ + git-aggregator \ + inotify \ + pdfminer.six \ + pg_activity \ + phonenumbers \ + plumbum \ + pudb \ + python-magic \ + watchdog \ + wdb \ + && (python3 -m compileall -q /usr/local/lib/python3.8/ || true) \ + && apt-get purge -yqq $build_deps \ + && apt-get autopurge -yqq \ + && rm -Rf /var/lib/apt/lists/* /tmp/* + +# Metadata +ARG VCS_REF +ARG BUILD_DATE +ARG VERSION +LABEL org.label-schema.schema-version="$VERSION" \ + org.label-schema.vendor=Tecnativa \ + org.label-schema.license=Apache-2.0 \ + org.label-schema.build-date="$BUILD_DATE" \ + org.label-schema.vcs-ref="$VCS_REF" \ + org.label-schema.vcs-url="https://github.com/Tecnativa/doodba" + +# Onbuild version, with all the magic +FROM base AS onbuild + +# Enable setting custom uids for odoo user during build of scaffolds +ONBUILD ARG UID=1000 +ONBUILD ARG GID=1000 + +# Enable Odoo user and filestore +ONBUILD RUN groupadd -g $GID odoo -o \ + && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && sync + +# Subimage triggers +ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] +ONBUILD CMD ["/usr/local/bin/odoo"] +ONBUILD ARG AGGREGATE=true +ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" +ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" +ONBUILD ARG DEPTH_DEFAULT=1 +ONBUILD ARG DEPTH_MERGE=100 +ONBUILD ARG CLEAN=true +ONBUILD ARG COMPILE=true +ONBUILD ARG FONT_MONO="Liberation Mono" +ONBUILD ARG FONT_SANS="Liberation Sans" +ONBUILD ARG FONT_SERIF="Liberation Serif" +ONBUILD ARG PIP_INSTALL_ODOO=true +ONBUILD ARG ADMIN_PASSWORD=admin +ONBUILD ARG SMTP_SERVER=smtp +ONBUILD ARG SMTP_PORT=25 +ONBUILD ARG SMTP_USER=false +ONBUILD ARG SMTP_PASSWORD=false +ONBUILD ARG SMTP_SSL=false +ONBUILD ARG EMAIL_FROM="" +ONBUILD ARG PROXY_MODE=false +ONBUILD ARG WITHOUT_DEMO=all +ONBUILD ARG PGUSER=odoo +ONBUILD ARG PGPASSWORD=odoopassword +ONBUILD ARG PGHOST=db +ONBUILD ARG PGPORT=5432 +ONBUILD ARG PGDATABASE=prod + +# Config variables +ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ + DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \ + DEFAULT_REPO_PATTERN_ODOO="$DEFAULT_REPO_PATTERN_ODOO" \ + UNACCENT="$UNACCENT" \ + PGUSER="$PGUSER" \ + PGPASSWORD="$PGPASSWORD" \ + PGHOST="$PGHOST" \ + PGPORT=$PGPORT \ + PGDATABASE="$PGDATABASE" \ + PROXY_MODE="$PROXY_MODE" \ + SMTP_SERVER="$SMTP_SERVER" \ + SMTP_PORT=$SMTP_PORT \ + SMTP_USER="$SMTP_USER" \ + SMTP_PASSWORD="$SMTP_PASSWORD" \ + SMTP_SSL="$SMTP_SSL" \ + EMAIL_FROM="$EMAIL_FROM" \ + WITHOUT_DEMO="$WITHOUT_DEMO" +ONBUILD ARG LOCAL_CUSTOM_DIR=./custom +ONBUILD COPY --chown=root:odoo $LOCAL_CUSTOM_DIR /opt/odoo/custom + +# https://docs.python.org/3/library/logging.html#levels +ONBUILD ARG LOG_LEVEL=INFO +ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ + && ln -s /opt/odoo/custom/ssh ~root/.ssh \ + && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ + && sync +ONBUILD ARG DB_VERSION=latest +ONBUILD RUN /opt/odoo/common/build && sync +ONBUILD VOLUME ["/var/lib/odoo"] +ONBUILD USER odoo diff --git a/README.md b/README.md index bd164c30..4a4f4fdd 100644 --- a/README.md +++ b/README.md @@ -394,8 +394,8 @@ server-tools: # Custom repositories ENV: DEFAULT_REPO_PATTERN: https://github.com/Tecnativa/{}.git - ODOO_VERSION: 14.0-new-feature -some-repo: # Cloned from https://github.com/Tecnativa/some-repo.git branch 14.0-new-feature + ODOO_VERSION: 15.0-new-feature +some-repo: # Cloned from https://github.com/Tecnativa/some-repo.git branch 15.0-new-feature - some_custom_module ``` diff --git a/tests/__init__.py b/tests/__init__.py index 5d96f8c1..801f2cee 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -16,7 +16,7 @@ DIR = dirname(__file__) ODOO_PREFIX = ("odoo", "--stop-after-init", "--workers=0") -ODOO_VERSIONS = frozenset(environ.get("DOCKER_TAG", "11.0 12.0 13.0 14.0").split()) +ODOO_VERSIONS = frozenset(environ.get("DOCKER_TAG", "11.0 12.0 13.0 14.0 15.0").split()) PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "13").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") GEIOP_CREDENTIALS_PROVIDED = environ.get("GEOIP_LICENSE_KEY", False) and environ.get( @@ -28,7 +28,7 @@ # preparing the pre-release for the next version of Odoo, which hasn't been # released yet. prerelease_skip = unittest.skipIf( - ODOO_VERSIONS == {"14.0"}, "Tests not supported in pre-release" + ODOO_VERSIONS & {"14.0", "15.0"}, "Tests not supported in pre-release" ) From 74ba1348c4b7daa25925bd7701acb97b47b1e6be Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Tue, 12 Oct 2021 11:02:12 +0200 Subject: [PATCH 157/255] [FIX] doodbalib: use --no-document instead of deprecated args for gem install --- lib/doodbalib/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/doodbalib/installer.py b/lib/doodbalib/installer.py index cf305b22..2f926cc8 100644 --- a/lib/doodbalib/installer.py +++ b/lib/doodbalib/installer.py @@ -88,7 +88,7 @@ def install(self): class GemInstaller(Installer): _cleanup_commands = ["rm -Rf ~/.gem /var/lib/gems/*/cache/"] - _install_command = ["gem", "install", "--no-rdoc", "--no-ri", "--no-update-sources"] + _install_command = ["gem", "install", "--no-document", "--no-update-sources"] class NpmInstaller(Installer): From 7803131718438988707cee11840548cd0721c401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marques?= Date: Wed, 13 Oct 2021 13:14:48 +0100 Subject: [PATCH 158/255] Fix tests Make necessary fixes to get v14 out of pre-release mode Configure test_qa for new images Add npm for tests that need it Check for patched werkzeug version only in versions < 14.0 Fix test_addons_env for 11.0 - 13.0 New openupgrade_scripts only exists from 14.0 Enable all tests already working in 15.0 Make dependency test for base_search_fuzzy a separate test. This enables us to run all other dependency tests with 15.0 already Co-authored-by: Andreas Perhab --- tests/__init__.py | 92 ++++++++++++------- tests/scaffoldings/addons_env_ou/Dockerfile | 2 + .../addons_env_ou/custom/src/addons.yaml | 16 ++++ .../addons_env_ou/docker-compose.yaml | 29 ++++++ .../dependencies/custom/src/addons.yaml | 2 - .../dependencies_base_search_fuzzy/Dockerfile | 2 + .../custom/src/addons.yaml | 2 + .../docker-compose.yaml | 29 ++++++ 8 files changed, 139 insertions(+), 35 deletions(-) create mode 100644 tests/scaffoldings/addons_env_ou/Dockerfile create mode 100644 tests/scaffoldings/addons_env_ou/custom/src/addons.yaml create mode 100644 tests/scaffoldings/addons_env_ou/docker-compose.yaml create mode 100644 tests/scaffoldings/dependencies_base_search_fuzzy/Dockerfile create mode 100644 tests/scaffoldings/dependencies_base_search_fuzzy/custom/src/addons.yaml create mode 100644 tests/scaffoldings/dependencies_base_search_fuzzy/docker-compose.yaml diff --git a/tests/__init__.py b/tests/__init__.py index 801f2cee..a74ae88e 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -28,7 +28,7 @@ # preparing the pre-release for the next version of Odoo, which hasn't been # released yet. prerelease_skip = unittest.skipIf( - ODOO_VERSIONS & {"14.0", "15.0"}, "Tests not supported in pre-release" + ODOO_VERSIONS & {"15.0"}, "Tests not supported in pre-release" ) @@ -191,23 +191,27 @@ def test_addons_filtered(self): ("bash", "-xc", 'test "$(addons list -cWsale)" == crm'), ) - @prerelease_skip def test_qa(self): """Test that QA tools are in place and work as expected.""" folder = join(SCAFFOLDINGS_DIR, "settings") - commands = ( - ("./custom/scripts/qa-insider-test",), - ("/qa/node_modules/.bin/eslint", "--version"), - ("/qa/venv/bin/flake8", "--version"), - ("/qa/venv/bin/pylint", "--version"), - ("/qa/venv/bin/python", "--version"), - ("/qa/venv/bin/python", "-c", "import pylint_odoo"), - ("test", "-d", "/qa/mqt"), - ) + commands = (("./custom/scripts/qa-insider-test",),) for sub_env in matrix(): + # Images up to v12 (inclusive) still had QA/NodeJS dependencies. + # Check if they are correctly installed. + if float(sub_env["ODOO_MINOR"]) < 13: + commands += ( + ("/qa/node_modules/.bin/eslint", "--version"), + ("/qa/venv/bin/flake8", "--version"), + ("/qa/venv/bin/pylint", "--version"), + ("/qa/venv/bin/python", "-c", "import pylint_odoo"), + ) + if sub_env["ODOO_MINOR"] != "11.0": + commands += (("/qa/node_modules/.bin/eslint", "--env-info"),) + commands += (("/qa/venv/bin/python", "--version"),) + if float(sub_env["ODOO_MINOR"]) < 14: + commands += (("test", "-d", "/qa/mqt"),) self.compose_test(folder, sub_env, *commands) - @prerelease_skip def test_settings(self): """Test settings are filled OK""" folder = join(SCAFFOLDINGS_DIR, "settings") @@ -301,7 +305,9 @@ def test_smallest(self): def test_addons_env(self): """Test environment variables in addons.yaml""" # The test is hacking ODOO_VERSION to pin a commit - for sub_env in matrix(): + # It uses OCA/OpenUpgrade as base for Odoo, which won't work from v14 + # and onwards as it no longer is a fork from Odoo + for sub_env in matrix(odoo={"11.0", "12.0", "13.0"}): self.compose_test( join(SCAFFOLDINGS_DIR, "addons_env"), sub_env, @@ -313,10 +319,20 @@ def test_addons_env(self): ("test", "-e", "auto/addons/crm"), ("test", "-d", "auto/addons/crm/migrations"), ) + for sub_env in matrix(odoo_skip={"11.0", "12.0", "13.0"}): + self.compose_test( + join(SCAFFOLDINGS_DIR, "addons_env_ou"), + sub_env, + # check module from custom repo pattern + ("test", "-d", "custom/src/misc-addons"), + ("test", "-d", "custom/src/misc-addons/web_debranding"), + ("test", "-e", "auto/addons/web_debranding"), + # Migrations folder + ("test", "-e", "auto/addons/openupgrade_scripts"), + ("test", "-d", "auto/addons/openupgrade_scripts/scripts"), + ) # HACK https://github.com/itpp-labs/misc-addons/issues/1014 - # TODO Remove decorator - @prerelease_skip def test_addons_env_double(self): """Test double addon reference in addons.yaml""" common_tests = ( @@ -384,8 +400,6 @@ def test_dotd(self): ("--version",), ) - # TODO Remove decorator when base_search_fuzzy is migrated to 14.0 - @prerelease_skip def test_dependencies(self): """Test dependencies installation.""" dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies") @@ -397,17 +411,6 @@ def test_dependencies(self): ("test", "!", "-f", "custom/dependencies/gem.txt"), ("test", "!", "-f", "custom/dependencies/npm.txt"), ("test", "!", "-f", "custom/dependencies/pip.txt"), - # It should have base_search_fuzzy available - ("test", "-d", "custom/src/server-tools/base_search_fuzzy"), - # Patched Werkzeug version - ( - "bash", - "-xc", - ( - 'test "$(python -c "import werkzeug; ' - 'print(werkzeug.__version__)")" == 0.14.1' - ), - ), # apt_build.txt ("test", "-f", "custom/dependencies/apt_build.txt"), ("test", "!", "-e", "/usr/sbin/sshd"), @@ -418,11 +421,7 @@ def test_dependencies(self): ("test", "-f", "custom/dependencies/070-apt-bc.txt"), ("test", "-e", "/usr/bin/bc"), # 150-npm-aloha_world-install.txt - ( - "test", - "-f", - ("custom/dependencies/" "150-npm-aloha_world-install.txt"), - ), + ("test", "-f", "custom/dependencies/150-npm-aloha_world-install.txt"), ("node", "-e", "require('test-npm-install')"), # 200-pip-without-ext ("test", "-f", "custom/dependencies/200-pip-without-ext"), @@ -432,6 +431,33 @@ def test_dependencies(self): ("test", "-f", "custom/dependencies/270-gem.txt"), ("hello-world",), ) + if float(sub_env["ODOO_MINOR"]) < 14: + self.compose_test( + dependencies_dir, + sub_env, + # For odoo versions < 14.0 we make sure we have a patched Werkzeug version + ( + "bash", + "-xc", + ( + 'test "$(python -c "import werkzeug; ' + 'print(werkzeug.__version__)")" == 0.14.1' + ), + ), + ) + + # TODO Remove decorator when base_search_fuzzy is migrated to 15.0 + @prerelease_skip + def test_dependencies_base_search_fuzzy(self): + """Test dependencies installation.""" + dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies_base_search_fuzzy") + for sub_env in matrix(): + self.compose_test( + dependencies_dir, + sub_env, + # It should have base_search_fuzzy available + ("test", "-d", "custom/src/server-tools/base_search_fuzzy"), + ) def test_modified_uids(self): """tests if we can build an image with a custom uid and gid of odoo""" diff --git a/tests/scaffoldings/addons_env_ou/Dockerfile b/tests/scaffoldings/addons_env_ou/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/addons_env_ou/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/addons_env_ou/custom/src/addons.yaml b/tests/scaffoldings/addons_env_ou/custom/src/addons.yaml new file mode 100644 index 00000000..874250c3 --- /dev/null +++ b/tests/scaffoldings/addons_env_ou/custom/src/addons.yaml @@ -0,0 +1,16 @@ +server-tools: + - module_auto_update +OpenUpgrade: + - openupgrade_scripts +--- +ENV: + DEFAULT_REPO_PATTERN_ODOO: https://github.com/OCA/OCB.git +odoo/addons: + - crm + - sale +--- +ENV: + DEFAULT_REPO_PATTERN: https://github.com/itpp-labs/{}.git + ODOO_VERSION: 554222498d5101ef59fc4d3e1059e2b407dffd6f +misc-addons: + - web_debranding diff --git a/tests/scaffoldings/addons_env_ou/docker-compose.yaml b/tests/scaffoldings/addons_env_ou/docker-compose.yaml new file mode 100644 index 00000000..5cb154cd --- /dev/null +++ b/tests/scaffoldings/addons_env_ou/docker-compose.yaml @@ -0,0 +1,29 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + WITHOUT_DEMO: "false" + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + volumes: + - filestore:/var/lib/odoo:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: diff --git a/tests/scaffoldings/dependencies/custom/src/addons.yaml b/tests/scaffoldings/dependencies/custom/src/addons.yaml index 1c8ff89e..e69de29b 100644 --- a/tests/scaffoldings/dependencies/custom/src/addons.yaml +++ b/tests/scaffoldings/dependencies/custom/src/addons.yaml @@ -1,2 +0,0 @@ -server-tools: - - base_search_fuzzy diff --git a/tests/scaffoldings/dependencies_base_search_fuzzy/Dockerfile b/tests/scaffoldings/dependencies_base_search_fuzzy/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/dependencies_base_search_fuzzy/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/dependencies_base_search_fuzzy/custom/src/addons.yaml b/tests/scaffoldings/dependencies_base_search_fuzzy/custom/src/addons.yaml new file mode 100644 index 00000000..1c8ff89e --- /dev/null +++ b/tests/scaffoldings/dependencies_base_search_fuzzy/custom/src/addons.yaml @@ -0,0 +1,2 @@ +server-tools: + - base_search_fuzzy diff --git a/tests/scaffoldings/dependencies_base_search_fuzzy/docker-compose.yaml b/tests/scaffoldings/dependencies_base_search_fuzzy/docker-compose.yaml new file mode 100644 index 00000000..5cb154cd --- /dev/null +++ b/tests/scaffoldings/dependencies_base_search_fuzzy/docker-compose.yaml @@ -0,0 +1,29 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + WITHOUT_DEMO: "false" + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + volumes: + - filestore:/var/lib/odoo:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: From 1e130ae9461d35c3c69cd5106662a7cd6b44a9c9 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Tue, 19 Oct 2021 13:04:21 +0200 Subject: [PATCH 159/255] [FIX] devel: fix geoip with devel /opt/odoo/auto mappings --- 11.0.Dockerfile | 1 + 12.0.Dockerfile | 1 + 13.0.Dockerfile | 1 + 14.0.Dockerfile | 1 + 15.0.Dockerfile | 1 + entrypoint.d/45-geoip | 13 ++++ tests/__init__.py | 59 ++++++++++--------- tests/scaffoldings/geoip_devel/Dockerfile | 2 + .../geoip_devel/custom/src/addons.yaml | 0 .../geoip_devel/docker-compose.yaml | 42 +++++++++++++ .../geoip_devel/odoo/auto/.gitkeep | 0 .../geoip_devel/odoo/custom/.gitkeep | 0 12 files changed, 93 insertions(+), 28 deletions(-) create mode 100644 tests/scaffoldings/geoip_devel/Dockerfile create mode 100644 tests/scaffoldings/geoip_devel/custom/src/addons.yaml create mode 100644 tests/scaffoldings/geoip_devel/docker-compose.yaml create mode 100644 tests/scaffoldings/geoip_devel/odoo/auto/.gitkeep create mode 100644 tests/scaffoldings/geoip_devel/odoo/custom/.gitkeep diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 036943a9..6bdf1edd 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -106,6 +106,7 @@ RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ && chmod -R a+rX /usr/local/lib/python3.5/site-packages/doodbalib \ + && cp -a /etc/GeoIP.conf /etc/GeoIP.conf.orig \ && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 3dbfbd39..427f69bd 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -100,6 +100,7 @@ RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ && chmod -R a+rX /usr/local/lib/python3.5/site-packages/doodbalib \ + && cp -a /etc/GeoIP.conf /etc/GeoIP.conf.orig \ && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 9a89ec1b..a248d90c 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -78,6 +78,7 @@ RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ && chmod -R a+rX /usr/local/lib/python3.6/site-packages/doodbalib \ + && cp -a /etc/GeoIP.conf /etc/GeoIP.conf.orig \ && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ diff --git a/14.0.Dockerfile b/14.0.Dockerfile index cd03d583..3942d76f 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -74,6 +74,7 @@ RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ && chmod -R a+rX /usr/local/lib/python3.8/site-packages/doodbalib \ + && cp -a /etc/GeoIP.conf /etc/GeoIP.conf.orig \ && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ diff --git a/15.0.Dockerfile b/15.0.Dockerfile index 4852e7a0..1de6fb32 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -73,6 +73,7 @@ RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ && chmod -R a+rX /usr/local/lib/python3.8/site-packages/doodbalib \ + && cp -a /etc/GeoIP.conf /etc/GeoIP.conf.orig \ && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ diff --git a/entrypoint.d/45-geoip b/entrypoint.d/45-geoip index 8d6256dd..f467f7c6 100755 --- a/entrypoint.d/45-geoip +++ b/entrypoint.d/45-geoip @@ -1,5 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +import os.path import re import sys @@ -18,6 +19,18 @@ if GEOIP_ACCOUNT_ID not in {"", "0"} and GEOIP_LICENSE_KEY not in {"", "0"}: "This product includes GeoLite2 data created by MaxMind, " "available from https://www.maxmind.com" ) + + # In devel mode, copy geoip conf to an inspectable dir if the do not exist yet and keep them up to date + os.makedirs("/opt/odoo/auto/geoip/", exist_ok=True) + if not os.path.exists("/opt/odoo/auto/geoip/GeoIP.conf"): + with open("/etc/GeoIP.conf.orig") as fpr, open( + "/opt/odoo/auto/geoip/GeoIP.conf", "w" + ) as fpw: + for line in fpr.readlines(): + if "DatabaseDirectory " in line: + line = "DatabaseDirectory /opt/odoo/auto/geoip/" + fpw.write(line) + # Obtain current GeoIP configuration geoip_file = local.path("/opt/odoo/auto/geoip/GeoIP.conf") geoip_conf = geoip_file.read() diff --git a/tests/__init__.py b/tests/__init__.py index a74ae88e..9f3bf780 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -549,34 +549,37 @@ def test_default_uids(self): not GEIOP_CREDENTIALS_PROVIDED, "GeoIP credentials missing in environment" ) def test_geoip(self): - geoip_dir = join(SCAFFOLDINGS_DIR, "geoip") - for sub_env in matrix(): - self.compose_test( - geoip_dir, - sub_env, - # verify that geoipupdate works after waiting for entrypoint to finish its update - ( - "bash", - "-c", - "timeout 60s bash -c 'while (ls -l /proc/*/exe 2>&1 | grep geoipupdate); do sleep 1; done' &&" - " geoipupdate", - ), - # verify that geoip database exists after entrypoint finished its update - # using ls and /proc because ps is missing in image for 13.0 - ( - "bash", - "-c", - "timeout 60s bash -c 'while (ls -l /proc/*/exe 2>&1 | grep geoipupdate); do sleep 1; done' &&" - " test -e /opt/odoo/auto/geoip/GeoLite2-City.mmdb", - ), - # verify that geoip database is configured - ( - "grep", - "-R", - "geoip_database = /opt/odoo/auto/geoip/GeoLite2-City.mmdb", - "/opt/odoo/auto/odoo.conf", - ), - ) + for geoip_dir in ( + join(SCAFFOLDINGS_DIR, "geoip"), + join(SCAFFOLDINGS_DIR, "geoip_devel"), + ): + for sub_env in matrix(): + self.compose_test( + geoip_dir, + dict(sub_env, UID=str(os.getuid()), GID=str(os.getgid()),), + # verify that geoipupdate works after waiting for entrypoint to finish its update + ( + "bash", + "-c", + "timeout 60s bash -c 'while (ls -l /proc/*/exe 2>&1 | grep geoipupdate); do sleep 1; done' &&" + " geoipupdate", + ), + # verify that geoip database exists after entrypoint finished its update + # using ls and /proc because ps is missing in image for 13.0 + ( + "bash", + "-c", + "timeout 60s bash -c 'while (ls -l /proc/*/exe 2>&1 | grep geoipupdate); do sleep 1; done' &&" + " test -e /opt/odoo/auto/geoip/GeoLite2-City.mmdb", + ), + # verify that geoip database is configured + ( + "grep", + "-R", + "geoip_database = /opt/odoo/auto/geoip/GeoLite2-City.mmdb", + "/opt/odoo/auto/odoo.conf", + ), + ) def test_postgres_client_version(self): postgres_client_version_dir = join(SCAFFOLDINGS_DIR, "postgres_client_version") diff --git a/tests/scaffoldings/geoip_devel/Dockerfile b/tests/scaffoldings/geoip_devel/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/geoip_devel/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/geoip_devel/custom/src/addons.yaml b/tests/scaffoldings/geoip_devel/custom/src/addons.yaml new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/geoip_devel/docker-compose.yaml b/tests/scaffoldings/geoip_devel/docker-compose.yaml new file mode 100644 index 00000000..c973e144 --- /dev/null +++ b/tests/scaffoldings/geoip_devel/docker-compose.yaml @@ -0,0 +1,42 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + PIP_INSTALL_ODOO: "false" + WITHOUT_DEMO: "false" + + # enable creating geoip directories with correct permissions + UID: "${UID:-1000}" + GID: "${GID:-1000}" + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + + # This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com + GEOIP_ACCOUNT_ID: $GEOIP_ACCOUNT_ID + GEOIP_LICENSE_KEY: $GEOIP_LICENSE_KEY + volumes: + - filestore:/var/lib/odoo:z + # also use mappings from https://github.com/Tecnativa/doodba-copier-template/blob/main/devel.yaml.jinja to + # simulate devel.yaml + - ./odoo/custom:/opt/odoo/custom:ro,z + - ./odoo/auto:/opt/odoo/auto:rw,z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: diff --git a/tests/scaffoldings/geoip_devel/odoo/auto/.gitkeep b/tests/scaffoldings/geoip_devel/odoo/auto/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/geoip_devel/odoo/custom/.gitkeep b/tests/scaffoldings/geoip_devel/odoo/custom/.gitkeep new file mode 100644 index 00000000..e69de29b From e249eaf9eda2640f1fca5fd66b53e408c700fde8 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 2 Feb 2022 09:15:32 +0000 Subject: [PATCH 160/255] [IMP] add missing flanker soft dependency In Odoo 15.0, support for flanker has been included. See https://github.com/odoo/odoo/blob/a7f7233e0eae8ee101d745a9813cba930fd03dcb/addons/mail/tools/mail_validation.py#L11-L27 Without this, we get these logs: odoo.addons.mail.tools.mail_validation: The `flanker` Python module is not installed,so email validation fallback to email_normalize. Use 'pip install flanker' to install it @moduon MT-221 --- 15.0.Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/15.0.Dockerfile b/15.0.Dockerfile index 1de6fb32..23a7ce1e 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -125,6 +125,7 @@ RUN build_deps=" \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ debugpy \ + flanker \ geoip2 \ git-aggregator \ inotify \ From 4560f60fa9785651518bb0021a6d4589e09cb875 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 2 Feb 2022 12:39:26 +0000 Subject: [PATCH 161/255] [FIX] missing flanker dependencies As seen in https://github.com/mailgun/flanker/pull/164, for using flanker for validation, one needs additional dependencies. That's Odoo's use case, so without this patch it fails with: ``` 2022-02-02 12:26:32,758 29 WARNING odoo odoo.modules.loading: Module crm demo data failed to install, installed without demo data Traceback (most recent call last): File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 680, in _tag_root f(rec) File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 333, in _tag_function _eval_xml(self, rec, env) File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 204, in _eval_xml return odoo.api.call_kw(model, method_name, args, kwargs) File "/opt/odoo/custom/src/odoo/odoo/api.py", line 464, in call_kw result = _call_kw_multi(method, model, args, kwargs) File "/opt/odoo/custom/src/odoo/odoo/api.py", line 451, in _call_kw_multi result = method(recs, *args, **kwargs) File "/opt/odoo/auto/addons/crm/models/crm_lead.py", line 897, in action_set_lost res = self.action_archive() File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5062, in action_archive return self.filtered(lambda record: record[self._active_name]).toggle_active() File "/opt/odoo/auto/addons/crm/models/crm_lead.py", line 885, in toggle_active res = super(Lead, self).toggle_active() File "/opt/odoo/auto/addons/mail/models/mail_activity_mixin.py", line 337, in toggle_active return super(MailActivityMixin, self).toggle_active() File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5055, in toggle_active active_recs[self._active_name] = False File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5891, in __setitem__ return self._fields[key].__set__(self, value) File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1217, in __set__ records.write({self.name: write_value}) File "/opt/odoo/auto/addons/crm/models/crm_lead.py", line 685, in write self._handle_won_lost(vals) File "/opt/odoo/auto/addons/crm/models/crm_lead.py", line 803, in _handle_won_lost leads_reach_lost._pls_increment_frequencies(to_state='lost') File "/opt/odoo/auto/addons/crm/models/crm_lead.py", line 1998, in _pls_increment_frequencies new_frequencies_by_team, existing_frequencies_by_team = self._pls_prepare_update_frequency_table(target_state=from_state or to_state) File "/opt/odoo/auto/addons/crm/models/crm_lead.py", line 2156, in _pls_prepare_update_frequency_table leads_values_dict = pls_leads._pls_get_lead_pls_values(domain=domain) File "/opt/odoo/auto/addons/crm/models/crm_lead.py", line 2376, in _pls_get_lead_pls_values self.flush(['probability']) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5644, in flush self.recompute(fnames, records=records) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 6124, in recompute process(field) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 6095, in process field.recompute(recs) File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1243, in recompute self.compute_value(recs) File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1265, in compute_value records._compute_field_value(self) File "/opt/odoo/auto/addons/mail/models/mail_thread.py", line 410, in _compute_field_value return super()._compute_field_value(field) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4256, in _compute_field_value getattr(self, field.compute)() File "/opt/odoo/auto/addons/crm/models/crm_lead.py", line 453, in _compute_probabilities lead_probabilities = self._pls_get_naive_bayes_probabilities() File "/opt/odoo/auto/addons/crm/models/crm_lead.py", line 1876, in _pls_get_naive_bayes_probabilities leads_values_dict = self._pls_get_lead_pls_values(domain=domain) File "/opt/odoo/auto/addons/crm/models/crm_lead.py", line 2421, in _pls_get_lead_pls_values value = lead[field].id if isinstance(lead[field], models.BaseModel) else lead[field] File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5882, in __getitem__ return self._fields[key].__get__(self, type(self)) File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1054, in __get__ self.recompute(record) File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1243, in recompute self.compute_value(recs) File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1265, in compute_value records._compute_field_value(self) File "/opt/odoo/auto/addons/mail/models/mail_thread.py", line 410, in _compute_field_value return super()._compute_field_value(field) File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4256, in _compute_field_value getattr(self, field.compute)() File "/opt/odoo/auto/addons/crm/models/crm_lead.py", line 439, in _compute_email_state if mail_validation.mail_validate(email): File "/opt/odoo/auto/addons/mail/tools/mail_validation.py", line 17, in mail_validate return bool(address.validate_address(email)) File "/usr/local/lib/python3.8/site-packages/flanker/utils.py", line 64, in wrapper return_value = f(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/flanker/addresslib/address.py", line 312, in validate_address exchanger, mx_metrics = mail_exchanger_lookup(paddr.hostname, metrics=True) File "/usr/local/lib/python3.8/site-packages/flanker/utils.py", line 64, in wrapper return_value = f(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/flanker/addresslib/validate.py", line 146, in mail_exchanger_lookup in_cache, cache_value = lookup_exchanger_in_cache(domain) File "/usr/local/lib/python3.8/site-packages/flanker/addresslib/validate.py", line 188, in lookup_exchanger_in_cache lookup = _get_mx_cache()[domain] File "/usr/local/lib/python3.8/site-packages/flanker/addresslib/validate.py", line 238, in _get_mx_cache from flanker.addresslib.drivers.redis_driver import RedisCache File "/usr/local/lib/python3.8/site-packages/flanker/addresslib/drivers/redis_driver.py", line 3, in import redis ModuleNotFoundError: No module named 'redis' ``` @moduon MT-221 --- 15.0.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/15.0.Dockerfile b/15.0.Dockerfile index 23a7ce1e..f6652b0e 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -125,7 +125,7 @@ RUN build_deps=" \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ debugpy \ - flanker \ + flanker[validator] \ geoip2 \ git-aggregator \ inotify \ From 372d29ef611f465cac4d9c7c90cbfa330eca4990 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 18 Feb 2022 09:39:18 +0000 Subject: [PATCH 162/255] feat: add pyOpenSSL by default This is one Odoo lazy dependency since v14. https://github.com/odoo/odoo/blob/d4de2cfe64f42a711816bfbbc88a371519eee9da/addons/l10n_es_edi_sii/__manifest__.py#L46 @moduon MT-282 --- 14.0.Dockerfile | 1 + 15.0.Dockerfile | 1 + 2 files changed, 2 insertions(+) diff --git a/14.0.Dockerfile b/14.0.Dockerfile index 3942d76f..1c3fde3f 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -135,6 +135,7 @@ RUN build_deps=" \ phonenumbers \ plumbum \ pudb \ + pyOpenSSL \ python-magic \ watchdog \ wdb \ diff --git a/15.0.Dockerfile b/15.0.Dockerfile index f6652b0e..fbae455f 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -134,6 +134,7 @@ RUN build_deps=" \ phonenumbers \ plumbum \ pudb \ + pyOpenSSL \ python-magic \ watchdog \ wdb \ From d81a424924a407e4d74b0394c76ed90fd2fa2bac Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Tue, 8 Mar 2022 17:04:23 +0100 Subject: [PATCH 163/255] [IMP] 15.0: generate flanker cached tables during build and ignore the warnings printed on the first import see https://github.com/mailgun/flanker/issues/231 --- 15.0.Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/15.0.Dockerfile b/15.0.Dockerfile index fbae455f..71c6aa76 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -139,6 +139,9 @@ RUN build_deps=" \ watchdog \ wdb \ && (python3 -m compileall -q /usr/local/lib/python3.8/ || true) \ + # generate flanker cached tables during install when /usr/local/lib/ is still intended to be written to + # https://github.com/Tecnativa/doodba/issues/486 + && python3 -c 'from flanker.addresslib import address' >/dev/null 2>&1 \ && apt-get purge -yqq $build_deps \ && apt-get autopurge -yqq \ && rm -Rf /var/lib/apt/lists/* /tmp/* From e3c0c43cc8ea24beeae24d227d067a94698e0093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=2E=20D=C3=ADaz?= Date: Tue, 21 Jun 2022 15:08:54 +0200 Subject: [PATCH 164/255] [IMP] better log messages --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 13.0.Dockerfile | 2 +- 14.0.Dockerfile | 2 +- 15.0.Dockerfile | 2 +- README.md | 2 +- bin/autoaggregate | 6 +++--- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 6bdf1edd..bdfbb8a6 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -26,7 +26,7 @@ ENV DB_FILTER=.* \ DEBUGPY_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ - PYTHONOPTIMIZE=1 \ + PYTHONOPTIMIZE="" \ UNACCENT=true \ WAIT_DB=true \ WDB_NO_BROWSER_AUTO_OPEN=True \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 427f69bd..0d9da3dd 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -26,7 +26,7 @@ ENV DB_FILTER=.* \ DEBUGPY_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ - PYTHONOPTIMIZE=1 \ + PYTHONOPTIMIZE="" \ UNACCENT=true \ WAIT_DB=true \ WDB_NO_BROWSER_AUTO_OPEN=True \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index a248d90c..4c34d24f 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -26,7 +26,7 @@ ENV DB_FILTER=.* \ DEBUGPY_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ - PYTHONOPTIMIZE=1 \ + PYTHONOPTIMIZE="" \ UNACCENT=true \ WAIT_DB=true \ WDB_NO_BROWSER_AUTO_OPEN=True \ diff --git a/14.0.Dockerfile b/14.0.Dockerfile index 1c3fde3f..3a5f14b2 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -23,7 +23,7 @@ ENV DB_FILTER=.* \ DEBUGPY_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ - PYTHONOPTIMIZE=1 \ + PYTHONOPTIMIZE="" \ UNACCENT=true \ WAIT_DB=true \ WDB_NO_BROWSER_AUTO_OPEN=True \ diff --git a/15.0.Dockerfile b/15.0.Dockerfile index 71c6aa76..50112a8a 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -23,7 +23,7 @@ ENV DB_FILTER=.* \ DEBUGPY_ENABLE=0 \ PUDB_RDB_HOST=0.0.0.0 \ PUDB_RDB_PORT=6899 \ - PYTHONOPTIMIZE=1 \ + PYTHONOPTIMIZE="" \ UNACCENT=true \ WAIT_DB=true \ WDB_NO_BROWSER_AUTO_OPEN=True \ diff --git a/README.md b/README.md index 4a4f4fdd..121be421 100644 --- a/README.md +++ b/README.md @@ -422,7 +422,7 @@ This folder is full of magic. I'll document it some day. For now, just look at t Only some notes: -- Will compile your code with [`PYTHONOPTIMIZE=1`][] by default. +- Will compile your code with [`PYTHONOPTIMIZE=""`][] by default. - Will remove all code not used from the image by default (not listed in `/opt/odoo/custom/src/addons.yaml`), to keep it thin. diff --git a/bin/autoaggregate b/bin/autoaggregate index 0e79f486..a1a3c05d 100755 --- a/bin/autoaggregate +++ b/bin/autoaggregate @@ -45,9 +45,9 @@ def aggregate(config): for _exec in pre_execs: try: _exec() - except Exception as e: - logger.error("Error in %s: %s" % (_exec, e)) - logger.exception(e) + except Exception as err: + logger.error("Error in %s: %s" % (_exec, err)) + logger.exception(err) raise if ~GID: From 13666528232287ffc355747d31a1e139f276f358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=2E=20D=C3=ADaz?= Date: Tue, 21 Jun 2022 15:21:44 +0200 Subject: [PATCH 165/255] [IMP] readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 121be421..5e327ca5 100644 --- a/README.md +++ b/README.md @@ -356,7 +356,7 @@ Advanced features: - You can use any wildcards supported by [Python's glob module][glob]. -This example shows these advanced features: +The following example shows these advanced features: ```yaml # Spanish Localization From ee5d9ac5f26a3439a3687650cad26cf0809da287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=2E=20D=C3=ADaz?= Date: Tue, 21 Jun 2022 15:40:33 +0200 Subject: [PATCH 166/255] [IMP] pre-commit update --- .pre-commit-config.yaml | 13 +++++++------ README.md | 5 +++++ bin/addons | 2 +- build.d/800-permissions | 1 - entrypoint.d/45-geoip | 1 - hooks/build | 33 ++++++++++++++++++--------------- lib/doodbalib/__init__.py | 2 +- tests/__init__.py | 18 +++++++++++++++--- 8 files changed, 47 insertions(+), 28 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1f4b4a10..12f1f4dd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,11 +2,11 @@ default_language_version: python: python3 repos: - repo: https://github.com/psf/black - rev: 19.10b0 + rev: 22.3.0 hooks: - id: black - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.4.0 + rev: v4.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -20,19 +20,20 @@ repos: - id: mixed-line-ending args: ["--fix=lf"] - repo: https://github.com/asottile/seed-isort-config - rev: v1.9.3 + rev: v2.2.0 hooks: - id: seed-isort-config - repo: https://github.com/pre-commit/mirrors-isort - rev: v4.3.21 + rev: v5.10.1 hooks: - id: isort - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.2.1 + rev: v2.7.1 hooks: - id: prettier - repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs - rev: v1.1.0 + rev: v1.1.2 hooks: - id: markdown-toc args: [--bullets=-, -i] + exclude: .github/ diff --git a/README.md b/README.md index 5e327ca5..205733ab 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,9 @@ it work anywhere quickly. You can start working with this straight away with our [template][]. + + + - [Image usage](#image-usage) @@ -78,6 +81,8 @@ You can start working with this straight away with our [template][]. + + ## Image usage Basically, every directory you have to worry about is found inside `/opt/odoo`. This is diff --git a/bin/addons b/bin/addons index 5be5f1d3..18c0dfb3 100755 --- a/bin/addons +++ b/bin/addons @@ -139,6 +139,6 @@ else: if args.test: command += ["--test-enable", "--workers", "0"] if os.environ.get("PGDATABASE"): - command += ["--db-filter", u"^{}$".format(os.environ.get("PGDATABASE"))] + command += ["--db-filter", "^{}$".format(os.environ.get("PGDATABASE"))] logger.info("Executing %s", " ".join(command)) check_call(command) diff --git a/build.d/800-permissions b/build.d/800-permissions index a34dc176..312ab845 100755 --- a/build.d/800-permissions +++ b/build.d/800-permissions @@ -3,7 +3,6 @@ import os.path from doodbalib import AUTO_DIR, CUSTOM_DIR - from plumbum import FG, local find, xargs, chmod, chown = ( diff --git a/entrypoint.d/45-geoip b/entrypoint.d/45-geoip index f467f7c6..85df2a9e 100755 --- a/entrypoint.d/45-geoip +++ b/entrypoint.d/45-geoip @@ -5,7 +5,6 @@ import re import sys from doodbalib import logger - from plumbum import BG, local from plumbum.cmd import geoipupdate diff --git a/hooks/build b/hooks/build index c7526b46..2fc238b3 100755 --- a/hooks/build +++ b/hooks/build @@ -15,21 +15,24 @@ tag = local["docker"]["image", "tag"] # Build base and onbuild images for target, suffix in (("base", ""), ("onbuild", "-onbuild")): image_name = "%s:%s%s" % (REPO, VERSION, suffix) - build[ - "--build-arg", - "VCS_REF=%s" % COMMIT, - "--build-arg", - "BUILD_DATE=%s" % date().strip(), - "--build-arg", - "ODOO_VERSION=%s" % VERSION, - "--tag", - image_name, - "--target", - target, - "--file", - "%s.Dockerfile" % VERSION, - ROOT, - ] & FG + ( + build[ + "--build-arg", + "VCS_REF=%s" % COMMIT, + "--build-arg", + "BUILD_DATE=%s" % date().strip(), + "--build-arg", + "ODOO_VERSION=%s" % VERSION, + "--tag", + image_name, + "--target", + target, + "--file", + "%s.Dockerfile" % VERSION, + ROOT, + ] + & FG + ) # Tag "latest" image if applicable if VERSION == local.env.get("LATEST_RELEASE"): diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index e0264c80..6da810b9 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -159,7 +159,7 @@ def addons_config(filtered=True, strict=False): # Other addons fall in between if filtered and len(repos) != 1: raise AddonsConfigError( - u"Addon {} defined in several repos {}".format(addon, repos) + "Addon {} defined in several repos {}".format(addon, repos) ) for repo in repos: yield addon, repo diff --git a/tests/__init__.py b/tests/__init__.py index 9f3bf780..08d423ac 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -123,7 +123,11 @@ def test_addons_filtered(self): "-xc", 'test "$(addons list -dw private_addon -W dummy_addon)" == base,website', ), - ("bash", "-xc", 'test "$(addons list -nd)" == base,iap',), + ( + "bash", + "-xc", + 'test "$(addons list -nd)" == base,iap', + ), ( "bash", "-xc", @@ -556,7 +560,11 @@ def test_geoip(self): for sub_env in matrix(): self.compose_test( geoip_dir, - dict(sub_env, UID=str(os.getuid()), GID=str(os.getgid()),), + dict( + sub_env, + UID=str(os.getuid()), + GID=str(os.getgid()), + ), # verify that geoipupdate works after waiting for entrypoint to finish its update ( "bash", @@ -634,7 +642,11 @@ def test_symlinks(self): "/opt/odoo/auto/addons/addon_alias/__openerp__.py", ), # verify that symlinking outside the src directory doesn't enable changing permission of important stuff - ("bash", "-c", '[[ "$(stat -c %U:%G /bin/date)" == "root:root" ]]',), + ( + "bash", + "-c", + '[[ "$(stat -c %U:%G /bin/date)" == "root:root" ]]', + ), # verify that everything in src dir (except symlinks) is accessible by odoo ( "bash", From 26c4d6f4d1e20e7b35df6293250df63cc4b08c8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 22:08:52 +0000 Subject: [PATCH 167/255] Bump paramiko from 2.7.2 to 2.10.1 Bumps [paramiko](https://github.com/paramiko/paramiko) from 2.7.2 to 2.10.1. - [Release notes](https://github.com/paramiko/paramiko/releases) - [Changelog](https://github.com/paramiko/paramiko/blob/main/NEWS) - [Commits](https://github.com/paramiko/paramiko/compare/2.7.2...2.10.1) --- updated-dependencies: - dependency-name: paramiko dependency-type: indirect ... Signed-off-by: dependabot[bot] --- poetry.lock | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index 295bd9b7..2e8ee896 100644 --- a/poetry.lock +++ b/poetry.lock @@ -124,7 +124,7 @@ python-versions = "*" [[package]] name = "docker" -version = "4.4.0" +version = "4.4.4" description = "A Python library for the Docker Engine API." category = "dev" optional = false @@ -240,7 +240,7 @@ python-versions = "*" [[package]] name = "paramiko" -version = "2.7.2" +version = "2.10.1" description = "SSH2 protocol library" category = "dev" optional = false @@ -250,6 +250,7 @@ python-versions = "*" bcrypt = ">=3.1.3" cryptography = ">=2.5" pynacl = ">=1.0.1" +six = "*" [package.extras] all = ["pyasn1 (>=0.1.7)", "pynacl (>=1.0.1)", "bcrypt (>=3.1.3)", "invoke (>=1.3)", "gssapi (>=1.4.1)", "pywin32 (>=2.1.8)"] @@ -439,10 +440,13 @@ attrs = [ {file = "attrs-20.3.0.tar.gz", hash = "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700"}, ] bcrypt = [ + {file = "bcrypt-3.2.0-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:b589229207630484aefe5899122fb938a5b017b0f4349f769b8c13e78d99a8fd"}, {file = "bcrypt-3.2.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:c95d4cbebffafcdd28bd28bb4e25b31c50f6da605c81ffd9ad8a3d1b2ab7b1b6"}, {file = "bcrypt-3.2.0-cp36-abi3-manylinux1_x86_64.whl", hash = "sha256:63d4e3ff96188e5898779b6057878fecf3f11cfe6ec3b313ea09955d587ec7a7"}, {file = "bcrypt-3.2.0-cp36-abi3-manylinux2010_x86_64.whl", hash = "sha256:cd1ea2ff3038509ea95f687256c46b79f5fc382ad0aa3664d200047546d511d1"}, {file = "bcrypt-3.2.0-cp36-abi3-manylinux2014_aarch64.whl", hash = "sha256:cdcdcb3972027f83fe24a48b1e90ea4b584d35f1cc279d76de6fc4b13376239d"}, + {file = "bcrypt-3.2.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:a0584a92329210fcd75eb8a3250c5a941633f8bfaf2a18f81009b097732839b7"}, + {file = "bcrypt-3.2.0-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:56e5da069a76470679f312a7d3d23deb3ac4519991a0361abc11da837087b61d"}, {file = "bcrypt-3.2.0-cp36-abi3-win32.whl", hash = "sha256:a67fb841b35c28a59cebed05fbd3e80eea26e6d75851f0574a9273c80f3e9b55"}, {file = "bcrypt-3.2.0-cp36-abi3-win_amd64.whl", hash = "sha256:81fec756feff5b6818ea7ab031205e1d323d8943d237303baca2c5f9c7846f34"}, {file = "bcrypt-3.2.0.tar.gz", hash = "sha256:5b93c1726e50a93a033c36e5ca7fdcd29a5c7395af50a6892f5d9e7c6cfbfb29"}, @@ -477,16 +481,19 @@ cffi = [ {file = "cffi-1.14.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a7711edca4dcef1a75257b50a2fbfe92a65187c47dab5a0f1b9b332c5919a3fb"}, {file = "cffi-1.14.4-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:00e28066507bfc3fe865a31f325c8391a1ac2916219340f87dfad602c3e48e5d"}, {file = "cffi-1.14.4-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:798caa2a2384b1cbe8a2a139d80734c9db54f9cc155c99d7cc92441a23871c03"}, + {file = "cffi-1.14.4-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:a5ed8c05548b54b998b9498753fb9cadbfd92ee88e884641377d8a8b291bcc01"}, {file = "cffi-1.14.4-cp37-cp37m-win32.whl", hash = "sha256:00a1ba5e2e95684448de9b89888ccd02c98d512064b4cb987d48f4b40aa0421e"}, {file = "cffi-1.14.4-cp37-cp37m-win_amd64.whl", hash = "sha256:9cc46bc107224ff5b6d04369e7c595acb700c3613ad7bcf2e2012f62ece80c35"}, {file = "cffi-1.14.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:df5169c4396adc04f9b0a05f13c074df878b6052430e03f50e68adf3a57aa28d"}, {file = "cffi-1.14.4-cp38-cp38-manylinux1_i686.whl", hash = "sha256:9ffb888f19d54a4d4dfd4b3f29bc2c16aa4972f1c2ab9c4ab09b8ab8685b9c2b"}, {file = "cffi-1.14.4-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8d6603078baf4e11edc4168a514c5ce5b3ba6e3e9c374298cb88437957960a53"}, + {file = "cffi-1.14.4-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:d5ff0621c88ce83a28a10d2ce719b2ee85635e85c515f12bac99a95306da4b2e"}, {file = "cffi-1.14.4-cp38-cp38-win32.whl", hash = "sha256:b4e248d1087abf9f4c10f3c398896c87ce82a9856494a7155823eb45a892395d"}, {file = "cffi-1.14.4-cp38-cp38-win_amd64.whl", hash = "sha256:ec80dc47f54e6e9a78181ce05feb71a0353854cc26999db963695f950b5fb375"}, {file = "cffi-1.14.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:840793c68105fe031f34d6a086eaea153a0cd5c491cde82a74b420edd0a2b909"}, {file = "cffi-1.14.4-cp39-cp39-manylinux1_i686.whl", hash = "sha256:b18e0a9ef57d2b41f5c68beefa32317d286c3d6ac0484efd10d6e07491bb95dd"}, {file = "cffi-1.14.4-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:045d792900a75e8b1e1b0ab6787dd733a8190ffcf80e8c8ceb2fb10a29ff238a"}, + {file = "cffi-1.14.4-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:7ef7d4ced6b325e92eb4d3502946c78c5367bc416398d387b39591532536734e"}, {file = "cffi-1.14.4-cp39-cp39-win32.whl", hash = "sha256:ba4e9e0ae13fc41c6b23299545e5ef73055213e466bd107953e4a013a5ddd7e3"}, {file = "cffi-1.14.4-cp39-cp39-win_amd64.whl", hash = "sha256:f032b34669220030f905152045dfa27741ce1a6db3324a5bc0b96b6c7420c87b"}, {file = "cffi-1.14.4.tar.gz", hash = "sha256:1a465cbe98a7fd391d47dce4b8f7e5b921e6cd805ef421d04f5f66ba8f06086c"}, @@ -528,8 +535,8 @@ distro = [ {file = "distro-1.5.0.tar.gz", hash = "sha256:0e58756ae38fbd8fc3020d54badb8eae17c5b9dcbed388b17bb55b8a5928df92"}, ] docker = [ - {file = "docker-4.4.0-py2.py3-none-any.whl", hash = "sha256:317e95a48c32de8c1aac92a48066a5b73e218ed096e03758bcdd799a7130a1a1"}, - {file = "docker-4.4.0.tar.gz", hash = "sha256:cffc771d4ea1389fc66bc95cb72d304aa41d1a1563482a9a000fba3a84ed5071"}, + {file = "docker-4.4.4-py2.py3-none-any.whl", hash = "sha256:f3607d5695be025fa405a12aca2e5df702a57db63790c73b927eb6a94aac60af"}, + {file = "docker-4.4.4.tar.gz", hash = "sha256:d3393c878f575d3a9ca3b94471a3c89a6d960b35feb92f033c0de36cc9d934db"}, ] docker-compose = [ {file = "docker-compose-1.27.4.tar.gz", hash = "sha256:5a5690f24c27d4b43dcbe6b3fae91ba680713208e99ee863352b3bae37bcaa83"}, @@ -562,8 +569,8 @@ nodeenv = [ {file = "nodeenv-1.5.0.tar.gz", hash = "sha256:ab45090ae383b716c4ef89e690c41ff8c2b257b85b309f01f3654df3d084bd7c"}, ] paramiko = [ - {file = "paramiko-2.7.2-py2.py3-none-any.whl", hash = "sha256:4f3e316fef2ac628b05097a637af35685183111d4bc1b5979bd397c2ab7b5898"}, - {file = "paramiko-2.7.2.tar.gz", hash = "sha256:7f36f4ba2c0d81d219f4595e35f70d56cc94f9ac40a6acdf51d6ca210ce65035"}, + {file = "paramiko-2.10.1-py2.py3-none-any.whl", hash = "sha256:f6cbd3e1204abfdbcd40b3ecbc9d32f04027cd3080fe666245e21e7540ccfc1b"}, + {file = "paramiko-2.10.1.tar.gz", hash = "sha256:443f4da23ec24e9a9c0ea54017829c282abdda1d57110bf229360775ccd27a31"}, ] plumbum = [ {file = "plumbum-1.6.9-py2.py3-none-any.whl", hash = "sha256:91418dcc66b58ab9d2e3b04b3d1e0d787dc45923154fb8b4a826bd9316dba0d6"}, From 3ddfede88917f715ec75a5f7ce52346f50f7ae6c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Jun 2022 17:27:38 +0000 Subject: [PATCH 168/255] Bump pyyaml from 5.3.1 to 5.4 Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.3.1 to 5.4. - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES) - [Commits](https://github.com/yaml/pyyaml/compare/5.3.1...5.4) --- updated-dependencies: - dependency-name: pyyaml dependency-type: indirect ... Signed-off-by: dependabot[bot] --- poetry.lock | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/poetry.lock b/poetry.lock index 2e8ee896..57b29ade 100644 --- a/poetry.lock +++ b/poetry.lock @@ -335,11 +335,11 @@ python-versions = "*" [[package]] name = "pyyaml" -version = "5.3.1" +version = "5.4" description = "YAML parser and emitter for Python" category = "dev" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" [[package]] name = "requests" @@ -626,19 +626,27 @@ pywin32 = [ {file = "pywin32-227-cp39-cp39-win_amd64.whl", hash = "sha256:f27cec5e7f588c3d1051651830ecc00294f90728d19c3bf6916e6dba93ea357c"}, ] pyyaml = [ - {file = "PyYAML-5.3.1-cp27-cp27m-win32.whl", hash = "sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f"}, - {file = "PyYAML-5.3.1-cp27-cp27m-win_amd64.whl", hash = "sha256:240097ff019d7c70a4922b6869d8a86407758333f02203e0fc6ff79c5dcede76"}, - {file = "PyYAML-5.3.1-cp35-cp35m-win32.whl", hash = "sha256:4f4b913ca1a7319b33cfb1369e91e50354d6f07a135f3b901aca02aa95940bd2"}, - {file = "PyYAML-5.3.1-cp35-cp35m-win_amd64.whl", hash = "sha256:cc8955cfbfc7a115fa81d85284ee61147059a753344bc51098f3ccd69b0d7e0c"}, - {file = "PyYAML-5.3.1-cp36-cp36m-win32.whl", hash = "sha256:7739fc0fa8205b3ee8808aea45e968bc90082c10aef6ea95e855e10abf4a37b2"}, - {file = "PyYAML-5.3.1-cp36-cp36m-win_amd64.whl", hash = "sha256:69f00dca373f240f842b2931fb2c7e14ddbacd1397d57157a9b005a6a9942648"}, - {file = "PyYAML-5.3.1-cp37-cp37m-win32.whl", hash = "sha256:d13155f591e6fcc1ec3b30685d50bf0711574e2c0dfffd7644babf8b5102ca1a"}, - {file = "PyYAML-5.3.1-cp37-cp37m-win_amd64.whl", hash = "sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf"}, - {file = "PyYAML-5.3.1-cp38-cp38-win32.whl", hash = "sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97"}, - {file = "PyYAML-5.3.1-cp38-cp38-win_amd64.whl", hash = "sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee"}, - {file = "PyYAML-5.3.1-cp39-cp39-win32.whl", hash = "sha256:ad9c67312c84def58f3c04504727ca879cb0013b2517c85a9a253f0cb6380c0a"}, - {file = "PyYAML-5.3.1-cp39-cp39-win_amd64.whl", hash = "sha256:6034f55dab5fea9e53f436aa68fa3ace2634918e8b5994d82f3621c04ff5ed2e"}, - {file = "PyYAML-5.3.1.tar.gz", hash = "sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d"}, + {file = "PyYAML-5.4-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:f7a21e3d99aa3095ef0553e7ceba36fb693998fbb1226f1392ce33681047465f"}, + {file = "PyYAML-5.4-cp27-cp27m-win32.whl", hash = "sha256:52bf0930903818e600ae6c2901f748bc4869c0c406056f679ab9614e5d21a166"}, + {file = "PyYAML-5.4-cp27-cp27m-win_amd64.whl", hash = "sha256:a36a48a51e5471513a5aea920cdad84cbd56d70a5057cca3499a637496ea379c"}, + {file = "PyYAML-5.4-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:5e7ac4e0e79a53451dc2814f6876c2fa6f71452de1498bbe29c0b54b69a986f4"}, + {file = "PyYAML-5.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cc552b6434b90d9dbed6a4f13339625dc466fd82597119897e9489c953acbc22"}, + {file = "PyYAML-5.4-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0dc9f2eb2e3c97640928dec63fd8dc1dd91e6b6ed236bd5ac00332b99b5c2ff9"}, + {file = "PyYAML-5.4-cp36-cp36m-win32.whl", hash = "sha256:5a3f345acff76cad4aa9cb171ee76c590f37394186325d53d1aa25318b0d4a09"}, + {file = "PyYAML-5.4-cp36-cp36m-win_amd64.whl", hash = "sha256:f3790156c606299ff499ec44db422f66f05a7363b39eb9d5b064f17bd7d7c47b"}, + {file = "PyYAML-5.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:124fd7c7bc1e95b1eafc60825f2daf67c73ce7b33f1194731240d24b0d1bf628"}, + {file = "PyYAML-5.4-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:8b818b6c5a920cbe4203b5a6b14256f0e5244338244560da89b7b0f1313ea4b6"}, + {file = "PyYAML-5.4-cp37-cp37m-win32.whl", hash = "sha256:737bd70e454a284d456aa1fa71a0b429dd527bcbf52c5c33f7c8eee81ac16b89"}, + {file = "PyYAML-5.4-cp37-cp37m-win_amd64.whl", hash = "sha256:7242790ab6c20316b8e7bb545be48d7ed36e26bbe279fd56f2c4a12510e60b4b"}, + {file = "PyYAML-5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cc547d3ead3754712223abb7b403f0a184e4c3eae18c9bb7fd15adef1597cc4b"}, + {file = "PyYAML-5.4-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8635d53223b1f561b081ff4adecb828fd484b8efffe542edcfdff471997f7c39"}, + {file = "PyYAML-5.4-cp38-cp38-win32.whl", hash = "sha256:26fcb33776857f4072601502d93e1a619f166c9c00befb52826e7b774efaa9db"}, + {file = "PyYAML-5.4-cp38-cp38-win_amd64.whl", hash = "sha256:b2243dd033fd02c01212ad5c601dafb44fbb293065f430b0d3dbf03f3254d615"}, + {file = "PyYAML-5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:31ba07c54ef4a897758563e3a0fcc60077698df10180abe4b8165d9895c00ebf"}, + {file = "PyYAML-5.4-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:02c78d77281d8f8d07a255e57abdbf43b02257f59f50cc6b636937d68efa5dd0"}, + {file = "PyYAML-5.4-cp39-cp39-win32.whl", hash = "sha256:fdc6b2cb4b19e431994f25a9160695cc59a4e861710cc6fc97161c5e845fc579"}, + {file = "PyYAML-5.4-cp39-cp39-win_amd64.whl", hash = "sha256:8bf38641b4713d77da19e91f8b5296b832e4db87338d6aeffe422d42f1ca896d"}, + {file = "PyYAML-5.4.tar.gz", hash = "sha256:3c49e39ac034fd64fd576d63bb4db53cda89b362768a67f07749d55f128ac18a"}, ] requests = [ {file = "requests-2.25.0-py2.py3-none-any.whl", hash = "sha256:e786fa28d8c9154e6a4de5d46a1d921b8749f8b74e28bde23768e5e16eece998"}, From a34bc26ea91beeb4a86aaff7611867e8d9a71dec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Jun 2022 17:28:41 +0000 Subject: [PATCH 169/255] Bump urllib3 from 1.26.2 to 1.26.5 Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.2 to 1.26.5. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/1.26.2...1.26.5) --- updated-dependencies: - dependency-name: urllib3 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- poetry.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/poetry.lock b/poetry.lock index 2e8ee896..189bf935 100644 --- a/poetry.lock +++ b/poetry.lock @@ -385,7 +385,7 @@ python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" [[package]] name = "urllib3" -version = "1.26.2" +version = "1.26.5" description = "HTTP library with thread-safe connection pooling, file post, and more." category = "dev" optional = false @@ -657,8 +657,8 @@ toml = [ {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, ] urllib3 = [ - {file = "urllib3-1.26.2-py2.py3-none-any.whl", hash = "sha256:d8ff90d979214d7b4f8ce956e80f4028fc6860e4431f731ea4a8c08f23f99473"}, - {file = "urllib3-1.26.2.tar.gz", hash = "sha256:19188f96923873c92ccb987120ec4acaa12f0461fa9ce5d3d0772bc965a39e08"}, + {file = "urllib3-1.26.5-py2.py3-none-any.whl", hash = "sha256:753a0374df26658f99d826cfe40394a686d05985786d946fbe4165b5148f5a7c"}, + {file = "urllib3-1.26.5.tar.gz", hash = "sha256:a7acd0977125325f516bda9735fa7142b909a8d01e8b2e4c8108d0984e6e0098"}, ] virtualenv = [ {file = "virtualenv-20.2.2-py2.py3-none-any.whl", hash = "sha256:54b05fc737ea9c9ee9f8340f579e5da5b09fb64fd010ab5757eb90268616907c"}, From 142cd3e9423ef737c6494a90aa716fa00729471f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Jun 2022 17:28:48 +0000 Subject: [PATCH 170/255] Bump cryptography from 3.3.1 to 3.3.2 Bumps [cryptography](https://github.com/pyca/cryptography) from 3.3.1 to 3.3.2. - [Release notes](https://github.com/pyca/cryptography/releases) - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/3.3.1...3.3.2) --- updated-dependencies: - dependency-name: cryptography dependency-type: indirect ... Signed-off-by: dependabot[bot] --- poetry.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/poetry.lock b/poetry.lock index 2e8ee896..571cc55f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -89,7 +89,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [[package]] name = "cryptography" -version = "3.3.1" +version = "3.3.2" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." category = "dev" optional = false @@ -511,20 +511,20 @@ colorama = [ {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, ] cryptography = [ - {file = "cryptography-3.3.1-cp27-cp27m-macosx_10_10_x86_64.whl", hash = "sha256:c366df0401d1ec4e548bebe8f91d55ebcc0ec3137900d214dd7aac8427ef3030"}, - {file = "cryptography-3.3.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9f6b0492d111b43de5f70052e24c1f0951cb9e6022188ebcb1cc3a3d301469b0"}, - {file = "cryptography-3.3.1-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:a69bd3c68b98298f490e84519b954335154917eaab52cf582fa2c5c7efc6e812"}, - {file = "cryptography-3.3.1-cp27-cp27m-win32.whl", hash = "sha256:84ef7a0c10c24a7773163f917f1cb6b4444597efd505a8aed0a22e8c4780f27e"}, - {file = "cryptography-3.3.1-cp27-cp27m-win_amd64.whl", hash = "sha256:594a1db4511bc4d960571536abe21b4e5c3003e8750ab8365fafce71c5d86901"}, - {file = "cryptography-3.3.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:0003a52a123602e1acee177dc90dd201f9bb1e73f24a070db7d36c588e8f5c7d"}, - {file = "cryptography-3.3.1-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:83d9d2dfec70364a74f4e7c70ad04d3ca2e6a08b703606993407bf46b97868c5"}, - {file = "cryptography-3.3.1-cp36-abi3-macosx_10_10_x86_64.whl", hash = "sha256:dc42f645f8f3a489c3dd416730a514e7a91a59510ddaadc09d04224c098d3302"}, - {file = "cryptography-3.3.1-cp36-abi3-manylinux1_x86_64.whl", hash = "sha256:788a3c9942df5e4371c199d10383f44a105d67d401fb4304178020142f020244"}, - {file = "cryptography-3.3.1-cp36-abi3-manylinux2010_x86_64.whl", hash = "sha256:69e836c9e5ff4373ce6d3ab311c1a2eed274793083858d3cd4c7d12ce20d5f9c"}, - {file = "cryptography-3.3.1-cp36-abi3-manylinux2014_aarch64.whl", hash = "sha256:9e21301f7a1e7c03dbea73e8602905a4ebba641547a462b26dd03451e5769e7c"}, - {file = "cryptography-3.3.1-cp36-abi3-win32.whl", hash = "sha256:b4890d5fb9b7a23e3bf8abf5a8a7da8e228f1e97dc96b30b95685df840b6914a"}, - {file = "cryptography-3.3.1-cp36-abi3-win_amd64.whl", hash = "sha256:0e85aaae861d0485eb5a79d33226dd6248d2a9f133b81532c8f5aae37de10ff7"}, - {file = "cryptography-3.3.1.tar.gz", hash = "sha256:7e177e4bea2de937a584b13645cab32f25e3d96fc0bc4a4cf99c27dc77682be6"}, + {file = "cryptography-3.3.2-cp27-cp27m-macosx_10_10_x86_64.whl", hash = "sha256:541dd758ad49b45920dda3b5b48c968f8b2533d8981bcdb43002798d8f7a89ed"}, + {file = "cryptography-3.3.2-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:49570438e60f19243e7e0d504527dd5fe9b4b967b5a1ff21cc12b57602dd85d3"}, + {file = "cryptography-3.3.2-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:a9a4ac9648d39ce71c2f63fe7dc6db144b9fa567ddfc48b9fde1b54483d26042"}, + {file = "cryptography-3.3.2-cp27-cp27m-win32.whl", hash = "sha256:aa4969f24d536ae2268c902b2c3d62ab464b5a66bcb247630d208a79a8098e9b"}, + {file = "cryptography-3.3.2-cp27-cp27m-win_amd64.whl", hash = "sha256:1bd0ccb0a1ed775cd7e2144fe46df9dc03eefd722bbcf587b3e0616ea4a81eff"}, + {file = "cryptography-3.3.2-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:e18e6ab84dfb0ab997faf8cca25a86ff15dfea4027b986322026cc99e0a892da"}, + {file = "cryptography-3.3.2-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:c7390f9b2119b2b43160abb34f63277a638504ef8df99f11cb52c1fda66a2e6f"}, + {file = "cryptography-3.3.2-cp36-abi3-macosx_10_10_x86_64.whl", hash = "sha256:0d7b69674b738068fa6ffade5c962ecd14969690585aaca0a1b1fc9058938a72"}, + {file = "cryptography-3.3.2-cp36-abi3-manylinux1_x86_64.whl", hash = "sha256:922f9602d67c15ade470c11d616f2b2364950602e370c76f0c94c94ae672742e"}, + {file = "cryptography-3.3.2-cp36-abi3-manylinux2010_x86_64.whl", hash = "sha256:a0f0b96c572fc9f25c3f4ddbf4688b9b38c69836713fb255f4a2715d93cbaf44"}, + {file = "cryptography-3.3.2-cp36-abi3-manylinux2014_aarch64.whl", hash = "sha256:a777c096a49d80f9d2979695b835b0f9c9edab73b59e4ceb51f19724dda887ed"}, + {file = "cryptography-3.3.2-cp36-abi3-win32.whl", hash = "sha256:3c284fc1e504e88e51c428db9c9274f2da9f73fdf5d7e13a36b8ecb039af6e6c"}, + {file = "cryptography-3.3.2-cp36-abi3-win_amd64.whl", hash = "sha256:7951a966613c4211b6612b0352f5bf29989955ee592c4a885d8c7d0f830d0433"}, + {file = "cryptography-3.3.2.tar.gz", hash = "sha256:5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed"}, ] distlib = [ {file = "distlib-0.3.1-py2.py3-none-any.whl", hash = "sha256:8c09de2c67b3e7deef7184574fc060ab8a793e7adbb183d942c389c8b13c52fb"}, From 6d2c907f7e018391e01650eefb464944456bd98b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=2E=20D=C3=ADaz?= Date: Tue, 21 Jun 2022 19:30:47 +0200 Subject: [PATCH 171/255] [IMP] restore pydevd-odoo --- 14.0.Dockerfile | 3 +-- 15.0.Dockerfile | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/14.0.Dockerfile b/14.0.Dockerfile index 3a5f14b2..88f53479 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -96,8 +96,6 @@ ARG ODOO_VERSION=14.0 ENV ODOO_VERSION="$ODOO_VERSION" # Install Odoo hard & soft dependencies, and Doodba utilities -# TODO: Add back pydevd-odoo once -# https://github.com/trinhanhngoc/pydevd-odoo/issues/3 is fixed RUN build_deps=" \ build-essential \ libfreetype6-dev \ @@ -127,6 +125,7 @@ RUN build_deps=" \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ debugpy \ + pydevd-odoo \ geoip2 \ git-aggregator \ inotify \ diff --git a/15.0.Dockerfile b/15.0.Dockerfile index 50112a8a..e80cb2ec 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -94,8 +94,6 @@ ARG ODOO_VERSION=15.0 ENV ODOO_VERSION="$ODOO_VERSION" # Install Odoo hard & soft dependencies, and Doodba utilities -# TODO: Add back pydevd-odoo once -# https://github.com/trinhanhngoc/pydevd-odoo/issues/3 is fixed RUN build_deps=" \ build-essential \ libfreetype6-dev \ @@ -125,6 +123,7 @@ RUN build_deps=" \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ debugpy \ + pydevd-odoo \ flanker[validator] \ geoip2 \ git-aggregator \ From b39deaae209a14f3f110e5e58761da3eee8f1a64 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Tue, 26 Apr 2022 11:04:25 +0100 Subject: [PATCH 172/255] feat: update db expiration date when preparing db This script is called when using `invoke preparedb` in develop mode. If developing enterprise code, this avoids an unnecessary warning. --- bin/preparedb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/preparedb b/bin/preparedb index b8a06634..f0421fc6 100755 --- a/bin/preparedb +++ b/bin/preparedb @@ -11,6 +11,9 @@ import click_odoo def main(env): """Set report.url in the database to be pointing at localhost.""" env["ir.config_parameter"].set_param("report.url", "http://localhost:8069") + env["ir.config_parameter"].set_param( + "database.expiration_date", "3000-01-30 00:00:00" + ) env.cr.commit() From a168dbd9fe229648e0166913fbb239f90300ea2f Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 30 Sep 2020 12:55:01 +0100 Subject: [PATCH 173/255] [IMP] Update CI to use postgres 14 @Tecnativa TT22772 --- .github/workflows/ci.yaml | 10 +++++++--- tests/__init__.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1e9e79e6..d0decb17 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,13 +33,17 @@ jobs: fail-fast: false matrix: # Test modern Odoo versions with latest Postgres version - pg_version: ["12"] + pg_version: ["14"] odoo_version: - "15.0" - "14.0" - "13.0" - - "12.0" - - "11.0" + include: + # Older odoo versions don't support latest postgres because of the adapter + - pg_version: "13" + odoo_version: "12.0" + - pg_version: "13" + odoo_version: "11.0" env: # Indicates what's the equivalent to tecnativa/doodba:latest image LATEST_RELEASE: "15.0" diff --git a/tests/__init__.py b/tests/__init__.py index 08d423ac..58924779 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -17,7 +17,7 @@ DIR = dirname(__file__) ODOO_PREFIX = ("odoo", "--stop-after-init", "--workers=0") ODOO_VERSIONS = frozenset(environ.get("DOCKER_TAG", "11.0 12.0 13.0 14.0 15.0").split()) -PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "13").split()) +PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "14").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") GEIOP_CREDENTIALS_PROVIDED = environ.get("GEOIP_LICENSE_KEY", False) and environ.get( "GEOIP_ACCOUNT_ID", False From c0515e13989e12f5fbbbd20948834965d3b74166 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Wed, 21 Sep 2022 08:23:16 +0200 Subject: [PATCH 174/255] [FIX] git-aggregator: use git-aggregator < 3.0.0 for V11.0 and V12.0 filter=blob:none is not compatible with older git version in debian stretch --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index bdfbb8a6..e7d6b8c6 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -82,7 +82,7 @@ RUN pip install \ astor \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ - git-aggregator \ + "git-aggregator<3.0.0" \ "pg_activity<2.0.0" \ plumbum \ ptvsd \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 0d9da3dd..51a39125 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -77,7 +77,7 @@ RUN pip install \ astor \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ - git-aggregator \ + "git-aggregator<3.0.0" \ "pg_activity<2.0.0" \ plumbum \ ptvsd \ From 4f886fba8b424dad26138440c0146c6a2c0f4a51 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 21 Sep 2022 15:46:50 +0200 Subject: [PATCH 175/255] Revert "[FIX] git-aggregator: use git-aggregator < 3.0.0 for V11.0 and V12.0" --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index e7d6b8c6..bdfbb8a6 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -82,7 +82,7 @@ RUN pip install \ astor \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ - "git-aggregator<3.0.0" \ + git-aggregator \ "pg_activity<2.0.0" \ plumbum \ ptvsd \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 51a39125..0d9da3dd 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -77,7 +77,7 @@ RUN pip install \ astor \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ - "git-aggregator<3.0.0" \ + git-aggregator \ "pg_activity<2.0.0" \ plumbum \ ptvsd \ From 7b25d25d8e56beee2592b744facf9e518ffca2e6 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 21 Sep 2022 19:30:35 +0200 Subject: [PATCH 176/255] [FIX] Use previous version of git-aggregator While https://github.com/acsone/git-aggregator/issues/68 is not fixed. --- 11.0.Dockerfile | 2 +- 12.0.Dockerfile | 2 +- 13.0.Dockerfile | 2 +- 14.0.Dockerfile | 2 +- 15.0.Dockerfile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index bdfbb8a6..e7d6b8c6 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -82,7 +82,7 @@ RUN pip install \ astor \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ - git-aggregator \ + "git-aggregator<3.0.0" \ "pg_activity<2.0.0" \ plumbum \ ptvsd \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 0d9da3dd..51a39125 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -77,7 +77,7 @@ RUN pip install \ astor \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ - git-aggregator \ + "git-aggregator<3.0.0" \ "pg_activity<2.0.0" \ plumbum \ ptvsd \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 4c34d24f..f58243de 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -127,7 +127,7 @@ RUN build_deps=" \ -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ 'websocket-client~=0.56' \ astor \ - git-aggregator \ + "git-aggregator<3.0.0" \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ "pg_activity<2.0.0" \ diff --git a/14.0.Dockerfile b/14.0.Dockerfile index 88f53479..889cbd5d 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -127,7 +127,7 @@ RUN build_deps=" \ debugpy \ pydevd-odoo \ geoip2 \ - git-aggregator \ + "git-aggregator<3.0.0" \ inotify \ pdfminer.six \ pg_activity \ diff --git a/15.0.Dockerfile b/15.0.Dockerfile index e80cb2ec..8eba5de2 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -126,7 +126,7 @@ RUN build_deps=" \ pydevd-odoo \ flanker[validator] \ geoip2 \ - git-aggregator \ + "git-aggregator<3.0.0" \ inotify \ pdfminer.six \ pg_activity \ From b475fd2babf611ae841f78d2079f9f635a1b6d5c Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2022 15:40:27 +0200 Subject: [PATCH 177/255] Add Odoo 16.0 - Dockerfile copied from 15.0 and slightly adapted - Fix tests - Make it `:latest`. TODO: Switch to Python 3.10 TT39845 --- .github/workflows/ci.yaml | 3 +- .vscode/settings.json | 3 +- 16.0.Dockerfile | 233 ++++++++++++++++++++++++++++++++++++++ README.md | 2 +- tests/__init__.py | 8 +- 5 files changed, 243 insertions(+), 6 deletions(-) create mode 100644 16.0.Dockerfile diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d0decb17..d0f3e22c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,6 +35,7 @@ jobs: # Test modern Odoo versions with latest Postgres version pg_version: ["14"] odoo_version: + - "16.0" - "15.0" - "14.0" - "13.0" @@ -46,7 +47,7 @@ jobs: odoo_version: "11.0" env: # Indicates what's the equivalent to tecnativa/doodba:latest image - LATEST_RELEASE: "15.0" + LATEST_RELEASE: "16.0" # Variables found by default in Docker Hub builder DOCKER_REPO: tecnativa/doodba DOCKER_TAG: ${{ matrix.odoo_version }} diff --git a/.vscode/settings.json b/.vscode/settings.json index d3cbe582..b031368d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,5 +11,6 @@ "[dockerfile]": { "editor.formatOnSave": false - } + }, + "python.analysis.extraPaths": ["./lib", "./tests"] } diff --git a/16.0.Dockerfile b/16.0.Dockerfile new file mode 100644 index 00000000..42acd0a9 --- /dev/null +++ b/16.0.Dockerfile @@ -0,0 +1,233 @@ +FROM python:3.8-slim-bullseye AS base + +EXPOSE 8069 8072 + +ARG GEOIP_UPDATER_VERSION=4.3.0 +ARG WKHTMLTOPDF_VERSION=0.12.5 +ARG WKHTMLTOPDF_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd' +ENV DB_FILTER=.* \ + DEPTH_DEFAULT=1 \ + DEPTH_MERGE=100 \ + EMAIL=https://hub.docker.com/r/tecnativa/odoo \ + GEOIP_ACCOUNT_ID="" \ + GEOIP_LICENSE_KEY="" \ + GIT_AUTHOR_NAME=docker-odoo \ + INITIAL_LANG="" \ + LC_ALL=C.UTF-8 \ + LIST_DB=false \ + NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \ + OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ + PATH="/home/odoo/.local/bin:$PATH" \ + PIP_NO_CACHE_DIR=0 \ + DEBUGPY_ARGS="--listen 0.0.0.0:6899 --wait-for-client" \ + DEBUGPY_ENABLE=0 \ + PUDB_RDB_HOST=0.0.0.0 \ + PUDB_RDB_PORT=6899 \ + PYTHONOPTIMIZE="" \ + UNACCENT=true \ + WAIT_DB=true \ + WDB_NO_BROWSER_AUTO_OPEN=True \ + WDB_SOCKET_SERVER=wdb \ + WDB_WEB_PORT=1984 \ + WDB_WEB_SERVER=localhost + +# Other requirements and recommendations +# See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control +RUN apt-get -qq update \ + && apt-get install -yqq --no-install-recommends \ + curl \ + && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.buster_amd64.deb \ + && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ + && apt-get install -yqq --no-install-recommends \ + ./wkhtmltox.deb \ + chromium \ + ffmpeg \ + fonts-liberation2 \ + gettext \ + git \ + gnupg2 \ + locales-all \ + nano \ + npm \ + openssh-client \ + telnet \ + vim \ + && echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && apt-get update \ + && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && apt-get autopurge -yqq \ + && rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \ + && sync + +WORKDIR /opt/odoo +COPY bin/* /usr/local/bin/ +COPY lib/doodbalib /usr/local/lib/python3.8/site-packages/doodbalib +COPY build.d common/build.d +COPY conf.d common/conf.d +COPY entrypoint.d common/entrypoint.d +RUN mkdir -p auto/addons auto/geoip custom/src/private \ + && ln /usr/local/bin/direxec common/entrypoint \ + && ln /usr/local/bin/direxec common/build \ + && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ + && chmod -R a+rX /usr/local/lib/python3.8/site-packages/doodbalib \ + && cp -a /etc/GeoIP.conf /etc/GeoIP.conf.orig \ + && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ + && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ + && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ + && sync + +# Doodba-QA dependencies in a separate virtualenv +COPY qa /qa +RUN python -m venv --system-site-packages /qa/venv \ + && . /qa/venv/bin/activate \ + && pip install \ + click \ + coverage \ + && deactivate \ + && mkdir -p /qa/artifacts + +ARG ODOO_SOURCE=OCA/OCB +ARG ODOO_VERSION=16.0 +ENV ODOO_VERSION="$ODOO_VERSION" + +# Install Odoo hard & soft dependencies, and Doodba utilities +RUN build_deps=" \ + build-essential \ + libfreetype6-dev \ + libfribidi-dev \ + libghc-zlib-dev \ + libharfbuzz-dev \ + libjpeg-dev \ + liblcms2-dev \ + libldap2-dev \ + libopenjp2-7-dev \ + libpq-dev \ + libsasl2-dev \ + libtiff5-dev \ + libwebp-dev \ + libxml2-dev \ + libxslt-dev \ + tcl-dev \ + tk-dev \ + zlib1g-dev \ + " \ + && apt-get update \ + && apt-get install -yqq --no-install-recommends $build_deps \ + && pip install \ + -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + 'websocket-client~=0.56' \ + astor \ + # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 + git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ + debugpy \ + pydevd-odoo \ + flanker[validator] \ + geoip2 \ + "git-aggregator<3.0.0" \ + inotify \ + pdfminer.six \ + pg_activity \ + phonenumbers \ + plumbum \ + pudb \ + pyOpenSSL \ + python-magic \ + watchdog \ + wdb \ + && (python3 -m compileall -q /usr/local/lib/python3.8/ || true) \ + # generate flanker cached tables during install when /usr/local/lib/ is still intended to be written to + # https://github.com/Tecnativa/doodba/issues/486 + && python3 -c 'from flanker.addresslib import address' >/dev/null 2>&1 \ + && apt-get purge -yqq $build_deps \ + && apt-get autopurge -yqq \ + && rm -Rf /var/lib/apt/lists/* /tmp/* + +# Metadata +ARG VCS_REF +ARG BUILD_DATE +ARG VERSION +LABEL org.label-schema.schema-version="$VERSION" \ + org.label-schema.vendor=Tecnativa \ + org.label-schema.license=Apache-2.0 \ + org.label-schema.build-date="$BUILD_DATE" \ + org.label-schema.vcs-ref="$VCS_REF" \ + org.label-schema.vcs-url="https://github.com/Tecnativa/doodba" + +# Onbuild version, with all the magic +FROM base AS onbuild + +# Enable setting custom uids for odoo user during build of scaffolds +ONBUILD ARG UID=1000 +ONBUILD ARG GID=1000 + +# Enable Odoo user and filestore +ONBUILD RUN groupadd -g $GID odoo -o \ + && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && sync + +# Subimage triggers +ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] +ONBUILD CMD ["/usr/local/bin/odoo"] +ONBUILD ARG AGGREGATE=true +ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" +ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" +ONBUILD ARG DEPTH_DEFAULT=1 +ONBUILD ARG DEPTH_MERGE=100 +ONBUILD ARG CLEAN=true +ONBUILD ARG COMPILE=true +ONBUILD ARG FONT_MONO="Liberation Mono" +ONBUILD ARG FONT_SANS="Liberation Sans" +ONBUILD ARG FONT_SERIF="Liberation Serif" +ONBUILD ARG PIP_INSTALL_ODOO=true +ONBUILD ARG ADMIN_PASSWORD=admin +ONBUILD ARG SMTP_SERVER=smtp +ONBUILD ARG SMTP_PORT=25 +ONBUILD ARG SMTP_USER=false +ONBUILD ARG SMTP_PASSWORD=false +ONBUILD ARG SMTP_SSL=false +ONBUILD ARG EMAIL_FROM="" +ONBUILD ARG PROXY_MODE=false +ONBUILD ARG WITHOUT_DEMO=all +ONBUILD ARG PGUSER=odoo +ONBUILD ARG PGPASSWORD=odoopassword +ONBUILD ARG PGHOST=db +ONBUILD ARG PGPORT=5432 +ONBUILD ARG PGDATABASE=prod + +# Config variables +ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ + DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \ + DEFAULT_REPO_PATTERN_ODOO="$DEFAULT_REPO_PATTERN_ODOO" \ + UNACCENT="$UNACCENT" \ + PGUSER="$PGUSER" \ + PGPASSWORD="$PGPASSWORD" \ + PGHOST="$PGHOST" \ + PGPORT=$PGPORT \ + PGDATABASE="$PGDATABASE" \ + PROXY_MODE="$PROXY_MODE" \ + SMTP_SERVER="$SMTP_SERVER" \ + SMTP_PORT=$SMTP_PORT \ + SMTP_USER="$SMTP_USER" \ + SMTP_PASSWORD="$SMTP_PASSWORD" \ + SMTP_SSL="$SMTP_SSL" \ + EMAIL_FROM="$EMAIL_FROM" \ + WITHOUT_DEMO="$WITHOUT_DEMO" +ONBUILD ARG LOCAL_CUSTOM_DIR=./custom +ONBUILD COPY --chown=root:odoo $LOCAL_CUSTOM_DIR /opt/odoo/custom + +# https://docs.python.org/3/library/logging.html#levels +ONBUILD ARG LOG_LEVEL=INFO +ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ + && ln -s /opt/odoo/custom/ssh ~root/.ssh \ + && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ + && sync +ONBUILD ARG DB_VERSION=latest +ONBUILD RUN /opt/odoo/common/build && sync +ONBUILD VOLUME ["/var/lib/odoo"] +ONBUILD USER odoo diff --git a/README.md b/README.md index 205733ab..f025b1d9 100644 --- a/README.md +++ b/README.md @@ -399,7 +399,7 @@ server-tools: # Custom repositories ENV: DEFAULT_REPO_PATTERN: https://github.com/Tecnativa/{}.git - ODOO_VERSION: 15.0-new-feature + ODOO_VERSION: 16.0-new-feature some-repo: # Cloned from https://github.com/Tecnativa/some-repo.git branch 15.0-new-feature - some_custom_module ``` diff --git a/tests/__init__.py b/tests/__init__.py index 58924779..c177f1cf 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -16,7 +16,9 @@ DIR = dirname(__file__) ODOO_PREFIX = ("odoo", "--stop-after-init", "--workers=0") -ODOO_VERSIONS = frozenset(environ.get("DOCKER_TAG", "11.0 12.0 13.0 14.0 15.0").split()) +ODOO_VERSIONS = frozenset( + environ.get("DOCKER_TAG", "11.0 12.0 13.0 14.0 15.0 16.0").split() +) PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "14").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") GEIOP_CREDENTIALS_PROVIDED = environ.get("GEOIP_LICENSE_KEY", False) and environ.get( @@ -28,7 +30,7 @@ # preparing the pre-release for the next version of Odoo, which hasn't been # released yet. prerelease_skip = unittest.skipIf( - ODOO_VERSIONS & {"15.0"}, "Tests not supported in pre-release" + ODOO_VERSIONS & {"16.0"}, "Tests not supported in pre-release" ) @@ -450,7 +452,7 @@ def test_dependencies(self): ), ) - # TODO Remove decorator when base_search_fuzzy is migrated to 15.0 + # TODO Remove decorator when base_search_fuzzy is migrated to 16.0 @prerelease_skip def test_dependencies_base_search_fuzzy(self): """Test dependencies installation.""" From 63895afcd1c92db96a6295678a3893e215989236 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Tue, 8 Nov 2022 07:54:13 +0100 Subject: [PATCH 178/255] [FIX] stretch: use apt-archive for postgres in stretch https://www.postgresql.org/message-id/Y2kmqL%2BpCuSZiQBV%40msg.df7cb.de --- 11.0.Dockerfile | 4 +++- 12.0.Dockerfile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index e7d6b8c6..a2a24d2f 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -50,7 +50,9 @@ RUN apt-get -qq update \ telnet \ vim \ zlibc \ - && echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + apt-transport-https \ + ca-certificates \ + && echo 'deb https://apt-archive.postgresql.org/pub/repos/apt stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3 /dev/stdin \ && curl -sL https://deb.nodesource.com/setup_6.x | bash - \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 51a39125..cd87abea 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -50,7 +50,9 @@ RUN apt-get -qq update \ telnet \ vim \ zlibc \ - && echo 'deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + apt-transport-https \ + ca-certificates \ + && echo 'deb https://apt-archive.postgresql.org/pub/repos/apt stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3 /dev/stdin \ && curl -sL https://deb.nodesource.com/setup_8.x | bash - \ From 65e4104d7d3482789736b71a8b3db4bd6659a157 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Feb 2023 00:56:37 +0000 Subject: [PATCH 179/255] Bump cryptography from 3.3.2 to 39.0.1 Bumps [cryptography](https://github.com/pyca/cryptography) from 3.3.2 to 39.0.1. - [Release notes](https://github.com/pyca/cryptography/releases) - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/3.3.2...39.0.1) --- updated-dependencies: - dependency-name: cryptography dependency-type: indirect ... Signed-off-by: dependabot[bot] --- poetry.lock | 559 +++++++++++++++++++++++++++------------------------- 1 file changed, 293 insertions(+), 266 deletions(-) diff --git a/poetry.lock b/poetry.lock index 34dfca3a..915be88b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,3 +1,5 @@ +# This file is automatically @generated by Poetry and should not be changed by hand. + [[package]] name = "appdirs" version = "1.4.4" @@ -5,6 +7,10 @@ description = "A small Python module for determining appropriate platform-specif category = "dev" optional = false python-versions = "*" +files = [ + {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, + {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, +] [[package]] name = "attrs" @@ -13,12 +19,16 @@ description = "Classes Without Boilerplate" category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "attrs-20.3.0-py2.py3-none-any.whl", hash = "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6"}, + {file = "attrs-20.3.0.tar.gz", hash = "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700"}, +] [package.extras] -dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "furo", "sphinx", "pre-commit"] +dev = ["coverage[toml] (>=5.0.2)", "furo", "hypothesis", "pre-commit", "pympler", "pytest (>=4.3.0)", "six", "sphinx", "zope.interface"] docs = ["furo", "sphinx", "zope.interface"] tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] -tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"] +tests-no-zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"] [[package]] name = "bcrypt" @@ -27,6 +37,18 @@ description = "Modern password hashing for your software and your servers" category = "dev" optional = false python-versions = ">=3.6" +files = [ + {file = "bcrypt-3.2.0-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:b589229207630484aefe5899122fb938a5b017b0f4349f769b8c13e78d99a8fd"}, + {file = "bcrypt-3.2.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:c95d4cbebffafcdd28bd28bb4e25b31c50f6da605c81ffd9ad8a3d1b2ab7b1b6"}, + {file = "bcrypt-3.2.0-cp36-abi3-manylinux1_x86_64.whl", hash = "sha256:63d4e3ff96188e5898779b6057878fecf3f11cfe6ec3b313ea09955d587ec7a7"}, + {file = "bcrypt-3.2.0-cp36-abi3-manylinux2010_x86_64.whl", hash = "sha256:cd1ea2ff3038509ea95f687256c46b79f5fc382ad0aa3664d200047546d511d1"}, + {file = "bcrypt-3.2.0-cp36-abi3-manylinux2014_aarch64.whl", hash = "sha256:cdcdcb3972027f83fe24a48b1e90ea4b584d35f1cc279d76de6fc4b13376239d"}, + {file = "bcrypt-3.2.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:a0584a92329210fcd75eb8a3250c5a941633f8bfaf2a18f81009b097732839b7"}, + {file = "bcrypt-3.2.0-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:56e5da069a76470679f312a7d3d23deb3ac4519991a0361abc11da837087b61d"}, + {file = "bcrypt-3.2.0-cp36-abi3-win32.whl", hash = "sha256:a67fb841b35c28a59cebed05fbd3e80eea26e6d75851f0574a9273c80f3e9b55"}, + {file = "bcrypt-3.2.0-cp36-abi3-win_amd64.whl", hash = "sha256:81fec756feff5b6818ea7ab031205e1d323d8943d237303baca2c5f9c7846f34"}, + {file = "bcrypt-3.2.0.tar.gz", hash = "sha256:5b93c1726e50a93a033c36e5ca7fdcd29a5c7395af50a6892f5d9e7c6cfbfb29"}, +] [package.dependencies] cffi = ">=1.1" @@ -43,6 +65,10 @@ description = "A decorator for caching properties in classes." category = "dev" optional = false python-versions = "*" +files = [ + {file = "cached-property-1.5.2.tar.gz", hash = "sha256:9fa5755838eecbb2d234c3aa390bd80fbd3ac6b6869109bfc1b499f7bd89a130"}, + {file = "cached_property-1.5.2-py2.py3-none-any.whl", hash = "sha256:df4f613cf7ad9a588cc381aaf4a512d26265ecebd5eb9e1ba12f1319eb85a6a0"}, +] [[package]] name = "certifi" @@ -51,6 +77,10 @@ description = "Python package for providing Mozilla's CA Bundle." category = "dev" optional = false python-versions = "*" +files = [ + {file = "certifi-2020.12.5-py2.py3-none-any.whl", hash = "sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830"}, + {file = "certifi-2020.12.5.tar.gz", hash = "sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"}, +] [[package]] name = "cffi" @@ -59,6 +89,45 @@ description = "Foreign Function Interface for Python calling C code." category = "dev" optional = false python-versions = "*" +files = [ + {file = "cffi-1.14.4-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:ebb253464a5d0482b191274f1c8bf00e33f7e0b9c66405fbffc61ed2c839c775"}, + {file = "cffi-1.14.4-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:2c24d61263f511551f740d1a065eb0212db1dbbbbd241db758f5244281590c06"}, + {file = "cffi-1.14.4-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9f7a31251289b2ab6d4012f6e83e58bc3b96bd151f5b5262467f4bb6b34a7c26"}, + {file = "cffi-1.14.4-cp27-cp27m-win32.whl", hash = "sha256:5cf4be6c304ad0b6602f5c4e90e2f59b47653ac1ed9c662ed379fe48a8f26b0c"}, + {file = "cffi-1.14.4-cp27-cp27m-win_amd64.whl", hash = "sha256:f60567825f791c6f8a592f3c6e3bd93dd2934e3f9dac189308426bd76b00ef3b"}, + {file = "cffi-1.14.4-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:c6332685306b6417a91b1ff9fae889b3ba65c2292d64bd9245c093b1b284809d"}, + {file = "cffi-1.14.4-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:d9efd8b7a3ef378dd61a1e77367f1924375befc2eba06168b6ebfa903a5e59ca"}, + {file = "cffi-1.14.4-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:51a8b381b16ddd370178a65360ebe15fbc1c71cf6f584613a7ea08bfad946698"}, + {file = "cffi-1.14.4-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:1d2c4994f515e5b485fd6d3a73d05526aa0fcf248eb135996b088d25dfa1865b"}, + {file = "cffi-1.14.4-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:af5c59122a011049aad5dd87424b8e65a80e4a6477419c0c1015f73fb5ea0293"}, + {file = "cffi-1.14.4-cp35-cp35m-win32.whl", hash = "sha256:594234691ac0e9b770aee9fcdb8fa02c22e43e5c619456efd0d6c2bf276f3eb2"}, + {file = "cffi-1.14.4-cp35-cp35m-win_amd64.whl", hash = "sha256:64081b3f8f6f3c3de6191ec89d7dc6c86a8a43911f7ecb422c60e90c70be41c7"}, + {file = "cffi-1.14.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f803eaa94c2fcda012c047e62bc7a51b0bdabda1cad7a92a522694ea2d76e49f"}, + {file = "cffi-1.14.4-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:105abaf8a6075dc96c1fe5ae7aae073f4696f2905fde6aeada4c9d2926752362"}, + {file = "cffi-1.14.4-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0638c3ae1a0edfb77c6765d487fee624d2b1ee1bdfeffc1f0b58c64d149e7eec"}, + {file = "cffi-1.14.4-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:7c6b1dece89874d9541fc974917b631406233ea0440d0bdfbb8e03bf39a49b3b"}, + {file = "cffi-1.14.4-cp36-cp36m-win32.whl", hash = "sha256:155136b51fd733fa94e1c2ea5211dcd4c8879869008fc811648f16541bf99668"}, + {file = "cffi-1.14.4-cp36-cp36m-win_amd64.whl", hash = "sha256:6bc25fc545a6b3d57b5f8618e59fc13d3a3a68431e8ca5fd4c13241cd70d0009"}, + {file = "cffi-1.14.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a7711edca4dcef1a75257b50a2fbfe92a65187c47dab5a0f1b9b332c5919a3fb"}, + {file = "cffi-1.14.4-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:00e28066507bfc3fe865a31f325c8391a1ac2916219340f87dfad602c3e48e5d"}, + {file = "cffi-1.14.4-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:798caa2a2384b1cbe8a2a139d80734c9db54f9cc155c99d7cc92441a23871c03"}, + {file = "cffi-1.14.4-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:a5ed8c05548b54b998b9498753fb9cadbfd92ee88e884641377d8a8b291bcc01"}, + {file = "cffi-1.14.4-cp37-cp37m-win32.whl", hash = "sha256:00a1ba5e2e95684448de9b89888ccd02c98d512064b4cb987d48f4b40aa0421e"}, + {file = "cffi-1.14.4-cp37-cp37m-win_amd64.whl", hash = "sha256:9cc46bc107224ff5b6d04369e7c595acb700c3613ad7bcf2e2012f62ece80c35"}, + {file = "cffi-1.14.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:df5169c4396adc04f9b0a05f13c074df878b6052430e03f50e68adf3a57aa28d"}, + {file = "cffi-1.14.4-cp38-cp38-manylinux1_i686.whl", hash = "sha256:9ffb888f19d54a4d4dfd4b3f29bc2c16aa4972f1c2ab9c4ab09b8ab8685b9c2b"}, + {file = "cffi-1.14.4-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8d6603078baf4e11edc4168a514c5ce5b3ba6e3e9c374298cb88437957960a53"}, + {file = "cffi-1.14.4-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:d5ff0621c88ce83a28a10d2ce719b2ee85635e85c515f12bac99a95306da4b2e"}, + {file = "cffi-1.14.4-cp38-cp38-win32.whl", hash = "sha256:b4e248d1087abf9f4c10f3c398896c87ce82a9856494a7155823eb45a892395d"}, + {file = "cffi-1.14.4-cp38-cp38-win_amd64.whl", hash = "sha256:ec80dc47f54e6e9a78181ce05feb71a0353854cc26999db963695f950b5fb375"}, + {file = "cffi-1.14.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:840793c68105fe031f34d6a086eaea153a0cd5c491cde82a74b420edd0a2b909"}, + {file = "cffi-1.14.4-cp39-cp39-manylinux1_i686.whl", hash = "sha256:b18e0a9ef57d2b41f5c68beefa32317d286c3d6ac0484efd10d6e07491bb95dd"}, + {file = "cffi-1.14.4-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:045d792900a75e8b1e1b0ab6787dd733a8190ffcf80e8c8ceb2fb10a29ff238a"}, + {file = "cffi-1.14.4-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:7ef7d4ced6b325e92eb4d3502946c78c5367bc416398d387b39591532536734e"}, + {file = "cffi-1.14.4-cp39-cp39-win32.whl", hash = "sha256:ba4e9e0ae13fc41c6b23299545e5ef73055213e466bd107953e4a013a5ddd7e3"}, + {file = "cffi-1.14.4-cp39-cp39-win_amd64.whl", hash = "sha256:f032b34669220030f905152045dfa27741ce1a6db3324a5bc0b96b6c7420c87b"}, + {file = "cffi-1.14.4.tar.gz", hash = "sha256:1a465cbe98a7fd391d47dce4b8f7e5b921e6cd805ef421d04f5f66ba8f06086c"}, +] [package.dependencies] pycparser = "*" @@ -70,6 +139,10 @@ description = "Validate configuration and produce human readable error messages. category = "dev" optional = false python-versions = ">=3.6.1" +files = [ + {file = "cfgv-3.2.0-py2.py3-none-any.whl", hash = "sha256:32e43d604bbe7896fe7c248a9c2276447dbef840feb28fe20494f62af110211d"}, + {file = "cfgv-3.2.0.tar.gz", hash = "sha256:cf22deb93d4bcf92f345a5c3cd39d3d41d6340adc60c78bbbd6588c384fda6a1"}, +] [[package]] name = "chardet" @@ -78,6 +151,10 @@ description = "Universal encoding detector for Python 2 and 3" category = "dev" optional = false python-versions = "*" +files = [ + {file = "chardet-3.0.4-py2.py3-none-any.whl", hash = "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"}, + {file = "chardet-3.0.4.tar.gz", hash = "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"}, +] [[package]] name = "colorama" @@ -86,25 +163,54 @@ description = "Cross-platform colored terminal text." category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, + {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, +] [[package]] name = "cryptography" -version = "3.3.2" +version = "39.0.1" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." category = "dev" optional = false -python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*" +python-versions = ">=3.6" +files = [ + {file = "cryptography-39.0.1-cp36-abi3-macosx_10_12_universal2.whl", hash = "sha256:6687ef6d0a6497e2b58e7c5b852b53f62142cfa7cd1555795758934da363a965"}, + {file = "cryptography-39.0.1-cp36-abi3-macosx_10_12_x86_64.whl", hash = "sha256:706843b48f9a3f9b9911979761c91541e3d90db1ca905fd63fee540a217698bc"}, + {file = "cryptography-39.0.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:5d2d8b87a490bfcd407ed9d49093793d0f75198a35e6eb1a923ce1ee86c62b41"}, + {file = "cryptography-39.0.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:83e17b26de248c33f3acffb922748151d71827d6021d98c70e6c1a25ddd78505"}, + {file = "cryptography-39.0.1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e124352fd3db36a9d4a21c1aa27fd5d051e621845cb87fb851c08f4f75ce8be6"}, + {file = "cryptography-39.0.1-cp36-abi3-manylinux_2_24_x86_64.whl", hash = "sha256:5aa67414fcdfa22cf052e640cb5ddc461924a045cacf325cd164e65312d99502"}, + {file = "cryptography-39.0.1-cp36-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:35f7c7d015d474f4011e859e93e789c87d21f6f4880ebdc29896a60403328f1f"}, + {file = "cryptography-39.0.1-cp36-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f24077a3b5298a5a06a8e0536e3ea9ec60e4c7ac486755e5fb6e6ea9b3500106"}, + {file = "cryptography-39.0.1-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:f0c64d1bd842ca2633e74a1a28033d139368ad959872533b1bab8c80e8240a0c"}, + {file = "cryptography-39.0.1-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:0f8da300b5c8af9f98111ffd512910bc792b4c77392a9523624680f7956a99d4"}, + {file = "cryptography-39.0.1-cp36-abi3-win32.whl", hash = "sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8"}, + {file = "cryptography-39.0.1-cp36-abi3-win_amd64.whl", hash = "sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac"}, + {file = "cryptography-39.0.1-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad"}, + {file = "cryptography-39.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388"}, + {file = "cryptography-39.0.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336"}, + {file = "cryptography-39.0.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2"}, + {file = "cryptography-39.0.1-pp39-pypy39_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:6f8ba7f0328b79f08bdacc3e4e66fb4d7aab0c3584e0bd41328dce5262e26b2e"}, + {file = "cryptography-39.0.1-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:ef8b72fa70b348724ff1218267e7f7375b8de4e8194d1636ee60510aae104cd0"}, + {file = "cryptography-39.0.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:aec5a6c9864be7df2240c382740fcf3b96928c46604eaa7f3091f58b878c0bb6"}, + {file = "cryptography-39.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:fdd188c8a6ef8769f148f88f859884507b954cc64db6b52f66ef199bb9ad660a"}, + {file = "cryptography-39.0.1.tar.gz", hash = "sha256:d1f6198ee6d9148405e49887803907fe8962a23e6c6f83ea7d98f1c0de375695"}, +] [package.dependencies] cffi = ">=1.12" -six = ">=1.4.1" [package.extras] -docs = ["sphinx (>=1.6.5,!=1.8.0,!=3.1.0,!=3.1.1)", "sphinx-rtd-theme"] -docstest = ["doc8", "pyenchant (>=1.6.11)", "twine (>=1.12.0)", "sphinxcontrib-spelling (>=4.0.1)"] -pep8test = ["black", "flake8", "flake8-import-order", "pep8-naming"] +docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.1.1)"] +docstest = ["pyenchant (>=1.6.11)", "sphinxcontrib-spelling (>=4.0.1)", "twine (>=1.12.0)"] +pep8test = ["black", "check-manifest", "mypy", "ruff", "types-pytz", "types-requests"] +sdist = ["setuptools-rust (>=0.11.4)"] ssh = ["bcrypt (>=3.1.5)"] -test = ["pytest (>=3.6.0,!=3.9.0,!=3.9.1,!=3.9.2)", "pretend", "iso8601", "pytz", "hypothesis (>=1.11.4,!=3.79.2)"] +test = ["hypothesis (>=1.11.4,!=3.79.2)", "iso8601", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-shard (>=0.1.2)", "pytest-subtests", "pytest-xdist", "pytz"] +test-randomorder = ["pytest-randomly"] +tox = ["tox"] [[package]] name = "distlib" @@ -113,6 +219,10 @@ description = "Distribution utilities" category = "dev" optional = false python-versions = "*" +files = [ + {file = "distlib-0.3.1-py2.py3-none-any.whl", hash = "sha256:8c09de2c67b3e7deef7184574fc060ab8a793e7adbb183d942c389c8b13c52fb"}, + {file = "distlib-0.3.1.zip", hash = "sha256:edf6116872c863e1aa9d5bb7cb5e05a022c519a4594dc703843343a9ddd9bff1"}, +] [[package]] name = "distro" @@ -121,6 +231,10 @@ description = "Distro - an OS platform information API" category = "dev" optional = false python-versions = "*" +files = [ + {file = "distro-1.5.0-py2.py3-none-any.whl", hash = "sha256:df74eed763e18d10d0da624258524ae80486432cd17392d9c3d96f5e83cd2799"}, + {file = "distro-1.5.0.tar.gz", hash = "sha256:0e58756ae38fbd8fc3020d54badb8eae17c5b9dcbed388b17bb55b8a5928df92"}, +] [[package]] name = "docker" @@ -129,6 +243,10 @@ description = "A Python library for the Docker Engine API." category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "docker-4.4.4-py2.py3-none-any.whl", hash = "sha256:f3607d5695be025fa405a12aca2e5df702a57db63790c73b927eb6a94aac60af"}, + {file = "docker-4.4.4.tar.gz", hash = "sha256:d3393c878f575d3a9ca3b94471a3c89a6d960b35feb92f033c0de36cc9d934db"}, +] [package.dependencies] paramiko = {version = ">=2.4.2", optional = true, markers = "extra == \"ssh\""} @@ -139,7 +257,7 @@ websocket-client = ">=0.32.0" [package.extras] ssh = ["paramiko (>=2.4.2)"] -tls = ["pyOpenSSL (>=17.5.0)", "cryptography (>=1.3.4)", "idna (>=2.0.0)"] +tls = ["cryptography (>=1.3.4)", "idna (>=2.0.0)", "pyOpenSSL (>=17.5.0)"] [[package]] name = "docker-compose" @@ -148,6 +266,10 @@ description = "Multi-container orchestration for Docker" category = "dev" optional = false python-versions = ">=3.4" +files = [ + {file = "docker-compose-1.27.4.tar.gz", hash = "sha256:5a5690f24c27d4b43dcbe6b3fae91ba680713208e99ee863352b3bae37bcaa83"}, + {file = "docker_compose-1.27.4-py2.py3-none-any.whl", hash = "sha256:84ca2edad226435e3a378ea24ca2ca4e1a77cc7c8de057e2812124c6dcb55147"}, +] [package.dependencies] cached-property = ">=1.2.0,<2" @@ -174,6 +296,9 @@ description = "Python library to use the pseudo-tty of a docker container" category = "dev" optional = false python-versions = "*" +files = [ + {file = "dockerpty-0.4.1.tar.gz", hash = "sha256:69a9d69d573a0daa31bcd1c0774eeed5c15c295fe719c61aca550ed1393156ce"}, +] [package.dependencies] six = ">=1.3.0" @@ -185,6 +310,9 @@ description = "Pythonic argument parser, that will make you smile" category = "dev" optional = false python-versions = "*" +files = [ + {file = "docopt-0.6.2.tar.gz", hash = "sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"}, +] [[package]] name = "filelock" @@ -193,6 +321,10 @@ description = "A platform independent file lock." category = "dev" optional = false python-versions = "*" +files = [ + {file = "filelock-3.0.12-py3-none-any.whl", hash = "sha256:929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"}, + {file = "filelock-3.0.12.tar.gz", hash = "sha256:18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59"}, +] [[package]] name = "identify" @@ -201,6 +333,10 @@ description = "File identification library for Python" category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" +files = [ + {file = "identify-1.5.10-py2.py3-none-any.whl", hash = "sha256:cc86e6a9a390879dcc2976cef169dd9cc48843ed70b7380f321d1b118163c60e"}, + {file = "identify-1.5.10.tar.gz", hash = "sha256:943cd299ac7f5715fcb3f684e2fc1594c1e0f22a90d15398e5888143bd4144b5"}, +] [package.extras] license = ["editdistance"] @@ -212,6 +348,10 @@ description = "Internationalized Domain Names in Applications (IDNA)" category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, + {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, +] [[package]] name = "jsonschema" @@ -220,15 +360,20 @@ description = "An implementation of JSON Schema validation for Python" category = "dev" optional = false python-versions = "*" +files = [ + {file = "jsonschema-3.2.0-py2.py3-none-any.whl", hash = "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163"}, + {file = "jsonschema-3.2.0.tar.gz", hash = "sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"}, +] [package.dependencies] attrs = ">=17.4.0" pyrsistent = ">=0.14.0" +setuptools = "*" six = ">=1.11.0" [package.extras] format = ["idna", "jsonpointer (>1.13)", "rfc3987", "strict-rfc3339", "webcolors"] -format_nongpl = ["idna", "jsonpointer (>1.13)", "webcolors", "rfc3986-validator (>0.1.0)", "rfc3339-validator"] +format-nongpl = ["idna", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "webcolors"] [[package]] name = "nodeenv" @@ -237,6 +382,10 @@ description = "Node.js virtual environment builder" category = "dev" optional = false python-versions = "*" +files = [ + {file = "nodeenv-1.5.0-py2.py3-none-any.whl", hash = "sha256:5304d424c529c997bc888453aeaa6362d242b6b4631e90f3d4bf1b290f1c84a9"}, + {file = "nodeenv-1.5.0.tar.gz", hash = "sha256:ab45090ae383b716c4ef89e690c41ff8c2b257b85b309f01f3654df3d084bd7c"}, +] [[package]] name = "paramiko" @@ -245,6 +394,10 @@ description = "SSH2 protocol library" category = "dev" optional = false python-versions = "*" +files = [ + {file = "paramiko-2.10.1-py2.py3-none-any.whl", hash = "sha256:f6cbd3e1204abfdbcd40b3ecbc9d32f04027cd3080fe666245e21e7540ccfc1b"}, + {file = "paramiko-2.10.1.tar.gz", hash = "sha256:443f4da23ec24e9a9c0ea54017829c282abdda1d57110bf229360775ccd27a31"}, +] [package.dependencies] bcrypt = ">=3.1.3" @@ -253,9 +406,9 @@ pynacl = ">=1.0.1" six = "*" [package.extras] -all = ["pyasn1 (>=0.1.7)", "pynacl (>=1.0.1)", "bcrypt (>=3.1.3)", "invoke (>=1.3)", "gssapi (>=1.4.1)", "pywin32 (>=2.1.8)"] -ed25519 = ["pynacl (>=1.0.1)", "bcrypt (>=3.1.3)"] -gssapi = ["pyasn1 (>=0.1.7)", "gssapi (>=1.4.1)", "pywin32 (>=2.1.8)"] +all = ["bcrypt (>=3.1.3)", "gssapi (>=1.4.1)", "invoke (>=1.3)", "pyasn1 (>=0.1.7)", "pynacl (>=1.0.1)", "pywin32 (>=2.1.8)"] +ed25519 = ["bcrypt (>=3.1.3)", "pynacl (>=1.0.1)"] +gssapi = ["gssapi (>=1.4.1)", "pyasn1 (>=0.1.7)", "pywin32 (>=2.1.8)"] invoke = ["invoke (>=1.3)"] [[package]] @@ -265,6 +418,10 @@ description = "Plumbum: shell combinators library" category = "dev" optional = false python-versions = ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" +files = [ + {file = "plumbum-1.6.9-py2.py3-none-any.whl", hash = "sha256:91418dcc66b58ab9d2e3b04b3d1e0d787dc45923154fb8b4a826bd9316dba0d6"}, + {file = "plumbum-1.6.9.tar.gz", hash = "sha256:16b9e19d96c80f2e9d051ef5f04927b834a6ac0ce5d2768eb8662b5cd53e43df"}, +] [[package]] name = "pre-commit" @@ -273,6 +430,10 @@ description = "A framework for managing and maintaining multi-language pre-commi category = "dev" optional = false python-versions = ">=3.6.1" +files = [ + {file = "pre_commit-2.9.3-py2.py3-none-any.whl", hash = "sha256:6c86d977d00ddc8a60d68eec19f51ef212d9462937acf3ea37c7adec32284ac0"}, + {file = "pre_commit-2.9.3.tar.gz", hash = "sha256:ee784c11953e6d8badb97d19bc46b997a3a9eded849881ec587accd8608d74a4"}, +] [package.dependencies] cfgv = ">=2.0.0" @@ -289,6 +450,10 @@ description = "C parser in Python" category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "pycparser-2.20-py2.py3-none-any.whl", hash = "sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705"}, + {file = "pycparser-2.20.tar.gz", hash = "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0"}, +] [[package]] name = "pynacl" @@ -297,6 +462,26 @@ description = "Python binding to the Networking and Cryptography (NaCl) library" category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "PyNaCl-1.4.0-cp27-cp27m-macosx_10_10_x86_64.whl", hash = "sha256:ea6841bc3a76fa4942ce00f3bda7d436fda21e2d91602b9e21b7ca9ecab8f3ff"}, + {file = "PyNaCl-1.4.0-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:d452a6746f0a7e11121e64625109bc4468fc3100452817001dbe018bb8b08514"}, + {file = "PyNaCl-1.4.0-cp27-cp27m-win32.whl", hash = "sha256:2fe0fc5a2480361dcaf4e6e7cea00e078fcda07ba45f811b167e3f99e8cff574"}, + {file = "PyNaCl-1.4.0-cp27-cp27m-win_amd64.whl", hash = "sha256:f8851ab9041756003119368c1e6cd0b9c631f46d686b3904b18c0139f4419f80"}, + {file = "PyNaCl-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:7757ae33dae81c300487591c68790dfb5145c7d03324000433d9a2c141f82af7"}, + {file = "PyNaCl-1.4.0-cp35-abi3-macosx_10_10_x86_64.whl", hash = "sha256:757250ddb3bff1eecd7e41e65f7f833a8405fede0194319f87899690624f2122"}, + {file = "PyNaCl-1.4.0-cp35-abi3-manylinux1_x86_64.whl", hash = "sha256:30f9b96db44e09b3304f9ea95079b1b7316b2b4f3744fe3aaecccd95d547063d"}, + {file = "PyNaCl-1.4.0-cp35-abi3-win32.whl", hash = "sha256:4e10569f8cbed81cb7526ae137049759d2a8d57726d52c1a000a3ce366779634"}, + {file = "PyNaCl-1.4.0-cp35-abi3-win_amd64.whl", hash = "sha256:c914f78da4953b33d4685e3cdc7ce63401247a21425c16a39760e282075ac4a6"}, + {file = "PyNaCl-1.4.0-cp35-cp35m-win32.whl", hash = "sha256:06cbb4d9b2c4bd3c8dc0d267416aaed79906e7b33f114ddbf0911969794b1cc4"}, + {file = "PyNaCl-1.4.0-cp35-cp35m-win_amd64.whl", hash = "sha256:511d269ee845037b95c9781aa702f90ccc36036f95d0f31373a6a79bd8242e25"}, + {file = "PyNaCl-1.4.0-cp36-cp36m-win32.whl", hash = "sha256:11335f09060af52c97137d4ac54285bcb7df0cef29014a1a4efe64ac065434c4"}, + {file = "PyNaCl-1.4.0-cp36-cp36m-win_amd64.whl", hash = "sha256:cd401ccbc2a249a47a3a1724c2918fcd04be1f7b54eb2a5a71ff915db0ac51c6"}, + {file = "PyNaCl-1.4.0-cp37-cp37m-win32.whl", hash = "sha256:8122ba5f2a2169ca5da936b2e5a511740ffb73979381b4229d9188f6dcb22f1f"}, + {file = "PyNaCl-1.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:537a7ccbea22905a0ab36ea58577b39d1fa9b1884869d173b5cf111f006f689f"}, + {file = "PyNaCl-1.4.0-cp38-cp38-win32.whl", hash = "sha256:9c4a7ea4fb81536c1b1f5cc44d54a296f96ae78c1ebd2311bd0b60be45a48d96"}, + {file = "PyNaCl-1.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:7c6092102219f59ff29788860ccb021e80fffd953920c4a8653889c029b2d420"}, + {file = "PyNaCl-1.4.0.tar.gz", hash = "sha256:54e9a2c849c742006516ad56a88f5c74bf2ce92c9f67435187c3c5953b346505"}, +] [package.dependencies] cffi = ">=1.4.1" @@ -304,7 +489,7 @@ six = "*" [package.extras] docs = ["sphinx (>=1.6.5)", "sphinx-rtd-theme"] -tests = ["pytest (>=3.2.1,!=3.3.0)", "hypothesis (>=3.27.0)"] +tests = ["hypothesis (>=3.27.0)", "pytest (>=3.2.1,!=3.3.0)"] [[package]] name = "pyrsistent" @@ -313,6 +498,9 @@ description = "Persistent/Functional/Immutable data structures" category = "dev" optional = false python-versions = ">=3.5" +files = [ + {file = "pyrsistent-0.17.3.tar.gz", hash = "sha256:2e636185d9eb976a18a8a8e96efce62f2905fea90041958d8cc2a189756ebf3e"}, +] [[package]] name = "python-dotenv" @@ -321,6 +509,10 @@ description = "Add .env support to your django/flask apps in development and dep category = "dev" optional = false python-versions = "*" +files = [ + {file = "python-dotenv-0.15.0.tar.gz", hash = "sha256:587825ed60b1711daea4832cf37524dfd404325b7db5e25ebe88c495c9f807a0"}, + {file = "python_dotenv-0.15.0-py2.py3-none-any.whl", hash = "sha256:0c8d1b80d1a1e91717ea7d526178e3882732420b03f08afea0406db6402e220e"}, +] [package.extras] cli = ["click (>=5.0)"] @@ -332,6 +524,20 @@ description = "Python for Window Extensions" category = "dev" optional = false python-versions = "*" +files = [ + {file = "pywin32-227-cp27-cp27m-win32.whl", hash = "sha256:371fcc39416d736401f0274dd64c2302728c9e034808e37381b5e1b22be4a6b0"}, + {file = "pywin32-227-cp27-cp27m-win_amd64.whl", hash = "sha256:4cdad3e84191194ea6d0dd1b1b9bdda574ff563177d2adf2b4efec2a244fa116"}, + {file = "pywin32-227-cp35-cp35m-win32.whl", hash = "sha256:f4c5be1a293bae0076d93c88f37ee8da68136744588bc5e2be2f299a34ceb7aa"}, + {file = "pywin32-227-cp35-cp35m-win_amd64.whl", hash = "sha256:a929a4af626e530383a579431b70e512e736e9588106715215bf685a3ea508d4"}, + {file = "pywin32-227-cp36-cp36m-win32.whl", hash = "sha256:300a2db938e98c3e7e2093e4491439e62287d0d493fe07cce110db070b54c0be"}, + {file = "pywin32-227-cp36-cp36m-win_amd64.whl", hash = "sha256:9b31e009564fb95db160f154e2aa195ed66bcc4c058ed72850d047141b36f3a2"}, + {file = "pywin32-227-cp37-cp37m-win32.whl", hash = "sha256:47a3c7551376a865dd8d095a98deba954a98f326c6fe3c72d8726ca6e6b15507"}, + {file = "pywin32-227-cp37-cp37m-win_amd64.whl", hash = "sha256:31f88a89139cb2adc40f8f0e65ee56a8c585f629974f9e07622ba80199057511"}, + {file = "pywin32-227-cp38-cp38-win32.whl", hash = "sha256:7f18199fbf29ca99dff10e1f09451582ae9e372a892ff03a28528a24d55875bc"}, + {file = "pywin32-227-cp38-cp38-win_amd64.whl", hash = "sha256:7c1ae32c489dc012930787f06244426f8356e129184a02c25aef163917ce158e"}, + {file = "pywin32-227-cp39-cp39-win32.whl", hash = "sha256:c054c52ba46e7eb6b7d7dfae4dbd987a1bb48ee86debe3f245a2884ece46e295"}, + {file = "pywin32-227-cp39-cp39-win_amd64.whl", hash = "sha256:f27cec5e7f588c3d1051651830ecc00294f90728d19c3bf6916e6dba93ea357c"}, +] [[package]] name = "pyyaml" @@ -340,6 +546,29 @@ description = "YAML parser and emitter for Python" category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +files = [ + {file = "PyYAML-5.4-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:f7a21e3d99aa3095ef0553e7ceba36fb693998fbb1226f1392ce33681047465f"}, + {file = "PyYAML-5.4-cp27-cp27m-win32.whl", hash = "sha256:52bf0930903818e600ae6c2901f748bc4869c0c406056f679ab9614e5d21a166"}, + {file = "PyYAML-5.4-cp27-cp27m-win_amd64.whl", hash = "sha256:a36a48a51e5471513a5aea920cdad84cbd56d70a5057cca3499a637496ea379c"}, + {file = "PyYAML-5.4-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:5e7ac4e0e79a53451dc2814f6876c2fa6f71452de1498bbe29c0b54b69a986f4"}, + {file = "PyYAML-5.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cc552b6434b90d9dbed6a4f13339625dc466fd82597119897e9489c953acbc22"}, + {file = "PyYAML-5.4-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0dc9f2eb2e3c97640928dec63fd8dc1dd91e6b6ed236bd5ac00332b99b5c2ff9"}, + {file = "PyYAML-5.4-cp36-cp36m-win32.whl", hash = "sha256:5a3f345acff76cad4aa9cb171ee76c590f37394186325d53d1aa25318b0d4a09"}, + {file = "PyYAML-5.4-cp36-cp36m-win_amd64.whl", hash = "sha256:f3790156c606299ff499ec44db422f66f05a7363b39eb9d5b064f17bd7d7c47b"}, + {file = "PyYAML-5.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:124fd7c7bc1e95b1eafc60825f2daf67c73ce7b33f1194731240d24b0d1bf628"}, + {file = "PyYAML-5.4-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:8b818b6c5a920cbe4203b5a6b14256f0e5244338244560da89b7b0f1313ea4b6"}, + {file = "PyYAML-5.4-cp37-cp37m-win32.whl", hash = "sha256:737bd70e454a284d456aa1fa71a0b429dd527bcbf52c5c33f7c8eee81ac16b89"}, + {file = "PyYAML-5.4-cp37-cp37m-win_amd64.whl", hash = "sha256:7242790ab6c20316b8e7bb545be48d7ed36e26bbe279fd56f2c4a12510e60b4b"}, + {file = "PyYAML-5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cc547d3ead3754712223abb7b403f0a184e4c3eae18c9bb7fd15adef1597cc4b"}, + {file = "PyYAML-5.4-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8635d53223b1f561b081ff4adecb828fd484b8efffe542edcfdff471997f7c39"}, + {file = "PyYAML-5.4-cp38-cp38-win32.whl", hash = "sha256:26fcb33776857f4072601502d93e1a619f166c9c00befb52826e7b774efaa9db"}, + {file = "PyYAML-5.4-cp38-cp38-win_amd64.whl", hash = "sha256:b2243dd033fd02c01212ad5c601dafb44fbb293065f430b0d3dbf03f3254d615"}, + {file = "PyYAML-5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:31ba07c54ef4a897758563e3a0fcc60077698df10180abe4b8165d9895c00ebf"}, + {file = "PyYAML-5.4-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:02c78d77281d8f8d07a255e57abdbf43b02257f59f50cc6b636937d68efa5dd0"}, + {file = "PyYAML-5.4-cp39-cp39-win32.whl", hash = "sha256:fdc6b2cb4b19e431994f25a9160695cc59a4e861710cc6fc97161c5e845fc579"}, + {file = "PyYAML-5.4-cp39-cp39-win_amd64.whl", hash = "sha256:8bf38641b4713d77da19e91f8b5296b832e4db87338d6aeffe422d42f1ca896d"}, + {file = "PyYAML-5.4.tar.gz", hash = "sha256:3c49e39ac034fd64fd576d63bb4db53cda89b362768a67f07749d55f128ac18a"}, +] [[package]] name = "requests" @@ -348,6 +577,10 @@ description = "Python HTTP for Humans." category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "requests-2.25.0-py2.py3-none-any.whl", hash = "sha256:e786fa28d8c9154e6a4de5d46a1d921b8749f8b74e28bde23768e5e16eece998"}, + {file = "requests-2.25.0.tar.gz", hash = "sha256:7f1a0b932f4a60a1a65caa4263921bb7d9ee911957e0ae4a23a6dd08185ad5f8"}, +] [package.dependencies] certifi = ">=2017.4.17" @@ -356,9 +589,26 @@ idna = ">=2.5,<3" urllib3 = ">=1.21.1,<1.27" [package.extras] -security = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)"] +security = ["cryptography (>=1.3.4)", "pyOpenSSL (>=0.14)"] socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] +[[package]] +name = "setuptools" +version = "67.2.0" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "setuptools-67.2.0-py3-none-any.whl", hash = "sha256:16ccf598aab3b506593c17378473978908a2734d7336755a8769b480906bec1c"}, + {file = "setuptools-67.2.0.tar.gz", hash = "sha256:b440ee5f7e607bb8c9de15259dba2583dd41a38879a7abc1d43a71c59524da48"}, +] + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8 (<5)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] + [[package]] name = "six" version = "1.15.0" @@ -366,6 +616,10 @@ description = "Python 2 and 3 compatibility utilities" category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, + {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"}, +] [[package]] name = "texttable" @@ -374,6 +628,10 @@ description = "module for creating simple ASCII tables" category = "dev" optional = false python-versions = "*" +files = [ + {file = "texttable-1.6.3-py2.py3-none-any.whl", hash = "sha256:f802f2ef8459058736264210f716c757cbf85007a30886d8541aa8c3404f1dda"}, + {file = "texttable-1.6.3.tar.gz", hash = "sha256:ce0faf21aa77d806bbff22b107cc22cce68dc9438f97a2df32c93e9afa4ce436"}, +] [[package]] name = "toml" @@ -382,6 +640,10 @@ description = "Python Library for Tom's Obvious, Minimal Language" category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] [[package]] name = "urllib3" @@ -390,10 +652,14 @@ description = "HTTP library with thread-safe connection pooling, file post, and category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" +files = [ + {file = "urllib3-1.26.5-py2.py3-none-any.whl", hash = "sha256:753a0374df26658f99d826cfe40394a686d05985786d946fbe4165b5148f5a7c"}, + {file = "urllib3-1.26.5.tar.gz", hash = "sha256:a7acd0977125325f516bda9735fa7142b909a8d01e8b2e4c8108d0984e6e0098"}, +] [package.extras] brotli = ["brotlipy (>=0.6.0)"] -secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"] +secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)"] socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] @@ -403,6 +669,10 @@ description = "Virtual Python Environment builder" category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" +files = [ + {file = "virtualenv-20.2.2-py2.py3-none-any.whl", hash = "sha256:54b05fc737ea9c9ee9f8340f579e5da5b09fb64fd010ab5757eb90268616907c"}, + {file = "virtualenv-20.2.2.tar.gz", hash = "sha256:b7a8ec323ee02fb2312f098b6b4c9de99559b462775bc8fe3627a73706603c1b"}, +] [package.dependencies] appdirs = ">=1.4.3,<2" @@ -412,7 +682,7 @@ six = ">=1.9.0,<2" [package.extras] docs = ["proselint (>=0.10.2)", "sphinx (>=3)", "sphinx-argparse (>=0.2.5)", "sphinx-rtd-theme (>=0.4.3)", "towncrier (>=19.9.0rc1)"] -testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", "pytest (>=4)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.1)", "pytest-mock (>=2)", "pytest-randomly (>=1)", "pytest-timeout (>=1)", "pytest-xdist (>=1.31.0)", "packaging (>=20.0)", "xonsh (>=0.9.16)"] +testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", "packaging (>=20.0)", "pytest (>=4)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.1)", "pytest-mock (>=2)", "pytest-randomly (>=1)", "pytest-timeout (>=1)", "pytest-xdist (>=1.31.0)", "xonsh (>=0.9.16)"] [[package]] name = "websocket-client" @@ -421,258 +691,15 @@ description = "WebSocket client for Python. hybi13 is supported." category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "websocket_client-0.57.0-py2.py3-none-any.whl", hash = "sha256:0fc45c961324d79c781bab301359d5a1b00b13ad1b10415a4780229ef71a5549"}, + {file = "websocket_client-0.57.0.tar.gz", hash = "sha256:d735b91d6d1692a6a181f2a8c9e0238e5f6373356f561bb9dc4c7af36f452010"}, +] [package.dependencies] six = "*" [metadata] -lock-version = "1.1" +lock-version = "2.0" python-versions = "^3.9" content-hash = "b4edd7e09296f18061bf1dea5d0b6fb53a988c6f0ea8b754712650048e65a8af" - -[metadata.files] -appdirs = [ - {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, - {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, -] -attrs = [ - {file = "attrs-20.3.0-py2.py3-none-any.whl", hash = "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6"}, - {file = "attrs-20.3.0.tar.gz", hash = "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700"}, -] -bcrypt = [ - {file = "bcrypt-3.2.0-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:b589229207630484aefe5899122fb938a5b017b0f4349f769b8c13e78d99a8fd"}, - {file = "bcrypt-3.2.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:c95d4cbebffafcdd28bd28bb4e25b31c50f6da605c81ffd9ad8a3d1b2ab7b1b6"}, - {file = "bcrypt-3.2.0-cp36-abi3-manylinux1_x86_64.whl", hash = "sha256:63d4e3ff96188e5898779b6057878fecf3f11cfe6ec3b313ea09955d587ec7a7"}, - {file = "bcrypt-3.2.0-cp36-abi3-manylinux2010_x86_64.whl", hash = "sha256:cd1ea2ff3038509ea95f687256c46b79f5fc382ad0aa3664d200047546d511d1"}, - {file = "bcrypt-3.2.0-cp36-abi3-manylinux2014_aarch64.whl", hash = "sha256:cdcdcb3972027f83fe24a48b1e90ea4b584d35f1cc279d76de6fc4b13376239d"}, - {file = "bcrypt-3.2.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:a0584a92329210fcd75eb8a3250c5a941633f8bfaf2a18f81009b097732839b7"}, - {file = "bcrypt-3.2.0-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:56e5da069a76470679f312a7d3d23deb3ac4519991a0361abc11da837087b61d"}, - {file = "bcrypt-3.2.0-cp36-abi3-win32.whl", hash = "sha256:a67fb841b35c28a59cebed05fbd3e80eea26e6d75851f0574a9273c80f3e9b55"}, - {file = "bcrypt-3.2.0-cp36-abi3-win_amd64.whl", hash = "sha256:81fec756feff5b6818ea7ab031205e1d323d8943d237303baca2c5f9c7846f34"}, - {file = "bcrypt-3.2.0.tar.gz", hash = "sha256:5b93c1726e50a93a033c36e5ca7fdcd29a5c7395af50a6892f5d9e7c6cfbfb29"}, -] -cached-property = [ - {file = "cached-property-1.5.2.tar.gz", hash = "sha256:9fa5755838eecbb2d234c3aa390bd80fbd3ac6b6869109bfc1b499f7bd89a130"}, - {file = "cached_property-1.5.2-py2.py3-none-any.whl", hash = "sha256:df4f613cf7ad9a588cc381aaf4a512d26265ecebd5eb9e1ba12f1319eb85a6a0"}, -] -certifi = [ - {file = "certifi-2020.12.5-py2.py3-none-any.whl", hash = "sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830"}, - {file = "certifi-2020.12.5.tar.gz", hash = "sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"}, -] -cffi = [ - {file = "cffi-1.14.4-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:ebb253464a5d0482b191274f1c8bf00e33f7e0b9c66405fbffc61ed2c839c775"}, - {file = "cffi-1.14.4-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:2c24d61263f511551f740d1a065eb0212db1dbbbbd241db758f5244281590c06"}, - {file = "cffi-1.14.4-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9f7a31251289b2ab6d4012f6e83e58bc3b96bd151f5b5262467f4bb6b34a7c26"}, - {file = "cffi-1.14.4-cp27-cp27m-win32.whl", hash = "sha256:5cf4be6c304ad0b6602f5c4e90e2f59b47653ac1ed9c662ed379fe48a8f26b0c"}, - {file = "cffi-1.14.4-cp27-cp27m-win_amd64.whl", hash = "sha256:f60567825f791c6f8a592f3c6e3bd93dd2934e3f9dac189308426bd76b00ef3b"}, - {file = "cffi-1.14.4-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:c6332685306b6417a91b1ff9fae889b3ba65c2292d64bd9245c093b1b284809d"}, - {file = "cffi-1.14.4-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:d9efd8b7a3ef378dd61a1e77367f1924375befc2eba06168b6ebfa903a5e59ca"}, - {file = "cffi-1.14.4-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:51a8b381b16ddd370178a65360ebe15fbc1c71cf6f584613a7ea08bfad946698"}, - {file = "cffi-1.14.4-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:1d2c4994f515e5b485fd6d3a73d05526aa0fcf248eb135996b088d25dfa1865b"}, - {file = "cffi-1.14.4-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:af5c59122a011049aad5dd87424b8e65a80e4a6477419c0c1015f73fb5ea0293"}, - {file = "cffi-1.14.4-cp35-cp35m-win32.whl", hash = "sha256:594234691ac0e9b770aee9fcdb8fa02c22e43e5c619456efd0d6c2bf276f3eb2"}, - {file = "cffi-1.14.4-cp35-cp35m-win_amd64.whl", hash = "sha256:64081b3f8f6f3c3de6191ec89d7dc6c86a8a43911f7ecb422c60e90c70be41c7"}, - {file = "cffi-1.14.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f803eaa94c2fcda012c047e62bc7a51b0bdabda1cad7a92a522694ea2d76e49f"}, - {file = "cffi-1.14.4-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:105abaf8a6075dc96c1fe5ae7aae073f4696f2905fde6aeada4c9d2926752362"}, - {file = "cffi-1.14.4-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0638c3ae1a0edfb77c6765d487fee624d2b1ee1bdfeffc1f0b58c64d149e7eec"}, - {file = "cffi-1.14.4-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:7c6b1dece89874d9541fc974917b631406233ea0440d0bdfbb8e03bf39a49b3b"}, - {file = "cffi-1.14.4-cp36-cp36m-win32.whl", hash = "sha256:155136b51fd733fa94e1c2ea5211dcd4c8879869008fc811648f16541bf99668"}, - {file = "cffi-1.14.4-cp36-cp36m-win_amd64.whl", hash = "sha256:6bc25fc545a6b3d57b5f8618e59fc13d3a3a68431e8ca5fd4c13241cd70d0009"}, - {file = "cffi-1.14.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a7711edca4dcef1a75257b50a2fbfe92a65187c47dab5a0f1b9b332c5919a3fb"}, - {file = "cffi-1.14.4-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:00e28066507bfc3fe865a31f325c8391a1ac2916219340f87dfad602c3e48e5d"}, - {file = "cffi-1.14.4-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:798caa2a2384b1cbe8a2a139d80734c9db54f9cc155c99d7cc92441a23871c03"}, - {file = "cffi-1.14.4-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:a5ed8c05548b54b998b9498753fb9cadbfd92ee88e884641377d8a8b291bcc01"}, - {file = "cffi-1.14.4-cp37-cp37m-win32.whl", hash = "sha256:00a1ba5e2e95684448de9b89888ccd02c98d512064b4cb987d48f4b40aa0421e"}, - {file = "cffi-1.14.4-cp37-cp37m-win_amd64.whl", hash = "sha256:9cc46bc107224ff5b6d04369e7c595acb700c3613ad7bcf2e2012f62ece80c35"}, - {file = "cffi-1.14.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:df5169c4396adc04f9b0a05f13c074df878b6052430e03f50e68adf3a57aa28d"}, - {file = "cffi-1.14.4-cp38-cp38-manylinux1_i686.whl", hash = "sha256:9ffb888f19d54a4d4dfd4b3f29bc2c16aa4972f1c2ab9c4ab09b8ab8685b9c2b"}, - {file = "cffi-1.14.4-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8d6603078baf4e11edc4168a514c5ce5b3ba6e3e9c374298cb88437957960a53"}, - {file = "cffi-1.14.4-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:d5ff0621c88ce83a28a10d2ce719b2ee85635e85c515f12bac99a95306da4b2e"}, - {file = "cffi-1.14.4-cp38-cp38-win32.whl", hash = "sha256:b4e248d1087abf9f4c10f3c398896c87ce82a9856494a7155823eb45a892395d"}, - {file = "cffi-1.14.4-cp38-cp38-win_amd64.whl", hash = "sha256:ec80dc47f54e6e9a78181ce05feb71a0353854cc26999db963695f950b5fb375"}, - {file = "cffi-1.14.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:840793c68105fe031f34d6a086eaea153a0cd5c491cde82a74b420edd0a2b909"}, - {file = "cffi-1.14.4-cp39-cp39-manylinux1_i686.whl", hash = "sha256:b18e0a9ef57d2b41f5c68beefa32317d286c3d6ac0484efd10d6e07491bb95dd"}, - {file = "cffi-1.14.4-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:045d792900a75e8b1e1b0ab6787dd733a8190ffcf80e8c8ceb2fb10a29ff238a"}, - {file = "cffi-1.14.4-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:7ef7d4ced6b325e92eb4d3502946c78c5367bc416398d387b39591532536734e"}, - {file = "cffi-1.14.4-cp39-cp39-win32.whl", hash = "sha256:ba4e9e0ae13fc41c6b23299545e5ef73055213e466bd107953e4a013a5ddd7e3"}, - {file = "cffi-1.14.4-cp39-cp39-win_amd64.whl", hash = "sha256:f032b34669220030f905152045dfa27741ce1a6db3324a5bc0b96b6c7420c87b"}, - {file = "cffi-1.14.4.tar.gz", hash = "sha256:1a465cbe98a7fd391d47dce4b8f7e5b921e6cd805ef421d04f5f66ba8f06086c"}, -] -cfgv = [ - {file = "cfgv-3.2.0-py2.py3-none-any.whl", hash = "sha256:32e43d604bbe7896fe7c248a9c2276447dbef840feb28fe20494f62af110211d"}, - {file = "cfgv-3.2.0.tar.gz", hash = "sha256:cf22deb93d4bcf92f345a5c3cd39d3d41d6340adc60c78bbbd6588c384fda6a1"}, -] -chardet = [ - {file = "chardet-3.0.4-py2.py3-none-any.whl", hash = "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"}, - {file = "chardet-3.0.4.tar.gz", hash = "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"}, -] -colorama = [ - {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, - {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, -] -cryptography = [ - {file = "cryptography-3.3.2-cp27-cp27m-macosx_10_10_x86_64.whl", hash = "sha256:541dd758ad49b45920dda3b5b48c968f8b2533d8981bcdb43002798d8f7a89ed"}, - {file = "cryptography-3.3.2-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:49570438e60f19243e7e0d504527dd5fe9b4b967b5a1ff21cc12b57602dd85d3"}, - {file = "cryptography-3.3.2-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:a9a4ac9648d39ce71c2f63fe7dc6db144b9fa567ddfc48b9fde1b54483d26042"}, - {file = "cryptography-3.3.2-cp27-cp27m-win32.whl", hash = "sha256:aa4969f24d536ae2268c902b2c3d62ab464b5a66bcb247630d208a79a8098e9b"}, - {file = "cryptography-3.3.2-cp27-cp27m-win_amd64.whl", hash = "sha256:1bd0ccb0a1ed775cd7e2144fe46df9dc03eefd722bbcf587b3e0616ea4a81eff"}, - {file = "cryptography-3.3.2-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:e18e6ab84dfb0ab997faf8cca25a86ff15dfea4027b986322026cc99e0a892da"}, - {file = "cryptography-3.3.2-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:c7390f9b2119b2b43160abb34f63277a638504ef8df99f11cb52c1fda66a2e6f"}, - {file = "cryptography-3.3.2-cp36-abi3-macosx_10_10_x86_64.whl", hash = "sha256:0d7b69674b738068fa6ffade5c962ecd14969690585aaca0a1b1fc9058938a72"}, - {file = "cryptography-3.3.2-cp36-abi3-manylinux1_x86_64.whl", hash = "sha256:922f9602d67c15ade470c11d616f2b2364950602e370c76f0c94c94ae672742e"}, - {file = "cryptography-3.3.2-cp36-abi3-manylinux2010_x86_64.whl", hash = "sha256:a0f0b96c572fc9f25c3f4ddbf4688b9b38c69836713fb255f4a2715d93cbaf44"}, - {file = "cryptography-3.3.2-cp36-abi3-manylinux2014_aarch64.whl", hash = "sha256:a777c096a49d80f9d2979695b835b0f9c9edab73b59e4ceb51f19724dda887ed"}, - {file = "cryptography-3.3.2-cp36-abi3-win32.whl", hash = "sha256:3c284fc1e504e88e51c428db9c9274f2da9f73fdf5d7e13a36b8ecb039af6e6c"}, - {file = "cryptography-3.3.2-cp36-abi3-win_amd64.whl", hash = "sha256:7951a966613c4211b6612b0352f5bf29989955ee592c4a885d8c7d0f830d0433"}, - {file = "cryptography-3.3.2.tar.gz", hash = "sha256:5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed"}, -] -distlib = [ - {file = "distlib-0.3.1-py2.py3-none-any.whl", hash = "sha256:8c09de2c67b3e7deef7184574fc060ab8a793e7adbb183d942c389c8b13c52fb"}, - {file = "distlib-0.3.1.zip", hash = "sha256:edf6116872c863e1aa9d5bb7cb5e05a022c519a4594dc703843343a9ddd9bff1"}, -] -distro = [ - {file = "distro-1.5.0-py2.py3-none-any.whl", hash = "sha256:df74eed763e18d10d0da624258524ae80486432cd17392d9c3d96f5e83cd2799"}, - {file = "distro-1.5.0.tar.gz", hash = "sha256:0e58756ae38fbd8fc3020d54badb8eae17c5b9dcbed388b17bb55b8a5928df92"}, -] -docker = [ - {file = "docker-4.4.4-py2.py3-none-any.whl", hash = "sha256:f3607d5695be025fa405a12aca2e5df702a57db63790c73b927eb6a94aac60af"}, - {file = "docker-4.4.4.tar.gz", hash = "sha256:d3393c878f575d3a9ca3b94471a3c89a6d960b35feb92f033c0de36cc9d934db"}, -] -docker-compose = [ - {file = "docker-compose-1.27.4.tar.gz", hash = "sha256:5a5690f24c27d4b43dcbe6b3fae91ba680713208e99ee863352b3bae37bcaa83"}, - {file = "docker_compose-1.27.4-py2.py3-none-any.whl", hash = "sha256:84ca2edad226435e3a378ea24ca2ca4e1a77cc7c8de057e2812124c6dcb55147"}, -] -dockerpty = [ - {file = "dockerpty-0.4.1.tar.gz", hash = "sha256:69a9d69d573a0daa31bcd1c0774eeed5c15c295fe719c61aca550ed1393156ce"}, -] -docopt = [ - {file = "docopt-0.6.2.tar.gz", hash = "sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"}, -] -filelock = [ - {file = "filelock-3.0.12-py3-none-any.whl", hash = "sha256:929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"}, - {file = "filelock-3.0.12.tar.gz", hash = "sha256:18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59"}, -] -identify = [ - {file = "identify-1.5.10-py2.py3-none-any.whl", hash = "sha256:cc86e6a9a390879dcc2976cef169dd9cc48843ed70b7380f321d1b118163c60e"}, - {file = "identify-1.5.10.tar.gz", hash = "sha256:943cd299ac7f5715fcb3f684e2fc1594c1e0f22a90d15398e5888143bd4144b5"}, -] -idna = [ - {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, - {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, -] -jsonschema = [ - {file = "jsonschema-3.2.0-py2.py3-none-any.whl", hash = "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163"}, - {file = "jsonschema-3.2.0.tar.gz", hash = "sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"}, -] -nodeenv = [ - {file = "nodeenv-1.5.0-py2.py3-none-any.whl", hash = "sha256:5304d424c529c997bc888453aeaa6362d242b6b4631e90f3d4bf1b290f1c84a9"}, - {file = "nodeenv-1.5.0.tar.gz", hash = "sha256:ab45090ae383b716c4ef89e690c41ff8c2b257b85b309f01f3654df3d084bd7c"}, -] -paramiko = [ - {file = "paramiko-2.10.1-py2.py3-none-any.whl", hash = "sha256:f6cbd3e1204abfdbcd40b3ecbc9d32f04027cd3080fe666245e21e7540ccfc1b"}, - {file = "paramiko-2.10.1.tar.gz", hash = "sha256:443f4da23ec24e9a9c0ea54017829c282abdda1d57110bf229360775ccd27a31"}, -] -plumbum = [ - {file = "plumbum-1.6.9-py2.py3-none-any.whl", hash = "sha256:91418dcc66b58ab9d2e3b04b3d1e0d787dc45923154fb8b4a826bd9316dba0d6"}, - {file = "plumbum-1.6.9.tar.gz", hash = "sha256:16b9e19d96c80f2e9d051ef5f04927b834a6ac0ce5d2768eb8662b5cd53e43df"}, -] -pre-commit = [ - {file = "pre_commit-2.9.3-py2.py3-none-any.whl", hash = "sha256:6c86d977d00ddc8a60d68eec19f51ef212d9462937acf3ea37c7adec32284ac0"}, - {file = "pre_commit-2.9.3.tar.gz", hash = "sha256:ee784c11953e6d8badb97d19bc46b997a3a9eded849881ec587accd8608d74a4"}, -] -pycparser = [ - {file = "pycparser-2.20-py2.py3-none-any.whl", hash = "sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705"}, - {file = "pycparser-2.20.tar.gz", hash = "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0"}, -] -pynacl = [ - {file = "PyNaCl-1.4.0-cp27-cp27m-macosx_10_10_x86_64.whl", hash = "sha256:ea6841bc3a76fa4942ce00f3bda7d436fda21e2d91602b9e21b7ca9ecab8f3ff"}, - {file = "PyNaCl-1.4.0-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:d452a6746f0a7e11121e64625109bc4468fc3100452817001dbe018bb8b08514"}, - {file = "PyNaCl-1.4.0-cp27-cp27m-win32.whl", hash = "sha256:2fe0fc5a2480361dcaf4e6e7cea00e078fcda07ba45f811b167e3f99e8cff574"}, - {file = "PyNaCl-1.4.0-cp27-cp27m-win_amd64.whl", hash = "sha256:f8851ab9041756003119368c1e6cd0b9c631f46d686b3904b18c0139f4419f80"}, - {file = "PyNaCl-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:7757ae33dae81c300487591c68790dfb5145c7d03324000433d9a2c141f82af7"}, - {file = "PyNaCl-1.4.0-cp35-abi3-macosx_10_10_x86_64.whl", hash = "sha256:757250ddb3bff1eecd7e41e65f7f833a8405fede0194319f87899690624f2122"}, - {file = "PyNaCl-1.4.0-cp35-abi3-manylinux1_x86_64.whl", hash = "sha256:30f9b96db44e09b3304f9ea95079b1b7316b2b4f3744fe3aaecccd95d547063d"}, - {file = "PyNaCl-1.4.0-cp35-abi3-win32.whl", hash = "sha256:4e10569f8cbed81cb7526ae137049759d2a8d57726d52c1a000a3ce366779634"}, - {file = "PyNaCl-1.4.0-cp35-abi3-win_amd64.whl", hash = "sha256:c914f78da4953b33d4685e3cdc7ce63401247a21425c16a39760e282075ac4a6"}, - {file = "PyNaCl-1.4.0-cp35-cp35m-win32.whl", hash = "sha256:06cbb4d9b2c4bd3c8dc0d267416aaed79906e7b33f114ddbf0911969794b1cc4"}, - {file = "PyNaCl-1.4.0-cp35-cp35m-win_amd64.whl", hash = "sha256:511d269ee845037b95c9781aa702f90ccc36036f95d0f31373a6a79bd8242e25"}, - {file = "PyNaCl-1.4.0-cp36-cp36m-win32.whl", hash = "sha256:11335f09060af52c97137d4ac54285bcb7df0cef29014a1a4efe64ac065434c4"}, - {file = "PyNaCl-1.4.0-cp36-cp36m-win_amd64.whl", hash = "sha256:cd401ccbc2a249a47a3a1724c2918fcd04be1f7b54eb2a5a71ff915db0ac51c6"}, - {file = "PyNaCl-1.4.0-cp37-cp37m-win32.whl", hash = "sha256:8122ba5f2a2169ca5da936b2e5a511740ffb73979381b4229d9188f6dcb22f1f"}, - {file = "PyNaCl-1.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:537a7ccbea22905a0ab36ea58577b39d1fa9b1884869d173b5cf111f006f689f"}, - {file = "PyNaCl-1.4.0-cp38-cp38-win32.whl", hash = "sha256:9c4a7ea4fb81536c1b1f5cc44d54a296f96ae78c1ebd2311bd0b60be45a48d96"}, - {file = "PyNaCl-1.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:7c6092102219f59ff29788860ccb021e80fffd953920c4a8653889c029b2d420"}, - {file = "PyNaCl-1.4.0.tar.gz", hash = "sha256:54e9a2c849c742006516ad56a88f5c74bf2ce92c9f67435187c3c5953b346505"}, -] -pyrsistent = [ - {file = "pyrsistent-0.17.3.tar.gz", hash = "sha256:2e636185d9eb976a18a8a8e96efce62f2905fea90041958d8cc2a189756ebf3e"}, -] -python-dotenv = [ - {file = "python-dotenv-0.15.0.tar.gz", hash = "sha256:587825ed60b1711daea4832cf37524dfd404325b7db5e25ebe88c495c9f807a0"}, - {file = "python_dotenv-0.15.0-py2.py3-none-any.whl", hash = "sha256:0c8d1b80d1a1e91717ea7d526178e3882732420b03f08afea0406db6402e220e"}, -] -pywin32 = [ - {file = "pywin32-227-cp27-cp27m-win32.whl", hash = "sha256:371fcc39416d736401f0274dd64c2302728c9e034808e37381b5e1b22be4a6b0"}, - {file = "pywin32-227-cp27-cp27m-win_amd64.whl", hash = "sha256:4cdad3e84191194ea6d0dd1b1b9bdda574ff563177d2adf2b4efec2a244fa116"}, - {file = "pywin32-227-cp35-cp35m-win32.whl", hash = "sha256:f4c5be1a293bae0076d93c88f37ee8da68136744588bc5e2be2f299a34ceb7aa"}, - {file = "pywin32-227-cp35-cp35m-win_amd64.whl", hash = "sha256:a929a4af626e530383a579431b70e512e736e9588106715215bf685a3ea508d4"}, - {file = "pywin32-227-cp36-cp36m-win32.whl", hash = "sha256:300a2db938e98c3e7e2093e4491439e62287d0d493fe07cce110db070b54c0be"}, - {file = "pywin32-227-cp36-cp36m-win_amd64.whl", hash = "sha256:9b31e009564fb95db160f154e2aa195ed66bcc4c058ed72850d047141b36f3a2"}, - {file = "pywin32-227-cp37-cp37m-win32.whl", hash = "sha256:47a3c7551376a865dd8d095a98deba954a98f326c6fe3c72d8726ca6e6b15507"}, - {file = "pywin32-227-cp37-cp37m-win_amd64.whl", hash = "sha256:31f88a89139cb2adc40f8f0e65ee56a8c585f629974f9e07622ba80199057511"}, - {file = "pywin32-227-cp38-cp38-win32.whl", hash = "sha256:7f18199fbf29ca99dff10e1f09451582ae9e372a892ff03a28528a24d55875bc"}, - {file = "pywin32-227-cp38-cp38-win_amd64.whl", hash = "sha256:7c1ae32c489dc012930787f06244426f8356e129184a02c25aef163917ce158e"}, - {file = "pywin32-227-cp39-cp39-win32.whl", hash = "sha256:c054c52ba46e7eb6b7d7dfae4dbd987a1bb48ee86debe3f245a2884ece46e295"}, - {file = "pywin32-227-cp39-cp39-win_amd64.whl", hash = "sha256:f27cec5e7f588c3d1051651830ecc00294f90728d19c3bf6916e6dba93ea357c"}, -] -pyyaml = [ - {file = "PyYAML-5.4-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:f7a21e3d99aa3095ef0553e7ceba36fb693998fbb1226f1392ce33681047465f"}, - {file = "PyYAML-5.4-cp27-cp27m-win32.whl", hash = "sha256:52bf0930903818e600ae6c2901f748bc4869c0c406056f679ab9614e5d21a166"}, - {file = "PyYAML-5.4-cp27-cp27m-win_amd64.whl", hash = "sha256:a36a48a51e5471513a5aea920cdad84cbd56d70a5057cca3499a637496ea379c"}, - {file = "PyYAML-5.4-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:5e7ac4e0e79a53451dc2814f6876c2fa6f71452de1498bbe29c0b54b69a986f4"}, - {file = "PyYAML-5.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cc552b6434b90d9dbed6a4f13339625dc466fd82597119897e9489c953acbc22"}, - {file = "PyYAML-5.4-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0dc9f2eb2e3c97640928dec63fd8dc1dd91e6b6ed236bd5ac00332b99b5c2ff9"}, - {file = "PyYAML-5.4-cp36-cp36m-win32.whl", hash = "sha256:5a3f345acff76cad4aa9cb171ee76c590f37394186325d53d1aa25318b0d4a09"}, - {file = "PyYAML-5.4-cp36-cp36m-win_amd64.whl", hash = "sha256:f3790156c606299ff499ec44db422f66f05a7363b39eb9d5b064f17bd7d7c47b"}, - {file = "PyYAML-5.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:124fd7c7bc1e95b1eafc60825f2daf67c73ce7b33f1194731240d24b0d1bf628"}, - {file = "PyYAML-5.4-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:8b818b6c5a920cbe4203b5a6b14256f0e5244338244560da89b7b0f1313ea4b6"}, - {file = "PyYAML-5.4-cp37-cp37m-win32.whl", hash = "sha256:737bd70e454a284d456aa1fa71a0b429dd527bcbf52c5c33f7c8eee81ac16b89"}, - {file = "PyYAML-5.4-cp37-cp37m-win_amd64.whl", hash = "sha256:7242790ab6c20316b8e7bb545be48d7ed36e26bbe279fd56f2c4a12510e60b4b"}, - {file = "PyYAML-5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cc547d3ead3754712223abb7b403f0a184e4c3eae18c9bb7fd15adef1597cc4b"}, - {file = "PyYAML-5.4-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8635d53223b1f561b081ff4adecb828fd484b8efffe542edcfdff471997f7c39"}, - {file = "PyYAML-5.4-cp38-cp38-win32.whl", hash = "sha256:26fcb33776857f4072601502d93e1a619f166c9c00befb52826e7b774efaa9db"}, - {file = "PyYAML-5.4-cp38-cp38-win_amd64.whl", hash = "sha256:b2243dd033fd02c01212ad5c601dafb44fbb293065f430b0d3dbf03f3254d615"}, - {file = "PyYAML-5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:31ba07c54ef4a897758563e3a0fcc60077698df10180abe4b8165d9895c00ebf"}, - {file = "PyYAML-5.4-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:02c78d77281d8f8d07a255e57abdbf43b02257f59f50cc6b636937d68efa5dd0"}, - {file = "PyYAML-5.4-cp39-cp39-win32.whl", hash = "sha256:fdc6b2cb4b19e431994f25a9160695cc59a4e861710cc6fc97161c5e845fc579"}, - {file = "PyYAML-5.4-cp39-cp39-win_amd64.whl", hash = "sha256:8bf38641b4713d77da19e91f8b5296b832e4db87338d6aeffe422d42f1ca896d"}, - {file = "PyYAML-5.4.tar.gz", hash = "sha256:3c49e39ac034fd64fd576d63bb4db53cda89b362768a67f07749d55f128ac18a"}, -] -requests = [ - {file = "requests-2.25.0-py2.py3-none-any.whl", hash = "sha256:e786fa28d8c9154e6a4de5d46a1d921b8749f8b74e28bde23768e5e16eece998"}, - {file = "requests-2.25.0.tar.gz", hash = "sha256:7f1a0b932f4a60a1a65caa4263921bb7d9ee911957e0ae4a23a6dd08185ad5f8"}, -] -six = [ - {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, - {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"}, -] -texttable = [ - {file = "texttable-1.6.3-py2.py3-none-any.whl", hash = "sha256:f802f2ef8459058736264210f716c757cbf85007a30886d8541aa8c3404f1dda"}, - {file = "texttable-1.6.3.tar.gz", hash = "sha256:ce0faf21aa77d806bbff22b107cc22cce68dc9438f97a2df32c93e9afa4ce436"}, -] -toml = [ - {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, - {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, -] -urllib3 = [ - {file = "urllib3-1.26.5-py2.py3-none-any.whl", hash = "sha256:753a0374df26658f99d826cfe40394a686d05985786d946fbe4165b5148f5a7c"}, - {file = "urllib3-1.26.5.tar.gz", hash = "sha256:a7acd0977125325f516bda9735fa7142b909a8d01e8b2e4c8108d0984e6e0098"}, -] -virtualenv = [ - {file = "virtualenv-20.2.2-py2.py3-none-any.whl", hash = "sha256:54b05fc737ea9c9ee9f8340f579e5da5b09fb64fd010ab5757eb90268616907c"}, - {file = "virtualenv-20.2.2.tar.gz", hash = "sha256:b7a8ec323ee02fb2312f098b6b4c9de99559b462775bc8fe3627a73706603c1b"}, -] -websocket-client = [ - {file = "websocket_client-0.57.0-py2.py3-none-any.whl", hash = "sha256:0fc45c961324d79c781bab301359d5a1b00b13ad1b10415a4780229ef71a5549"}, - {file = "websocket_client-0.57.0.tar.gz", hash = "sha256:d735b91d6d1692a6a181f2a8c9e0238e5f6373356f561bb9dc4c7af36f452010"}, -] From be18050eb42091d1faacf1427979101662966ef8 Mon Sep 17 00:00:00 2001 From: Karl Date: Mon, 6 Mar 2023 21:03:00 +0000 Subject: [PATCH 180/255] [FIX] click-odoo-contrib so out of date it doesnt understand 16.0 [FIX] click-odoo-contrib patch not required for 15.0 --- 15.0.Dockerfile | 3 +-- 16.0.Dockerfile | 3 +-- tests/__init__.py | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/15.0.Dockerfile b/15.0.Dockerfile index 8eba5de2..311f30ec 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -120,8 +120,7 @@ RUN build_deps=" \ -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ 'websocket-client~=0.56' \ astor \ - # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 - git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ + click-odoo-contrib \ debugpy \ pydevd-odoo \ flanker[validator] \ diff --git a/16.0.Dockerfile b/16.0.Dockerfile index 42acd0a9..619b9bc3 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -120,8 +120,7 @@ RUN build_deps=" \ -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ 'websocket-client~=0.56' \ astor \ - # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 - git+https://github.com/Tecnativa/click-odoo-contrib.git@fix-active-modules-hashing \ + click-odoo-contrib \ debugpy \ pydevd-odoo \ flanker[validator] \ diff --git a/tests/__init__.py b/tests/__init__.py index c177f1cf..09e69c08 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -284,6 +284,8 @@ def test_smallest(self): ODOO_PREFIX + ("--init", "base"), # Auto updater must work ("click-odoo-update",), + # Auto updater must work, ignoring core addons + ("click-odoo-update", "--ignore-core-addons"), # Needed tools exist ("curl", "--version"), ("git", "--version"), From 039f3b401ab009c32a03fac632a368b0f17e1e24 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 24 Apr 2023 08:25:56 +0200 Subject: [PATCH 181/255] [FIX] 1[12].0: use archive for debian stretch packages --- 11.0.Dockerfile | 3 +++ 12.0.Dockerfile | 3 +++ 2 files changed, 6 insertions(+) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index a2a24d2f..279a4a2c 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -34,6 +34,9 @@ ENV DB_FILTER=.* \ WDB_WEB_PORT=1984 \ WDB_WEB_SERVER=localhost +# Debian stretch was moved to archive (and stretch-updates does not exist in archive) +RUN sed -i 's,http://deb.debian.org,http://archive.debian.org,g;s,http://security.debian.org,http://archive.debian.org,g;s,\(.*stretch-updates\),#\1,' /etc/apt/sources.list + # Other requirements and recommendations to run Odoo # See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control RUN apt-get -qq update \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index cd87abea..2bf063ba 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -34,6 +34,9 @@ ENV DB_FILTER=.* \ WDB_WEB_PORT=1984 \ WDB_WEB_SERVER=localhost +# Debian stretch was moved to archive (and stretch-updates does not exist in archive) +RUN sed -i 's,http://deb.debian.org,http://archive.debian.org,g;s,http://security.debian.org,http://archive.debian.org,g;s,\(.*stretch-updates\),#\1,' /etc/apt/sources.list + # Other requirements and recommendations to run Odoo # See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control RUN apt-get -qq update \ From af59f6e6ef9229d35755f6d31451831f84e9eca2 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 18 Sep 2023 08:41:51 +0200 Subject: [PATCH 182/255] [FIX] 11.0: use execjs <2.9.1 to avoid "execjs requires Ruby version >= 2.5.0." errors --- 11.0.Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 279a4a2c..5347bd58 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -77,7 +77,8 @@ RUN ln -s /usr/bin/nodejs /usr/local/bin/node \ && rm -Rf ~/.npm /tmp/* # Special case to get bootstrap-sass, required by Odoo for Sass assets -RUN gem install --no-rdoc --no-ri --no-update-sources autoprefixer-rails --version '<9.8.6' \ +RUN gem install --no-rdoc --no-ri --no-update-sources execjs --version '<2.9.1' \ + && gem install --no-rdoc --no-ri --no-update-sources autoprefixer-rails --version '<9.8.6' \ && gem install --no-rdoc --no-ri --no-update-sources bootstrap-sass --version '<3.4' \ && rm -Rf ~/.gem /var/lib/gems/*/cache/ From d33df7fe662017bf12988424c2a1f5373e0f16b4 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 18 Sep 2023 10:09:59 +0200 Subject: [PATCH 183/255] [FIX] ci: use pyyaml 5.3.1, only in ci --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d0f3e22c..431ffb6b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -63,6 +63,9 @@ jobs: - run: pip install poetry - name: Patch $PATH run: echo "$HOME/.local/bin" >> $GITHUB_PATH + # override pyyaml to 5.3.1 as PIP_CONSTRAINT does not work for poetry + # to get rid of AttributeError: cython_sources when installing pyyaml + - run: poetry add pyyaml==5.3.1 - run: poetry install # Build images - run: poetry run ./hooks/build From 8191fabb6bfb10623d54de3a8a6b461edb512b90 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Thu, 24 Aug 2023 13:10:31 -0500 Subject: [PATCH 184/255] [IMP] use PY 3.9 for avoid issue at install poetry --- .github/workflows/ci.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d0f3e22c..cb23fb8a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,10 +11,12 @@ on: jobs: pre-commit: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v1 + with: + python-version: "3.9" - name: Set PY run: echo "PY=$(python -c 'import hashlib, @@ -27,7 +29,7 @@ jobs: - uses: pre-commit/action@v1.0.1 build-test-push: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: pre-commit strategy: fail-fast: false @@ -42,8 +44,10 @@ jobs: include: # Older odoo versions don't support latest postgres because of the adapter - pg_version: "13" - odoo_version: "12.0" + odoo_version: "13.0" - pg_version: "13" + odoo_version: "12.0" + - pg_version: "12" odoo_version: "11.0" env: # Indicates what's the equivalent to tecnativa/doodba:latest image @@ -59,6 +63,8 @@ jobs: # Prepare - uses: actions/checkout@v2 - uses: actions/setup-python@v1 + with: + python-version: "3.9" # Install dev and test dependencies - run: pip install poetry - name: Patch $PATH From a4171fec1aae82a81c3774b5f8f49691bbc4de2e Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 6 Nov 2023 09:36:51 +0100 Subject: [PATCH 185/255] [IMP] Raise actions to latest versions --- .github/workflows/ci.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f9b85859..81020cea 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,8 +13,8 @@ jobs: pre-commit: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 with: python-version: "3.9" - name: Set PY @@ -22,11 +22,11 @@ jobs: echo "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV - - uses: actions/cache@v1 + - uses: actions/cache@v3 with: path: ~/.cache/pre-commit key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} - - uses: pre-commit/action@v1.0.1 + - uses: pre-commit/action@v3.0.0 build-test-push: runs-on: ubuntu-22.04 @@ -61,8 +61,8 @@ jobs: PG_VERSIONS: ${{ matrix.pg_version }} steps: # Prepare - - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 with: python-version: "3.9" # Install dev and test dependencies From 97abdd141581caa25af4fc5add321800a810a405 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 11:55:09 +0000 Subject: [PATCH 186/255] Bump certifi from 2020.12.5 to 2023.7.22 Bumps [certifi](https://github.com/certifi/python-certifi) from 2020.12.5 to 2023.7.22. - [Commits](https://github.com/certifi/python-certifi/compare/2020.12.05...2023.07.22) --- updated-dependencies: - dependency-name: certifi dependency-type: indirect ... Signed-off-by: dependabot[bot] --- poetry.lock | 50 +++++++------------------------------------------- 1 file changed, 7 insertions(+), 43 deletions(-) diff --git a/poetry.lock b/poetry.lock index 915be88b..bd20a96e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,10 +1,9 @@ -# This file is automatically @generated by Poetry and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "appdirs" version = "1.4.4" description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" optional = false python-versions = "*" files = [ @@ -16,7 +15,6 @@ files = [ name = "attrs" version = "20.3.0" description = "Classes Without Boilerplate" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -34,7 +32,6 @@ tests-no-zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (> name = "bcrypt" version = "3.2.0" description = "Modern password hashing for your software and your servers" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -62,7 +59,6 @@ typecheck = ["mypy"] name = "cached-property" version = "1.5.2" description = "A decorator for caching properties in classes." -category = "dev" optional = false python-versions = "*" files = [ @@ -72,21 +68,19 @@ files = [ [[package]] name = "certifi" -version = "2020.12.5" +version = "2023.7.22" description = "Python package for providing Mozilla's CA Bundle." -category = "dev" optional = false -python-versions = "*" +python-versions = ">=3.6" files = [ - {file = "certifi-2020.12.5-py2.py3-none-any.whl", hash = "sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830"}, - {file = "certifi-2020.12.5.tar.gz", hash = "sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"}, + {file = "certifi-2023.7.22-py3-none-any.whl", hash = "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"}, + {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, ] [[package]] name = "cffi" version = "1.14.4" description = "Foreign Function Interface for Python calling C code." -category = "dev" optional = false python-versions = "*" files = [ @@ -136,7 +130,6 @@ pycparser = "*" name = "cfgv" version = "3.2.0" description = "Validate configuration and produce human readable error messages." -category = "dev" optional = false python-versions = ">=3.6.1" files = [ @@ -148,7 +141,6 @@ files = [ name = "chardet" version = "3.0.4" description = "Universal encoding detector for Python 2 and 3" -category = "dev" optional = false python-versions = "*" files = [ @@ -160,7 +152,6 @@ files = [ name = "colorama" version = "0.4.4" description = "Cross-platform colored terminal text." -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -172,7 +163,6 @@ files = [ name = "cryptography" version = "39.0.1" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -189,6 +179,8 @@ files = [ {file = "cryptography-39.0.1-cp36-abi3-win32.whl", hash = "sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8"}, {file = "cryptography-39.0.1-cp36-abi3-win_amd64.whl", hash = "sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac"}, {file = "cryptography-39.0.1-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad"}, + {file = "cryptography-39.0.1-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:c5caeb8188c24888c90b5108a441c106f7faa4c4c075a2bcae438c6e8ca73cef"}, + {file = "cryptography-39.0.1-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:4789d1e3e257965e960232345002262ede4d094d1a19f4d3b52e48d4d8f3b885"}, {file = "cryptography-39.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388"}, {file = "cryptography-39.0.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336"}, {file = "cryptography-39.0.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2"}, @@ -216,7 +208,6 @@ tox = ["tox"] name = "distlib" version = "0.3.1" description = "Distribution utilities" -category = "dev" optional = false python-versions = "*" files = [ @@ -228,7 +219,6 @@ files = [ name = "distro" version = "1.5.0" description = "Distro - an OS platform information API" -category = "dev" optional = false python-versions = "*" files = [ @@ -240,7 +230,6 @@ files = [ name = "docker" version = "4.4.4" description = "A Python library for the Docker Engine API." -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -263,7 +252,6 @@ tls = ["cryptography (>=1.3.4)", "idna (>=2.0.0)", "pyOpenSSL (>=17.5.0)"] name = "docker-compose" version = "1.27.4" description = "Multi-container orchestration for Docker" -category = "dev" optional = false python-versions = ">=3.4" files = [ @@ -293,7 +281,6 @@ tests = ["ddt (>=1.2.2,<2)", "pytest (<6)"] name = "dockerpty" version = "0.4.1" description = "Python library to use the pseudo-tty of a docker container" -category = "dev" optional = false python-versions = "*" files = [ @@ -307,7 +294,6 @@ six = ">=1.3.0" name = "docopt" version = "0.6.2" description = "Pythonic argument parser, that will make you smile" -category = "dev" optional = false python-versions = "*" files = [ @@ -318,7 +304,6 @@ files = [ name = "filelock" version = "3.0.12" description = "A platform independent file lock." -category = "dev" optional = false python-versions = "*" files = [ @@ -330,7 +315,6 @@ files = [ name = "identify" version = "1.5.10" description = "File identification library for Python" -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" files = [ @@ -345,7 +329,6 @@ license = ["editdistance"] name = "idna" version = "2.10" description = "Internationalized Domain Names in Applications (IDNA)" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -357,7 +340,6 @@ files = [ name = "jsonschema" version = "3.2.0" description = "An implementation of JSON Schema validation for Python" -category = "dev" optional = false python-versions = "*" files = [ @@ -379,7 +361,6 @@ format-nongpl = ["idna", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-va name = "nodeenv" version = "1.5.0" description = "Node.js virtual environment builder" -category = "dev" optional = false python-versions = "*" files = [ @@ -391,7 +372,6 @@ files = [ name = "paramiko" version = "2.10.1" description = "SSH2 protocol library" -category = "dev" optional = false python-versions = "*" files = [ @@ -415,7 +395,6 @@ invoke = ["invoke (>=1.3)"] name = "plumbum" version = "1.6.9" description = "Plumbum: shell combinators library" -category = "dev" optional = false python-versions = ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" files = [ @@ -427,7 +406,6 @@ files = [ name = "pre-commit" version = "2.9.3" description = "A framework for managing and maintaining multi-language pre-commit hooks." -category = "dev" optional = false python-versions = ">=3.6.1" files = [ @@ -447,7 +425,6 @@ virtualenv = ">=20.0.8" name = "pycparser" version = "2.20" description = "C parser in Python" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -459,7 +436,6 @@ files = [ name = "pynacl" version = "1.4.0" description = "Python binding to the Networking and Cryptography (NaCl) library" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -495,7 +471,6 @@ tests = ["hypothesis (>=3.27.0)", "pytest (>=3.2.1,!=3.3.0)"] name = "pyrsistent" version = "0.17.3" description = "Persistent/Functional/Immutable data structures" -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -506,7 +481,6 @@ files = [ name = "python-dotenv" version = "0.15.0" description = "Add .env support to your django/flask apps in development and deployments" -category = "dev" optional = false python-versions = "*" files = [ @@ -521,7 +495,6 @@ cli = ["click (>=5.0)"] name = "pywin32" version = "227" description = "Python for Window Extensions" -category = "dev" optional = false python-versions = "*" files = [ @@ -543,7 +516,6 @@ files = [ name = "pyyaml" version = "5.4" description = "YAML parser and emitter for Python" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" files = [ @@ -574,7 +546,6 @@ files = [ name = "requests" version = "2.25.0" description = "Python HTTP for Humans." -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -596,7 +567,6 @@ socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] name = "setuptools" version = "67.2.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -613,7 +583,6 @@ testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs ( name = "six" version = "1.15.0" description = "Python 2 and 3 compatibility utilities" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -625,7 +594,6 @@ files = [ name = "texttable" version = "1.6.3" description = "module for creating simple ASCII tables" -category = "dev" optional = false python-versions = "*" files = [ @@ -637,7 +605,6 @@ files = [ name = "toml" version = "0.10.2" description = "Python Library for Tom's Obvious, Minimal Language" -category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -649,7 +616,6 @@ files = [ name = "urllib3" version = "1.26.5" description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" files = [ @@ -666,7 +632,6 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] name = "virtualenv" version = "20.2.2" description = "Virtual Python Environment builder" -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" files = [ @@ -688,7 +653,6 @@ testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", name = "websocket-client" version = "0.57.0" description = "WebSocket client for Python. hybi13 is supported." -category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ From d2d331f2f2695fe15f6c7f676dd7090df09ef1f5 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sun, 5 Nov 2023 12:20:24 +0100 Subject: [PATCH 187/255] Add Odoo 17.0 - Dockerfile copied from 16.0 and slightly adapted - Fix tests - Make it `:latest`. - Deprecate some old Odoo versions. - Bump PG to 15 - Switch to Python 3.10 - Adapt CI TT45808 --- .github/workflows/ci.yaml | 29 ++--- 17.0.Dockerfile | 232 ++++++++++++++++++++++++++++++++++++++ tests/__init__.py | 9 +- 3 files changed, 252 insertions(+), 18 deletions(-) create mode 100644 17.0.Dockerfile diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 81020cea..32eb4ce4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,23 +35,26 @@ jobs: fail-fast: false matrix: # Test modern Odoo versions with latest Postgres version - pg_version: ["14"] - odoo_version: - - "16.0" - - "15.0" - - "14.0" - - "13.0" + pg_version: ["15"] + odoo_version: ["17.0"] + python_version: ["3.10"] include: - # Older odoo versions don't support latest postgres because of the adapter - - pg_version: "13" + # Older odoo versions don't support latest postgres and Python versions + - pg_version: "14" + odoo_version: "15.0" + python_version: "3.9" + - pg_version: "14" + odoo_version: "14.0" + python_version: "3.9" + - pg_version: "14" odoo_version: "13.0" + python_version: "3.9" - pg_version: "13" - odoo_version: "12.0" - - pg_version: "12" - odoo_version: "11.0" + odoo_version: "13.0" + python_version: "3.9" env: # Indicates what's the equivalent to tecnativa/doodba:latest image - LATEST_RELEASE: "16.0" + LATEST_RELEASE: "17.0" # Variables found by default in Docker Hub builder DOCKER_REPO: tecnativa/doodba DOCKER_TAG: ${{ matrix.odoo_version }} @@ -64,7 +67,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: - python-version: "3.9" + python-version: ${{ matrix.python_version }} # Install dev and test dependencies - run: pip install poetry - name: Patch $PATH diff --git a/17.0.Dockerfile b/17.0.Dockerfile new file mode 100644 index 00000000..3b244950 --- /dev/null +++ b/17.0.Dockerfile @@ -0,0 +1,232 @@ +FROM python:3.10-slim-bullseye AS base + +EXPOSE 8069 8072 + +ARG GEOIP_UPDATER_VERSION=4.3.0 +ARG WKHTMLTOPDF_VERSION=0.12.5 +ARG WKHTMLTOPDF_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd' +ENV DB_FILTER=.* \ + DEPTH_DEFAULT=1 \ + DEPTH_MERGE=100 \ + EMAIL=https://hub.docker.com/r/tecnativa/odoo \ + GEOIP_ACCOUNT_ID="" \ + GEOIP_LICENSE_KEY="" \ + GIT_AUTHOR_NAME=docker-odoo \ + INITIAL_LANG="" \ + LC_ALL=C.UTF-8 \ + LIST_DB=false \ + NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \ + OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ + PATH="/home/odoo/.local/bin:$PATH" \ + PIP_NO_CACHE_DIR=0 \ + DEBUGPY_ARGS="--listen 0.0.0.0:6899 --wait-for-client" \ + DEBUGPY_ENABLE=0 \ + PUDB_RDB_HOST=0.0.0.0 \ + PUDB_RDB_PORT=6899 \ + PYTHONOPTIMIZE="" \ + UNACCENT=true \ + WAIT_DB=true \ + WDB_NO_BROWSER_AUTO_OPEN=True \ + WDB_SOCKET_SERVER=wdb \ + WDB_WEB_PORT=1984 \ + WDB_WEB_SERVER=localhost + +# Other requirements and recommendations +# See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control +RUN apt-get -qq update \ + && apt-get install -yqq --no-install-recommends \ + curl \ + && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.buster_amd64.deb \ + && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ + && apt-get install -yqq --no-install-recommends \ + ./wkhtmltox.deb \ + chromium \ + ffmpeg \ + fonts-liberation2 \ + gettext \ + git \ + gnupg2 \ + locales-all \ + nano \ + npm \ + openssh-client \ + telnet \ + vim \ + && echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && apt-get update \ + && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && apt-get autopurge -yqq \ + && rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \ + && sync + +WORKDIR /opt/odoo +COPY bin/* /usr/local/bin/ +COPY lib/doodbalib /usr/local/lib/python3.10/site-packages/doodbalib +COPY build.d common/build.d +COPY conf.d common/conf.d +COPY entrypoint.d common/entrypoint.d +RUN mkdir -p auto/addons auto/geoip custom/src/private \ + && ln /usr/local/bin/direxec common/entrypoint \ + && ln /usr/local/bin/direxec common/build \ + && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ + && chmod -R a+rX /usr/local/lib/python3.10/site-packages/doodbalib \ + && cp -a /etc/GeoIP.conf /etc/GeoIP.conf.orig \ + && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ + && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ + && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ + && sync + +# Doodba-QA dependencies in a separate virtualenv +COPY qa /qa +RUN python -m venv --system-site-packages /qa/venv \ + && . /qa/venv/bin/activate \ + && pip install \ + click \ + coverage \ + && deactivate \ + && mkdir -p /qa/artifacts + +ARG ODOO_SOURCE=OCA/OCB +ARG ODOO_VERSION=17.0 +ENV ODOO_VERSION="$ODOO_VERSION" + +# Install Odoo hard & soft dependencies, and Doodba utilities +RUN build_deps=" \ + build-essential \ + libfreetype6-dev \ + libfribidi-dev \ + libghc-zlib-dev \ + libharfbuzz-dev \ + libjpeg-dev \ + liblcms2-dev \ + libldap2-dev \ + libopenjp2-7-dev \ + libpq-dev \ + libsasl2-dev \ + libtiff5-dev \ + libwebp-dev \ + libxml2-dev \ + libxslt-dev \ + tcl-dev \ + tk-dev \ + zlib1g-dev \ + " \ + && apt-get update \ + && apt-get install -yqq --no-install-recommends $build_deps \ + && pip install \ + -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + 'websocket-client~=0.56' \ + astor \ + click-odoo-contrib \ + debugpy \ + pydevd-odoo \ + flanker[validator] \ + geoip2 \ + "git-aggregator<3.0.0" \ + inotify \ + pdfminer.six \ + pg_activity \ + phonenumbers \ + plumbum \ + pudb \ + pyOpenSSL \ + python-magic \ + watchdog \ + wdb \ + && (python3 -m compileall -q /usr/local/lib/python3.10/ || true) \ + # generate flanker cached tables during install when /usr/local/lib/ is still intended to be written to + # https://github.com/Tecnativa/doodba/issues/486 + && python3 -c 'from flanker.addresslib import address' >/dev/null 2>&1 \ + && apt-get purge -yqq $build_deps \ + && apt-get autopurge -yqq \ + && rm -Rf /var/lib/apt/lists/* /tmp/* + +# Metadata +ARG VCS_REF +ARG BUILD_DATE +ARG VERSION +LABEL org.label-schema.schema-version="$VERSION" \ + org.label-schema.vendor=Tecnativa \ + org.label-schema.license=Apache-2.0 \ + org.label-schema.build-date="$BUILD_DATE" \ + org.label-schema.vcs-ref="$VCS_REF" \ + org.label-schema.vcs-url="https://github.com/Tecnativa/doodba" + +# Onbuild version, with all the magic +FROM base AS onbuild + +# Enable setting custom uids for odoo user during build of scaffolds +ONBUILD ARG UID=1000 +ONBUILD ARG GID=1000 + +# Enable Odoo user and filestore +ONBUILD RUN groupadd -g $GID odoo -o \ + && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && sync + +# Subimage triggers +ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] +ONBUILD CMD ["/usr/local/bin/odoo"] +ONBUILD ARG AGGREGATE=true +ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" +ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" +ONBUILD ARG DEPTH_DEFAULT=1 +ONBUILD ARG DEPTH_MERGE=100 +ONBUILD ARG CLEAN=true +ONBUILD ARG COMPILE=true +ONBUILD ARG FONT_MONO="Liberation Mono" +ONBUILD ARG FONT_SANS="Liberation Sans" +ONBUILD ARG FONT_SERIF="Liberation Serif" +ONBUILD ARG PIP_INSTALL_ODOO=true +ONBUILD ARG ADMIN_PASSWORD=admin +ONBUILD ARG SMTP_SERVER=smtp +ONBUILD ARG SMTP_PORT=25 +ONBUILD ARG SMTP_USER=false +ONBUILD ARG SMTP_PASSWORD=false +ONBUILD ARG SMTP_SSL=false +ONBUILD ARG EMAIL_FROM="" +ONBUILD ARG PROXY_MODE=false +ONBUILD ARG WITHOUT_DEMO=all +ONBUILD ARG PGUSER=odoo +ONBUILD ARG PGPASSWORD=odoopassword +ONBUILD ARG PGHOST=db +ONBUILD ARG PGPORT=5432 +ONBUILD ARG PGDATABASE=prod + +# Config variables +ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ + DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \ + DEFAULT_REPO_PATTERN_ODOO="$DEFAULT_REPO_PATTERN_ODOO" \ + UNACCENT="$UNACCENT" \ + PGUSER="$PGUSER" \ + PGPASSWORD="$PGPASSWORD" \ + PGHOST="$PGHOST" \ + PGPORT=$PGPORT \ + PGDATABASE="$PGDATABASE" \ + PROXY_MODE="$PROXY_MODE" \ + SMTP_SERVER="$SMTP_SERVER" \ + SMTP_PORT=$SMTP_PORT \ + SMTP_USER="$SMTP_USER" \ + SMTP_PASSWORD="$SMTP_PASSWORD" \ + SMTP_SSL="$SMTP_SSL" \ + EMAIL_FROM="$EMAIL_FROM" \ + WITHOUT_DEMO="$WITHOUT_DEMO" +ONBUILD ARG LOCAL_CUSTOM_DIR=./custom +ONBUILD COPY --chown=root:odoo $LOCAL_CUSTOM_DIR /opt/odoo/custom + +# https://docs.python.org/3/library/logging.html#levels +ONBUILD ARG LOG_LEVEL=INFO +ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ + && ln -s /opt/odoo/custom/ssh ~root/.ssh \ + && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ + && sync +ONBUILD ARG DB_VERSION=latest +ONBUILD RUN /opt/odoo/common/build && sync +ONBUILD VOLUME ["/var/lib/odoo"] +ONBUILD USER odoo diff --git a/tests/__init__.py b/tests/__init__.py index 09e69c08..4ab55f61 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -16,15 +16,14 @@ DIR = dirname(__file__) ODOO_PREFIX = ("odoo", "--stop-after-init", "--workers=0") -ODOO_VERSIONS = frozenset( - environ.get("DOCKER_TAG", "11.0 12.0 13.0 14.0 15.0 16.0").split() -) -PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "14").split()) +ODOO_VERSIONS = frozenset(environ.get("DOCKER_TAG", "17.0").split()) +PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "15").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") GEIOP_CREDENTIALS_PROVIDED = environ.get("GEOIP_LICENSE_KEY", False) and environ.get( "GEOIP_ACCOUNT_ID", False ) + # This decorator skips tests that will fail until some branches and/or addons # are migrated to the next release. It is used in situations where Doodba is # preparing the pre-release for the next version of Odoo, which hasn't been @@ -454,7 +453,7 @@ def test_dependencies(self): ), ) - # TODO Remove decorator when base_search_fuzzy is migrated to 16.0 + # TODO: Remove decorator when base_search_fuzzy is migrated to 17.0 @prerelease_skip def test_dependencies_base_search_fuzzy(self): """Test dependencies installation.""" From 4f5edff10ba286797ba2f8e3cc66fa70642677b9 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 7 Nov 2023 20:02:02 +0100 Subject: [PATCH 188/255] [FIX] CI tested versions + reorder for having Odoo version first --- .github/workflows/ci.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 32eb4ce4..69783a17 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,22 +35,22 @@ jobs: fail-fast: false matrix: # Test modern Odoo versions with latest Postgres version - pg_version: ["15"] odoo_version: ["17.0"] + pg_version: ["15"] python_version: ["3.10"] include: # Older odoo versions don't support latest postgres and Python versions - - pg_version: "14" - odoo_version: "15.0" - python_version: "3.9" - - pg_version: "14" - odoo_version: "14.0" + - odoo_version: "16.0" + pg_version: "14" + python_version: "3.10" + - odoo_version: "15.0" + pg_version: "14" python_version: "3.9" - - pg_version: "14" - odoo_version: "13.0" + - odoo_version: "14.0" + pg_version: "14" python_version: "3.9" - - pg_version: "13" - odoo_version: "13.0" + - odoo_version: "13.0" + pg_version: "14" python_version: "3.9" env: # Indicates what's the equivalent to tecnativa/doodba:latest image From cbba39a9e329b3c4dc3589b2c055e84ce95184be Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 7 Nov 2023 21:09:11 +0100 Subject: [PATCH 189/255] [FIX] Tests not valid por P3.10 --- .github/workflows/ci.yaml | 16 ++-------------- tests/__init__.py | 2 -- .../custom/dependencies/200-pip-without-ext | 2 -- .../dotd/custom/dependencies/pip.txt | 2 -- 4 files changed, 2 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 69783a17..357b988a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,20 +38,6 @@ jobs: odoo_version: ["17.0"] pg_version: ["15"] python_version: ["3.10"] - include: - # Older odoo versions don't support latest postgres and Python versions - - odoo_version: "16.0" - pg_version: "14" - python_version: "3.10" - - odoo_version: "15.0" - pg_version: "14" - python_version: "3.9" - - odoo_version: "14.0" - pg_version: "14" - python_version: "3.9" - - odoo_version: "13.0" - pg_version: "14" - python_version: "3.9" env: # Indicates what's the equivalent to tecnativa/doodba:latest image LATEST_RELEASE: "17.0" @@ -68,6 +54,8 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} + - name: DF + run: df -h # Install dev and test dependencies - run: pip install poetry - name: Patch $PATH diff --git a/tests/__init__.py b/tests/__init__.py index 4ab55f61..8d560ee7 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -390,7 +390,6 @@ def test_dotd(self): 'test "$(hello-world)" == "this is executable hello-world"', ), ("python", "-xc", "import Crypto; print(Crypto.__version__)"), - ("sh", "-xc", "rst2html.py --version | grep 'Docutils 0.14'"), # ``requirements.txt`` from addon repos were processed ("python", "-c", "import numpy"), # Local executable binaries found in $PATH @@ -433,7 +432,6 @@ def test_dependencies(self): # 200-pip-without-ext ("test", "-f", "custom/dependencies/200-pip-without-ext"), ("python", "-c", "import Crypto; print(Crypto.__version__)"), - ("sh", "-xc", "rst2html.py --version | grep 'Docutils 0.14'"), # 270-gem.txt ("test", "-f", "custom/dependencies/270-gem.txt"), ("hello-world",), diff --git a/tests/scaffoldings/dependencies/custom/dependencies/200-pip-without-ext b/tests/scaffoldings/dependencies/custom/dependencies/200-pip-without-ext index 5b9322ed..86ae918c 100644 --- a/tests/scaffoldings/dependencies/custom/dependencies/200-pip-without-ext +++ b/tests/scaffoldings/dependencies/custom/dependencies/200-pip-without-ext @@ -1,4 +1,2 @@ # Compiled locally, which would fail if `apt_build.txt` fails pycrypto==2.6.1 --no-binary :all: -# Odoo pins docutils==0.12, so let's check it gets upgraded -docutils==0.14 diff --git a/tests/scaffoldings/dotd/custom/dependencies/pip.txt b/tests/scaffoldings/dotd/custom/dependencies/pip.txt index 8a08fee1..e9d91282 100644 --- a/tests/scaffoldings/dotd/custom/dependencies/pip.txt +++ b/tests/scaffoldings/dotd/custom/dependencies/pip.txt @@ -1,6 +1,4 @@ # Compiled locally, which would fail if `apt_build.txt` fails pycrypto==2.6.1 --no-binary :all: -# Odoo pins docutils==0.12, so let's check it gets upgraded -docutils==0.14 # External dependency files can be included too; example: numpy -r https://raw.githubusercontent.com/Tecnativa/doodba/6cec8ea6eefa9d8de8cff103cfca6e373f8fe910/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt From 6c804acc51fc45a37d08570b179a90c4e26988a1 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Thu, 9 Nov 2023 11:44:26 +0100 Subject: [PATCH 190/255] [FIX] Skip openupgrade test Because openupgrade v17 repo is not finished yet --- tests/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__init__.py b/tests/__init__.py index 8d560ee7..da30e966 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -326,7 +326,7 @@ def test_addons_env(self): ("test", "-e", "auto/addons/crm"), ("test", "-d", "auto/addons/crm/migrations"), ) - for sub_env in matrix(odoo_skip={"11.0", "12.0", "13.0"}): + for sub_env in matrix(odoo_skip={"11.0", "12.0", "13.0", "17.0"}): self.compose_test( join(SCAFFOLDINGS_DIR, "addons_env_ou"), sub_env, From f5e69923100b65953a7f1df3376a08bd220e62bb Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Thu, 9 Nov 2023 15:07:58 +0100 Subject: [PATCH 191/255] [FIX] Skip test test_addons_filtered, test_dotd and test_dependencies_base_search_fuzzy if odoo version is 17.0 --- tests/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index da30e966..f1c68ab0 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -93,7 +93,7 @@ def compose_test(self, workdir, sub_env, *commands): def test_addons_filtered(self): """Test addons filtering with ``ONLY`` keyword in ``addons.yaml``.""" project_dir = join(SCAFFOLDINGS_DIR, "dotd") - for sub_env in matrix(): + for sub_env in matrix(odoo_skip={"17.0"}): self.compose_test( project_dir, dict(sub_env, DBNAME="prod"), @@ -367,7 +367,7 @@ def test_addons_env_double(self): def test_dotd(self): """Test environment with common ``*.d`` directories.""" - for sub_env in matrix(): + for sub_env in matrix(odoo_skip={"17.0"}): self.compose_test( join(SCAFFOLDINGS_DIR, "dotd"), sub_env, @@ -456,7 +456,7 @@ def test_dependencies(self): def test_dependencies_base_search_fuzzy(self): """Test dependencies installation.""" dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies_base_search_fuzzy") - for sub_env in matrix(): + for sub_env in matrix(odoo_skip={"17.0"}): self.compose_test( dependencies_dir, sub_env, From dbdace25df492d62a3a30597c92a63aa7138076f Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 7 Nov 2023 21:09:11 +0100 Subject: [PATCH 192/255] [FIX] Tests not valid por P3.10 --- tests/__init__.py | 2 -- .../dependencies/custom/dependencies/200-pip-without-ext | 2 -- tests/scaffoldings/dotd/custom/dependencies/pip.txt | 2 -- 3 files changed, 6 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 4ab55f61..8d560ee7 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -390,7 +390,6 @@ def test_dotd(self): 'test "$(hello-world)" == "this is executable hello-world"', ), ("python", "-xc", "import Crypto; print(Crypto.__version__)"), - ("sh", "-xc", "rst2html.py --version | grep 'Docutils 0.14'"), # ``requirements.txt`` from addon repos were processed ("python", "-c", "import numpy"), # Local executable binaries found in $PATH @@ -433,7 +432,6 @@ def test_dependencies(self): # 200-pip-without-ext ("test", "-f", "custom/dependencies/200-pip-without-ext"), ("python", "-c", "import Crypto; print(Crypto.__version__)"), - ("sh", "-xc", "rst2html.py --version | grep 'Docutils 0.14'"), # 270-gem.txt ("test", "-f", "custom/dependencies/270-gem.txt"), ("hello-world",), diff --git a/tests/scaffoldings/dependencies/custom/dependencies/200-pip-without-ext b/tests/scaffoldings/dependencies/custom/dependencies/200-pip-without-ext index 5b9322ed..86ae918c 100644 --- a/tests/scaffoldings/dependencies/custom/dependencies/200-pip-without-ext +++ b/tests/scaffoldings/dependencies/custom/dependencies/200-pip-without-ext @@ -1,4 +1,2 @@ # Compiled locally, which would fail if `apt_build.txt` fails pycrypto==2.6.1 --no-binary :all: -# Odoo pins docutils==0.12, so let's check it gets upgraded -docutils==0.14 diff --git a/tests/scaffoldings/dotd/custom/dependencies/pip.txt b/tests/scaffoldings/dotd/custom/dependencies/pip.txt index 8a08fee1..e9d91282 100644 --- a/tests/scaffoldings/dotd/custom/dependencies/pip.txt +++ b/tests/scaffoldings/dotd/custom/dependencies/pip.txt @@ -1,6 +1,4 @@ # Compiled locally, which would fail if `apt_build.txt` fails pycrypto==2.6.1 --no-binary :all: -# Odoo pins docutils==0.12, so let's check it gets upgraded -docutils==0.14 # External dependency files can be included too; example: numpy -r https://raw.githubusercontent.com/Tecnativa/doodba/6cec8ea6eefa9d8de8cff103cfca6e373f8fe910/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt From cf6e01e485ce3cf4acc6f5b481584024557423c6 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Thu, 9 Nov 2023 11:44:26 +0100 Subject: [PATCH 193/255] [FIX] Skip openupgrade test Because openupgrade v17 repo is not finished yet --- tests/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/__init__.py b/tests/__init__.py index 8d560ee7..da30e966 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -326,7 +326,7 @@ def test_addons_env(self): ("test", "-e", "auto/addons/crm"), ("test", "-d", "auto/addons/crm/migrations"), ) - for sub_env in matrix(odoo_skip={"11.0", "12.0", "13.0"}): + for sub_env in matrix(odoo_skip={"11.0", "12.0", "13.0", "17.0"}): self.compose_test( join(SCAFFOLDINGS_DIR, "addons_env_ou"), sub_env, From 6d578a8815fce8bce505a7eb1215e2ed99f7209a Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Thu, 9 Nov 2023 15:07:58 +0100 Subject: [PATCH 194/255] [FIX] Skip test test_addons_filtered, test_dotd and test_dependencies_base_search_fuzzy if odoo version is 17.0 --- tests/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index da30e966..f1c68ab0 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -93,7 +93,7 @@ def compose_test(self, workdir, sub_env, *commands): def test_addons_filtered(self): """Test addons filtering with ``ONLY`` keyword in ``addons.yaml``.""" project_dir = join(SCAFFOLDINGS_DIR, "dotd") - for sub_env in matrix(): + for sub_env in matrix(odoo_skip={"17.0"}): self.compose_test( project_dir, dict(sub_env, DBNAME="prod"), @@ -367,7 +367,7 @@ def test_addons_env_double(self): def test_dotd(self): """Test environment with common ``*.d`` directories.""" - for sub_env in matrix(): + for sub_env in matrix(odoo_skip={"17.0"}): self.compose_test( join(SCAFFOLDINGS_DIR, "dotd"), sub_env, @@ -456,7 +456,7 @@ def test_dependencies(self): def test_dependencies_base_search_fuzzy(self): """Test dependencies installation.""" dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies_base_search_fuzzy") - for sub_env in matrix(): + for sub_env in matrix(odoo_skip={"17.0"}): self.compose_test( dependencies_dir, sub_env, From 6ef131dbf18b731661be67aafed4dd2c4d9225d5 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Fri, 10 Nov 2023 11:49:53 +0100 Subject: [PATCH 195/255] [FIX] Add ninja and patchelf to apt dependencies - remove pip==23.3.1 from pip dependencies - test_dotb and test_addons_filtered - test_dependencies_base_search_fuzzy skiped because is not migrated to 17.0 yet --- .github/workflows/ci.yaml | 16 ++++++++++++++-- tests/__init__.py | 4 ++-- .../dotd/custom/dependencies/apt.txt | 2 ++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 357b988a..69783a17 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,6 +38,20 @@ jobs: odoo_version: ["17.0"] pg_version: ["15"] python_version: ["3.10"] + include: + # Older odoo versions don't support latest postgres and Python versions + - odoo_version: "16.0" + pg_version: "14" + python_version: "3.10" + - odoo_version: "15.0" + pg_version: "14" + python_version: "3.9" + - odoo_version: "14.0" + pg_version: "14" + python_version: "3.9" + - odoo_version: "13.0" + pg_version: "14" + python_version: "3.9" env: # Indicates what's the equivalent to tecnativa/doodba:latest image LATEST_RELEASE: "17.0" @@ -54,8 +68,6 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} - - name: DF - run: df -h # Install dev and test dependencies - run: pip install poetry - name: Patch $PATH diff --git a/tests/__init__.py b/tests/__init__.py index f1c68ab0..f2f1be72 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -93,7 +93,7 @@ def compose_test(self, workdir, sub_env, *commands): def test_addons_filtered(self): """Test addons filtering with ``ONLY`` keyword in ``addons.yaml``.""" project_dir = join(SCAFFOLDINGS_DIR, "dotd") - for sub_env in matrix(odoo_skip={"17.0"}): + for sub_env in matrix(): self.compose_test( project_dir, dict(sub_env, DBNAME="prod"), @@ -367,7 +367,7 @@ def test_addons_env_double(self): def test_dotd(self): """Test environment with common ``*.d`` directories.""" - for sub_env in matrix(odoo_skip={"17.0"}): + for sub_env in matrix(): self.compose_test( join(SCAFFOLDINGS_DIR, "dotd"), sub_env, diff --git a/tests/scaffoldings/dotd/custom/dependencies/apt.txt b/tests/scaffoldings/dotd/custom/dependencies/apt.txt index b56177ad..5b76ceb3 100644 --- a/tests/scaffoldings/dotd/custom/dependencies/apt.txt +++ b/tests/scaffoldings/dotd/custom/dependencies/apt.txt @@ -1,3 +1,5 @@ # This line should be ignored busybox ruby +ninja-build +patchelf From 2b139ea37abbab163b3c76bfbdd8c9726bca7dd2 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 14 Nov 2023 14:23:16 +0100 Subject: [PATCH 196/255] [IMP] Use python 3.10 in v16.0 --- 16.0.Dockerfile | 8 ++++---- tests/__init__.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/16.0.Dockerfile b/16.0.Dockerfile index 619b9bc3..47deb5ec 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8-slim-bullseye AS base +FROM python:3.10-slim-bullseye AS base EXPOSE 8069 8072 @@ -64,7 +64,7 @@ RUN apt-get -qq update \ WORKDIR /opt/odoo COPY bin/* /usr/local/bin/ -COPY lib/doodbalib /usr/local/lib/python3.8/site-packages/doodbalib +COPY lib/doodbalib /usr/local/lib/python3.10/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d @@ -72,7 +72,7 @@ RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ - && chmod -R a+rX /usr/local/lib/python3.8/site-packages/doodbalib \ + && chmod -R a+rX /usr/local/lib/python3.10/site-packages/doodbalib \ && cp -a /etc/GeoIP.conf /etc/GeoIP.conf.orig \ && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ @@ -136,7 +136,7 @@ RUN build_deps=" \ python-magic \ watchdog \ wdb \ - && (python3 -m compileall -q /usr/local/lib/python3.8/ || true) \ + && (python3 -m compileall -q /usr/local/lib/python3.10/ || true) \ # generate flanker cached tables during install when /usr/local/lib/ is still intended to be written to # https://github.com/Tecnativa/doodba/issues/486 && python3 -c 'from flanker.addresslib import address' >/dev/null 2>&1 \ diff --git a/tests/__init__.py b/tests/__init__.py index f1c68ab0..f2f1be72 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -93,7 +93,7 @@ def compose_test(self, workdir, sub_env, *commands): def test_addons_filtered(self): """Test addons filtering with ``ONLY`` keyword in ``addons.yaml``.""" project_dir = join(SCAFFOLDINGS_DIR, "dotd") - for sub_env in matrix(odoo_skip={"17.0"}): + for sub_env in matrix(): self.compose_test( project_dir, dict(sub_env, DBNAME="prod"), @@ -367,7 +367,7 @@ def test_addons_env_double(self): def test_dotd(self): """Test environment with common ``*.d`` directories.""" - for sub_env in matrix(odoo_skip={"17.0"}): + for sub_env in matrix(): self.compose_test( join(SCAFFOLDINGS_DIR, "dotd"), sub_env, From 79ef218fece6142edb8a25b0fb9ba37976bd5530 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Fri, 17 Nov 2023 08:34:25 +0100 Subject: [PATCH 197/255] [IMP] Change debian to bookworm in 16.0.Dockerfile -Updating wkhtmltopdf to a bookworm compatible version --- 16.0.Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/16.0.Dockerfile b/16.0.Dockerfile index 47deb5ec..cab3fd7b 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -1,10 +1,10 @@ -FROM python:3.10-slim-bullseye AS base +FROM python:3.10-slim-bookworm AS base EXPOSE 8069 8072 ARG GEOIP_UPDATER_VERSION=4.3.0 -ARG WKHTMLTOPDF_VERSION=0.12.5 -ARG WKHTMLTOPDF_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd' +ARG WKHTMLTOPDF_VERSION=0.13.0 +ARG WKHTMLTOPDF_CHECKSUM='8feeb4d814263688d6e6fe28e03b541be5ca94f39c6e1ef8ff4c88dd8fb9443a' ENV DB_FILTER=.* \ DEPTH_DEFAULT=1 \ DEPTH_MERGE=100 \ @@ -36,7 +36,7 @@ ENV DB_FILTER=.* \ RUN apt-get -qq update \ && apt-get install -yqq --no-install-recommends \ curl \ - && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.buster_amd64.deb \ + && curl -SLo wkhtmltox.deb https://github.com/odoo/wkhtmltopdf/releases/download/nightly/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.nightly.bookworm_amd64.deb \ && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ && apt-get install -yqq --no-install-recommends \ ./wkhtmltox.deb \ @@ -51,8 +51,8 @@ RUN apt-get -qq update \ npm \ openssh-client \ telnet \ - vim \ - && echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + vim +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ From 980f14eb28cb23bb60840f05f7317cae101c2aaf Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Fri, 17 Nov 2023 10:00:47 +0100 Subject: [PATCH 198/255] [IMP] Change debian to bookworm in 17.0.Dockerfile -Updating wkhtmltopdf to a bookworm compatible version --- 17.0.Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/17.0.Dockerfile b/17.0.Dockerfile index 3b244950..580148fd 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -1,10 +1,10 @@ -FROM python:3.10-slim-bullseye AS base +FROM python:3.10-slim-bookworm AS base EXPOSE 8069 8072 ARG GEOIP_UPDATER_VERSION=4.3.0 -ARG WKHTMLTOPDF_VERSION=0.12.5 -ARG WKHTMLTOPDF_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd' +ARG WKHTMLTOPDF_VERSION=0.13.0 +ARG WKHTMLTOPDF_CHECKSUM='8feeb4d814263688d6e6fe28e03b541be5ca94f39c6e1ef8ff4c88dd8fb9443a' ENV DB_FILTER=.* \ DEPTH_DEFAULT=1 \ DEPTH_MERGE=100 \ @@ -36,7 +36,7 @@ ENV DB_FILTER=.* \ RUN apt-get -qq update \ && apt-get install -yqq --no-install-recommends \ curl \ - && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.buster_amd64.deb \ + && curl -SLo wkhtmltox.deb https://github.com/odoo/wkhtmltopdf/releases/download/nightly/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.nightly.bookworm_amd64.deb \ && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ && apt-get install -yqq --no-install-recommends \ ./wkhtmltox.deb \ @@ -51,8 +51,8 @@ RUN apt-get -qq update \ npm \ openssh-client \ telnet \ - vim \ - && echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + vim +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ From 57bb34fc499a242b66a28072ba90ec5820f10dd5 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Fri, 17 Nov 2023 08:42:29 +0100 Subject: [PATCH 199/255] [FIX] Not use python-dev on v17, and v16 -Adding tests scaffoldings for odoo_version >= 16 in test_dotd and test_dependencies --- tests/__init__.py | 47 ++++++++++++++----- .../dependencies_ge_16/Dockerfile | 2 + .../custom/build.d/150-conditional-ruby | 14 ++++++ .../custom/dependencies/070-apt-bc.txt | 2 + .../150-npm-aloha_world-install.txt | 2 + .../custom/dependencies/200-pip-without-ext | 2 + .../custom/dependencies/270-gem.txt | 2 + .../dependencies/apt-without-sequence.txt | 2 + .../custom/dependencies/apt_build.txt | 6 +++ .../dependencies_ge_16/custom/src/addons.yaml | 0 .../dependencies_ge_16/docker-compose.yaml | 29 ++++++++++++ tests/scaffoldings/dotd_ge_16/Dockerfile | 2 + .../dotd_ge_16/custom/build.d/10-touch-build | 3 ++ .../custom/build.d/100-assert-touched | 3 ++ .../custom/build.d/101-assert-aggregation | 4 ++ .../dotd_ge_16/custom/build.d/15-broken-link | 3 ++ .../custom/build.d/201-assert-dependencies | 7 +++ .../dotd_ge_16/custom/conf.d/test-conf | 1 + .../dotd_ge_16/custom/dependencies/apt.txt | 5 ++ .../custom/dependencies/apt_build.txt | 6 +++ .../dotd_ge_16/custom/dependencies/gem.txt | 2 + .../dotd_ge_16/custom/dependencies/npm.txt | 2 + .../dotd_ge_16/custom/dependencies/pip.txt | 4 ++ .../custom/entrypoint.d/check-requirements | 3 ++ .../custom/entrypoint.d/pip-install-user | 8 ++++ .../custom/entrypoint.d/touch-entrypoint | 3 ++ .../dotd_ge_16/custom/src/addons.yaml | 20 ++++++++ .../custom/src/dummy_repo/dummy_link | 1 + .../custom/src/dummy_repo/requirements.txt | 1 + .../enterprise/make_odoo_rich/__openerp__.py | 2 + .../odoo/src/private/dummy_addon/__init__.py | 0 .../src/private/dummy_addon/__manifest__.py | 2 + .../odoo/src/private/product/__init__.py | 0 .../odoo/src/private/product/__manifest__.py | 2 + .../src/private/some_random_evil_file.txt | 0 .../dotd_ge_16/custom/src/private/.empty | 0 .../src/private/disabled_addon/__init__.py | 0 .../src/private/disabled_addon/__openerp__.py | 2 + .../src/private/private_addon/__init__.py | 0 .../src/private/private_addon/__openerp__.py | 2 + .../src/private/some_random_evil_file.txt | 0 .../dotd_ge_16/docker-compose.yaml | 30 ++++++++++++ 42 files changed, 214 insertions(+), 12 deletions(-) create mode 100644 tests/scaffoldings/dependencies_ge_16/Dockerfile create mode 100755 tests/scaffoldings/dependencies_ge_16/custom/build.d/150-conditional-ruby create mode 100644 tests/scaffoldings/dependencies_ge_16/custom/dependencies/070-apt-bc.txt create mode 100644 tests/scaffoldings/dependencies_ge_16/custom/dependencies/150-npm-aloha_world-install.txt create mode 100644 tests/scaffoldings/dependencies_ge_16/custom/dependencies/200-pip-without-ext create mode 100644 tests/scaffoldings/dependencies_ge_16/custom/dependencies/270-gem.txt create mode 100644 tests/scaffoldings/dependencies_ge_16/custom/dependencies/apt-without-sequence.txt create mode 100644 tests/scaffoldings/dependencies_ge_16/custom/dependencies/apt_build.txt create mode 100644 tests/scaffoldings/dependencies_ge_16/custom/src/addons.yaml create mode 100644 tests/scaffoldings/dependencies_ge_16/docker-compose.yaml create mode 100644 tests/scaffoldings/dotd_ge_16/Dockerfile create mode 100755 tests/scaffoldings/dotd_ge_16/custom/build.d/10-touch-build create mode 100755 tests/scaffoldings/dotd_ge_16/custom/build.d/100-assert-touched create mode 100755 tests/scaffoldings/dotd_ge_16/custom/build.d/101-assert-aggregation create mode 100755 tests/scaffoldings/dotd_ge_16/custom/build.d/15-broken-link create mode 100755 tests/scaffoldings/dotd_ge_16/custom/build.d/201-assert-dependencies create mode 100644 tests/scaffoldings/dotd_ge_16/custom/conf.d/test-conf create mode 100644 tests/scaffoldings/dotd_ge_16/custom/dependencies/apt.txt create mode 100644 tests/scaffoldings/dotd_ge_16/custom/dependencies/apt_build.txt create mode 100644 tests/scaffoldings/dotd_ge_16/custom/dependencies/gem.txt create mode 100644 tests/scaffoldings/dotd_ge_16/custom/dependencies/npm.txt create mode 100644 tests/scaffoldings/dotd_ge_16/custom/dependencies/pip.txt create mode 100755 tests/scaffoldings/dotd_ge_16/custom/entrypoint.d/check-requirements create mode 100755 tests/scaffoldings/dotd_ge_16/custom/entrypoint.d/pip-install-user create mode 100755 tests/scaffoldings/dotd_ge_16/custom/entrypoint.d/touch-entrypoint create mode 100644 tests/scaffoldings/dotd_ge_16/custom/src/addons.yaml create mode 120000 tests/scaffoldings/dotd_ge_16/custom/src/dummy_repo/dummy_link create mode 100644 tests/scaffoldings/dotd_ge_16/custom/src/dummy_repo/requirements.txt create mode 100644 tests/scaffoldings/dotd_ge_16/custom/src/enterprise/make_odoo_rich/__openerp__.py create mode 100644 tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/dummy_addon/__init__.py create mode 100644 tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/dummy_addon/__manifest__.py create mode 100644 tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/product/__init__.py create mode 100644 tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/product/__manifest__.py create mode 100644 tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/some_random_evil_file.txt create mode 100644 tests/scaffoldings/dotd_ge_16/custom/src/private/.empty create mode 100644 tests/scaffoldings/dotd_ge_16/custom/src/private/disabled_addon/__init__.py create mode 100644 tests/scaffoldings/dotd_ge_16/custom/src/private/disabled_addon/__openerp__.py create mode 100644 tests/scaffoldings/dotd_ge_16/custom/src/private/private_addon/__init__.py create mode 100644 tests/scaffoldings/dotd_ge_16/custom/src/private/private_addon/__openerp__.py create mode 100644 tests/scaffoldings/dotd_ge_16/custom/src/private/some_random_evil_file.txt create mode 100644 tests/scaffoldings/dotd_ge_16/docker-compose.yaml diff --git a/tests/__init__.py b/tests/__init__.py index f2f1be72..d8e95f5c 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -90,10 +90,9 @@ def compose_test(self, workdir, sub_env, *commands): finally: self.popen(("docker-compose", "down", "-v"), cwd=workdir, env=full_env) - def test_addons_filtered(self): - """Test addons filtering with ``ONLY`` keyword in ``addons.yaml``.""" - project_dir = join(SCAFFOLDINGS_DIR, "dotd") - for sub_env in matrix(): + def _check_addons(self, scaffolding_dir, odoo_skip): + project_dir = join(SCAFFOLDINGS_DIR, scaffolding_dir) + for sub_env in matrix(odoo_skip=odoo_skip): self.compose_test( project_dir, dict(sub_env, DBNAME="prod"), @@ -196,6 +195,14 @@ def test_addons_filtered(self): ("bash", "-xc", 'test "$(addons list -cWsale)" == crm'), ) + def test_addons_filtered_lt_16(self): + """Test addons filtering with ``ONLY`` keyword in ``addons.yaml`` for versions < 16""" + self._check_addons("dotd", {"16.0", "17.0"}) + + def test_addons_filtered_ge_16(self): + """Test addons filtering with ``ONLY`` keyword in ``addons.yaml`` for versions >= 16""" + self._check_addons("dotd_ge_16", {"11.0", "12.0", "13.0", "14.0", "15.0"}) + def test_qa(self): """Test that QA tools are in place and work as expected.""" folder = join(SCAFFOLDINGS_DIR, "settings") @@ -365,11 +372,10 @@ def test_addons_env_double(self): ("grep", "-q", "12.0.2.0.0", "auto/addons/rma/__manifest__.py"), ) - def test_dotd(self): - """Test environment with common ``*.d`` directories.""" - for sub_env in matrix(): + def _check_dotd(self, scaffolding_dir, odoo_skip): + for sub_env in matrix(odoo_skip=odoo_skip): self.compose_test( - join(SCAFFOLDINGS_DIR, "dotd"), + join(SCAFFOLDINGS_DIR, scaffolding_dir), sub_env, # ``custom/build.d`` was properly executed ("test", "-f", "/home/odoo/created-at-build"), @@ -406,10 +412,17 @@ def test_dotd(self): ("--version",), ) - def test_dependencies(self): - """Test dependencies installation.""" - dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies") - for sub_env in matrix(): + def test_dotd_lt_16(self): + """Test environment with common ``*.d`` directories for versions < 16.""" + self._check_dotd("dotd", {"16.0", "17.0"}) + + def test_dotd_ge_16(self): + """Test environment with common ``*.d`` directories for versions >= 16.""" + self._check_dotd("dotd_ge_16", {"11.0", "12.0", "13.0", "14.0", "15.0"}) + + def _check_dependencies(self, scaffolding_dir, odoo_skip): + dependencies_dir = join(SCAFFOLDINGS_DIR, scaffolding_dir) + for sub_env in matrix(odoo_skip=odoo_skip): self.compose_test( dependencies_dir, sub_env, @@ -451,6 +464,16 @@ def test_dependencies(self): ), ) + def test_dependencies_lt_16(self): + """Test dependencies installation for versions < 16""" + self._check_dependencies("dependencies", {"16.0", "17.0"}) + + def test_dependencies_ge_16(self): + """Test dependencies installation for versions >= 16""" + self._check_dependencies( + "dependencies_ge_16", {"11.0", "12.0", "13.0", "14.0", "15.0"} + ) + # TODO: Remove decorator when base_search_fuzzy is migrated to 17.0 @prerelease_skip def test_dependencies_base_search_fuzzy(self): diff --git a/tests/scaffoldings/dependencies_ge_16/Dockerfile b/tests/scaffoldings/dependencies_ge_16/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/dependencies_ge_16/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/dependencies_ge_16/custom/build.d/150-conditional-ruby b/tests/scaffoldings/dependencies_ge_16/custom/build.d/150-conditional-ruby new file mode 100755 index 00000000..e9959230 --- /dev/null +++ b/tests/scaffoldings/dependencies_ge_16/custom/build.d/150-conditional-ruby @@ -0,0 +1,14 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +"""Add ruby as a conditional dependency.""" + +import os + +from doodbalib import ODOO_VERSION + +if float(ODOO_VERSION) >= 13: + # These Doodba versions still can use the ruby gem autoinstaller, but + # need ruby to be manually installed because it is not in the base image + # by default (it was until Odoo 12.0) + with open("/opt/odoo/custom/dependencies/000-apt-ruby.txt", "w") as fd: + fd.writelines(["ruby"]) diff --git a/tests/scaffoldings/dependencies_ge_16/custom/dependencies/070-apt-bc.txt b/tests/scaffoldings/dependencies_ge_16/custom/dependencies/070-apt-bc.txt new file mode 100644 index 00000000..4aef3ad0 --- /dev/null +++ b/tests/scaffoldings/dependencies_ge_16/custom/dependencies/070-apt-bc.txt @@ -0,0 +1,2 @@ +# This line should be ignored +bc diff --git a/tests/scaffoldings/dependencies_ge_16/custom/dependencies/150-npm-aloha_world-install.txt b/tests/scaffoldings/dependencies_ge_16/custom/dependencies/150-npm-aloha_world-install.txt new file mode 100644 index 00000000..d822001c --- /dev/null +++ b/tests/scaffoldings/dependencies_ge_16/custom/dependencies/150-npm-aloha_world-install.txt @@ -0,0 +1,2 @@ +# This line should be ignored +test-npm-install diff --git a/tests/scaffoldings/dependencies_ge_16/custom/dependencies/200-pip-without-ext b/tests/scaffoldings/dependencies_ge_16/custom/dependencies/200-pip-without-ext new file mode 100644 index 00000000..86ae918c --- /dev/null +++ b/tests/scaffoldings/dependencies_ge_16/custom/dependencies/200-pip-without-ext @@ -0,0 +1,2 @@ +# Compiled locally, which would fail if `apt_build.txt` fails +pycrypto==2.6.1 --no-binary :all: diff --git a/tests/scaffoldings/dependencies_ge_16/custom/dependencies/270-gem.txt b/tests/scaffoldings/dependencies_ge_16/custom/dependencies/270-gem.txt new file mode 100644 index 00000000..ce51ab87 --- /dev/null +++ b/tests/scaffoldings/dependencies_ge_16/custom/dependencies/270-gem.txt @@ -0,0 +1,2 @@ +# This line should be ignored +hello-world diff --git a/tests/scaffoldings/dependencies_ge_16/custom/dependencies/apt-without-sequence.txt b/tests/scaffoldings/dependencies_ge_16/custom/dependencies/apt-without-sequence.txt new file mode 100644 index 00000000..2100ebc6 --- /dev/null +++ b/tests/scaffoldings/dependencies_ge_16/custom/dependencies/apt-without-sequence.txt @@ -0,0 +1,2 @@ +# This package WON'T be installed +busybox diff --git a/tests/scaffoldings/dependencies_ge_16/custom/dependencies/apt_build.txt b/tests/scaffoldings/dependencies_ge_16/custom/dependencies/apt_build.txt new file mode 100644 index 00000000..2068bd87 --- /dev/null +++ b/tests/scaffoldings/dependencies_ge_16/custom/dependencies/apt_build.txt @@ -0,0 +1,6 @@ +# This installs gcc among other things +build-essential +# This is the basic need to build any python extensions in v11- +python3-dev +# Just to test it is removed later +openssh-server diff --git a/tests/scaffoldings/dependencies_ge_16/custom/src/addons.yaml b/tests/scaffoldings/dependencies_ge_16/custom/src/addons.yaml new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/dependencies_ge_16/docker-compose.yaml b/tests/scaffoldings/dependencies_ge_16/docker-compose.yaml new file mode 100644 index 00000000..5cb154cd --- /dev/null +++ b/tests/scaffoldings/dependencies_ge_16/docker-compose.yaml @@ -0,0 +1,29 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + WITHOUT_DEMO: "false" + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + volumes: + - filestore:/var/lib/odoo:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: diff --git a/tests/scaffoldings/dotd_ge_16/Dockerfile b/tests/scaffoldings/dotd_ge_16/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/dotd_ge_16/custom/build.d/10-touch-build b/tests/scaffoldings/dotd_ge_16/custom/build.d/10-touch-build new file mode 100755 index 00000000..953a11f0 --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/build.d/10-touch-build @@ -0,0 +1,3 @@ +#!/bin/bash +set -ex +touch /home/odoo/created-at-build diff --git a/tests/scaffoldings/dotd_ge_16/custom/build.d/100-assert-touched b/tests/scaffoldings/dotd_ge_16/custom/build.d/100-assert-touched new file mode 100755 index 00000000..4f905cdd --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/build.d/100-assert-touched @@ -0,0 +1,3 @@ +#!/bin/bash +set -ex +test -f /home/odoo/created-at-build diff --git a/tests/scaffoldings/dotd_ge_16/custom/build.d/101-assert-aggregation b/tests/scaffoldings/dotd_ge_16/custom/build.d/101-assert-aggregation new file mode 100755 index 00000000..a8c07a2e --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/build.d/101-assert-aggregation @@ -0,0 +1,4 @@ +#!/bin/bash +# Git aggregation is performed at step 100 +set -ex +test -d /opt/odoo/custom/src/odoo diff --git a/tests/scaffoldings/dotd_ge_16/custom/build.d/15-broken-link b/tests/scaffoldings/dotd_ge_16/custom/build.d/15-broken-link new file mode 100755 index 00000000..684810f2 --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/build.d/15-broken-link @@ -0,0 +1,3 @@ +#!/bin/bash +set -ex +ln -s brokenpath auto/addons/dummy_addon diff --git a/tests/scaffoldings/dotd_ge_16/custom/build.d/201-assert-dependencies b/tests/scaffoldings/dotd_ge_16/custom/build.d/201-assert-dependencies new file mode 100755 index 00000000..04d2692d --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/build.d/201-assert-dependencies @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Dependencies are processed at step 200 +set -ex +which busybox +hello-world +node -e "require('test-npm-install')" +python -c "import numpy, Crypto" diff --git a/tests/scaffoldings/dotd_ge_16/custom/conf.d/test-conf b/tests/scaffoldings/dotd_ge_16/custom/conf.d/test-conf new file mode 100644 index 00000000..21c748da --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/conf.d/test-conf @@ -0,0 +1 @@ +[test-conf] diff --git a/tests/scaffoldings/dotd_ge_16/custom/dependencies/apt.txt b/tests/scaffoldings/dotd_ge_16/custom/dependencies/apt.txt new file mode 100644 index 00000000..5b76ceb3 --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/dependencies/apt.txt @@ -0,0 +1,5 @@ +# This line should be ignored +busybox +ruby +ninja-build +patchelf diff --git a/tests/scaffoldings/dotd_ge_16/custom/dependencies/apt_build.txt b/tests/scaffoldings/dotd_ge_16/custom/dependencies/apt_build.txt new file mode 100644 index 00000000..b74d8115 --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/dependencies/apt_build.txt @@ -0,0 +1,6 @@ +# This installs gcc among other things +build-essential +# This is the basic need to build any python extensions on v11- +python3-dev +# Just to test it is removed after building +openssh-server diff --git a/tests/scaffoldings/dotd_ge_16/custom/dependencies/gem.txt b/tests/scaffoldings/dotd_ge_16/custom/dependencies/gem.txt new file mode 100644 index 00000000..ce51ab87 --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/dependencies/gem.txt @@ -0,0 +1,2 @@ +# This line should be ignored +hello-world diff --git a/tests/scaffoldings/dotd_ge_16/custom/dependencies/npm.txt b/tests/scaffoldings/dotd_ge_16/custom/dependencies/npm.txt new file mode 100644 index 00000000..d822001c --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/dependencies/npm.txt @@ -0,0 +1,2 @@ +# This line should be ignored +test-npm-install diff --git a/tests/scaffoldings/dotd_ge_16/custom/dependencies/pip.txt b/tests/scaffoldings/dotd_ge_16/custom/dependencies/pip.txt new file mode 100644 index 00000000..e9d91282 --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/dependencies/pip.txt @@ -0,0 +1,4 @@ +# Compiled locally, which would fail if `apt_build.txt` fails +pycrypto==2.6.1 --no-binary :all: +# External dependency files can be included too; example: numpy +-r https://raw.githubusercontent.com/Tecnativa/doodba/6cec8ea6eefa9d8de8cff103cfca6e373f8fe910/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt diff --git a/tests/scaffoldings/dotd_ge_16/custom/entrypoint.d/check-requirements b/tests/scaffoldings/dotd_ge_16/custom/entrypoint.d/check-requirements new file mode 100755 index 00000000..a2aedbeb --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/entrypoint.d/check-requirements @@ -0,0 +1,3 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import numpy diff --git a/tests/scaffoldings/dotd_ge_16/custom/entrypoint.d/pip-install-user b/tests/scaffoldings/dotd_ge_16/custom/entrypoint.d/pip-install-user new file mode 100755 index 00000000..b82411e1 --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/entrypoint.d/pip-install-user @@ -0,0 +1,8 @@ +#!/bin/bash +set -ex + +# Check that --user installations work +pip install --user pg_activity + +# Binary must be in $PATH +pg_activity --version diff --git a/tests/scaffoldings/dotd_ge_16/custom/entrypoint.d/touch-entrypoint b/tests/scaffoldings/dotd_ge_16/custom/entrypoint.d/touch-entrypoint new file mode 100755 index 00000000..3ce7311b --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/entrypoint.d/touch-entrypoint @@ -0,0 +1,3 @@ +#!/bin/bash +set -ex +touch /home/odoo/created-at-entrypoint diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/addons.yaml b/tests/scaffoldings/dotd_ge_16/custom/src/addons.yaml new file mode 100644 index 00000000..10da6de1 --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/src/addons.yaml @@ -0,0 +1,20 @@ +other-doodba/odoo/src/private: + - absent_addon + - dummy_addon + - product +enterprise: + - make_odoo_rich +--- +ONLY: + PGDATABASE: + - limited_core +odoo/addons: + - crm + - sale + +--- +ONLY: + PGDATABASE: + - limited_private + - limited_core +private: [] diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/dummy_repo/dummy_link b/tests/scaffoldings/dotd_ge_16/custom/src/dummy_repo/dummy_link new file mode 120000 index 00000000..abb95d99 --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/src/dummy_repo/dummy_link @@ -0,0 +1 @@ +dummy_addon \ No newline at end of file diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/dummy_repo/requirements.txt b/tests/scaffoldings/dotd_ge_16/custom/src/dummy_repo/requirements.txt new file mode 100644 index 00000000..24ce15ab --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/src/dummy_repo/requirements.txt @@ -0,0 +1 @@ +numpy diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/enterprise/make_odoo_rich/__openerp__.py b/tests/scaffoldings/dotd_ge_16/custom/src/enterprise/make_odoo_rich/__openerp__.py new file mode 100644 index 00000000..cc1ba263 --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/src/enterprise/make_odoo_rich/__openerp__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +{"name": "make_odoo_rich", "depends": ["iap"]} diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/dummy_addon/__init__.py b/tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/dummy_addon/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/dummy_addon/__manifest__.py b/tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/dummy_addon/__manifest__.py new file mode 100644 index 00000000..7a4cc997 --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/dummy_addon/__manifest__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +{"name": "dummy_addon", "depends": ["web"], "installable": True} diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/product/__init__.py b/tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/product/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/product/__manifest__.py b/tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/product/__manifest__.py new file mode 100644 index 00000000..4e285873 --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/product/__manifest__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +{"name": "other-doodba/product"} diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/some_random_evil_file.txt b/tests/scaffoldings/dotd_ge_16/custom/src/other-doodba/odoo/src/private/some_random_evil_file.txt new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/private/.empty b/tests/scaffoldings/dotd_ge_16/custom/src/private/.empty new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/private/disabled_addon/__init__.py b/tests/scaffoldings/dotd_ge_16/custom/src/private/disabled_addon/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/private/disabled_addon/__openerp__.py b/tests/scaffoldings/dotd_ge_16/custom/src/private/disabled_addon/__openerp__.py new file mode 100644 index 00000000..32114e6b --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/src/private/disabled_addon/__openerp__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +{"name": "disabled_addon", "installable": False} diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/private/private_addon/__init__.py b/tests/scaffoldings/dotd_ge_16/custom/src/private/private_addon/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/private/private_addon/__openerp__.py b/tests/scaffoldings/dotd_ge_16/custom/src/private/private_addon/__openerp__.py new file mode 100644 index 00000000..a9c52e7d --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/custom/src/private/private_addon/__openerp__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +{"name": "private_addon", "depends": ["dummy_addon", "website"]} diff --git a/tests/scaffoldings/dotd_ge_16/custom/src/private/some_random_evil_file.txt b/tests/scaffoldings/dotd_ge_16/custom/src/private/some_random_evil_file.txt new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/dotd_ge_16/docker-compose.yaml b/tests/scaffoldings/dotd_ge_16/docker-compose.yaml new file mode 100644 index 00000000..fbbaec8d --- /dev/null +++ b/tests/scaffoldings/dotd_ge_16/docker-compose.yaml @@ -0,0 +1,30 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + LOG_LEVEL: DEBUG + ODOO_VERSION: $ODOO_MINOR + tty: true + environment: + PGUSER: another_odoo + PGPASSWORD: anotherodoopassword + PGHOST: postgresql + PGDATABASE: ${DBNAME:-prod} + depends_on: + - postgresql + volumes: + - filestore:/var/lib/odoo:z + + postgresql: + image: tecnativa/postgres-autoconf:${DB_VERSION}-alpine + environment: + POSTGRES_USER: another_odoo + POSTGRES_PASSWORD: anotherodoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: From b7abde14251ecebff28c1940de7b16186a3aff64 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sat, 18 Nov 2023 11:44:37 +0100 Subject: [PATCH 200/255] [FIX] Use newer flanker from source for 16.0 and 17.0 --- 16.0.Dockerfile | 2 +- 17.0.Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/16.0.Dockerfile b/16.0.Dockerfile index cab3fd7b..d0afa7ff 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -123,7 +123,7 @@ RUN build_deps=" \ click-odoo-contrib \ debugpy \ pydevd-odoo \ - flanker[validator] \ + git+https://github.com/mailgun/flanker.git@v0.9.15#egg=flanker \ geoip2 \ "git-aggregator<3.0.0" \ inotify \ diff --git a/17.0.Dockerfile b/17.0.Dockerfile index 580148fd..d738bc23 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -123,7 +123,7 @@ RUN build_deps=" \ click-odoo-contrib \ debugpy \ pydevd-odoo \ - flanker[validator] \ + git+https://github.com/mailgun/flanker.git@v0.9.15#egg=flanker \ geoip2 \ "git-aggregator<3.0.0" \ inotify \ From fa870a29ed9dfe396fe5a25bc6833f566678ea4f Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 20 Nov 2023 08:59:04 +0100 Subject: [PATCH 201/255] [FIX] flanker new version dependencies The newest flanker version includes 2 dependencies that are not automatically installed, so we need to explicitly add them. --- 16.0.Dockerfile | 2 ++ 17.0.Dockerfile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/16.0.Dockerfile b/16.0.Dockerfile index d0afa7ff..adbba8c1 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -123,6 +123,8 @@ RUN build_deps=" \ click-odoo-contrib \ debugpy \ pydevd-odoo \ + redis \ + dnsq \ git+https://github.com/mailgun/flanker.git@v0.9.15#egg=flanker \ geoip2 \ "git-aggregator<3.0.0" \ diff --git a/17.0.Dockerfile b/17.0.Dockerfile index d738bc23..bf259c11 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -123,6 +123,8 @@ RUN build_deps=" \ click-odoo-contrib \ debugpy \ pydevd-odoo \ + redis \ + dnsq \ git+https://github.com/mailgun/flanker.git@v0.9.15#egg=flanker \ geoip2 \ "git-aggregator<3.0.0" \ From 45df6f65b10756fa58c6c733f50778600489d1b3 Mon Sep 17 00:00:00 2001 From: Pablo Esteban Date: Mon, 20 Nov 2023 10:07:23 +0100 Subject: [PATCH 202/255] [FIX] Update git-aggregator version to 4.0 --- 16.0.Dockerfile | 2 +- 17.0.Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/16.0.Dockerfile b/16.0.Dockerfile index d0afa7ff..051e67bb 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -125,7 +125,7 @@ RUN build_deps=" \ pydevd-odoo \ git+https://github.com/mailgun/flanker.git@v0.9.15#egg=flanker \ geoip2 \ - "git-aggregator<3.0.0" \ + "git-aggregator==4.0" \ inotify \ pdfminer.six \ pg_activity \ diff --git a/17.0.Dockerfile b/17.0.Dockerfile index d738bc23..ffd64cd9 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -125,7 +125,7 @@ RUN build_deps=" \ pydevd-odoo \ git+https://github.com/mailgun/flanker.git@v0.9.15#egg=flanker \ geoip2 \ - "git-aggregator<3.0.0" \ + "git-aggregator==4.0" \ inotify \ pdfminer.six \ pg_activity \ From e8d02e579fead55e503913dacb7f9a81cee032ef Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 20 Nov 2023 13:50:43 +0100 Subject: [PATCH 203/255] [IMP] Use pip notation for flanker deps Putting this notation, it installs the required dependencies. --- 16.0.Dockerfile | 4 +--- 17.0.Dockerfile | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/16.0.Dockerfile b/16.0.Dockerfile index adbba8c1..4a81cff1 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -123,9 +123,7 @@ RUN build_deps=" \ click-odoo-contrib \ debugpy \ pydevd-odoo \ - redis \ - dnsq \ - git+https://github.com/mailgun/flanker.git@v0.9.15#egg=flanker \ + git+https://github.com/mailgun/flanker.git@v0.9.15#egg=flanker[validator] \ geoip2 \ "git-aggregator<3.0.0" \ inotify \ diff --git a/17.0.Dockerfile b/17.0.Dockerfile index bf259c11..fcaa5d31 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -123,9 +123,7 @@ RUN build_deps=" \ click-odoo-contrib \ debugpy \ pydevd-odoo \ - redis \ - dnsq \ - git+https://github.com/mailgun/flanker.git@v0.9.15#egg=flanker \ + git+https://github.com/mailgun/flanker.git@v0.9.15#egg=flanker[validator] \ geoip2 \ "git-aggregator<3.0.0" \ inotify \ From fec2803a69b7971555bd8e3d364d3b5b8289a7bf Mon Sep 17 00:00:00 2001 From: Karl Southern Date: Mon, 20 Nov 2023 13:38:35 +0000 Subject: [PATCH 204/255] [FIX] if ~root/.ssh/ is prematurely created, we need to remove it, ensuring that AUTOAGGREGATE can read the ssh/config correctly --- 16.0.Dockerfile | 3 ++- 17.0.Dockerfile | 3 ++- tests/__init__.py | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/16.0.Dockerfile b/16.0.Dockerfile index adbba8c1..192be7e5 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -224,7 +224,8 @@ ONBUILD COPY --chown=root:odoo $LOCAL_CUSTOM_DIR /opt/odoo/custom # https://docs.python.org/3/library/logging.html#levels ONBUILD ARG LOG_LEVEL=INFO -ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ +ONBUILD RUN [[ -d ~root/.ssh ]] && rm -r ~root/.ssh; \ + mkdir -p /opt/odoo/custom/ssh \ && ln -s /opt/odoo/custom/ssh ~root/.ssh \ && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ && sync diff --git a/17.0.Dockerfile b/17.0.Dockerfile index bf259c11..ee8151a1 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -224,7 +224,8 @@ ONBUILD COPY --chown=root:odoo $LOCAL_CUSTOM_DIR /opt/odoo/custom # https://docs.python.org/3/library/logging.html#levels ONBUILD ARG LOG_LEVEL=INFO -ONBUILD RUN mkdir -p /opt/odoo/custom/ssh \ +ONBUILD RUN [[ -d ~root/.ssh ]] && rm -r ~root/.ssh; \ + mkdir -p /opt/odoo/custom/ssh \ && ln -s /opt/odoo/custom/ssh ~root/.ssh \ && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ && sync diff --git a/tests/__init__.py b/tests/__init__.py index d8e95f5c..62562658 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -306,6 +306,8 @@ def test_smallest(self): ("bash", "-xc", 'test "$(which geoipupdate)" != ""'), ("test", "!", "-e", "/usr/share/GeoIP/GeoLite2-City.mmdb"), ("bash", "-xc", "! geoipupdate"), + # Ensure /root/.ssh/ has not been mangled + ("bash", "-c", "[[ ! -d ~root/.ssh/ssh ]]"), ) smallest_dir = join(SCAFFOLDINGS_DIR, "smallest") for sub_env in matrix(): From 1e175309e28b52b8876c5be49ea1e68e752a7a08 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 20 Nov 2023 16:53:05 +0100 Subject: [PATCH 205/255] [IMP] tests: add test for uid 998 --- tests/__init__.py | 55 ++++++++++--------- tests/scaffoldings/uids_998/Dockerfile | 2 + .../uids_998/custom/src/addons.yaml | 0 .../scaffoldings/uids_998/docker-compose.yaml | 33 +++++++++++ 4 files changed, 64 insertions(+), 26 deletions(-) create mode 100644 tests/scaffoldings/uids_998/Dockerfile create mode 100644 tests/scaffoldings/uids_998/custom/src/addons.yaml create mode 100644 tests/scaffoldings/uids_998/docker-compose.yaml diff --git a/tests/__init__.py b/tests/__init__.py index 62562658..4f0f8dc7 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -491,32 +491,35 @@ def test_dependencies_base_search_fuzzy(self): def test_modified_uids(self): """tests if we can build an image with a custom uid and gid of odoo""" - uids_dir = join(SCAFFOLDINGS_DIR, "uids_1001") - for sub_env in matrix(): - self.compose_test( - uids_dir, - sub_env, - # verify that odoo user has the given ids - ("bash", "-xc", 'test "$(id -u)" == "1001"'), - ("bash", "-xc", 'test "$(id -g)" == "1002"'), - ("bash", "-xc", 'test "$(id -u -n)" == "odoo"'), - # all those directories need to belong to odoo (user or group odoo) - ( - "bash", - "-xc", - 'test "$(stat -c \'%U:%G\' /var/lib/odoo)" == "odoo:odoo"', - ), - ( - "bash", - "-xc", - 'test "$(stat -c \'%U:%G\' /opt/odoo/auto/addons)" == "root:odoo"', - ), - ( - "bash", - "-xc", - 'test "$(stat -c \'%U:%G\' /opt/odoo/custom/src)" == "root:odoo"', - ), - ) + for expected_uid, expected_gid, uids_dir in [ + (1001, 1002, join(SCAFFOLDINGS_DIR, "uids_1001")), + (998, 998, join(SCAFFOLDINGS_DIR, "uids_998")), + ]: + for sub_env in matrix(): + self.compose_test( + uids_dir, + sub_env, + # verify that odoo user has the given ids + ("bash", "-xc", 'test "$(id -u)" == "%s"' % expected_uid), + ("bash", "-xc", 'test "$(id -g)" == "%s"' % expected_gid), + ("bash", "-xc", 'test "$(id -u -n)" == "odoo"'), + # all those directories need to belong to odoo (user or group odoo) + ( + "bash", + "-xc", + 'test "$(stat -c \'%U:%G\' /var/lib/odoo)" == "odoo:odoo"', + ), + ( + "bash", + "-xc", + 'test "$(stat -c \'%U:%G\' /opt/odoo/auto/addons)" == "root:odoo"', + ), + ( + "bash", + "-xc", + 'test "$(stat -c \'%U:%G\' /opt/odoo/custom/src)" == "root:odoo"', + ), + ) def test_uids_mac_os(self): """tests if we can build an image with a custom uid and gid of odoo""" diff --git a/tests/scaffoldings/uids_998/Dockerfile b/tests/scaffoldings/uids_998/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/uids_998/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/uids_998/custom/src/addons.yaml b/tests/scaffoldings/uids_998/custom/src/addons.yaml new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/uids_998/docker-compose.yaml b/tests/scaffoldings/uids_998/docker-compose.yaml new file mode 100644 index 00000000..a79b428a --- /dev/null +++ b/tests/scaffoldings/uids_998/docker-compose.yaml @@ -0,0 +1,33 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + PIP_INSTALL_ODOO: "false" + WITHOUT_DEMO: "false" + UID: 998 + GID: 998 + + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + volumes: + - filestore:/var/lib/odoo:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: From 0280e6ba20d5125e4445b99c958f70b9404fe955 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Tue, 21 Nov 2023 11:45:13 +0100 Subject: [PATCH 206/255] [IMP] 1[67].0: use 499 as last system uid for systemd-network --- 16.0.Dockerfile | 10 +++++++++- 17.0.Dockerfile | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/16.0.Dockerfile b/16.0.Dockerfile index 9f795211..a3085ee7 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -5,6 +5,10 @@ EXPOSE 8069 8072 ARG GEOIP_UPDATER_VERSION=4.3.0 ARG WKHTMLTOPDF_VERSION=0.13.0 ARG WKHTMLTOPDF_CHECKSUM='8feeb4d814263688d6e6fe28e03b541be5ca94f39c6e1ef8ff4c88dd8fb9443a' +ARG LAST_SYSTEM_UID=499 +ARG LAST_SYSTEM_GID=499 +ARG FIRST_UID=500 +ARG FIRST_GID=500 ENV DB_FILTER=.* \ DEPTH_DEFAULT=1 \ DEPTH_MERGE=100 \ @@ -33,7 +37,11 @@ ENV DB_FILTER=.* \ # Other requirements and recommendations # See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control -RUN apt-get -qq update \ +RUN echo "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFIRST_UID=$FIRST_UID\nFIRST_GID=$FIRST_GID" >> /etc/adduser.conf \ + && echo "SYS_UID_MAX $LAST_SYSTEM_UID\nSYS_GID_MAX $LAST_SYSTEM_GID" >> /etc/login.defs \ + && sed -i -E "s/^UID_MIN\s+[0-9]+.*/UID_MIN $FIRST_UID/;s/^GID_MIN\s+[0-9]+.*/GID_MIN $FIRST_GID/" /etc/login.defs \ + && useradd --system -u $LAST_SYSTEM_UID -s /usr/sbin/nologin -d / systemd-network \ + && apt-get -qq update \ && apt-get install -yqq --no-install-recommends \ curl \ && curl -SLo wkhtmltox.deb https://github.com/odoo/wkhtmltopdf/releases/download/nightly/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.nightly.bookworm_amd64.deb \ diff --git a/17.0.Dockerfile b/17.0.Dockerfile index df41164a..0eda2b87 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -5,6 +5,10 @@ EXPOSE 8069 8072 ARG GEOIP_UPDATER_VERSION=4.3.0 ARG WKHTMLTOPDF_VERSION=0.13.0 ARG WKHTMLTOPDF_CHECKSUM='8feeb4d814263688d6e6fe28e03b541be5ca94f39c6e1ef8ff4c88dd8fb9443a' +ARG LAST_SYSTEM_UID=499 +ARG LAST_SYSTEM_GID=499 +ARG FIRST_UID=500 +ARG FIRST_GID=500 ENV DB_FILTER=.* \ DEPTH_DEFAULT=1 \ DEPTH_MERGE=100 \ @@ -33,7 +37,11 @@ ENV DB_FILTER=.* \ # Other requirements and recommendations # See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control -RUN apt-get -qq update \ +RUN echo -e "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFIRST_UID=$FIRST_UID\nFIRST_GID=$FIRST_GID" >> /etc/adduser.conf \ + && echo "SYS_UID_MAX $LAST_SYSTEM_UID\nSYS_GID_MAX $LAST_SYSTEM_GID" >> /etc/login.defs \ + && sed -i -E "s/^UID_MIN\s+[0-9]+.*/UID_MIN $FIRST_UID/;s/^GID_MIN\s+[0-9]+.*/GID_MIN $FIRST_GID/" /etc/login.defs \ + && useradd --system -u $LAST_SYSTEM_UID -s /usr/sbin/nologin -d / systemd-network \ + && apt-get -qq update \ && apt-get install -yqq --no-install-recommends \ curl \ && curl -SLo wkhtmltox.deb https://github.com/odoo/wkhtmltopdf/releases/download/nightly/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.nightly.bookworm_amd64.deb \ From 9487571e6acb59d4b28e86dffaa24302f427a82e Mon Sep 17 00:00:00 2001 From: Manuel Florido Date: Wed, 22 Nov 2023 17:08:09 +0100 Subject: [PATCH 207/255] [FIX] 16/17: Proper ~root/.ssh pre-removal The symlink to /opt/odoo/custom/ssh is still being created as sub-directory (/root/.ssh/ssh), getting an error when trying to build the Doodba image. Docker uses '/bin/sh' as default shell and '[[ ]]' is a specific comparison construct of Bash. Removing the brackets, now the symlinks to /opt/odoo/custom/ssh are being successfully created. --- 16.0.Dockerfile | 2 +- 17.0.Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/16.0.Dockerfile b/16.0.Dockerfile index a3085ee7..668c6e1d 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -230,7 +230,7 @@ ONBUILD COPY --chown=root:odoo $LOCAL_CUSTOM_DIR /opt/odoo/custom # https://docs.python.org/3/library/logging.html#levels ONBUILD ARG LOG_LEVEL=INFO -ONBUILD RUN [[ -d ~root/.ssh ]] && rm -r ~root/.ssh; \ +ONBUILD RUN [ -d ~root/.ssh ] && rm -r ~root/.ssh; \ mkdir -p /opt/odoo/custom/ssh \ && ln -s /opt/odoo/custom/ssh ~root/.ssh \ && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ diff --git a/17.0.Dockerfile b/17.0.Dockerfile index 0eda2b87..3f3dd87a 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -230,7 +230,7 @@ ONBUILD COPY --chown=root:odoo $LOCAL_CUSTOM_DIR /opt/odoo/custom # https://docs.python.org/3/library/logging.html#levels ONBUILD ARG LOG_LEVEL=INFO -ONBUILD RUN [[ -d ~root/.ssh ]] && rm -r ~root/.ssh; \ +ONBUILD RUN [ -d ~root/.ssh ] && rm -r ~root/.ssh; \ mkdir -p /opt/odoo/custom/ssh \ && ln -s /opt/odoo/custom/ssh ~root/.ssh \ && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ From 3aa6f41e5418c88c4f305a7a315ae229efc135ce Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Fri, 24 Nov 2023 09:08:49 +0100 Subject: [PATCH 208/255] [FIX] Change version wkhtml 0.13 to 0.12.6.1 to avoid printig problems --- 16.0.Dockerfile | 6 +++--- 17.0.Dockerfile | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/16.0.Dockerfile b/16.0.Dockerfile index 668c6e1d..9887cef7 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -3,8 +3,8 @@ FROM python:3.10-slim-bookworm AS base EXPOSE 8069 8072 ARG GEOIP_UPDATER_VERSION=4.3.0 -ARG WKHTMLTOPDF_VERSION=0.13.0 -ARG WKHTMLTOPDF_CHECKSUM='8feeb4d814263688d6e6fe28e03b541be5ca94f39c6e1ef8ff4c88dd8fb9443a' +ARG WKHTMLTOPDF_VERSION=0.12.6.1 +ARG WKHTMLTOPDF_CHECKSUM='98ba0d157b50d36f23bd0dedf4c0aa28c7b0c50fcdcdc54aa5b6bbba81a3941d' ARG LAST_SYSTEM_UID=499 ARG LAST_SYSTEM_GID=499 ARG FIRST_UID=500 @@ -44,7 +44,7 @@ RUN echo "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFI && apt-get -qq update \ && apt-get install -yqq --no-install-recommends \ curl \ - && curl -SLo wkhtmltox.deb https://github.com/odoo/wkhtmltopdf/releases/download/nightly/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.nightly.bookworm_amd64.deb \ + && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}-3/wkhtmltox_${WKHTMLTOPDF_VERSION}-3.bookworm_amd64.deb \ && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ && apt-get install -yqq --no-install-recommends \ ./wkhtmltox.deb \ diff --git a/17.0.Dockerfile b/17.0.Dockerfile index 3f3dd87a..fc0d4dcf 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -3,8 +3,8 @@ FROM python:3.10-slim-bookworm AS base EXPOSE 8069 8072 ARG GEOIP_UPDATER_VERSION=4.3.0 -ARG WKHTMLTOPDF_VERSION=0.13.0 -ARG WKHTMLTOPDF_CHECKSUM='8feeb4d814263688d6e6fe28e03b541be5ca94f39c6e1ef8ff4c88dd8fb9443a' +ARG WKHTMLTOPDF_VERSION=0.12.6.1 +ARG WKHTMLTOPDF_CHECKSUM='98ba0d157b50d36f23bd0dedf4c0aa28c7b0c50fcdcdc54aa5b6bbba81a3941d' ARG LAST_SYSTEM_UID=499 ARG LAST_SYSTEM_GID=499 ARG FIRST_UID=500 @@ -44,7 +44,7 @@ RUN echo -e "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\ && apt-get -qq update \ && apt-get install -yqq --no-install-recommends \ curl \ - && curl -SLo wkhtmltox.deb https://github.com/odoo/wkhtmltopdf/releases/download/nightly/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.nightly.bookworm_amd64.deb \ + && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}-3/wkhtmltox_${WKHTMLTOPDF_VERSION}-3.bookworm_amd64.deb \ && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ && apt-get install -yqq --no-install-recommends \ ./wkhtmltox.deb \ From 24bd01bc1c8e67e99d17ea79ea06926290e1908f Mon Sep 17 00:00:00 2001 From: Pablo Esteban Date: Mon, 27 Nov 2023 09:44:54 +0100 Subject: [PATCH 209/255] [FIX] Fix tests that rely on repo_merge git-aggregator 4.0 default fast-forward behavior overrides the git configuration in 099-git_merge_no_ff. Replace it with 099-create-fake-odo to create a fake odoo repo with two branches. --- tests/__init__.py | 4 ++-- .../custom/build.d/099-create-fake-odoo | 18 ++++++++++++++++++ .../custom/build.d/099-git_merge_no_ff | 10 ---------- .../repo_merge/custom/src/repos.yaml | 9 +++------ .../repo_merge/docker-compose.yaml | 1 + 5 files changed, 24 insertions(+), 18 deletions(-) create mode 100755 tests/scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo delete mode 100755 tests/scaffoldings/repo_merge/custom/build.d/099-git_merge_no_ff diff --git a/tests/__init__.py b/tests/__init__.py index d8e95f5c..c99c99ed 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -716,8 +716,8 @@ def test_repo_merge_aggregate_permissions(self): UID=str(os.getuid()), GID=str(os.getgid()), ), - # prepare repos.yaml to be non fast forward - ("/opt/odoo/custom/build.d/099-git_merge_no_ff",), + # create a fake odoo git repo to ensure a merge commit is created + ("/opt/odoo/custom/build.d/099-create-fake-odoo",), # autoaggregate as odoo:odoo to check if merges also work ("autoaggregate",), ( diff --git a/tests/scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo b/tests/scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo new file mode 100755 index 00000000..d3f1794c --- /dev/null +++ b/tests/scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo @@ -0,0 +1,18 @@ +#!/bin/bash +mkdir /tmp/fake-odoo +cd /tmp/fake-odoo + +git init +touch odoo-bin +git add odoo-bin +git commit -m odoo-bin + +git checkout -b branch1 +touch 1.txt +git add 1.txt +git commit -m 1.txt + +git checkout -b branch2 HEAD~1 +touch 2.txt +git add 2.txt +git commit -m 2.txt diff --git a/tests/scaffoldings/repo_merge/custom/build.d/099-git_merge_no_ff b/tests/scaffoldings/repo_merge/custom/build.d/099-git_merge_no_ff deleted file mode 100755 index 6e6ecc63..00000000 --- a/tests/scaffoldings/repo_merge/custom/build.d/099-git_merge_no_ff +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -e -# configure git for odoo to merge without fast forward to test config for merge commits in autoaggregate -su --shell="$SHELL" odoo -c 'git config --global merge.ff false' -su --shell="$SHELL" odoo -c 'git config --global pull.ff false' - -# prepare a forced merge by using an OCB version that is one commit behind the ODOO_VERSION branch -OCB_VERSION_ONE_BEHIND=$(curl -s "https://api.github.com/repos/OCA/OCB/commits?page=2&per_page=1&sha=$ODOO_VERSION" | python -c 'import json, sys; print(json.loads("".join([l for l in sys.stdin]))[0]["sha"])') -# shellcheck disable=SC2016 -sed -i 's/\$ODOO_VERSION^1/'"$OCB_VERSION_ONE_BEHIND"'/' /opt/odoo/custom/src/repos.yaml diff --git a/tests/scaffoldings/repo_merge/custom/src/repos.yaml b/tests/scaffoldings/repo_merge/custom/src/repos.yaml index c04e6692..fcb83956 100644 --- a/tests/scaffoldings/repo_merge/custom/src/repos.yaml +++ b/tests/scaffoldings/repo_merge/custom/src/repos.yaml @@ -3,10 +3,7 @@ defaults: depth: $DEPTH_MERGE remotes: - ocb: https://github.com/OCA/OCB.git - target: ocb $ODOO_VERSION + local: /tmp/fake-odoo merges: - # $ODOO_VERSION^1 gets replaced by commit sha that is one behind $ODOO_VERSION in OCB repo by 099-git_merge_no_ff - # in this test, to force gitaggregate creating a merge request - - ocb $ODOO_VERSION^1 - - ocb $ODOO_VERSION + - local branch1 + - local branch2 diff --git a/tests/scaffoldings/repo_merge/docker-compose.yaml b/tests/scaffoldings/repo_merge/docker-compose.yaml index de4ff6b2..909657a5 100644 --- a/tests/scaffoldings/repo_merge/docker-compose.yaml +++ b/tests/scaffoldings/repo_merge/docker-compose.yaml @@ -6,6 +6,7 @@ services: args: COMPILE: "false" ODOO_VERSION: $ODOO_MINOR + PIP_INSTALL_ODOO: "false" # ensure build.d/700-odoo-install does not fail WITHOUT_DEMO: "false" environment: PYTHONOPTIMIZE: "" From 76e8ce3a22a7da2c8eea5b55a5a61f670cf7bfec Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 4 Jul 2022 10:52:12 +0200 Subject: [PATCH 210/255] [FIX] direxec should not try to execute directories --- bin/direxec | 2 +- tests/__init__.py | 14 +++++++++ tests/scaffoldings/entrypoint/Dockerfile | 2 ++ .../entrypoint.d/60-customize_entrypoint.py | 8 +++++ .../entrypoint/custom/src/addons.yaml | 0 .../entrypoint/docker-compose.yaml | 30 +++++++++++++++++++ 6 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 tests/scaffoldings/entrypoint/Dockerfile create mode 100755 tests/scaffoldings/entrypoint/custom/entrypoint.d/60-customize_entrypoint.py create mode 100644 tests/scaffoldings/entrypoint/custom/src/addons.yaml create mode 100644 tests/scaffoldings/entrypoint/docker-compose.yaml diff --git a/bin/direxec b/bin/direxec index adecba7b..ca84efdd 100755 --- a/bin/direxec +++ b/bin/direxec @@ -25,7 +25,7 @@ except OSError: # Run scripts for executable, folder in sorted(files): command = os.path.join(folder, executable) - if os.access(command, os.X_OK): + if os.access(command, os.X_OK) and not os.path.isdir(command): logger.debug("Executing %s", command) subprocess.check_call(command) diff --git a/tests/__init__.py b/tests/__init__.py index 4f0f8dc7..541054bb 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -755,6 +755,20 @@ def test_aggregate_permissions(self): ("autoaggregate",), ) + def test_entrypoint_python(self): + symlink_dir = join(SCAFFOLDINGS_DIR, "entrypoint") + for sub_env in matrix(): + self.compose_test( + symlink_dir, + dict(sub_env, UID=str(os.getuid()), GID=str(os.getgid())), + # we verify that customizing entrypoint with python files work by writing to + # /tmp/customize_entrypoint.mark.txt with 60-customize_entrypoint.py + ( + "cat", + "/tmp/customize_entrypoint.mark.txt", + ), + ) + if __name__ == "__main__": unittest.main() diff --git a/tests/scaffoldings/entrypoint/Dockerfile b/tests/scaffoldings/entrypoint/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/entrypoint/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/entrypoint/custom/entrypoint.d/60-customize_entrypoint.py b/tests/scaffoldings/entrypoint/custom/entrypoint.d/60-customize_entrypoint.py new file mode 100755 index 00000000..c2054ffa --- /dev/null +++ b/tests/scaffoldings/entrypoint/custom/entrypoint.d/60-customize_entrypoint.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +import doodbalib + +doodbalib.logger.info("custom entrypoint running") +with open("/tmp/customize_entrypoint.mark.txt", "w") as fp: + fp.write("ok\n") +doodbalib.logger.info("custom created /tmp/customize_entrypoint.mark.txt") diff --git a/tests/scaffoldings/entrypoint/custom/src/addons.yaml b/tests/scaffoldings/entrypoint/custom/src/addons.yaml new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/entrypoint/docker-compose.yaml b/tests/scaffoldings/entrypoint/docker-compose.yaml new file mode 100644 index 00000000..cf15da4b --- /dev/null +++ b/tests/scaffoldings/entrypoint/docker-compose.yaml @@ -0,0 +1,30 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + # compile causes the creation of __pycache__ in entrypoint.d for this test + COMPILE: "true" + ODOO_VERSION: $ODOO_MINOR + WITHOUT_DEMO: "false" + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + volumes: + - filestore:/var/lib/odoo:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: From 57b8cf08264372ef431c0fda49596b910da6fab3 Mon Sep 17 00:00:00 2001 From: Pablo Esteban Date: Thu, 30 Nov 2023 11:25:59 +0100 Subject: [PATCH 211/255] [FIX] 099-create-fake-odoo: remove artifacts from previous runs --- .../scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo b/tests/scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo index d3f1794c..85995f55 100755 --- a/tests/scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo +++ b/tests/scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo @@ -1,4 +1,5 @@ #!/bin/bash +rm -rf /tmp/fake-odoo mkdir /tmp/fake-odoo cd /tmp/fake-odoo From 4ded613f5b67d861dbe403f14d7b28638bb258f0 Mon Sep 17 00:00:00 2001 From: Paul Catinean Date: Mon, 6 Nov 2023 17:13:12 +0100 Subject: [PATCH 212/255] [ADD] Added support for arm64 --- .github/workflows/ci.yaml | 96 +++++++++++++++++++++++++++++---------- 14.0.Dockerfile | 43 ++++++++++++++---- 15.0.Dockerfile | 43 ++++++++++++++---- 16.0.Dockerfile | 45 +++++++++++++----- 17.0.Dockerfile | 35 ++++++++++---- hooks/build | 39 ---------------- hooks/push | 35 -------------- 7 files changed, 200 insertions(+), 136 deletions(-) delete mode 100755 hooks/build delete mode 100755 hooks/push diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 69783a17..8be83136 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,7 +28,7 @@ jobs: key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} - uses: pre-commit/action@v3.0.0 - build-test-push: + test: runs-on: ubuntu-22.04 needs: pre-commit strategy: @@ -53,12 +53,6 @@ jobs: pg_version: "14" python_version: "3.9" env: - # Indicates what's the equivalent to tecnativa/doodba:latest image - LATEST_RELEASE: "17.0" - # Variables found by default in Docker Hub builder - DOCKER_REPO: tecnativa/doodba - DOCKER_TAG: ${{ matrix.odoo_version }} - GIT_SHA1: ${{ github.sha }} # Other variables to configure tests and execution environment DOCKER_BUILDKIT: 1 PG_VERSIONS: ${{ matrix.pg_version }} @@ -76,22 +70,76 @@ jobs: # to get rid of AttributeError: cython_sources when installing pyyaml - run: poetry add pyyaml==5.3.1 - run: poetry install - # Build images - - run: poetry run ./hooks/build # Test - run: poetry run python -m unittest -v tests - # Push - - name: push to docker hub - if: github.repository == 'Tecnativa/doodba' && github.ref == 'refs/heads/master' - env: - REGISTRY_HOST: docker.io - REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} - run: poetry run ./hooks/push - - name: push to github container registry - if: github.repository == 'Tecnativa/doodba' && github.ref == 'refs/heads/master' - env: - REGISTRY_HOST: ghcr.io - REGISTRY_PASSWORD: ${{ secrets.BOT_TOKEN }} - REGISTRY_USERNAME: ${{ secrets.BOT_LOGIN }} - run: poetry run ./hooks/push + + build-push: + runs-on: ubuntu-22.04 + needs: test + strategy: + fail-fast: false + matrix: + # Test modern Odoo versions with latest Postgres version + odoo_version: ["17.0"] + platforms: ["linux/amd64,linux/arm64"] + include: + # Older odoo versions don't support latest postgres and Python versions + - odoo_version: "16.0" + platforms: "linux/amd64,linux/arm64" + - odoo_version: "15.0" + platforms: "linux/amd64,linux/arm64" + - odoo_version: "14.0" + platforms: "linux/amd64,linux/arm64" + - odoo_version: "13.0" + platforms: "linux/amd64" + env: + # Indicates what's the equivalent to tecnativa/doodba:latest image + LATEST_RELEASE: "17.0" + # Define the docker hub repository location and github container registry host + DOCKER_REPO: tecnativa/doodba + GHCR_HOST: ghcr.io + steps: + # Set build date as env variable to be used later + - name: Set build date + run: echo "BUILD_DATE=$(date '+%Y-%m-%dT%H:%M:%S.%N%:z')" >> $GITHUB_ENV + # Prepare + - uses: actions/checkout@v4 + # Setup QEMU + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + # Setup buildx + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + if: github.repository == 'tecnativa/doodba' && github.ref == 'refs/heads/master' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_LOGIN }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + if: github.repository == 'tecnativa/doodba' && github.ref == 'refs/heads/master' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ./${{ matrix.odoo_version }}.Dockerfile + platforms: ${{ matrix.platforms }} + push: + ${{ github.repository == 'tecnativa/doodba' && github.ref == + 'refs/heads/master' }} + tags: | + ${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}onbuild + ${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}-onbuild + ${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }} + ${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }}-onbuild + ${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}:latest', env.DOCKER_REPO) || '' }} + ${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}/{1}{2}:latest', env.GHCR_HOST, env.DOCKER_REPO, env.DOCKER_REPO_SUFFIX) || '' }} + build-args: | + VCS_REF=${{ github.sha }} + BUILD_DATE=${{ env.BUILD_DATE }} + ODOO_VERSION=${{ matrix.odoo_version }} diff --git a/14.0.Dockerfile b/14.0.Dockerfile index 889cbd5d..51e31e52 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -2,9 +2,11 @@ FROM python:3.8-slim-buster AS base EXPOSE 8069 8072 -ARG GEOIP_UPDATER_VERSION=4.3.0 +ARG TARGETARCH +ARG GEOIP_UPDATER_VERSION=6.0.0 ARG WKHTMLTOPDF_VERSION=0.12.5 -ARG WKHTMLTOPDF_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd' +ARG WKHTMLTOPDF_AMD64_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd' +ARG WKHTMLTOPDF_ARM64_CHECKSUM="3344e3a72f4cb4c1218cf48ac5fa9e88bef62aa7fa6f2295be7d5bc1fef100b1" ENV DB_FILTER=.* \ DEPTH_DEFAULT=1 \ DEPTH_MERGE=100 \ @@ -35,8 +37,25 @@ ENV DB_FILTER=.* \ # See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control RUN apt-get -qq update \ && apt-get install -yqq --no-install-recommends \ - curl \ - && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.buster_amd64.deb \ + curl; \ + if [ "$TARGETARCH" = "arm64" ]; then \ + if [ "$WKHTMLTOPDF_VERSION" != "0.12.6.1" ]; then \ + echo "Error: WKHTMLTOPDF_VERSION must be exactly 0.12.6.1 for arm builds. Forcing version to 0.12.6.1"; \ + export WKHTMLTOPDF_VERSION="0.12.6.1";\ + fi; \ + WKHTMLTOPDF_URL="https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}-2/wkhtmltox_${WKHTMLTOPDF_VERSION}-2.bullseye_${TARGETARCH}.deb" \ + WKHTMLTOPDF_CHECKSUM=$WKHTMLTOPDF_ARM64_CHECKSUM; \ + elif [ "$TARGETARCH" = "amd64" ]; then \ + WKHTMLTOPDF_URL="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.buster_${TARGETARCH}.deb" \ + WKHTMLTOPDF_CHECKSUM=$WKHTMLTOPDF_AMD64_CHECKSUM; \ + else \ + echo "Unsupported architecture: $TARGETARCH" >&2; \ + exit 1; \ + fi \ + && curl -SLo wkhtmltox.deb ${WKHTMLTOPDF_URL} \ + && echo "Downloading wkhtmltopdf from: ${WKHTMLTOPDF_URL}" \ + && echo "Expected wkhtmltox checksum: ${WKHTMLTOPDF_CHECKSUM}" \ + && echo "Computed wkhtmltox checksum: $(sha256sum wkhtmltox.deb | awk '{ print $1 }')" \ && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ && apt-get install -yqq --no-install-recommends \ ./wkhtmltox.deb \ @@ -56,9 +75,9 @@ RUN apt-get -qq update \ && echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ - && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ - && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ - && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ + && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ + && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ && apt-get autopurge -yqq \ && rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \ && sync @@ -118,8 +137,14 @@ RUN build_deps=" \ " \ && apt-get update \ && apt-get install -yqq --no-install-recommends $build_deps \ - && pip install \ - -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + && \ + if [ "$TARGETARCH" = "arm64" ]; then \ + echo "Upgrading odoo requirements.txt with gevent==21.12.0 and greenlet==1.1.0 (minimum versions compatible with arm64)" && \ + sed -i 's/gevent==[0-9\.]*/gevent==21.12.0/' requirements.txt && \ + sed -i 's/greenlet==[0-9\.]*/greenlet==1.1.0/' requirements.txt; \ + fi \ + && pip install -r requirements.txt \ 'websocket-client~=0.56' \ astor \ # Install fix from https://github.com/acsone/click-odoo-contrib/pull/93 diff --git a/15.0.Dockerfile b/15.0.Dockerfile index 311f30ec..1bb05d65 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -2,9 +2,11 @@ FROM python:3.8-slim-bullseye AS base EXPOSE 8069 8072 -ARG GEOIP_UPDATER_VERSION=4.3.0 +ARG TARGETARCH +ARG GEOIP_UPDATER_VERSION=6.0.0 ARG WKHTMLTOPDF_VERSION=0.12.5 -ARG WKHTMLTOPDF_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd' +ARG WKHTMLTOPDF_AMD64_CHECKSUM='dfab5506104447eef2530d1adb9840ee3a67f30caaad5e9bcb8743ef2f9421bd' +ARG WKHTMLTOPDF_ARM64_CHECKSUM="3344e3a72f4cb4c1218cf48ac5fa9e88bef62aa7fa6f2295be7d5bc1fef100b1" ENV DB_FILTER=.* \ DEPTH_DEFAULT=1 \ DEPTH_MERGE=100 \ @@ -35,8 +37,25 @@ ENV DB_FILTER=.* \ # See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control RUN apt-get -qq update \ && apt-get install -yqq --no-install-recommends \ - curl \ - && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.buster_amd64.deb \ + curl; \ + if [ "$TARGETARCH" = "arm64" ]; then \ + if [ "$WKHTMLTOPDF_VERSION" != "0.12.6.1" ]; then \ + echo "Error: WKHTMLTOPDF_VERSION must be exactly 0.12.6.1 for arm builds. Forcing version to 0.12.6.1"; \ + export WKHTMLTOPDF_VERSION="0.12.6.1";\ + fi; \ + WKHTMLTOPDF_URL="https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}-2/wkhtmltox_${WKHTMLTOPDF_VERSION}-2.bullseye_${TARGETARCH}.deb" \ + WKHTMLTOPDF_CHECKSUM=$WKHTMLTOPDF_ARM64_CHECKSUM; \ + elif [ "$TARGETARCH" = "amd64" ]; then \ + WKHTMLTOPDF_URL="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}-1.buster_${TARGETARCH}.deb" \ + WKHTMLTOPDF_CHECKSUM=$WKHTMLTOPDF_AMD64_CHECKSUM; \ + else \ + echo "Unsupported architecture: $TARGETARCH" >&2; \ + exit 1; \ + fi \ + && curl -SLo wkhtmltox.deb ${WKHTMLTOPDF_URL} \ + && echo "Downloading wkhtmltopdf from: ${WKHTMLTOPDF_URL}" \ + && echo "Expected wkhtmltox checksum: ${WKHTMLTOPDF_CHECKSUM}" \ + && echo "Computed wkhtmltox checksum: $(sha256sum wkhtmltox.deb | awk '{ print $1 }')" \ && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ && apt-get install -yqq --no-install-recommends \ ./wkhtmltox.deb \ @@ -55,9 +74,9 @@ RUN apt-get -qq update \ && echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ - && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ - && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ - && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ + && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ + && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ && apt-get autopurge -yqq \ && rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \ && sync @@ -116,8 +135,14 @@ RUN build_deps=" \ " \ && apt-get update \ && apt-get install -yqq --no-install-recommends $build_deps \ - && pip install \ - -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + && \ + if [ "$TARGETARCH" = "arm64" ]; then \ + echo "Upgrading odoo requirements.txt with gevent==21.12.0 and greenlet==1.1.0 (minimum versions compatible with arm64)" && \ + sed -i 's/gevent==[0-9\.]*/gevent==21.12.0/' requirements.txt && \ + sed -i 's/greenlet==[0-9\.]*/greenlet==1.1.0/' requirements.txt; \ + fi \ + && pip install -r requirements.txt \ 'websocket-client~=0.56' \ astor \ click-odoo-contrib \ diff --git a/16.0.Dockerfile b/16.0.Dockerfile index b41dbc3b..6ec59ab2 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -2,13 +2,17 @@ FROM python:3.10-slim-bookworm AS base EXPOSE 8069 8072 -ARG GEOIP_UPDATER_VERSION=4.3.0 +ARG TARGETARCH +ARG GEOIP_UPDATER_VERSION=6.0.0 ARG WKHTMLTOPDF_VERSION=0.12.6.1 -ARG WKHTMLTOPDF_CHECKSUM='98ba0d157b50d36f23bd0dedf4c0aa28c7b0c50fcdcdc54aa5b6bbba81a3941d' +ARG WKHTMLTOPDF_AMD64_CHECKSUM='98ba0d157b50d36f23bd0dedf4c0aa28c7b0c50fcdcdc54aa5b6bbba81a3941d' +ARG WKHTMLTOPDF_ARM64_CHECKSUM="b6606157b27c13e044d0abbe670301f88de4e1782afca4f9c06a5817f3e03a9c" +ARG WKHTMLTOPDF_URL="https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}-3/wkhtmltox_${WKHTMLTOPDF_VERSION}-3.bookworm_${TARGETARCH}.deb" ARG LAST_SYSTEM_UID=499 ARG LAST_SYSTEM_GID=499 ARG FIRST_UID=500 ARG FIRST_GID=500 + ENV DB_FILTER=.* \ DEPTH_DEFAULT=1 \ DEPTH_MERGE=100 \ @@ -35,16 +39,27 @@ ENV DB_FILTER=.* \ WDB_WEB_PORT=1984 \ WDB_WEB_SERVER=localhost + # Other requirements and recommendations # See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control RUN echo "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFIRST_UID=$FIRST_UID\nFIRST_GID=$FIRST_GID" >> /etc/adduser.conf \ - && echo "SYS_UID_MAX $LAST_SYSTEM_UID\nSYS_GID_MAX $LAST_SYSTEM_GID" >> /etc/login.defs \ - && sed -i -E "s/^UID_MIN\s+[0-9]+.*/UID_MIN $FIRST_UID/;s/^GID_MIN\s+[0-9]+.*/GID_MIN $FIRST_GID/" /etc/login.defs \ + && echo "SYS_UID_MAX $LAST_SYSTEM_UID\nSYS_GID_MAX $LAST_SYSTEM_GID" >> /etc/login.defs \ + && sed -i -E "s/^UID_MIN\s+[0-9]+.*/UID_MIN $FIRST_UID/;s/^GID_MIN\s+[0-9]+.*/GID_MIN $FIRST_GID/" /etc/login.defs \ && useradd --system -u $LAST_SYSTEM_UID -s /usr/sbin/nologin -d / systemd-network \ && apt-get -qq update \ - && apt-get install -yqq --no-install-recommends \ - curl \ - && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}-3/wkhtmltox_${WKHTMLTOPDF_VERSION}-3.bookworm_amd64.deb \ + && apt-get install -yqq --no-install-recommends curl \ + && if [ "$TARGETARCH" = "arm64" ]; then \ + WKHTMLTOPDF_CHECKSUM=$WKHTMLTOPDF_ARM64_CHECKSUM; \ + elif [ "$TARGETARCH" = "amd64" ]; then \ + WKHTMLTOPDF_CHECKSUM=$WKHTMLTOPDF_AMD64_CHECKSUM; \ + else \ + echo "Unsupported architecture: $TARGETARCH" >&2; \ + exit 1; \ + fi \ + && curl -SLo wkhtmltox.deb ${WKHTMLTOPDF_URL} \ + && echo "Downloading wkhtmltopdf from: ${WKHTMLTOPDF_URL}" \ + && echo "Expected wkhtmltox checksum: ${WKHTMLTOPDF_CHECKSUM}" \ + && echo "Computed wkhtmltox checksum: $(sha256sum wkhtmltox.deb | awk '{ print $1 }')" \ && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ && apt-get install -yqq --no-install-recommends \ ./wkhtmltox.deb \ @@ -63,9 +78,9 @@ RUN echo "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFI RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ - && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ - && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ - && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ + && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ + && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ && apt-get autopurge -yqq \ && rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \ && sync @@ -124,8 +139,14 @@ RUN build_deps=" \ " \ && apt-get update \ && apt-get install -yqq --no-install-recommends $build_deps \ - && pip install \ - -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + && \ + if [ "$TARGETARCH" = "arm64" ]; then \ + echo "Upgrading odoo requirements.txt with gevent==21.12.0 and greenlet==1.1.0 (minimum version compatible with arm64)" && \ + sed -i 's/gevent==[0-9\.]*/gevent==21.12.0/' requirements.txt && \ + sed -i 's/greenlet==[0-9\.]*/greenlet==1.1.0/' requirements.txt; \ + fi \ + && pip install -r requirements.txt \ 'websocket-client~=0.56' \ astor \ click-odoo-contrib \ diff --git a/17.0.Dockerfile b/17.0.Dockerfile index 432cf503..94bec602 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -2,9 +2,12 @@ FROM python:3.10-slim-bookworm AS base EXPOSE 8069 8072 -ARG GEOIP_UPDATER_VERSION=4.3.0 +ARG TARGETARCH +ARG GEOIP_UPDATER_VERSION=6.0.0 ARG WKHTMLTOPDF_VERSION=0.12.6.1 -ARG WKHTMLTOPDF_CHECKSUM='98ba0d157b50d36f23bd0dedf4c0aa28c7b0c50fcdcdc54aa5b6bbba81a3941d' +ARG WKHTMLTOPDF_AMD64_CHECKSUM='98ba0d157b50d36f23bd0dedf4c0aa28c7b0c50fcdcdc54aa5b6bbba81a3941d' +ARG WKHTMLTOPDF_ARM64_CHECKSUM="b6606157b27c13e044d0abbe670301f88de4e1782afca4f9c06a5817f3e03a9c" +ARG WKHTMLTOPDF_URL="https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}-3/wkhtmltox_${WKHTMLTOPDF_VERSION}-3.bookworm_${TARGETARCH}.deb" ARG LAST_SYSTEM_UID=499 ARG LAST_SYSTEM_GID=499 ARG FIRST_UID=500 @@ -44,7 +47,18 @@ RUN echo -e "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\ && apt-get -qq update \ && apt-get install -yqq --no-install-recommends \ curl \ - && curl -SLo wkhtmltox.deb https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}-3/wkhtmltox_${WKHTMLTOPDF_VERSION}-3.bookworm_amd64.deb \ + && if [ "$TARGETARCH" = "arm64" ]; then \ + WKHTMLTOPDF_CHECKSUM=$WKHTMLTOPDF_ARM64_CHECKSUM; \ + elif [ "$TARGETARCH" = "amd64" ]; then \ + WKHTMLTOPDF_CHECKSUM=$WKHTMLTOPDF_AMD64_CHECKSUM; \ + else \ + echo "Unsupported architecture: $TARGETARCH" >&2; \ + exit 1; \ + fi \ + && curl -SLo wkhtmltox.deb ${WKHTMLTOPDF_URL} \ + && echo "Downloading wkhtmltopdf from: ${WKHTMLTOPDF_URL}" \ + && echo "Expected wkhtmltox checksum: ${WKHTMLTOPDF_CHECKSUM}" \ + && echo "Computed wkhtmltox checksum: $(sha256sum wkhtmltox.deb | awk '{ print $1 }')" \ && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ && apt-get install -yqq --no-install-recommends \ ./wkhtmltox.deb \ @@ -63,9 +77,9 @@ RUN echo -e "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\ RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ - && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ - && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ - && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_amd64.deb \ + && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ + && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ + && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ && apt-get autopurge -yqq \ && rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \ && sync @@ -124,8 +138,13 @@ RUN build_deps=" \ " \ && apt-get update \ && apt-get install -yqq --no-install-recommends $build_deps \ - && pip install \ - -r https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + && \ + if [ "$TARGETARCH" = "arm64" ]; then \ + echo "Upgrading odoo requirements.txt with gevent==21.12.0 (minimum version compatible with arm64)" && \ + sed -i 's/gevent==[0-9\.]*/gevent==21.12.0/' requirements.txt; \ + fi \ + && pip install -r requirements.txt \ 'websocket-client~=0.56' \ astor \ click-odoo-contrib \ diff --git a/hooks/build b/hooks/build deleted file mode 100755 index 2fc238b3..00000000 --- a/hooks/build +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -from plumbum import FG, local - -REPO = local.env["DOCKER_REPO"] -VERSION = local.env["DOCKER_TAG"] -ROOT = local.path(__file__).up(2) -COMMIT = local.env.get("GIT_SHA1", local.env.get("TRAVIS_COMMIT", "")) - -# Shortcuts -build = local["time"]["docker", "image", "build"] -date = local["date"]["--rfc-3339", "ns"] -tag = local["docker"]["image", "tag"] - -# Build base and onbuild images -for target, suffix in (("base", ""), ("onbuild", "-onbuild")): - image_name = "%s:%s%s" % (REPO, VERSION, suffix) - ( - build[ - "--build-arg", - "VCS_REF=%s" % COMMIT, - "--build-arg", - "BUILD_DATE=%s" % date().strip(), - "--build-arg", - "ODOO_VERSION=%s" % VERSION, - "--tag", - image_name, - "--target", - target, - "--file", - "%s.Dockerfile" % VERSION, - ROOT, - ] - & FG - ) - - # Tag "latest" image if applicable - if VERSION == local.env.get("LATEST_RELEASE"): - tag[image_name, "%s:latest%s" % (REPO, suffix)] & FG diff --git a/hooks/push b/hooks/push deleted file mode 100755 index d71bc724..00000000 --- a/hooks/push +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -from plumbum import FG, local -from plumbum.cmd import docker # noqa pylint: disable=import-error - -REGISTRY = local.env["REGISTRY_HOST"] -REPO = local.env["DOCKER_REPO"] -REPO_SUFFIX = local.env.get("DOCKER_REPO_SUFFIX", "") -VERSION = local.env["DOCKER_TAG"] - -# Log all locally available images; will help to pin images -docker["image", "ls", "--digests", REPO] & FG - -# Login in Docker Hub -docker( - "login", - "--username", - local.env["REGISTRY_USERNAME"], - "--password", - local.env["REGISTRY_PASSWORD"], - REGISTRY, -) - -# Push built images -for suffix in ("", "-onbuild"): - # Prefix images with registry - local_tag = f"{REPO}:{VERSION}{suffix}" - public_tag = f"{REGISTRY}/{REPO}{REPO_SUFFIX}:{VERSION}{suffix}" - docker["image", "tag", local_tag, public_tag] & FG - # Push to registry - docker["image", "push", public_tag] & FG - if VERSION == local.env.get("LATEST_RELEASE"): - public_latest_tag = f"{REGISTRY}/{REPO}{REPO_SUFFIX}:latest{suffix}" - docker["image", "tag", local_tag, public_latest_tag] & FG - docker["image", "push", public_latest_tag] & FG From 6233a7fad4571ac08e2f8fc04ca8461a91e9133b Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Tue, 5 Mar 2024 11:16:43 +0100 Subject: [PATCH 213/255] [IMP] tests: add test for screencast and verify artifacts are stored --- tests/__init__.py | 41 +++++++++++++++++++ tests/scaffoldings/test_artifacts/Dockerfile | 2 + .../test_artifacts/custom/src/addons.yaml | 0 .../test_artifacts/docker-compose.yaml | 33 +++++++++++++++ .../test_artifacts/test-artifacts/.gitkeep | 0 5 files changed, 76 insertions(+) create mode 100644 tests/scaffoldings/test_artifacts/Dockerfile create mode 100644 tests/scaffoldings/test_artifacts/custom/src/addons.yaml create mode 100644 tests/scaffoldings/test_artifacts/docker-compose.yaml create mode 100644 tests/scaffoldings/test_artifacts/test-artifacts/.gitkeep diff --git a/tests/__init__.py b/tests/__init__.py index 684288ea..3b90f172 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -769,6 +769,47 @@ def test_entrypoint_python(self): ), ) + def test_screencasts(self): + test_artifacts_dir = join(SCAFFOLDINGS_DIR, "test_artifacts") + for sub_env in matrix(odoo_skip={"11.0", "12.0", "13.0", "14.0"}): + self.compose_test( + test_artifacts_dir, + dict(sub_env, UID=str(os.getuid()), GID=str(os.getgid())), + # remove artifacts from previous tests + ( + "find", + "/opt/odoo/auto/test-artifacts", + "-type", + "f", + "-exec", + "rm", + "-v", + "{}", + ";", + ), + # install odoo base module + ( + "odoo", + "-i", + "base", + "--stop-after-init", + ), + # run odoo test for screencast + ( + "odoo", + "--test-tags", + ".test_screencasts", + "--stop-after-init", + ), + # verify screencast is saved in container + ( + "grep", + "-Rl", + ".", + "/opt/odoo/auto/test-artifacts", + ), + ) + if __name__ == "__main__": unittest.main() diff --git a/tests/scaffoldings/test_artifacts/Dockerfile b/tests/scaffoldings/test_artifacts/Dockerfile new file mode 100644 index 00000000..4916c47a --- /dev/null +++ b/tests/scaffoldings/test_artifacts/Dockerfile @@ -0,0 +1,2 @@ +ARG ODOO_VERSION +FROM tecnativa/doodba:${ODOO_VERSION}-onbuild diff --git a/tests/scaffoldings/test_artifacts/custom/src/addons.yaml b/tests/scaffoldings/test_artifacts/custom/src/addons.yaml new file mode 100644 index 00000000..e69de29b diff --git a/tests/scaffoldings/test_artifacts/docker-compose.yaml b/tests/scaffoldings/test_artifacts/docker-compose.yaml new file mode 100644 index 00000000..f228b913 --- /dev/null +++ b/tests/scaffoldings/test_artifacts/docker-compose.yaml @@ -0,0 +1,33 @@ +version: "2.1" +services: + odoo: + build: + context: ./ + args: + COMPILE: "false" + ODOO_VERSION: $ODOO_MINOR + WITHOUT_DEMO: "false" + # enable creating test artifact directories with correct permissions + UID: "${UID:-1000}" + GID: "${GID:-1000}" + tty: true + depends_on: + - db + environment: + PYTHONOPTIMIZE: "" + UNACCENT: "false" + volumes: + - filestore:/var/lib/odoo:z + - ./test-artifacts:/opt/odoo/auto/test-artifacts:z + + db: + image: postgres:${DB_VERSION}-alpine + environment: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoopassword + volumes: + - db:/var/lib/postgresql/data:z + +volumes: + db: + filestore: diff --git a/tests/scaffoldings/test_artifacts/test-artifacts/.gitkeep b/tests/scaffoldings/test_artifacts/test-artifacts/.gitkeep new file mode 100644 index 00000000..e69de29b From 8caf28e00c9983adf89c75d84e69875c6525f2ee Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Tue, 5 Mar 2024 10:42:45 +0100 Subject: [PATCH 214/255] [FIX] geoip: fix config for 17.0 --- conf.d/60-geoip.conf | 4 ++++ entrypoint.d/45-geoip | 3 ++- tests/__init__.py | 27 +++++++++++++++++++++------ 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/conf.d/60-geoip.conf b/conf.d/60-geoip.conf index 1665f2c0..4ff56817 100644 --- a/conf.d/60-geoip.conf +++ b/conf.d/60-geoip.conf @@ -1,2 +1,6 @@ [options] +; Used before v17 geoip_database = /opt/odoo/auto/geoip/GeoLite2-City.mmdb +; Used in v17+ +geoip_city_db = /opt/odoo/auto/geoip/GeoLite2-City.mmdb +geoip_country_db = /opt/odoo/auto/geoip/GeoLite2-Country.mmdb diff --git a/entrypoint.d/45-geoip b/entrypoint.d/45-geoip index 85df2a9e..4035e27a 100755 --- a/entrypoint.d/45-geoip +++ b/entrypoint.d/45-geoip @@ -19,7 +19,7 @@ if GEOIP_ACCOUNT_ID not in {"", "0"} and GEOIP_LICENSE_KEY not in {"", "0"}: "available from https://www.maxmind.com" ) - # In devel mode, copy geoip conf to an inspectable dir if the do not exist yet and keep them up to date + # copy geoip conf to an inspectable dir (devel mode) if they do not exist yet and keep them up to date os.makedirs("/opt/odoo/auto/geoip/", exist_ok=True) if not os.path.exists("/opt/odoo/auto/geoip/GeoIP.conf"): with open("/etc/GeoIP.conf.orig") as fpr, open( @@ -27,6 +27,7 @@ if GEOIP_ACCOUNT_ID not in {"", "0"} and GEOIP_LICENSE_KEY not in {"", "0"}: ) as fpw: for line in fpr.readlines(): if "DatabaseDirectory " in line: + # save databases in /opt/odoo/auto/geoip/ line = "DatabaseDirectory /opt/odoo/auto/geoip/" fpw.write(line) diff --git a/tests/__init__.py b/tests/__init__.py index 684288ea..40b6a305 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -587,6 +587,26 @@ def test_geoip(self): join(SCAFFOLDINGS_DIR, "geoip_devel"), ): for sub_env in matrix(): + if float(sub_env.get("ODOO_MINOR")) < 17.0: + # in Odoo versions lower than 17.0 we have only one GeoIP database config parameter + expected_geoip_config_lines = ( + "geoip_database = /opt/odoo/auto/geoip/GeoLite2-City.mmdb", + ) + else: + # starting with Odoo 17.0 we expect GeoIP city db and country db to be configured + expected_geoip_config_lines = ( + "geoip_city_db = /opt/odoo/auto/geoip/GeoLite2-City.mmdb", + "geoip_country_db = /opt/odoo/auto/geoip/GeoLite2-Country.mmdb", + ) + test_config_lines = ( + ( + "grep", + "-R", + line, + "/opt/odoo/auto/odoo.conf", + ) + for line in expected_geoip_config_lines + ) self.compose_test( geoip_dir, dict( @@ -610,12 +630,7 @@ def test_geoip(self): " test -e /opt/odoo/auto/geoip/GeoLite2-City.mmdb", ), # verify that geoip database is configured - ( - "grep", - "-R", - "geoip_database = /opt/odoo/auto/geoip/GeoLite2-City.mmdb", - "/opt/odoo/auto/odoo.conf", - ), + *test_config_lines, ) def test_postgres_client_version(self): From da0d3e51b2c85b9253801df688e9a1150bba35c4 Mon Sep 17 00:00:00 2001 From: Paul Catinean Date: Wed, 20 Mar 2024 14:18:58 +0200 Subject: [PATCH 215/255] [FIX] Fix docker image tags and ghcr.io auth credentials --- .github/workflows/ci.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8be83136..bd47fd46 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -121,8 +121,8 @@ jobs: uses: docker/login-action@v3 with: registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ secrets.BOT_LOGIN }} + password: ${{ secrets.BOT_TOKEN }} - name: Build and push uses: docker/build-push-action@v5 with: @@ -133,12 +133,14 @@ jobs: ${{ github.repository == 'tecnativa/doodba' && github.ref == 'refs/heads/master' }} tags: | - ${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}onbuild + ${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }} ${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}-onbuild ${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }} ${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }}-onbuild ${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}:latest', env.DOCKER_REPO) || '' }} + ${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}:latest-onbuild', env.DOCKER_REPO) || '' }} ${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}/{1}{2}:latest', env.GHCR_HOST, env.DOCKER_REPO, env.DOCKER_REPO_SUFFIX) || '' }} + ${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}/{1}{2}:latest-onbuild', env.GHCR_HOST, env.DOCKER_REPO, env.DOCKER_REPO_SUFFIX) || '' }} build-args: | VCS_REF=${{ github.sha }} BUILD_DATE=${{ env.BUILD_DATE }} From 61fa5d5c07a6e5dd17a28a93ff15d7934381d76e Mon Sep 17 00:00:00 2001 From: Paul Catinean Date: Wed, 27 Mar 2024 19:49:50 +0200 Subject: [PATCH 216/255] [FIX] Separate base and onbuild image steps and tags --- .github/workflows/ci.yaml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bd47fd46..de9f5aa8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -123,7 +123,7 @@ jobs: registry: ghcr.io username: ${{ secrets.BOT_LOGIN }} password: ${{ secrets.BOT_TOKEN }} - - name: Build and push + - name: Build base image uses: docker/build-push-action@v5 with: context: . @@ -134,13 +134,29 @@ jobs: 'refs/heads/master' }} tags: | ${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }} - ${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}-onbuild ${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }} - ${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }}-onbuild ${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}:latest', env.DOCKER_REPO) || '' }} - ${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}:latest-onbuild', env.DOCKER_REPO) || '' }} ${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}/{1}{2}:latest', env.GHCR_HOST, env.DOCKER_REPO, env.DOCKER_REPO_SUFFIX) || '' }} + target: base + build-args: | + VCS_REF=${{ github.sha }} + BUILD_DATE=${{ env.BUILD_DATE }} + ODOO_VERSION=${{ matrix.odoo_version }} + - name: Build onbuild image + uses: docker/build-push-action@v5 + with: + context: . + file: ./${{ matrix.odoo_version }}.Dockerfile + platforms: ${{ matrix.platforms }} + push: + ${{ github.repository == 'tecnativa/doodba' && github.ref == + 'refs/heads/master' }} + tags: | + ${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}-onbuild + ${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }}-onbuild + ${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}:latest-onbuild', env.DOCKER_REPO) || '' }} ${{ matrix.odoo_version == env.LATEST_RELEASE && format('{0}/{1}{2}:latest-onbuild', env.GHCR_HOST, env.DOCKER_REPO, env.DOCKER_REPO_SUFFIX) || '' }} + target: onbuild build-args: | VCS_REF=${{ github.sha }} BUILD_DATE=${{ env.BUILD_DATE }} From 2e68baa2ffc317a9adc24a423d2e5e1140c34acb Mon Sep 17 00:00:00 2001 From: Obay Abdelgadir Date: Thu, 2 May 2024 12:15:50 +0300 Subject: [PATCH 217/255] remove -e from echo inside Dockerfile --- 17.0.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/17.0.Dockerfile b/17.0.Dockerfile index 94bec602..f8b196a9 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -40,7 +40,7 @@ ENV DB_FILTER=.* \ # Other requirements and recommendations # See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control -RUN echo -e "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFIRST_UID=$FIRST_UID\nFIRST_GID=$FIRST_GID" >> /etc/adduser.conf \ +RUN echo "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFIRST_UID=$FIRST_UID\nFIRST_GID=$FIRST_GID" >> /etc/adduser.conf \ && echo "SYS_UID_MAX $LAST_SYSTEM_UID\nSYS_GID_MAX $LAST_SYSTEM_GID" >> /etc/login.defs \ && sed -i -E "s/^UID_MIN\s+[0-9]+.*/UID_MIN $FIRST_UID/;s/^GID_MIN\s+[0-9]+.*/GID_MIN $FIRST_GID/" /etc/login.defs \ && useradd --system -u $LAST_SYSTEM_UID -s /usr/sbin/nologin -d / systemd-network \ From 4a9a0db7504e05de386147da4ebdd189c99dd8d4 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Fri, 27 Sep 2024 13:55:29 +0200 Subject: [PATCH 218/255] [FIX] Mark /tmp/fake-odoo as safe --- .../scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo b/tests/scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo index 85995f55..c81c6d2a 100755 --- a/tests/scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo +++ b/tests/scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo @@ -4,6 +4,7 @@ mkdir /tmp/fake-odoo cd /tmp/fake-odoo git init +git config --system --add safe.directory /tmp/fake-odoo/.git touch odoo-bin git add odoo-bin git commit -m odoo-bin From 92b617470ab1bb64aa0d1fc3253dfcb7ad6534ba Mon Sep 17 00:00:00 2001 From: Pablo Esteban Date: Fri, 27 Sep 2024 10:30:37 +0200 Subject: [PATCH 219/255] [FIX] {13.0,14.0}.Dockerfile: use the apt-archive postgres repository in versions using buster --- 13.0.Dockerfile | 2 +- 14.0.Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/13.0.Dockerfile b/13.0.Dockerfile index f58243de..7f4e0ef1 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -56,7 +56,7 @@ RUN apt-get -qq update \ telnet \ vim \ zlibc \ - && echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + && echo 'deb https://apt-archive.postgresql.org/pub/repos/apt buster-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ && apt-get install -yqq --no-install-recommends \ diff --git a/14.0.Dockerfile b/14.0.Dockerfile index 51e31e52..77fcdbad 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -72,7 +72,7 @@ RUN apt-get -qq update \ telnet \ vim \ zlibc \ - && echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + && echo 'deb https://apt-archive.postgresql.org/pub/repos/apt buster-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ From df7fbe1211f6525b314af7a057939acc9ba4cbd5 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Sat, 14 Sep 2024 15:51:22 +0200 Subject: [PATCH 220/255] [FIX] 20-postgres-wait: avoid assuming you have permission to list database --- entrypoint.d/20-postgres-wait | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/entrypoint.d/20-postgres-wait b/entrypoint.d/20-postgres-wait index 55ee402b..cca4d52d 100755 --- a/entrypoint.d/20-postgres-wait +++ b/entrypoint.d/20-postgres-wait @@ -6,6 +6,16 @@ fi log INFO Waiting until postgres is listening at $PGHOST... while true; do - psql --list > /dev/null 2>&1 && break + # If your postgres connection has minimal permissions, you should + # have at least an empty PGDATABASE and rights on this + # databases. The following will then succeed: + [ -n "$PGDATABASE" ] && echo "SELECT 1;" | psql "$PGDATABASE" > /dev/null 2>&1 && break + + # if previous check failed (if PGDATABASE is set, but not yet + # created), you are in a more common scenario where odoo is + # expected to manage databases, and it should have the permissions + # to create it and will attempt to do it. In that case, you'll + # probably also have the permissions to list the databases. + psql -l > /dev/null 2>&1 && break sleep 1 done From b06b34d853f867afa685662aa1bd5438ea2ec7f9 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 1 Oct 2024 16:28:29 +0200 Subject: [PATCH 221/255] [ADD] Odoo 18.0 --- .github/workflows/ci.yaml | 14 +- .vscode/settings.json | 3 +- 18.0.Dockerfile | 260 ++++++++++++++++++++++++++++++++++++++ tests/__init__.py | 4 +- 4 files changed, 274 insertions(+), 7 deletions(-) create mode 100644 18.0.Dockerfile diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index de9f5aa8..5687759f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,11 +35,14 @@ jobs: fail-fast: false matrix: # Test modern Odoo versions with latest Postgres version - odoo_version: ["17.0"] - pg_version: ["15"] + odoo_version: ["18.0"] + pg_version: ["16"] python_version: ["3.10"] include: # Older odoo versions don't support latest postgres and Python versions + - odoo_version: "17.0" + pg_version: "15" + python_version: "3.10" - odoo_version: "16.0" pg_version: "14" python_version: "3.10" @@ -56,6 +59,7 @@ jobs: # Other variables to configure tests and execution environment DOCKER_BUILDKIT: 1 PG_VERSIONS: ${{ matrix.pg_version }} + ODOO_MINOR: ${{ matrix.odoo_version }} steps: # Prepare - uses: actions/checkout@v4 @@ -80,10 +84,12 @@ jobs: fail-fast: false matrix: # Test modern Odoo versions with latest Postgres version - odoo_version: ["17.0"] + odoo_version: ["18.0"] platforms: ["linux/amd64,linux/arm64"] include: # Older odoo versions don't support latest postgres and Python versions + - odoo_version: "17.0" + platforms: "linux/amd64,linux/arm64" - odoo_version: "16.0" platforms: "linux/amd64,linux/arm64" - odoo_version: "15.0" @@ -94,7 +100,7 @@ jobs: platforms: "linux/amd64" env: # Indicates what's the equivalent to tecnativa/doodba:latest image - LATEST_RELEASE: "17.0" + LATEST_RELEASE: "18.0" # Define the docker hub repository location and github container registry host DOCKER_REPO: tecnativa/doodba GHCR_HOST: ghcr.io diff --git a/.vscode/settings.json b/.vscode/settings.json index b031368d..5eb59ba3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,5 +12,6 @@ "[dockerfile]": { "editor.formatOnSave": false }, - "python.analysis.extraPaths": ["./lib", "./tests"] + "python.analysis.extraPaths": ["./lib", "./tests"], + "python.languageServer": "None" } diff --git a/18.0.Dockerfile b/18.0.Dockerfile new file mode 100644 index 00000000..9bce3d99 --- /dev/null +++ b/18.0.Dockerfile @@ -0,0 +1,260 @@ +FROM python:3.10-slim-bookworm AS base + +EXPOSE 8069 8072 + +ARG TARGETARCH +ARG GEOIP_UPDATER_VERSION=6.0.0 +ARG WKHTMLTOPDF_VERSION=0.12.6.1 +ARG WKHTMLTOPDF_AMD64_CHECKSUM='98ba0d157b50d36f23bd0dedf4c0aa28c7b0c50fcdcdc54aa5b6bbba81a3941d' +ARG WKHTMLTOPDF_ARM64_CHECKSUM="b6606157b27c13e044d0abbe670301f88de4e1782afca4f9c06a5817f3e03a9c" +ARG WKHTMLTOPDF_URL="https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}-3/wkhtmltox_${WKHTMLTOPDF_VERSION}-3.bookworm_${TARGETARCH}.deb" +ARG LAST_SYSTEM_UID=499 +ARG LAST_SYSTEM_GID=499 +ARG FIRST_UID=500 +ARG FIRST_GID=500 +ENV DB_FILTER=.* \ + DEPTH_DEFAULT=1 \ + DEPTH_MERGE=100 \ + EMAIL=https://hub.docker.com/r/tecnativa/odoo \ + GEOIP_ACCOUNT_ID="" \ + GEOIP_LICENSE_KEY="" \ + GIT_AUTHOR_NAME=docker-odoo \ + INITIAL_LANG="" \ + LC_ALL=C.UTF-8 \ + LIST_DB=false \ + NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \ + OPENERP_SERVER=/opt/odoo/auto/odoo.conf \ + PATH="/home/odoo/.local/bin:$PATH" \ + PIP_NO_CACHE_DIR=0 \ + DEBUGPY_ARGS="--listen 0.0.0.0:6899 --wait-for-client" \ + DEBUGPY_ENABLE=0 \ + PUDB_RDB_HOST=0.0.0.0 \ + PUDB_RDB_PORT=6899 \ + PYTHONOPTIMIZE="" \ + UNACCENT=true \ + WAIT_DB=true \ + WDB_NO_BROWSER_AUTO_OPEN=True \ + WDB_SOCKET_SERVER=wdb \ + WDB_WEB_PORT=1984 \ + WDB_WEB_SERVER=localhost + +# Other requirements and recommendations +# See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control +RUN echo "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFIRST_UID=$FIRST_UID\nFIRST_GID=$FIRST_GID" >> /etc/adduser.conf \ + && echo "SYS_UID_MAX $LAST_SYSTEM_UID\nSYS_GID_MAX $LAST_SYSTEM_GID" >> /etc/login.defs \ + && sed -i -E "s/^UID_MIN\s+[0-9]+.*/UID_MIN $FIRST_UID/;s/^GID_MIN\s+[0-9]+.*/GID_MIN $FIRST_GID/" /etc/login.defs \ + && useradd --system -u $LAST_SYSTEM_UID -s /usr/sbin/nologin -d / systemd-network \ + && apt-get -qq update \ + && apt-get install -yqq --no-install-recommends \ + curl \ + && if [ "$TARGETARCH" = "arm64" ]; then \ + WKHTMLTOPDF_CHECKSUM=$WKHTMLTOPDF_ARM64_CHECKSUM; \ + elif [ "$TARGETARCH" = "amd64" ]; then \ + WKHTMLTOPDF_CHECKSUM=$WKHTMLTOPDF_AMD64_CHECKSUM; \ + else \ + echo "Unsupported architecture: $TARGETARCH" >&2; \ + exit 1; \ + fi \ + && curl -SLo wkhtmltox.deb ${WKHTMLTOPDF_URL} \ + && echo "Downloading wkhtmltopdf from: ${WKHTMLTOPDF_URL}" \ + && echo "Expected wkhtmltox checksum: ${WKHTMLTOPDF_CHECKSUM}" \ + && echo "Computed wkhtmltox checksum: $(sha256sum wkhtmltox.deb | awk '{ print $1 }')" \ + && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ + && apt-get install -yqq --no-install-recommends \ + ./wkhtmltox.deb \ + chromium \ + ffmpeg \ + fonts-liberation2 \ + gettext \ + git \ + gnupg2 \ + locales-all \ + nano \ + npm \ + openssh-client \ + telnet \ + vim +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && apt-get update \ + && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ + && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ + && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ + && apt-get autopurge -yqq \ + && rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \ + && sync + +WORKDIR /opt/odoo +COPY bin/* /usr/local/bin/ +COPY lib/doodbalib /usr/local/lib/python3.10/site-packages/doodbalib +COPY build.d common/build.d +COPY conf.d common/conf.d +COPY entrypoint.d common/entrypoint.d +RUN mkdir -p auto/addons auto/geoip custom/src/private \ + && ln /usr/local/bin/direxec common/entrypoint \ + && ln /usr/local/bin/direxec common/build \ + && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ + && chmod -R a+rX /usr/local/lib/python3.10/site-packages/doodbalib \ + && cp -a /etc/GeoIP.conf /etc/GeoIP.conf.orig \ + && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ + && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ + && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ + && sync + +# Doodba-QA dependencies in a separate virtualenv +COPY qa /qa +RUN python -m venv --system-site-packages /qa/venv \ + && . /qa/venv/bin/activate \ + && pip install \ + click \ + coverage \ + && deactivate \ + && mkdir -p /qa/artifacts + +ARG ODOO_SOURCE=OCA/OCB +ARG ODOO_VERSION=18.0 +ENV ODOO_VERSION="$ODOO_VERSION" + +# Install Odoo hard & soft dependencies, and Doodba utilities +RUN build_deps=" \ + build-essential \ + libfreetype6-dev \ + libfribidi-dev \ + libghc-zlib-dev \ + libharfbuzz-dev \ + libjpeg-dev \ + liblcms2-dev \ + libldap2-dev \ + libopenjp2-7-dev \ + libpq-dev \ + libsasl2-dev \ + libtiff5-dev \ + libwebp-dev \ + libxml2-dev \ + libxslt-dev \ + tcl-dev \ + tk-dev \ + zlib1g-dev \ + " \ + && apt-get update \ + && apt-get install -yqq --no-install-recommends $build_deps \ + && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + && \ + if [ "$TARGETARCH" = "arm64" ]; then \ + echo "Upgrading odoo requirements.txt with gevent==21.12.0 (minimum version compatible with arm64)" && \ + sed -i 's/gevent==[0-9\.]*/gevent==21.12.0/' requirements.txt; \ + fi \ + && pip install -r requirements.txt \ + 'websocket-client~=0.56' \ + astor \ + click-odoo-contrib \ + debugpy \ + pydevd-odoo \ + git+https://github.com/mailgun/flanker.git@v0.9.15#egg=flanker[validator] \ + geoip2 \ + "git-aggregator==4.0" \ + inotify \ + pdfminer.six \ + pg_activity \ + phonenumbers \ + plumbum \ + pudb \ + pyOpenSSL \ + python-magic \ + watchdog \ + wdb \ + && (python3 -m compileall -q /usr/local/lib/python3.10/ || true) \ + # generate flanker cached tables during install when /usr/local/lib/ is still intended to be written to + # https://github.com/Tecnativa/doodba/issues/486 + && python3 -c 'from flanker.addresslib import address' >/dev/null 2>&1 \ + && apt-get purge -yqq $build_deps \ + && apt-get autopurge -yqq \ + && rm -Rf /var/lib/apt/lists/* /tmp/* + +# Metadata +ARG VCS_REF +ARG BUILD_DATE +ARG VERSION +LABEL org.label-schema.schema-version="$VERSION" \ + org.label-schema.vendor=Tecnativa \ + org.label-schema.license=Apache-2.0 \ + org.label-schema.build-date="$BUILD_DATE" \ + org.label-schema.vcs-ref="$VCS_REF" \ + org.label-schema.vcs-url="https://github.com/Tecnativa/doodba" + +# Onbuild version, with all the magic +FROM base AS onbuild + +# Enable setting custom uids for odoo user during build of scaffolds +ONBUILD ARG UID=1000 +ONBUILD ARG GID=1000 + +# Enable Odoo user and filestore +ONBUILD RUN groupadd -g $GID odoo -o \ + && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && sync + +# Subimage triggers +ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] +ONBUILD CMD ["/usr/local/bin/odoo"] +ONBUILD ARG AGGREGATE=true +ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" +ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" +ONBUILD ARG DEPTH_DEFAULT=1 +ONBUILD ARG DEPTH_MERGE=100 +ONBUILD ARG CLEAN=true +ONBUILD ARG COMPILE=true +ONBUILD ARG FONT_MONO="Liberation Mono" +ONBUILD ARG FONT_SANS="Liberation Sans" +ONBUILD ARG FONT_SERIF="Liberation Serif" +ONBUILD ARG PIP_INSTALL_ODOO=true +ONBUILD ARG ADMIN_PASSWORD=admin +ONBUILD ARG SMTP_SERVER=smtp +ONBUILD ARG SMTP_PORT=25 +ONBUILD ARG SMTP_USER=false +ONBUILD ARG SMTP_PASSWORD=false +ONBUILD ARG SMTP_SSL=false +ONBUILD ARG EMAIL_FROM="" +ONBUILD ARG PROXY_MODE=false +ONBUILD ARG WITHOUT_DEMO=all +ONBUILD ARG PGUSER=odoo +ONBUILD ARG PGPASSWORD=odoopassword +ONBUILD ARG PGHOST=db +ONBUILD ARG PGPORT=5432 +ONBUILD ARG PGDATABASE=prod + +# Config variables +ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ + DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \ + DEFAULT_REPO_PATTERN_ODOO="$DEFAULT_REPO_PATTERN_ODOO" \ + UNACCENT="$UNACCENT" \ + PGUSER="$PGUSER" \ + PGPASSWORD="$PGPASSWORD" \ + PGHOST="$PGHOST" \ + PGPORT=$PGPORT \ + PGDATABASE="$PGDATABASE" \ + PROXY_MODE="$PROXY_MODE" \ + SMTP_SERVER="$SMTP_SERVER" \ + SMTP_PORT=$SMTP_PORT \ + SMTP_USER="$SMTP_USER" \ + SMTP_PASSWORD="$SMTP_PASSWORD" \ + SMTP_SSL="$SMTP_SSL" \ + EMAIL_FROM="$EMAIL_FROM" \ + WITHOUT_DEMO="$WITHOUT_DEMO" +ONBUILD ARG LOCAL_CUSTOM_DIR=./custom +ONBUILD COPY --chown=root:odoo $LOCAL_CUSTOM_DIR /opt/odoo/custom + +# https://docs.python.org/3/library/logging.html#levels +ONBUILD ARG LOG_LEVEL=INFO +ONBUILD RUN [ -d ~root/.ssh ] && rm -r ~root/.ssh; \ + mkdir -p /opt/odoo/custom/ssh \ + && ln -s /opt/odoo/custom/ssh ~root/.ssh \ + && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ + && sync +ONBUILD ARG DB_VERSION=latest +ONBUILD RUN /opt/odoo/common/build && sync +ONBUILD VOLUME ["/var/lib/odoo"] +ONBUILD USER odoo diff --git a/tests/__init__.py b/tests/__init__.py index 5f4bd287..1458f4c0 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -16,8 +16,8 @@ DIR = dirname(__file__) ODOO_PREFIX = ("odoo", "--stop-after-init", "--workers=0") -ODOO_VERSIONS = frozenset(environ.get("DOCKER_TAG", "17.0").split()) -PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "15").split()) +ODOO_VERSIONS = frozenset(environ.get("DOCKER_TAG", "18.0").split()) +PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "16").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") GEIOP_CREDENTIALS_PROVIDED = environ.get("GEOIP_LICENSE_KEY", False) and environ.get( "GEOIP_ACCOUNT_ID", False From 583898e3198bb758049d3f29bb429eb6c5f64f68 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Mon, 7 Oct 2024 12:15:26 +0200 Subject: [PATCH 222/255] [FIX] CI Error, using always last image --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5687759f..3648a75a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,6 +60,7 @@ jobs: DOCKER_BUILDKIT: 1 PG_VERSIONS: ${{ matrix.pg_version }} ODOO_MINOR: ${{ matrix.odoo_version }} + DOCKER_TAG: ${{ matrix.odoo_version }} steps: # Prepare - uses: actions/checkout@v4 From ec63e8cce1a0ab6b6841d237a018bf699f2a4e59 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 8 Oct 2024 08:03:02 +0200 Subject: [PATCH 223/255] [FIX] Not testing Doodba 18.0 to be able to push image --- .github/workflows/ci.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3648a75a..5e2a6fa1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,14 +35,11 @@ jobs: fail-fast: false matrix: # Test modern Odoo versions with latest Postgres version - odoo_version: ["18.0"] - pg_version: ["16"] + odoo_version: ["17.0"] + pg_version: ["15"] python_version: ["3.10"] include: # Older odoo versions don't support latest postgres and Python versions - - odoo_version: "17.0" - pg_version: "15" - python_version: "3.10" - odoo_version: "16.0" pg_version: "14" python_version: "3.10" From cb5226569288dc3db5f61a3a567c1802e98be256 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 8 Oct 2024 11:23:39 +0200 Subject: [PATCH 224/255] [ADD] Odoo 18.0 pg 16 test --- .github/workflows/ci.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5e2a6fa1..3648a75a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,11 +35,14 @@ jobs: fail-fast: false matrix: # Test modern Odoo versions with latest Postgres version - odoo_version: ["17.0"] - pg_version: ["15"] + odoo_version: ["18.0"] + pg_version: ["16"] python_version: ["3.10"] include: # Older odoo versions don't support latest postgres and Python versions + - odoo_version: "17.0" + pg_version: "15" + python_version: "3.10" - odoo_version: "16.0" pg_version: "14" python_version: "3.10" From 3b208bc8d66ef2b49963625fdac76603003e777a Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 8 Oct 2024 11:26:39 +0200 Subject: [PATCH 225/255] [FIX] Skip some unnecessary tests - Skip openupgrade test since it is not ready on 18.0 - Skip base_search_fuzzy test since it is not ready on 18.0 - Run correct tests based on Odoo version --- tests/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 1458f4c0..0cfcff66 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -197,7 +197,7 @@ def _check_addons(self, scaffolding_dir, odoo_skip): def test_addons_filtered_lt_16(self): """Test addons filtering with ``ONLY`` keyword in ``addons.yaml`` for versions < 16""" - self._check_addons("dotd", {"16.0", "17.0"}) + self._check_addons("dotd", {"16.0", "17.0", "18.0"}) def test_addons_filtered_ge_16(self): """Test addons filtering with ``ONLY`` keyword in ``addons.yaml`` for versions >= 16""" @@ -335,7 +335,7 @@ def test_addons_env(self): ("test", "-e", "auto/addons/crm"), ("test", "-d", "auto/addons/crm/migrations"), ) - for sub_env in matrix(odoo_skip={"11.0", "12.0", "13.0", "17.0"}): + for sub_env in matrix(odoo_skip={"11.0", "12.0", "13.0", "18.0"}): self.compose_test( join(SCAFFOLDINGS_DIR, "addons_env_ou"), sub_env, @@ -416,7 +416,7 @@ def _check_dotd(self, scaffolding_dir, odoo_skip): def test_dotd_lt_16(self): """Test environment with common ``*.d`` directories for versions < 16.""" - self._check_dotd("dotd", {"16.0", "17.0"}) + self._check_dotd("dotd", {"16.0", "17.0", "18.0"}) def test_dotd_ge_16(self): """Test environment with common ``*.d`` directories for versions >= 16.""" @@ -468,7 +468,7 @@ def _check_dependencies(self, scaffolding_dir, odoo_skip): def test_dependencies_lt_16(self): """Test dependencies installation for versions < 16""" - self._check_dependencies("dependencies", {"16.0", "17.0"}) + self._check_dependencies("dependencies", {"16.0", "17.0", "18.0"}) def test_dependencies_ge_16(self): """Test dependencies installation for versions >= 16""" @@ -481,7 +481,7 @@ def test_dependencies_ge_16(self): def test_dependencies_base_search_fuzzy(self): """Test dependencies installation.""" dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies_base_search_fuzzy") - for sub_env in matrix(odoo_skip={"17.0"}): + for sub_env in matrix(odoo_skip={"17.0", "18.0"}): self.compose_test( dependencies_dir, sub_env, From fe2f6fc575e9b2cd74791ddff580eb250b750d49 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 8 Oct 2024 13:03:21 +0200 Subject: [PATCH 226/255] [IMP] Cleanup before and after build --- .github/workflows/ci.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3648a75a..ea56d3a1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -106,6 +106,10 @@ jobs: DOCKER_REPO: tecnativa/doodba GHCR_HOST: ghcr.io steps: + - name: Clean Docker system before build + run: | + docker system prune -af || true + docker builder prune -af || true # Set build date as env variable to be used later - name: Set build date run: echo "BUILD_DATE=$(date '+%Y-%m-%dT%H:%M:%S.%N%:z')" >> $GITHUB_ENV @@ -168,3 +172,7 @@ jobs: VCS_REF=${{ github.sha }} BUILD_DATE=${{ env.BUILD_DATE }} ODOO_VERSION=${{ matrix.odoo_version }} + - name: Clean Docker system after build + run: | + docker system prune -af || true + docker builder prune -af || true From dc605f60bd48cb0c618b229a1e9ef35899c728b2 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Mon, 14 Oct 2024 10:03:24 +0200 Subject: [PATCH 227/255] [ADD] GeoIP version handling to avoid warnings --- 11.0.Dockerfile | 2 ++ 12.0.Dockerfile | 2 ++ 13.0.Dockerfile | 2 ++ 14.0.Dockerfile | 2 ++ 15.0.Dockerfile | 2 ++ 16.0.Dockerfile | 2 ++ 17.0.Dockerfile | 2 ++ 18.0.Dockerfile | 2 ++ conf.d/{60-geoip.conf => 60-geoip-ge17.conf} | 3 --- conf.d/60-geoip-lt17.conf | 2 ++ 10 files changed, 18 insertions(+), 3 deletions(-) rename conf.d/{60-geoip.conf => 60-geoip-ge17.conf} (58%) create mode 100644 conf.d/60-geoip-lt17.conf diff --git a/11.0.Dockerfile b/11.0.Dockerfile index 5347bd58..b1b01acb 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -107,6 +107,8 @@ RUN ln -s /usr/local/lib/python3.5/site-packages/doodbalib \ COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d +RUN rm -f /opt/odoo/common/conf.d/60-geoip-ge17.conf \ + && mv /opt/odoo/common/conf.d/60-geoip-lt17.conf /opt/odoo/common/conf.d/60-geoip.conf RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 2bf063ba..b3e3f731 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -100,6 +100,8 @@ COPY lib/doodbalib /usr/local/lib/python3.5/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d +RUN rm -f /opt/odoo/common/conf.d/60-geoip-ge17.conf \ + && mv /opt/odoo/common/conf.d/60-geoip-lt17.conf /opt/odoo/common/conf.d/60-geoip.conf RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ diff --git a/13.0.Dockerfile b/13.0.Dockerfile index 7f4e0ef1..f8846cf4 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -73,6 +73,8 @@ COPY lib/doodbalib /usr/local/lib/python3.6/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d +RUN rm -f /opt/odoo/common/conf.d/60-geoip-ge17.conf \ + && mv /opt/odoo/common/conf.d/60-geoip-lt17.conf /opt/odoo/common/conf.d/60-geoip.conf RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ diff --git a/14.0.Dockerfile b/14.0.Dockerfile index 77fcdbad..b7b254e1 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -88,6 +88,8 @@ COPY lib/doodbalib /usr/local/lib/python3.8/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d +RUN rm -f /opt/odoo/common/conf.d/60-geoip-ge17.conf \ + && mv /opt/odoo/common/conf.d/60-geoip-lt17.conf /opt/odoo/common/conf.d/60-geoip.conf RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ diff --git a/15.0.Dockerfile b/15.0.Dockerfile index 1bb05d65..b6e83b88 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -87,6 +87,8 @@ COPY lib/doodbalib /usr/local/lib/python3.8/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d +RUN rm -f /opt/odoo/common/conf.d/60-geoip-ge17.conf \ + && mv /opt/odoo/common/conf.d/60-geoip-lt17.conf /opt/odoo/common/conf.d/60-geoip.conf RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ diff --git a/16.0.Dockerfile b/16.0.Dockerfile index 6ec59ab2..201b35fe 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -91,6 +91,8 @@ COPY lib/doodbalib /usr/local/lib/python3.10/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d +RUN rm -f /opt/odoo/common/conf.d/60-geoip-ge17.conf \ + && mv /opt/odoo/common/conf.d/60-geoip-lt17.conf /opt/odoo/common/conf.d/60-geoip.conf RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ diff --git a/17.0.Dockerfile b/17.0.Dockerfile index f8b196a9..bcb42ab3 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -90,6 +90,8 @@ COPY lib/doodbalib /usr/local/lib/python3.10/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d +RUN rm -f /opt/odoo/common/conf.d/60-geoip-lt17.conf \ + && mv /opt/odoo/common/conf.d/60-geoip-ge17.conf /opt/odoo/common/conf.d/60-geoip.conf RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ diff --git a/18.0.Dockerfile b/18.0.Dockerfile index 9bce3d99..f2e71f23 100644 --- a/18.0.Dockerfile +++ b/18.0.Dockerfile @@ -90,6 +90,8 @@ COPY lib/doodbalib /usr/local/lib/python3.10/site-packages/doodbalib COPY build.d common/build.d COPY conf.d common/conf.d COPY entrypoint.d common/entrypoint.d +RUN rm -f /opt/odoo/common/conf.d/60-geoip-lt17.conf \ + && mv /opt/odoo/common/conf.d/60-geoip-ge17.conf /opt/odoo/common/conf.d/60-geoip.conf RUN mkdir -p auto/addons auto/geoip custom/src/private \ && ln /usr/local/bin/direxec common/entrypoint \ && ln /usr/local/bin/direxec common/build \ diff --git a/conf.d/60-geoip.conf b/conf.d/60-geoip-ge17.conf similarity index 58% rename from conf.d/60-geoip.conf rename to conf.d/60-geoip-ge17.conf index 4ff56817..c624c604 100644 --- a/conf.d/60-geoip.conf +++ b/conf.d/60-geoip-ge17.conf @@ -1,6 +1,3 @@ [options] -; Used before v17 -geoip_database = /opt/odoo/auto/geoip/GeoLite2-City.mmdb -; Used in v17+ geoip_city_db = /opt/odoo/auto/geoip/GeoLite2-City.mmdb geoip_country_db = /opt/odoo/auto/geoip/GeoLite2-Country.mmdb diff --git a/conf.d/60-geoip-lt17.conf b/conf.d/60-geoip-lt17.conf new file mode 100644 index 00000000..1665f2c0 --- /dev/null +++ b/conf.d/60-geoip-lt17.conf @@ -0,0 +1,2 @@ +[options] +geoip_database = /opt/odoo/auto/geoip/GeoLite2-City.mmdb From 355d63fb66113d8671ca7246873b7fe7c47d9178 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 11 Nov 2024 08:48:25 +0100 Subject: [PATCH 228/255] [IMP] 16,17,18: use gevent 22.10.2 pip install gevent==21.8.0 fails with exception when installing with pip in ubuntu/debian. gevent 22.10.2 then also requires greenlet 2.0.2 --- 16.0.Dockerfile | 8 ++------ 17.0.Dockerfile | 7 ++----- 18.0.Dockerfile | 7 ++----- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/16.0.Dockerfile b/16.0.Dockerfile index 201b35fe..92a95f9b 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -142,12 +142,8 @@ RUN build_deps=" \ && apt-get update \ && apt-get install -yqq --no-install-recommends $build_deps \ && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ - && \ - if [ "$TARGETARCH" = "arm64" ]; then \ - echo "Upgrading odoo requirements.txt with gevent==21.12.0 and greenlet==1.1.0 (minimum version compatible with arm64)" && \ - sed -i 's/gevent==[0-9\.]*/gevent==21.12.0/' requirements.txt && \ - sed -i 's/greenlet==[0-9\.]*/greenlet==1.1.0/' requirements.txt; \ - fi \ + # disable gevent version recommendation from odoo and use 22.10.2 used in debian bookworm as python3-gevent + && sed -i -E "s/(gevent==)21\.8\.0( ; sys_platform != 'win32' and python_version > '3.9' and python_version <= '3.10')/\122.10.2\2/;s/(greenlet==)1.1.2( ; sys_platform != 'win32' and python_version > '3.9' and python_version <= '3.10')/\12.0.2\2/" requirements.txt \ && pip install -r requirements.txt \ 'websocket-client~=0.56' \ astor \ diff --git a/17.0.Dockerfile b/17.0.Dockerfile index bcb42ab3..88544d63 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -141,11 +141,8 @@ RUN build_deps=" \ && apt-get update \ && apt-get install -yqq --no-install-recommends $build_deps \ && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ - && \ - if [ "$TARGETARCH" = "arm64" ]; then \ - echo "Upgrading odoo requirements.txt with gevent==21.12.0 (minimum version compatible with arm64)" && \ - sed -i 's/gevent==[0-9\.]*/gevent==21.12.0/' requirements.txt; \ - fi \ + # disable gevent version recommendation from odoo and use 22.10.2 used in debian bookworm as python3-gevent + && sed -i -E "s/(gevent==)21\.8\.0( ; sys_platform != 'win32' and python_version == '3.10')/\122.10.2\2/;s/(greenlet==)1.1.2( ; sys_platform != 'win32' and python_version == '3.10')/\12.0.2\2/" requirements.txt \ && pip install -r requirements.txt \ 'websocket-client~=0.56' \ astor \ diff --git a/18.0.Dockerfile b/18.0.Dockerfile index f2e71f23..4b887f4e 100644 --- a/18.0.Dockerfile +++ b/18.0.Dockerfile @@ -141,11 +141,8 @@ RUN build_deps=" \ && apt-get update \ && apt-get install -yqq --no-install-recommends $build_deps \ && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ - && \ - if [ "$TARGETARCH" = "arm64" ]; then \ - echo "Upgrading odoo requirements.txt with gevent==21.12.0 (minimum version compatible with arm64)" && \ - sed -i 's/gevent==[0-9\.]*/gevent==21.12.0/' requirements.txt; \ - fi \ + # disable gevent version recommendation from odoo and use 22.10.2 used in debian bookworm as python3-gevent + && sed -i -E "s/(gevent==)21\.8\.0( ; sys_platform != 'win32' and python_version == '3.10')/\122.10.2\2/;s/(greenlet==)1.1.2( ; sys_platform != 'win32' and python_version == '3.10')/\12.0.2\2/" requirements.txt \ && pip install -r requirements.txt \ 'websocket-client~=0.56' \ astor \ From 9457d98632bebaec3e13c7092300fc4a0ac43bd8 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Thu, 13 Feb 2025 15:21:13 +0100 Subject: [PATCH 229/255] [CI] Modernize version --- .github/workflows/ci.yaml | 6 +++--- poetry.lock | 4 ++-- pyproject.toml | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ea56d3a1..7ec1ef98 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,7 @@ on: jobs: pre-commit: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 @@ -29,7 +29,7 @@ jobs: - uses: pre-commit/action@v3.0.0 test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: pre-commit strategy: fail-fast: false @@ -79,7 +79,7 @@ jobs: - run: poetry run python -m unittest -v tests build-push: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: test strategy: fail-fast: false diff --git a/poetry.lock b/poetry.lock index bd20a96e..154aa47d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "appdirs" @@ -666,4 +666,4 @@ six = "*" [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "b4edd7e09296f18061bf1dea5d0b6fb53a988c6f0ea8b754712650048e65a8af" +content-hash = "4901e7fb4702261fe012a23d1378ab716023faed725fd8e0178ee91bfb2921d5" diff --git a/pyproject.toml b/pyproject.toml index 12c6d5ee..21e33a98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,14 @@ [tool.poetry] name = "doodba" version = "0.0.0" +package-mode = false description = "Docker Odoo Base, a highly opinionated image ready to put Odoo inside it, but without Odoo" authors = ["Tecnativa"] [tool.poetry.dependencies] python = "^3.9" -[tool.poetry.dev-dependencies] +[tool.poetry.group.dev.dependencies] docker-compose = "^1.27.4" plumbum = "^1.6.9" pre-commit = "^2.9.3" From 21b8bde780564d92b150e72a22b2ada90c95d65e Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Wed, 26 Feb 2025 11:56:01 +0100 Subject: [PATCH 230/255] [FIX] Reset QEMU fixing v15 arm errors and some Dockerfile adjustment --- .github/workflows/ci.yaml | 3 +++ 15.0.Dockerfile | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7ec1ef98..a75cc315 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -118,6 +118,9 @@ jobs: # Setup QEMU - name: Set up QEMU uses: docker/setup-qemu-action@v3 + - name: Reset QEMU + if: ${{ matrix.odoo_version == '15.0' }} + run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes # Setup buildx - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/15.0.Dockerfile b/15.0.Dockerfile index b6e83b88..c63fc391 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -57,8 +57,8 @@ RUN apt-get -qq update \ && echo "Expected wkhtmltox checksum: ${WKHTMLTOPDF_CHECKSUM}" \ && echo "Computed wkhtmltox checksum: $(sha256sum wkhtmltox.deb | awk '{ print $1 }')" \ && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ + && dpkg -i wkhtmltox.deb || apt-get -y install -f \ && apt-get install -yqq --no-install-recommends \ - ./wkhtmltox.deb \ chromium \ ffmpeg \ fonts-liberation2 \ @@ -136,7 +136,7 @@ RUN build_deps=" \ zlib1g-dev \ " \ && apt-get update \ - && apt-get install -yqq --no-install-recommends $build_deps \ + && DEBIAN_FRONTEND=noninteractive apt-get install -yqq --no-install-recommends $build_deps \ && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ && \ if [ "$TARGETARCH" = "arm64" ]; then \ @@ -166,8 +166,8 @@ RUN build_deps=" \ && (python3 -m compileall -q /usr/local/lib/python3.8/ || true) \ # generate flanker cached tables during install when /usr/local/lib/ is still intended to be written to # https://github.com/Tecnativa/doodba/issues/486 - && python3 -c 'from flanker.addresslib import address' >/dev/null 2>&1 \ - && apt-get purge -yqq $build_deps \ + && python3 -c 'from flanker.addresslib import address' >/dev/null 2>&1 +RUN apt-get purge -yqq $build_deps \ && apt-get autopurge -yqq \ && rm -Rf /var/lib/apt/lists/* /tmp/* From 2c808b200e62d50baf1cfaf5fe7164f9cf40c08e Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Mon, 3 Mar 2025 12:29:26 +0100 Subject: [PATCH 231/255] [DCK] Create and push test PR images So we can test it before creating "oficial" images. Just working with origin:Tecnativa --- .github/workflows/ci.yaml | 106 +++++++++++++++++++++++++++++++++++--- 1 file changed, 100 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a75cc315..3df1a2db 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,10 +18,9 @@ jobs: with: python-version: "3.9" - name: Set PY - run: + run: | echo "PY=$(python -c 'import hashlib, - sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" - >> $GITHUB_ENV + sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV - uses: actions/cache@v3 with: path: ~/.cache/pre-commit @@ -78,7 +77,104 @@ jobs: # Test - run: poetry run python -m unittest -v tests - build-push: + build-push-pr: + if: > + github.event_name == 'pull_request' && + github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-24.04 + needs: test + strategy: + fail-fast: false + matrix: + # Test modern Odoo versions with latest Postgres version + odoo_version: ["18.0"] + platforms: ["linux/amd64,linux/arm64"] + include: + # Older odoo versions don't support latest postgres and Python versions + - odoo_version: "17.0" + platforms: "linux/amd64,linux/arm64" + - odoo_version: "16.0" + platforms: "linux/amd64,linux/arm64" + - odoo_version: "15.0" + platforms: "linux/amd64,linux/arm64" + - odoo_version: "14.0" + platforms: "linux/amd64,linux/arm64" + - odoo_version: "13.0" + platforms: "linux/amd64" + env: + # Indicates what's the equivalent to tecnativa/doodba:latest image + LATEST_RELEASE: "18.0" + DOCKER_REPO: tecnativa/doodba + GHCR_HOST: ghcr.io + steps: + - name: Clean Docker system before build + run: | + docker system prune -af || true + docker builder prune -af || true + # Set build date as env variable to be used later + - name: Set build date + run: echo "BUILD_DATE=$(date '+%Y-%m-%dT%H:%M:%S.%N%:z')" >> $GITHUB_ENV + # Prepare + - uses: actions/checkout@v4 + # Setup QEMU + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Reset QEMU + if: ${{ matrix.odoo_version == '15.0' }} + run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + # Setup buildx + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + if: github.repository == 'tecnativa/doodba' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_LOGIN }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + if: github.repository == 'tecnativa/doodba' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ secrets.BOT_LOGIN }} + password: ${{ secrets.BOT_TOKEN }} + - name: Build base image + uses: docker/build-push-action@v5 + with: + context: . + file: ./${{ matrix.odoo_version }}.Dockerfile + platforms: ${{ matrix.platforms }} + push: true + tags: | + ${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}-pr-${{ github.event.pull_request.number }}-test + ${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }}-pr-${{ github.event.pull_request.number }}-test + target: base + build-args: | + VCS_REF=${{ github.sha }} + BUILD_DATE=${{ env.BUILD_DATE }} + ODOO_VERSION=${{ matrix.odoo_version }} + - name: Build onbuild image + uses: docker/build-push-action@v5 + with: + context: . + file: ./${{ matrix.odoo_version }}.Dockerfile + platforms: ${{ matrix.platforms }} + push: true + tags: | + ${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}-onbuild-pr-${{ github.event.pull_request.number }}-test + ${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }}-onbuild-pr-${{ github.event.pull_request.number }}-test + target: onbuild + build-args: | + VCS_REF=${{ github.sha }} + BUILD_DATE=${{ env.BUILD_DATE }} + ODOO_VERSION=${{ matrix.odoo_version }} + - name: Clean Docker system after build + run: | + docker system prune -af || true + docker builder prune -af || true + + build-push-official: + if: github.repository == 'tecnativa/doodba' && github.ref == 'refs/heads/master' runs-on: ubuntu-24.04 needs: test strategy: @@ -125,13 +221,11 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub - if: github.repository == 'tecnativa/doodba' && github.ref == 'refs/heads/master' uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_LOGIN }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GitHub Container Registry - if: github.repository == 'tecnativa/doodba' && github.ref == 'refs/heads/master' uses: docker/login-action@v3 with: registry: ghcr.io From 431e3797137ed5c03f13552e7447b2755872b149 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 4 Mar 2025 13:01:47 +0100 Subject: [PATCH 232/255] [IMP] Build but not push when PR is from a fork --- .github/workflows/ci.yaml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3df1a2db..aaad67af 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -78,9 +78,7 @@ jobs: - run: poetry run python -m unittest -v tests build-push-pr: - if: > - github.event_name == 'pull_request' && - github.event.pull_request.head.repo.full_name == github.repository + if: github.event_name == 'pull_request' runs-on: ubuntu-24.04 needs: test strategy: @@ -126,13 +124,17 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub - if: github.repository == 'tecnativa/doodba' + if: + github.repository == 'tecnativa/doodba' && + github.event.pull_request.head.repo.full_name == github.repository uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_LOGIN }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GitHub Container Registry - if: github.repository == 'tecnativa/doodba' + if: + github.repository == 'tecnativa/doodba' && + github.event.pull_request.head.repo.full_name == github.repository uses: docker/login-action@v3 with: registry: ghcr.io @@ -144,7 +146,9 @@ jobs: context: . file: ./${{ matrix.odoo_version }}.Dockerfile platforms: ${{ matrix.platforms }} - push: true + push: + ${{ github.repository == 'tecnativa/doodba' && + github.event.pull_request.head.repo.full_name == github.repository }} tags: | ${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}-pr-${{ github.event.pull_request.number }}-test ${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }}-pr-${{ github.event.pull_request.number }}-test @@ -159,7 +163,9 @@ jobs: context: . file: ./${{ matrix.odoo_version }}.Dockerfile platforms: ${{ matrix.platforms }} - push: true + push: + ${{ github.repository == 'tecnativa/doodba' && + github.event.pull_request.head.repo.full_name == github.repository }} tags: | ${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}-onbuild-pr-${{ github.event.pull_request.number }}-test ${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }}-onbuild-pr-${{ github.event.pull_request.number }}-test From 320e61739c95cc1d66e92c1af4f81a4b000353b2 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Wed, 12 Feb 2025 22:36:20 +0100 Subject: [PATCH 233/255] [IMP] addons: Allow to enforce modules on dependencies --- bin/addons | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/addons b/bin/addons index 18c0dfb3..9e82492f 100755 --- a/bin/addons +++ b/bin/addons @@ -81,6 +81,13 @@ parser.add_argument( default=[], help="Addons to include always.", ) +parser.add_argument( + "--force-with", + action="append", + dest="force_with", + default=[], + help="Addons to enforce on dependencies.", +) parser.add_argument( "-W", "--without", action="append", default=[], help="Addons to exclude always." ) @@ -94,6 +101,8 @@ if addons & without: sys.exit("Cannot include and exclude the same addon!") if args.dependencies and args.fullpath: sys.exit("Unsupported combination of --dependencies and --fullpath") +if args.force_with and not args.dependencies: + sys.exit("Force With only makes sense combined with --dependencies") try: for addon, repo in addons_config(strict=args.explicit): if addon in without: @@ -124,7 +133,7 @@ except AddonsConfigError as error: sys.exit(error.message) # Use dependencies instead, if requested if args.dependencies: - addons = dependencies - addons + addons = (dependencies - addons).union(set(args.force_with)) addons -= without # Do the required action From 102bcc71abf83fcc57aee9b559b608d5fe981968 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Wed, 5 Mar 2025 08:45:09 +0100 Subject: [PATCH 234/255] [FIX] 15.0: purge apt data in the same layer as install --- 15.0.Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/15.0.Dockerfile b/15.0.Dockerfile index c63fc391..858b0064 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -166,8 +166,8 @@ RUN build_deps=" \ && (python3 -m compileall -q /usr/local/lib/python3.8/ || true) \ # generate flanker cached tables during install when /usr/local/lib/ is still intended to be written to # https://github.com/Tecnativa/doodba/issues/486 - && python3 -c 'from flanker.addresslib import address' >/dev/null 2>&1 -RUN apt-get purge -yqq $build_deps \ + && python3 -c 'from flanker.addresslib import address' >/dev/null 2>&1 \ + && apt-get purge -yqq $build_deps \ && apt-get autopurge -yqq \ && rm -Rf /var/lib/apt/lists/* /tmp/* From 8e6a03d4b5328b5007cea6bd68a3181c309b62ca Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Thu, 6 Mar 2025 11:41:25 +0100 Subject: [PATCH 235/255] [FIX] 15.0: install fix for wkhtmltox.deb to only run for dpkg install fails --- 15.0.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/15.0.Dockerfile b/15.0.Dockerfile index 858b0064..0b5a8f4f 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -57,7 +57,7 @@ RUN apt-get -qq update \ && echo "Expected wkhtmltox checksum: ${WKHTMLTOPDF_CHECKSUM}" \ && echo "Computed wkhtmltox checksum: $(sha256sum wkhtmltox.deb | awk '{ print $1 }')" \ && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ - && dpkg -i wkhtmltox.deb || apt-get -y install -f \ + && (dpkg -i wkhtmltox.deb || apt-get -y install -f) \ && apt-get install -yqq --no-install-recommends \ chromium \ ffmpeg \ From 1455b5113a2080c63e3836807940e7207dd3b7af Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Wed, 12 Mar 2025 08:04:26 +0100 Subject: [PATCH 236/255] [IMP] Set gevent==21.12.0 & greenlet==1.1.0 for all architectures to ensure consistency --- 14.0.Dockerfile | 8 ++------ 15.0.Dockerfile | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/14.0.Dockerfile b/14.0.Dockerfile index b7b254e1..4699c6bc 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -140,12 +140,8 @@ RUN build_deps=" \ && apt-get update \ && apt-get install -yqq --no-install-recommends $build_deps \ && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ - && \ - if [ "$TARGETARCH" = "arm64" ]; then \ - echo "Upgrading odoo requirements.txt with gevent==21.12.0 and greenlet==1.1.0 (minimum versions compatible with arm64)" && \ - sed -i 's/gevent==[0-9\.]*/gevent==21.12.0/' requirements.txt && \ - sed -i 's/greenlet==[0-9\.]*/greenlet==1.1.0/' requirements.txt; \ - fi \ + && echo "Setting gevent and greenlet versions to 21.12.0 and 1.1.0 (compatible with Debian Buster)" \ + && sed -i -E "s/(gevent==)[0-9\.]+/\121.12.0/; s/(greenlet==)[0-9\.]+/\11.1.0/" requirements.txt \ && pip install -r requirements.txt \ 'websocket-client~=0.56' \ astor \ diff --git a/15.0.Dockerfile b/15.0.Dockerfile index 0b5a8f4f..b626dfa8 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -138,12 +138,8 @@ RUN build_deps=" \ && apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -yqq --no-install-recommends $build_deps \ && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ - && \ - if [ "$TARGETARCH" = "arm64" ]; then \ - echo "Upgrading odoo requirements.txt with gevent==21.12.0 and greenlet==1.1.0 (minimum versions compatible with arm64)" && \ - sed -i 's/gevent==[0-9\.]*/gevent==21.12.0/' requirements.txt && \ - sed -i 's/greenlet==[0-9\.]*/greenlet==1.1.0/' requirements.txt; \ - fi \ + && echo "Setting gevent and greenlet versions to 21.12.0 and 1.1.0 (compatible with Debian Bullseye)" \ + && sed -i -E "s/(gevent==)[0-9\.]+/\121.12.0/; s/(greenlet==)[0-9\.]+/\11.1.0/" requirements.txt \ && pip install -r requirements.txt \ 'websocket-client~=0.56' \ astor \ From cbe30ab2f994fe5d08b20b3c290c3459c6c559e7 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Thu, 10 Apr 2025 08:40:13 +0200 Subject: [PATCH 237/255] [FIX] build: need to upgrade setuptools --- 16.0.Dockerfile | 2 ++ 17.0.Dockerfile | 2 ++ 18.0.Dockerfile | 2 ++ 3 files changed, 6 insertions(+) diff --git a/16.0.Dockerfile b/16.0.Dockerfile index 92a95f9b..e9417451 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -144,6 +144,8 @@ RUN build_deps=" \ && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ # disable gevent version recommendation from odoo and use 22.10.2 used in debian bookworm as python3-gevent && sed -i -E "s/(gevent==)21\.8\.0( ; sys_platform != 'win32' and python_version > '3.9' and python_version <= '3.10')/\122.10.2\2/;s/(greenlet==)1.1.2( ; sys_platform != 'win32' and python_version > '3.9' and python_version <= '3.10')/\12.0.2\2/" requirements.txt \ + # need to upgrade setuptools, since the fixes for CVE-2024-6345 rolled out in base images we get errors "error: invalid command 'bdist_wheel'" + && pip install --upgrade setuptools \ && pip install -r requirements.txt \ 'websocket-client~=0.56' \ astor \ diff --git a/17.0.Dockerfile b/17.0.Dockerfile index 88544d63..69ba5626 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -143,6 +143,8 @@ RUN build_deps=" \ && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ # disable gevent version recommendation from odoo and use 22.10.2 used in debian bookworm as python3-gevent && sed -i -E "s/(gevent==)21\.8\.0( ; sys_platform != 'win32' and python_version == '3.10')/\122.10.2\2/;s/(greenlet==)1.1.2( ; sys_platform != 'win32' and python_version == '3.10')/\12.0.2\2/" requirements.txt \ + # need to upgrade setuptools, since the fixes for CVE-2024-6345 rolled out in base images we get errors "error: invalid command 'bdist_wheel'" + && pip install --upgrade setuptools \ && pip install -r requirements.txt \ 'websocket-client~=0.56' \ astor \ diff --git a/18.0.Dockerfile b/18.0.Dockerfile index 4b887f4e..6d366c47 100644 --- a/18.0.Dockerfile +++ b/18.0.Dockerfile @@ -143,6 +143,8 @@ RUN build_deps=" \ && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ # disable gevent version recommendation from odoo and use 22.10.2 used in debian bookworm as python3-gevent && sed -i -E "s/(gevent==)21\.8\.0( ; sys_platform != 'win32' and python_version == '3.10')/\122.10.2\2/;s/(greenlet==)1.1.2( ; sys_platform != 'win32' and python_version == '3.10')/\12.0.2\2/" requirements.txt \ + # need to upgrade setuptools, since the fixes for CVE-2024-6345 rolled out in base images we get errors "error: invalid command 'bdist_wheel'" + && pip install --upgrade setuptools \ && pip install -r requirements.txt \ 'websocket-client~=0.56' \ astor \ From 89ad94ab9404fced831ef97388f771fd68db8cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=2E=20D=C3=ADaz?= Date: Thu, 1 May 2025 07:36:15 +0200 Subject: [PATCH 238/255] [UPD] Test environment --- .github/workflows/ci.yaml | 36 +- .gitignore | 3 + poetry.lock | 729 ++++-------------- pyproject.toml | 3 +- tests/__init__.py | 38 +- .../addons_env/docker-compose.yaml | 5 +- .../addons_env_double/docker-compose.yaml | 5 +- .../addons_env_ou/docker-compose.yaml | 5 +- .../aggregate_permissions/docker-compose.yaml | 3 +- .../dependencies/docker-compose.yaml | 5 +- .../docker-compose.yaml | 5 +- .../dependencies_ge_16/docker-compose.yaml | 5 +- tests/scaffoldings/dotd/docker-compose.yaml | 5 +- .../dotd_ge_16/docker-compose.yaml | 5 +- .../entrypoint/docker-compose.yaml | 5 +- tests/scaffoldings/geoip/docker-compose.yaml | 5 +- .../geoip_devel/docker-compose.yaml | 5 +- .../docker-compose.yaml | 5 +- .../repo_merge/docker-compose.yaml | 3 +- .../scaffoldings/settings/docker-compose.yaml | 5 +- .../scaffoldings/smallest/docker-compose.yaml | 5 +- .../scaffoldings/symlinks/docker-compose.yaml | 5 +- .../test_artifacts/docker-compose.yaml | 5 +- .../uids_1001/docker-compose.yaml | 5 +- .../scaffoldings/uids_998/docker-compose.yaml | 5 +- .../uids_default/docker-compose.yaml | 5 +- .../uids_mac_os/docker-compose.yaml | 5 +- 27 files changed, 236 insertions(+), 679 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index aaad67af..293812ad 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,24 +11,24 @@ on: jobs: pre-commit: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: - python-version: "3.9" + python-version: "3.11" - name: Set PY run: | echo "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: path: ~/.cache/pre-commit key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} - - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@v3.0.1 test: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest needs: pre-commit strategy: fail-fast: false @@ -66,20 +66,20 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} + - uses: docker/setup-compose-action@v1 + with: + version: latest # Install dev and test dependencies - run: pip install poetry - name: Patch $PATH run: echo "$HOME/.local/bin" >> $GITHUB_PATH - # override pyyaml to 5.3.1 as PIP_CONSTRAINT does not work for poetry - # to get rid of AttributeError: cython_sources when installing pyyaml - - run: poetry add pyyaml==5.3.1 - run: poetry install # Test - run: poetry run python -m unittest -v tests build-push-pr: if: github.event_name == 'pull_request' - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest needs: test strategy: fail-fast: false @@ -107,7 +107,7 @@ jobs: steps: - name: Clean Docker system before build run: | - docker system prune -af || true + docker system prune -af --volumes || true docker builder prune -af || true # Set build date as env variable to be used later - name: Set build date @@ -141,7 +141,7 @@ jobs: username: ${{ secrets.BOT_LOGIN }} password: ${{ secrets.BOT_TOKEN }} - name: Build base image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./${{ matrix.odoo_version }}.Dockerfile @@ -158,7 +158,7 @@ jobs: BUILD_DATE=${{ env.BUILD_DATE }} ODOO_VERSION=${{ matrix.odoo_version }} - name: Build onbuild image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./${{ matrix.odoo_version }}.Dockerfile @@ -176,12 +176,12 @@ jobs: ODOO_VERSION=${{ matrix.odoo_version }} - name: Clean Docker system after build run: | - docker system prune -af || true + docker system prune -af --volumes || true docker builder prune -af || true build-push-official: if: github.repository == 'tecnativa/doodba' && github.ref == 'refs/heads/master' - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest needs: test strategy: fail-fast: false @@ -210,7 +210,7 @@ jobs: steps: - name: Clean Docker system before build run: | - docker system prune -af || true + docker system prune -af --volumes || true docker builder prune -af || true # Set build date as env variable to be used later - name: Set build date @@ -238,7 +238,7 @@ jobs: username: ${{ secrets.BOT_LOGIN }} password: ${{ secrets.BOT_TOKEN }} - name: Build base image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./${{ matrix.odoo_version }}.Dockerfile @@ -257,7 +257,7 @@ jobs: BUILD_DATE=${{ env.BUILD_DATE }} ODOO_VERSION=${{ matrix.odoo_version }} - name: Build onbuild image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./${{ matrix.odoo_version }}.Dockerfile @@ -277,5 +277,5 @@ jobs: ODOO_VERSION=${{ matrix.odoo_version }} - name: Clean Docker system after build run: | - docker system prune -af || true + docker system prune -af --volumes || true docker builder prune -af || true diff --git a/.gitignore b/.gitignore index e6b57d33..58a133fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ .vscode **.pyc +# Tests garbage +tests/scaffoldings/repo_merge/custom/src/odoo +tests/scaffoldings/test_artifacts/test-artifacts diff --git a/poetry.lock b/poetry.lock index 154aa47d..b1fc7bac 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,416 +1,121 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. - -[[package]] -name = "appdirs" -version = "1.4.4" -description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -optional = false -python-versions = "*" -files = [ - {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, - {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, -] - -[[package]] -name = "attrs" -version = "20.3.0" -description = "Classes Without Boilerplate" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "attrs-20.3.0-py2.py3-none-any.whl", hash = "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6"}, - {file = "attrs-20.3.0.tar.gz", hash = "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700"}, -] - -[package.extras] -dev = ["coverage[toml] (>=5.0.2)", "furo", "hypothesis", "pre-commit", "pympler", "pytest (>=4.3.0)", "six", "sphinx", "zope.interface"] -docs = ["furo", "sphinx", "zope.interface"] -tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] -tests-no-zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"] - -[[package]] -name = "bcrypt" -version = "3.2.0" -description = "Modern password hashing for your software and your servers" -optional = false -python-versions = ">=3.6" -files = [ - {file = "bcrypt-3.2.0-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:b589229207630484aefe5899122fb938a5b017b0f4349f769b8c13e78d99a8fd"}, - {file = "bcrypt-3.2.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:c95d4cbebffafcdd28bd28bb4e25b31c50f6da605c81ffd9ad8a3d1b2ab7b1b6"}, - {file = "bcrypt-3.2.0-cp36-abi3-manylinux1_x86_64.whl", hash = "sha256:63d4e3ff96188e5898779b6057878fecf3f11cfe6ec3b313ea09955d587ec7a7"}, - {file = "bcrypt-3.2.0-cp36-abi3-manylinux2010_x86_64.whl", hash = "sha256:cd1ea2ff3038509ea95f687256c46b79f5fc382ad0aa3664d200047546d511d1"}, - {file = "bcrypt-3.2.0-cp36-abi3-manylinux2014_aarch64.whl", hash = "sha256:cdcdcb3972027f83fe24a48b1e90ea4b584d35f1cc279d76de6fc4b13376239d"}, - {file = "bcrypt-3.2.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:a0584a92329210fcd75eb8a3250c5a941633f8bfaf2a18f81009b097732839b7"}, - {file = "bcrypt-3.2.0-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:56e5da069a76470679f312a7d3d23deb3ac4519991a0361abc11da837087b61d"}, - {file = "bcrypt-3.2.0-cp36-abi3-win32.whl", hash = "sha256:a67fb841b35c28a59cebed05fbd3e80eea26e6d75851f0574a9273c80f3e9b55"}, - {file = "bcrypt-3.2.0-cp36-abi3-win_amd64.whl", hash = "sha256:81fec756feff5b6818ea7ab031205e1d323d8943d237303baca2c5f9c7846f34"}, - {file = "bcrypt-3.2.0.tar.gz", hash = "sha256:5b93c1726e50a93a033c36e5ca7fdcd29a5c7395af50a6892f5d9e7c6cfbfb29"}, -] - -[package.dependencies] -cffi = ">=1.1" -six = ">=1.4.1" - -[package.extras] -tests = ["pytest (>=3.2.1,!=3.3.0)"] -typecheck = ["mypy"] - -[[package]] -name = "cached-property" -version = "1.5.2" -description = "A decorator for caching properties in classes." -optional = false -python-versions = "*" -files = [ - {file = "cached-property-1.5.2.tar.gz", hash = "sha256:9fa5755838eecbb2d234c3aa390bd80fbd3ac6b6869109bfc1b499f7bd89a130"}, - {file = "cached_property-1.5.2-py2.py3-none-any.whl", hash = "sha256:df4f613cf7ad9a588cc381aaf4a512d26265ecebd5eb9e1ba12f1319eb85a6a0"}, -] - -[[package]] -name = "certifi" -version = "2023.7.22" -description = "Python package for providing Mozilla's CA Bundle." -optional = false -python-versions = ">=3.6" -files = [ - {file = "certifi-2023.7.22-py3-none-any.whl", hash = "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"}, - {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, -] - -[[package]] -name = "cffi" -version = "1.14.4" -description = "Foreign Function Interface for Python calling C code." -optional = false -python-versions = "*" -files = [ - {file = "cffi-1.14.4-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:ebb253464a5d0482b191274f1c8bf00e33f7e0b9c66405fbffc61ed2c839c775"}, - {file = "cffi-1.14.4-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:2c24d61263f511551f740d1a065eb0212db1dbbbbd241db758f5244281590c06"}, - {file = "cffi-1.14.4-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:9f7a31251289b2ab6d4012f6e83e58bc3b96bd151f5b5262467f4bb6b34a7c26"}, - {file = "cffi-1.14.4-cp27-cp27m-win32.whl", hash = "sha256:5cf4be6c304ad0b6602f5c4e90e2f59b47653ac1ed9c662ed379fe48a8f26b0c"}, - {file = "cffi-1.14.4-cp27-cp27m-win_amd64.whl", hash = "sha256:f60567825f791c6f8a592f3c6e3bd93dd2934e3f9dac189308426bd76b00ef3b"}, - {file = "cffi-1.14.4-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:c6332685306b6417a91b1ff9fae889b3ba65c2292d64bd9245c093b1b284809d"}, - {file = "cffi-1.14.4-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:d9efd8b7a3ef378dd61a1e77367f1924375befc2eba06168b6ebfa903a5e59ca"}, - {file = "cffi-1.14.4-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:51a8b381b16ddd370178a65360ebe15fbc1c71cf6f584613a7ea08bfad946698"}, - {file = "cffi-1.14.4-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:1d2c4994f515e5b485fd6d3a73d05526aa0fcf248eb135996b088d25dfa1865b"}, - {file = "cffi-1.14.4-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:af5c59122a011049aad5dd87424b8e65a80e4a6477419c0c1015f73fb5ea0293"}, - {file = "cffi-1.14.4-cp35-cp35m-win32.whl", hash = "sha256:594234691ac0e9b770aee9fcdb8fa02c22e43e5c619456efd0d6c2bf276f3eb2"}, - {file = "cffi-1.14.4-cp35-cp35m-win_amd64.whl", hash = "sha256:64081b3f8f6f3c3de6191ec89d7dc6c86a8a43911f7ecb422c60e90c70be41c7"}, - {file = "cffi-1.14.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f803eaa94c2fcda012c047e62bc7a51b0bdabda1cad7a92a522694ea2d76e49f"}, - {file = "cffi-1.14.4-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:105abaf8a6075dc96c1fe5ae7aae073f4696f2905fde6aeada4c9d2926752362"}, - {file = "cffi-1.14.4-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0638c3ae1a0edfb77c6765d487fee624d2b1ee1bdfeffc1f0b58c64d149e7eec"}, - {file = "cffi-1.14.4-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:7c6b1dece89874d9541fc974917b631406233ea0440d0bdfbb8e03bf39a49b3b"}, - {file = "cffi-1.14.4-cp36-cp36m-win32.whl", hash = "sha256:155136b51fd733fa94e1c2ea5211dcd4c8879869008fc811648f16541bf99668"}, - {file = "cffi-1.14.4-cp36-cp36m-win_amd64.whl", hash = "sha256:6bc25fc545a6b3d57b5f8618e59fc13d3a3a68431e8ca5fd4c13241cd70d0009"}, - {file = "cffi-1.14.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a7711edca4dcef1a75257b50a2fbfe92a65187c47dab5a0f1b9b332c5919a3fb"}, - {file = "cffi-1.14.4-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:00e28066507bfc3fe865a31f325c8391a1ac2916219340f87dfad602c3e48e5d"}, - {file = "cffi-1.14.4-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:798caa2a2384b1cbe8a2a139d80734c9db54f9cc155c99d7cc92441a23871c03"}, - {file = "cffi-1.14.4-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:a5ed8c05548b54b998b9498753fb9cadbfd92ee88e884641377d8a8b291bcc01"}, - {file = "cffi-1.14.4-cp37-cp37m-win32.whl", hash = "sha256:00a1ba5e2e95684448de9b89888ccd02c98d512064b4cb987d48f4b40aa0421e"}, - {file = "cffi-1.14.4-cp37-cp37m-win_amd64.whl", hash = "sha256:9cc46bc107224ff5b6d04369e7c595acb700c3613ad7bcf2e2012f62ece80c35"}, - {file = "cffi-1.14.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:df5169c4396adc04f9b0a05f13c074df878b6052430e03f50e68adf3a57aa28d"}, - {file = "cffi-1.14.4-cp38-cp38-manylinux1_i686.whl", hash = "sha256:9ffb888f19d54a4d4dfd4b3f29bc2c16aa4972f1c2ab9c4ab09b8ab8685b9c2b"}, - {file = "cffi-1.14.4-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8d6603078baf4e11edc4168a514c5ce5b3ba6e3e9c374298cb88437957960a53"}, - {file = "cffi-1.14.4-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:d5ff0621c88ce83a28a10d2ce719b2ee85635e85c515f12bac99a95306da4b2e"}, - {file = "cffi-1.14.4-cp38-cp38-win32.whl", hash = "sha256:b4e248d1087abf9f4c10f3c398896c87ce82a9856494a7155823eb45a892395d"}, - {file = "cffi-1.14.4-cp38-cp38-win_amd64.whl", hash = "sha256:ec80dc47f54e6e9a78181ce05feb71a0353854cc26999db963695f950b5fb375"}, - {file = "cffi-1.14.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:840793c68105fe031f34d6a086eaea153a0cd5c491cde82a74b420edd0a2b909"}, - {file = "cffi-1.14.4-cp39-cp39-manylinux1_i686.whl", hash = "sha256:b18e0a9ef57d2b41f5c68beefa32317d286c3d6ac0484efd10d6e07491bb95dd"}, - {file = "cffi-1.14.4-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:045d792900a75e8b1e1b0ab6787dd733a8190ffcf80e8c8ceb2fb10a29ff238a"}, - {file = "cffi-1.14.4-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:7ef7d4ced6b325e92eb4d3502946c78c5367bc416398d387b39591532536734e"}, - {file = "cffi-1.14.4-cp39-cp39-win32.whl", hash = "sha256:ba4e9e0ae13fc41c6b23299545e5ef73055213e466bd107953e4a013a5ddd7e3"}, - {file = "cffi-1.14.4-cp39-cp39-win_amd64.whl", hash = "sha256:f032b34669220030f905152045dfa27741ce1a6db3324a5bc0b96b6c7420c87b"}, - {file = "cffi-1.14.4.tar.gz", hash = "sha256:1a465cbe98a7fd391d47dce4b8f7e5b921e6cd805ef421d04f5f66ba8f06086c"}, -] - -[package.dependencies] -pycparser = "*" +# This file is automatically @generated by Poetry 2.1.2 and should not be changed by hand. [[package]] name = "cfgv" -version = "3.2.0" +version = "3.4.0" description = "Validate configuration and produce human readable error messages." optional = false -python-versions = ">=3.6.1" -files = [ - {file = "cfgv-3.2.0-py2.py3-none-any.whl", hash = "sha256:32e43d604bbe7896fe7c248a9c2276447dbef840feb28fe20494f62af110211d"}, - {file = "cfgv-3.2.0.tar.gz", hash = "sha256:cf22deb93d4bcf92f345a5c3cd39d3d41d6340adc60c78bbbd6588c384fda6a1"}, -] - -[[package]] -name = "chardet" -version = "3.0.4" -description = "Universal encoding detector for Python 2 and 3" -optional = false -python-versions = "*" +python-versions = ">=3.8" +groups = ["dev"] files = [ - {file = "chardet-3.0.4-py2.py3-none-any.whl", hash = "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"}, - {file = "chardet-3.0.4.tar.gz", hash = "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"}, + {file = "cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9"}, + {file = "cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560"}, ] -[[package]] -name = "colorama" -version = "0.4.4" -description = "Cross-platform colored terminal text." -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -files = [ - {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, - {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, -] - -[[package]] -name = "cryptography" -version = "39.0.1" -description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." -optional = false -python-versions = ">=3.6" -files = [ - {file = "cryptography-39.0.1-cp36-abi3-macosx_10_12_universal2.whl", hash = "sha256:6687ef6d0a6497e2b58e7c5b852b53f62142cfa7cd1555795758934da363a965"}, - {file = "cryptography-39.0.1-cp36-abi3-macosx_10_12_x86_64.whl", hash = "sha256:706843b48f9a3f9b9911979761c91541e3d90db1ca905fd63fee540a217698bc"}, - {file = "cryptography-39.0.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:5d2d8b87a490bfcd407ed9d49093793d0f75198a35e6eb1a923ce1ee86c62b41"}, - {file = "cryptography-39.0.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:83e17b26de248c33f3acffb922748151d71827d6021d98c70e6c1a25ddd78505"}, - {file = "cryptography-39.0.1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e124352fd3db36a9d4a21c1aa27fd5d051e621845cb87fb851c08f4f75ce8be6"}, - {file = "cryptography-39.0.1-cp36-abi3-manylinux_2_24_x86_64.whl", hash = "sha256:5aa67414fcdfa22cf052e640cb5ddc461924a045cacf325cd164e65312d99502"}, - {file = "cryptography-39.0.1-cp36-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:35f7c7d015d474f4011e859e93e789c87d21f6f4880ebdc29896a60403328f1f"}, - {file = "cryptography-39.0.1-cp36-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f24077a3b5298a5a06a8e0536e3ea9ec60e4c7ac486755e5fb6e6ea9b3500106"}, - {file = "cryptography-39.0.1-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:f0c64d1bd842ca2633e74a1a28033d139368ad959872533b1bab8c80e8240a0c"}, - {file = "cryptography-39.0.1-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:0f8da300b5c8af9f98111ffd512910bc792b4c77392a9523624680f7956a99d4"}, - {file = "cryptography-39.0.1-cp36-abi3-win32.whl", hash = "sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8"}, - {file = "cryptography-39.0.1-cp36-abi3-win_amd64.whl", hash = "sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac"}, - {file = "cryptography-39.0.1-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad"}, - {file = "cryptography-39.0.1-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:c5caeb8188c24888c90b5108a441c106f7faa4c4c075a2bcae438c6e8ca73cef"}, - {file = "cryptography-39.0.1-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:4789d1e3e257965e960232345002262ede4d094d1a19f4d3b52e48d4d8f3b885"}, - {file = "cryptography-39.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388"}, - {file = "cryptography-39.0.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336"}, - {file = "cryptography-39.0.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2"}, - {file = "cryptography-39.0.1-pp39-pypy39_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:6f8ba7f0328b79f08bdacc3e4e66fb4d7aab0c3584e0bd41328dce5262e26b2e"}, - {file = "cryptography-39.0.1-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:ef8b72fa70b348724ff1218267e7f7375b8de4e8194d1636ee60510aae104cd0"}, - {file = "cryptography-39.0.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:aec5a6c9864be7df2240c382740fcf3b96928c46604eaa7f3091f58b878c0bb6"}, - {file = "cryptography-39.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:fdd188c8a6ef8769f148f88f859884507b954cc64db6b52f66ef199bb9ad660a"}, - {file = "cryptography-39.0.1.tar.gz", hash = "sha256:d1f6198ee6d9148405e49887803907fe8962a23e6c6f83ea7d98f1c0de375695"}, -] - -[package.dependencies] -cffi = ">=1.12" - -[package.extras] -docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.1.1)"] -docstest = ["pyenchant (>=1.6.11)", "sphinxcontrib-spelling (>=4.0.1)", "twine (>=1.12.0)"] -pep8test = ["black", "check-manifest", "mypy", "ruff", "types-pytz", "types-requests"] -sdist = ["setuptools-rust (>=0.11.4)"] -ssh = ["bcrypt (>=3.1.5)"] -test = ["hypothesis (>=1.11.4,!=3.79.2)", "iso8601", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-shard (>=0.1.2)", "pytest-subtests", "pytest-xdist", "pytz"] -test-randomorder = ["pytest-randomly"] -tox = ["tox"] - [[package]] name = "distlib" -version = "0.3.1" +version = "0.3.9" description = "Distribution utilities" optional = false python-versions = "*" +groups = ["dev"] files = [ - {file = "distlib-0.3.1-py2.py3-none-any.whl", hash = "sha256:8c09de2c67b3e7deef7184574fc060ab8a793e7adbb183d942c389c8b13c52fb"}, - {file = "distlib-0.3.1.zip", hash = "sha256:edf6116872c863e1aa9d5bb7cb5e05a022c519a4594dc703843343a9ddd9bff1"}, -] - -[[package]] -name = "distro" -version = "1.5.0" -description = "Distro - an OS platform information API" -optional = false -python-versions = "*" -files = [ - {file = "distro-1.5.0-py2.py3-none-any.whl", hash = "sha256:df74eed763e18d10d0da624258524ae80486432cd17392d9c3d96f5e83cd2799"}, - {file = "distro-1.5.0.tar.gz", hash = "sha256:0e58756ae38fbd8fc3020d54badb8eae17c5b9dcbed388b17bb55b8a5928df92"}, -] - -[[package]] -name = "docker" -version = "4.4.4" -description = "A Python library for the Docker Engine API." -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -files = [ - {file = "docker-4.4.4-py2.py3-none-any.whl", hash = "sha256:f3607d5695be025fa405a12aca2e5df702a57db63790c73b927eb6a94aac60af"}, - {file = "docker-4.4.4.tar.gz", hash = "sha256:d3393c878f575d3a9ca3b94471a3c89a6d960b35feb92f033c0de36cc9d934db"}, -] - -[package.dependencies] -paramiko = {version = ">=2.4.2", optional = true, markers = "extra == \"ssh\""} -pywin32 = {version = "227", markers = "sys_platform == \"win32\""} -requests = ">=2.14.2,<2.18.0 || >2.18.0" -six = ">=1.4.0" -websocket-client = ">=0.32.0" - -[package.extras] -ssh = ["paramiko (>=2.4.2)"] -tls = ["cryptography (>=1.3.4)", "idna (>=2.0.0)", "pyOpenSSL (>=17.5.0)"] - -[[package]] -name = "docker-compose" -version = "1.27.4" -description = "Multi-container orchestration for Docker" -optional = false -python-versions = ">=3.4" -files = [ - {file = "docker-compose-1.27.4.tar.gz", hash = "sha256:5a5690f24c27d4b43dcbe6b3fae91ba680713208e99ee863352b3bae37bcaa83"}, - {file = "docker_compose-1.27.4-py2.py3-none-any.whl", hash = "sha256:84ca2edad226435e3a378ea24ca2ca4e1a77cc7c8de057e2812124c6dcb55147"}, -] - -[package.dependencies] -cached-property = ">=1.2.0,<2" -colorama = {version = ">=0.4,<1", markers = "sys_platform == \"win32\""} -distro = ">=1.5.0,<2" -docker = {version = ">=4.3.1,<5", extras = ["ssh"]} -dockerpty = ">=0.4.1,<1" -docopt = ">=0.6.1,<1" -jsonschema = ">=2.5.1,<4" -python-dotenv = ">=0.13.0,<1" -PyYAML = ">=3.10,<6" -requests = ">=2.20.0,<3" -texttable = ">=0.9.0,<2" -websocket-client = ">=0.32.0,<1" - -[package.extras] -socks = ["PySocks (>=1.5.6,!=1.5.7,<2)"] -tests = ["ddt (>=1.2.2,<2)", "pytest (<6)"] - -[[package]] -name = "dockerpty" -version = "0.4.1" -description = "Python library to use the pseudo-tty of a docker container" -optional = false -python-versions = "*" -files = [ - {file = "dockerpty-0.4.1.tar.gz", hash = "sha256:69a9d69d573a0daa31bcd1c0774eeed5c15c295fe719c61aca550ed1393156ce"}, -] - -[package.dependencies] -six = ">=1.3.0" - -[[package]] -name = "docopt" -version = "0.6.2" -description = "Pythonic argument parser, that will make you smile" -optional = false -python-versions = "*" -files = [ - {file = "docopt-0.6.2.tar.gz", hash = "sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"}, + {file = "distlib-0.3.9-py2.py3-none-any.whl", hash = "sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87"}, + {file = "distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403"}, ] [[package]] name = "filelock" -version = "3.0.12" +version = "3.18.0" description = "A platform independent file lock." optional = false -python-versions = "*" -files = [ - {file = "filelock-3.0.12-py3-none-any.whl", hash = "sha256:929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"}, - {file = "filelock-3.0.12.tar.gz", hash = "sha256:18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59"}, -] - -[[package]] -name = "identify" -version = "1.5.10" -description = "File identification library for Python" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" +python-versions = ">=3.9" +groups = ["dev"] files = [ - {file = "identify-1.5.10-py2.py3-none-any.whl", hash = "sha256:cc86e6a9a390879dcc2976cef169dd9cc48843ed70b7380f321d1b118163c60e"}, - {file = "identify-1.5.10.tar.gz", hash = "sha256:943cd299ac7f5715fcb3f684e2fc1594c1e0f22a90d15398e5888143bd4144b5"}, + {file = "filelock-3.18.0-py3-none-any.whl", hash = "sha256:c401f4f8377c4464e6db25fff06205fd89bdd83b65eb0488ed1b160f780e21de"}, + {file = "filelock-3.18.0.tar.gz", hash = "sha256:adbc88eabb99d2fec8c9c1b229b171f18afa655400173ddc653d5d01501fb9f2"}, ] [package.extras] -license = ["editdistance"] +docs = ["furo (>=2024.8.6)", "sphinx (>=8.1.3)", "sphinx-autodoc-typehints (>=3)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.6.10)", "diff-cover (>=9.2.1)", "pytest (>=8.3.4)", "pytest-asyncio (>=0.25.2)", "pytest-cov (>=6)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.28.1)"] +typing = ["typing-extensions (>=4.12.2) ; python_version < \"3.11\""] [[package]] -name = "idna" -version = "2.10" -description = "Internationalized Domain Names in Applications (IDNA)" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, - {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, -] - -[[package]] -name = "jsonschema" -version = "3.2.0" -description = "An implementation of JSON Schema validation for Python" +name = "identify" +version = "2.6.10" +description = "File identification library for Python" optional = false -python-versions = "*" +python-versions = ">=3.9" +groups = ["dev"] files = [ - {file = "jsonschema-3.2.0-py2.py3-none-any.whl", hash = "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163"}, - {file = "jsonschema-3.2.0.tar.gz", hash = "sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"}, + {file = "identify-2.6.10-py2.py3-none-any.whl", hash = "sha256:5f34248f54136beed1a7ba6a6b5c4b6cf21ff495aac7c359e1ef831ae3b8ab25"}, + {file = "identify-2.6.10.tar.gz", hash = "sha256:45e92fd704f3da71cc3880036633f48b4b7265fd4de2b57627cb157216eb7eb8"}, ] -[package.dependencies] -attrs = ">=17.4.0" -pyrsistent = ">=0.14.0" -setuptools = "*" -six = ">=1.11.0" - [package.extras] -format = ["idna", "jsonpointer (>1.13)", "rfc3987", "strict-rfc3339", "webcolors"] -format-nongpl = ["idna", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "webcolors"] +license = ["ukkonen"] [[package]] name = "nodeenv" -version = "1.5.0" +version = "1.9.1" description = "Node.js virtual environment builder" optional = false -python-versions = "*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] files = [ - {file = "nodeenv-1.5.0-py2.py3-none-any.whl", hash = "sha256:5304d424c529c997bc888453aeaa6362d242b6b4631e90f3d4bf1b290f1c84a9"}, - {file = "nodeenv-1.5.0.tar.gz", hash = "sha256:ab45090ae383b716c4ef89e690c41ff8c2b257b85b309f01f3654df3d084bd7c"}, + {file = "nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9"}, + {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, ] [[package]] -name = "paramiko" -version = "2.10.1" -description = "SSH2 protocol library" +name = "platformdirs" +version = "4.3.7" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false -python-versions = "*" +python-versions = ">=3.9" +groups = ["dev"] files = [ - {file = "paramiko-2.10.1-py2.py3-none-any.whl", hash = "sha256:f6cbd3e1204abfdbcd40b3ecbc9d32f04027cd3080fe666245e21e7540ccfc1b"}, - {file = "paramiko-2.10.1.tar.gz", hash = "sha256:443f4da23ec24e9a9c0ea54017829c282abdda1d57110bf229360775ccd27a31"}, + {file = "platformdirs-4.3.7-py3-none-any.whl", hash = "sha256:a03875334331946f13c549dbd8f4bac7a13a50a895a0eb1e8c6a8ace80d40a94"}, + {file = "platformdirs-4.3.7.tar.gz", hash = "sha256:eb437d586b6a0986388f0d6f74aa0cde27b48d0e3d66843640bfb6bdcdb6e351"}, ] -[package.dependencies] -bcrypt = ">=3.1.3" -cryptography = ">=2.5" -pynacl = ">=1.0.1" -six = "*" - [package.extras] -all = ["bcrypt (>=3.1.3)", "gssapi (>=1.4.1)", "invoke (>=1.3)", "pyasn1 (>=0.1.7)", "pynacl (>=1.0.1)", "pywin32 (>=2.1.8)"] -ed25519 = ["bcrypt (>=3.1.3)", "pynacl (>=1.0.1)"] -gssapi = ["gssapi (>=1.4.1)", "pyasn1 (>=0.1.7)", "pywin32 (>=2.1.8)"] -invoke = ["invoke (>=1.3)"] +docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.1.3)", "sphinx-autodoc-typehints (>=3)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.4)", "pytest-cov (>=6)", "pytest-mock (>=3.14)"] +type = ["mypy (>=1.14.1)"] [[package]] name = "plumbum" -version = "1.6.9" +version = "1.9.0" description = "Plumbum: shell combinators library" optional = false -python-versions = ">=2.6,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" +python-versions = ">=3.8" +groups = ["dev"] files = [ - {file = "plumbum-1.6.9-py2.py3-none-any.whl", hash = "sha256:91418dcc66b58ab9d2e3b04b3d1e0d787dc45923154fb8b4a826bd9316dba0d6"}, - {file = "plumbum-1.6.9.tar.gz", hash = "sha256:16b9e19d96c80f2e9d051ef5f04927b834a6ac0ce5d2768eb8662b5cd53e43df"}, + {file = "plumbum-1.9.0-py3-none-any.whl", hash = "sha256:9fd0d3b0e8d86e4b581af36edf3f3bbe9d1ae15b45b8caab28de1bcb27aaa7f5"}, + {file = "plumbum-1.9.0.tar.gz", hash = "sha256:e640062b72642c3873bd5bdc3effed75ba4d3c70ef6b6a7b907357a84d909219"}, ] +[package.dependencies] +pywin32 = {version = "*", markers = "platform_system == \"Windows\" and platform_python_implementation != \"PyPy\""} + +[package.extras] +dev = ["coverage[toml]", "paramiko", "psutil", "pytest (>=6.0)", "pytest-cov", "pytest-mock", "pytest-timeout"] +docs = ["sphinx (>=4.0.0)", "sphinx-rtd-theme (>=1.0.0)"] +ssh = ["paramiko"] +test = ["coverage[toml]", "paramiko", "psutil", "pytest (>=6.0)", "pytest-cov", "pytest-mock", "pytest-timeout"] + [[package]] name = "pre-commit" -version = "2.9.3" +version = "2.21.0" description = "A framework for managing and maintaining multi-language pre-commit hooks." optional = false -python-versions = ">=3.6.1" +python-versions = ">=3.7" +groups = ["dev"] files = [ - {file = "pre_commit-2.9.3-py2.py3-none-any.whl", hash = "sha256:6c86d977d00ddc8a60d68eec19f51ef212d9462937acf3ea37c7adec32284ac0"}, - {file = "pre_commit-2.9.3.tar.gz", hash = "sha256:ee784c11953e6d8badb97d19bc46b997a3a9eded849881ec587accd8608d74a4"}, + {file = "pre_commit-2.21.0-py2.py3-none-any.whl", hash = "sha256:e2f91727039fc39a92f58a588a25b87f936de6567eed4f0e673e0507edc75bad"}, + {file = "pre_commit-2.21.0.tar.gz", hash = "sha256:31ef31af7e474a8d8995027fefdfcf509b5c913ff31f2015b4ec4beb26a6f658"}, ] [package.dependencies] @@ -418,252 +123,120 @@ cfgv = ">=2.0.0" identify = ">=1.0.0" nodeenv = ">=0.11.1" pyyaml = ">=5.1" -toml = "*" -virtualenv = ">=20.0.8" - -[[package]] -name = "pycparser" -version = "2.20" -description = "C parser in Python" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "pycparser-2.20-py2.py3-none-any.whl", hash = "sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705"}, - {file = "pycparser-2.20.tar.gz", hash = "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0"}, -] - -[[package]] -name = "pynacl" -version = "1.4.0" -description = "Python binding to the Networking and Cryptography (NaCl) library" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "PyNaCl-1.4.0-cp27-cp27m-macosx_10_10_x86_64.whl", hash = "sha256:ea6841bc3a76fa4942ce00f3bda7d436fda21e2d91602b9e21b7ca9ecab8f3ff"}, - {file = "PyNaCl-1.4.0-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:d452a6746f0a7e11121e64625109bc4468fc3100452817001dbe018bb8b08514"}, - {file = "PyNaCl-1.4.0-cp27-cp27m-win32.whl", hash = "sha256:2fe0fc5a2480361dcaf4e6e7cea00e078fcda07ba45f811b167e3f99e8cff574"}, - {file = "PyNaCl-1.4.0-cp27-cp27m-win_amd64.whl", hash = "sha256:f8851ab9041756003119368c1e6cd0b9c631f46d686b3904b18c0139f4419f80"}, - {file = "PyNaCl-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:7757ae33dae81c300487591c68790dfb5145c7d03324000433d9a2c141f82af7"}, - {file = "PyNaCl-1.4.0-cp35-abi3-macosx_10_10_x86_64.whl", hash = "sha256:757250ddb3bff1eecd7e41e65f7f833a8405fede0194319f87899690624f2122"}, - {file = "PyNaCl-1.4.0-cp35-abi3-manylinux1_x86_64.whl", hash = "sha256:30f9b96db44e09b3304f9ea95079b1b7316b2b4f3744fe3aaecccd95d547063d"}, - {file = "PyNaCl-1.4.0-cp35-abi3-win32.whl", hash = "sha256:4e10569f8cbed81cb7526ae137049759d2a8d57726d52c1a000a3ce366779634"}, - {file = "PyNaCl-1.4.0-cp35-abi3-win_amd64.whl", hash = "sha256:c914f78da4953b33d4685e3cdc7ce63401247a21425c16a39760e282075ac4a6"}, - {file = "PyNaCl-1.4.0-cp35-cp35m-win32.whl", hash = "sha256:06cbb4d9b2c4bd3c8dc0d267416aaed79906e7b33f114ddbf0911969794b1cc4"}, - {file = "PyNaCl-1.4.0-cp35-cp35m-win_amd64.whl", hash = "sha256:511d269ee845037b95c9781aa702f90ccc36036f95d0f31373a6a79bd8242e25"}, - {file = "PyNaCl-1.4.0-cp36-cp36m-win32.whl", hash = "sha256:11335f09060af52c97137d4ac54285bcb7df0cef29014a1a4efe64ac065434c4"}, - {file = "PyNaCl-1.4.0-cp36-cp36m-win_amd64.whl", hash = "sha256:cd401ccbc2a249a47a3a1724c2918fcd04be1f7b54eb2a5a71ff915db0ac51c6"}, - {file = "PyNaCl-1.4.0-cp37-cp37m-win32.whl", hash = "sha256:8122ba5f2a2169ca5da936b2e5a511740ffb73979381b4229d9188f6dcb22f1f"}, - {file = "PyNaCl-1.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:537a7ccbea22905a0ab36ea58577b39d1fa9b1884869d173b5cf111f006f689f"}, - {file = "PyNaCl-1.4.0-cp38-cp38-win32.whl", hash = "sha256:9c4a7ea4fb81536c1b1f5cc44d54a296f96ae78c1ebd2311bd0b60be45a48d96"}, - {file = "PyNaCl-1.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:7c6092102219f59ff29788860ccb021e80fffd953920c4a8653889c029b2d420"}, - {file = "PyNaCl-1.4.0.tar.gz", hash = "sha256:54e9a2c849c742006516ad56a88f5c74bf2ce92c9f67435187c3c5953b346505"}, -] - -[package.dependencies] -cffi = ">=1.4.1" -six = "*" - -[package.extras] -docs = ["sphinx (>=1.6.5)", "sphinx-rtd-theme"] -tests = ["hypothesis (>=3.27.0)", "pytest (>=3.2.1,!=3.3.0)"] - -[[package]] -name = "pyrsistent" -version = "0.17.3" -description = "Persistent/Functional/Immutable data structures" -optional = false -python-versions = ">=3.5" -files = [ - {file = "pyrsistent-0.17.3.tar.gz", hash = "sha256:2e636185d9eb976a18a8a8e96efce62f2905fea90041958d8cc2a189756ebf3e"}, -] - -[[package]] -name = "python-dotenv" -version = "0.15.0" -description = "Add .env support to your django/flask apps in development and deployments" -optional = false -python-versions = "*" -files = [ - {file = "python-dotenv-0.15.0.tar.gz", hash = "sha256:587825ed60b1711daea4832cf37524dfd404325b7db5e25ebe88c495c9f807a0"}, - {file = "python_dotenv-0.15.0-py2.py3-none-any.whl", hash = "sha256:0c8d1b80d1a1e91717ea7d526178e3882732420b03f08afea0406db6402e220e"}, -] - -[package.extras] -cli = ["click (>=5.0)"] +virtualenv = ">=20.10.0" [[package]] name = "pywin32" -version = "227" +version = "310" description = "Python for Window Extensions" optional = false python-versions = "*" -files = [ - {file = "pywin32-227-cp27-cp27m-win32.whl", hash = "sha256:371fcc39416d736401f0274dd64c2302728c9e034808e37381b5e1b22be4a6b0"}, - {file = "pywin32-227-cp27-cp27m-win_amd64.whl", hash = "sha256:4cdad3e84191194ea6d0dd1b1b9bdda574ff563177d2adf2b4efec2a244fa116"}, - {file = "pywin32-227-cp35-cp35m-win32.whl", hash = "sha256:f4c5be1a293bae0076d93c88f37ee8da68136744588bc5e2be2f299a34ceb7aa"}, - {file = "pywin32-227-cp35-cp35m-win_amd64.whl", hash = "sha256:a929a4af626e530383a579431b70e512e736e9588106715215bf685a3ea508d4"}, - {file = "pywin32-227-cp36-cp36m-win32.whl", hash = "sha256:300a2db938e98c3e7e2093e4491439e62287d0d493fe07cce110db070b54c0be"}, - {file = "pywin32-227-cp36-cp36m-win_amd64.whl", hash = "sha256:9b31e009564fb95db160f154e2aa195ed66bcc4c058ed72850d047141b36f3a2"}, - {file = "pywin32-227-cp37-cp37m-win32.whl", hash = "sha256:47a3c7551376a865dd8d095a98deba954a98f326c6fe3c72d8726ca6e6b15507"}, - {file = "pywin32-227-cp37-cp37m-win_amd64.whl", hash = "sha256:31f88a89139cb2adc40f8f0e65ee56a8c585f629974f9e07622ba80199057511"}, - {file = "pywin32-227-cp38-cp38-win32.whl", hash = "sha256:7f18199fbf29ca99dff10e1f09451582ae9e372a892ff03a28528a24d55875bc"}, - {file = "pywin32-227-cp38-cp38-win_amd64.whl", hash = "sha256:7c1ae32c489dc012930787f06244426f8356e129184a02c25aef163917ce158e"}, - {file = "pywin32-227-cp39-cp39-win32.whl", hash = "sha256:c054c52ba46e7eb6b7d7dfae4dbd987a1bb48ee86debe3f245a2884ece46e295"}, - {file = "pywin32-227-cp39-cp39-win_amd64.whl", hash = "sha256:f27cec5e7f588c3d1051651830ecc00294f90728d19c3bf6916e6dba93ea357c"}, +groups = ["dev"] +markers = "platform_system == \"Windows\" and platform_python_implementation != \"PyPy\"" +files = [ + {file = "pywin32-310-cp310-cp310-win32.whl", hash = "sha256:6dd97011efc8bf51d6793a82292419eba2c71cf8e7250cfac03bba284454abc1"}, + {file = "pywin32-310-cp310-cp310-win_amd64.whl", hash = "sha256:c3e78706e4229b915a0821941a84e7ef420bf2b77e08c9dae3c76fd03fd2ae3d"}, + {file = "pywin32-310-cp310-cp310-win_arm64.whl", hash = "sha256:33babed0cf0c92a6f94cc6cc13546ab24ee13e3e800e61ed87609ab91e4c8213"}, + {file = "pywin32-310-cp311-cp311-win32.whl", hash = "sha256:1e765f9564e83011a63321bb9d27ec456a0ed90d3732c4b2e312b855365ed8bd"}, + {file = "pywin32-310-cp311-cp311-win_amd64.whl", hash = "sha256:126298077a9d7c95c53823934f000599f66ec9296b09167810eb24875f32689c"}, + {file = "pywin32-310-cp311-cp311-win_arm64.whl", hash = "sha256:19ec5fc9b1d51c4350be7bb00760ffce46e6c95eaf2f0b2f1150657b1a43c582"}, + {file = "pywin32-310-cp312-cp312-win32.whl", hash = "sha256:8a75a5cc3893e83a108c05d82198880704c44bbaee4d06e442e471d3c9ea4f3d"}, + {file = "pywin32-310-cp312-cp312-win_amd64.whl", hash = "sha256:bf5c397c9a9a19a6f62f3fb821fbf36cac08f03770056711f765ec1503972060"}, + {file = "pywin32-310-cp312-cp312-win_arm64.whl", hash = "sha256:2349cc906eae872d0663d4d6290d13b90621eaf78964bb1578632ff20e152966"}, + {file = "pywin32-310-cp313-cp313-win32.whl", hash = "sha256:5d241a659c496ada3253cd01cfaa779b048e90ce4b2b38cd44168ad555ce74ab"}, + {file = "pywin32-310-cp313-cp313-win_amd64.whl", hash = "sha256:667827eb3a90208ddbdcc9e860c81bde63a135710e21e4cb3348968e4bd5249e"}, + {file = "pywin32-310-cp313-cp313-win_arm64.whl", hash = "sha256:e308f831de771482b7cf692a1f308f8fca701b2d8f9dde6cc440c7da17e47b33"}, + {file = "pywin32-310-cp38-cp38-win32.whl", hash = "sha256:0867beb8addefa2e3979d4084352e4ac6e991ca45373390775f7084cc0209b9c"}, + {file = "pywin32-310-cp38-cp38-win_amd64.whl", hash = "sha256:30f0a9b3138fb5e07eb4973b7077e1883f558e40c578c6925acc7a94c34eaa36"}, + {file = "pywin32-310-cp39-cp39-win32.whl", hash = "sha256:851c8d927af0d879221e616ae1f66145253537bbdd321a77e8ef701b443a9a1a"}, + {file = "pywin32-310-cp39-cp39-win_amd64.whl", hash = "sha256:96867217335559ac619f00ad70e513c0fcf84b8a3af9fc2bba3b59b97da70475"}, ] [[package]] name = "pyyaml" -version = "5.4" +version = "6.0.2" description = "YAML parser and emitter for Python" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" -files = [ - {file = "PyYAML-5.4-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:f7a21e3d99aa3095ef0553e7ceba36fb693998fbb1226f1392ce33681047465f"}, - {file = "PyYAML-5.4-cp27-cp27m-win32.whl", hash = "sha256:52bf0930903818e600ae6c2901f748bc4869c0c406056f679ab9614e5d21a166"}, - {file = "PyYAML-5.4-cp27-cp27m-win_amd64.whl", hash = "sha256:a36a48a51e5471513a5aea920cdad84cbd56d70a5057cca3499a637496ea379c"}, - {file = "PyYAML-5.4-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:5e7ac4e0e79a53451dc2814f6876c2fa6f71452de1498bbe29c0b54b69a986f4"}, - {file = "PyYAML-5.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cc552b6434b90d9dbed6a4f13339625dc466fd82597119897e9489c953acbc22"}, - {file = "PyYAML-5.4-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0dc9f2eb2e3c97640928dec63fd8dc1dd91e6b6ed236bd5ac00332b99b5c2ff9"}, - {file = "PyYAML-5.4-cp36-cp36m-win32.whl", hash = "sha256:5a3f345acff76cad4aa9cb171ee76c590f37394186325d53d1aa25318b0d4a09"}, - {file = "PyYAML-5.4-cp36-cp36m-win_amd64.whl", hash = "sha256:f3790156c606299ff499ec44db422f66f05a7363b39eb9d5b064f17bd7d7c47b"}, - {file = "PyYAML-5.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:124fd7c7bc1e95b1eafc60825f2daf67c73ce7b33f1194731240d24b0d1bf628"}, - {file = "PyYAML-5.4-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:8b818b6c5a920cbe4203b5a6b14256f0e5244338244560da89b7b0f1313ea4b6"}, - {file = "PyYAML-5.4-cp37-cp37m-win32.whl", hash = "sha256:737bd70e454a284d456aa1fa71a0b429dd527bcbf52c5c33f7c8eee81ac16b89"}, - {file = "PyYAML-5.4-cp37-cp37m-win_amd64.whl", hash = "sha256:7242790ab6c20316b8e7bb545be48d7ed36e26bbe279fd56f2c4a12510e60b4b"}, - {file = "PyYAML-5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cc547d3ead3754712223abb7b403f0a184e4c3eae18c9bb7fd15adef1597cc4b"}, - {file = "PyYAML-5.4-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8635d53223b1f561b081ff4adecb828fd484b8efffe542edcfdff471997f7c39"}, - {file = "PyYAML-5.4-cp38-cp38-win32.whl", hash = "sha256:26fcb33776857f4072601502d93e1a619f166c9c00befb52826e7b774efaa9db"}, - {file = "PyYAML-5.4-cp38-cp38-win_amd64.whl", hash = "sha256:b2243dd033fd02c01212ad5c601dafb44fbb293065f430b0d3dbf03f3254d615"}, - {file = "PyYAML-5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:31ba07c54ef4a897758563e3a0fcc60077698df10180abe4b8165d9895c00ebf"}, - {file = "PyYAML-5.4-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:02c78d77281d8f8d07a255e57abdbf43b02257f59f50cc6b636937d68efa5dd0"}, - {file = "PyYAML-5.4-cp39-cp39-win32.whl", hash = "sha256:fdc6b2cb4b19e431994f25a9160695cc59a4e861710cc6fc97161c5e845fc579"}, - {file = "PyYAML-5.4-cp39-cp39-win_amd64.whl", hash = "sha256:8bf38641b4713d77da19e91f8b5296b832e4db87338d6aeffe422d42f1ca896d"}, - {file = "PyYAML-5.4.tar.gz", hash = "sha256:3c49e39ac034fd64fd576d63bb4db53cda89b362768a67f07749d55f128ac18a"}, -] - -[[package]] -name = "requests" -version = "2.25.0" -description = "Python HTTP for Humans." -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -files = [ - {file = "requests-2.25.0-py2.py3-none-any.whl", hash = "sha256:e786fa28d8c9154e6a4de5d46a1d921b8749f8b74e28bde23768e5e16eece998"}, - {file = "requests-2.25.0.tar.gz", hash = "sha256:7f1a0b932f4a60a1a65caa4263921bb7d9ee911957e0ae4a23a6dd08185ad5f8"}, -] - -[package.dependencies] -certifi = ">=2017.4.17" -chardet = ">=3.0.2,<4" -idna = ">=2.5,<3" -urllib3 = ">=1.21.1,<1.27" - -[package.extras] -security = ["cryptography (>=1.3.4)", "pyOpenSSL (>=0.14)"] -socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] - -[[package]] -name = "setuptools" -version = "67.2.0" -description = "Easily download, build, install, upgrade, and uninstall Python packages" -optional = false -python-versions = ">=3.7" -files = [ - {file = "setuptools-67.2.0-py3-none-any.whl", hash = "sha256:16ccf598aab3b506593c17378473978908a2734d7336755a8769b480906bec1c"}, - {file = "setuptools-67.2.0.tar.gz", hash = "sha256:b440ee5f7e607bb8c9de15259dba2583dd41a38879a7abc1d43a71c59524da48"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8 (<5)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] - -[[package]] -name = "six" -version = "1.15.0" -description = "Python 2 and 3 compatibility utilities" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" -files = [ - {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, - {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"}, -] - -[[package]] -name = "texttable" -version = "1.6.3" -description = "module for creating simple ASCII tables" -optional = false -python-versions = "*" -files = [ - {file = "texttable-1.6.3-py2.py3-none-any.whl", hash = "sha256:f802f2ef8459058736264210f716c757cbf85007a30886d8541aa8c3404f1dda"}, - {file = "texttable-1.6.3.tar.gz", hash = "sha256:ce0faf21aa77d806bbff22b107cc22cce68dc9438f97a2df32c93e9afa4ce436"}, +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"}, + {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68"}, + {file = "PyYAML-6.0.2-cp310-cp310-win32.whl", hash = "sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99"}, + {file = "PyYAML-6.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e"}, + {file = "PyYAML-6.0.2-cp311-cp311-win32.whl", hash = "sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5"}, + {file = "PyYAML-6.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b"}, + {file = "PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4"}, + {file = "PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652"}, + {file = "PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183"}, + {file = "PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563"}, + {file = "PyYAML-6.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083"}, + {file = "PyYAML-6.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706"}, + {file = "PyYAML-6.0.2-cp38-cp38-win32.whl", hash = "sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a"}, + {file = "PyYAML-6.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725"}, + {file = "PyYAML-6.0.2-cp39-cp39-win32.whl", hash = "sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631"}, + {file = "PyYAML-6.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8"}, + {file = "pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"}, ] -[[package]] -name = "toml" -version = "0.10.2" -description = "Python Library for Tom's Obvious, Minimal Language" -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" -files = [ - {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, - {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, -] - -[[package]] -name = "urllib3" -version = "1.26.5" -description = "HTTP library with thread-safe connection pooling, file post, and more." -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" -files = [ - {file = "urllib3-1.26.5-py2.py3-none-any.whl", hash = "sha256:753a0374df26658f99d826cfe40394a686d05985786d946fbe4165b5148f5a7c"}, - {file = "urllib3-1.26.5.tar.gz", hash = "sha256:a7acd0977125325f516bda9735fa7142b909a8d01e8b2e4c8108d0984e6e0098"}, -] - -[package.extras] -brotli = ["brotlipy (>=0.6.0)"] -secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)"] -socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] - [[package]] name = "virtualenv" -version = "20.2.2" +version = "20.30.0" description = "Virtual Python Environment builder" optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" +python-versions = ">=3.8" +groups = ["dev"] files = [ - {file = "virtualenv-20.2.2-py2.py3-none-any.whl", hash = "sha256:54b05fc737ea9c9ee9f8340f579e5da5b09fb64fd010ab5757eb90268616907c"}, - {file = "virtualenv-20.2.2.tar.gz", hash = "sha256:b7a8ec323ee02fb2312f098b6b4c9de99559b462775bc8fe3627a73706603c1b"}, + {file = "virtualenv-20.30.0-py3-none-any.whl", hash = "sha256:e34302959180fca3af42d1800df014b35019490b119eba981af27f2fa486e5d6"}, + {file = "virtualenv-20.30.0.tar.gz", hash = "sha256:800863162bcaa5450a6e4d721049730e7f2dae07720e0902b0e4040bd6f9ada8"}, ] [package.dependencies] -appdirs = ">=1.4.3,<2" -distlib = ">=0.3.1,<1" -filelock = ">=3.0.0,<4" -six = ">=1.9.0,<2" +distlib = ">=0.3.7,<1" +filelock = ">=3.12.2,<4" +platformdirs = ">=3.9.1,<5" [package.extras] -docs = ["proselint (>=0.10.2)", "sphinx (>=3)", "sphinx-argparse (>=0.2.5)", "sphinx-rtd-theme (>=0.4.3)", "towncrier (>=19.9.0rc1)"] -testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", "packaging (>=20.0)", "pytest (>=4)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.1)", "pytest-mock (>=2)", "pytest-randomly (>=1)", "pytest-timeout (>=1)", "pytest-xdist (>=1.31.0)", "xonsh (>=0.9.16)"] - -[[package]] -name = "websocket-client" -version = "0.57.0" -description = "WebSocket client for Python. hybi13 is supported." -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "websocket_client-0.57.0-py2.py3-none-any.whl", hash = "sha256:0fc45c961324d79c781bab301359d5a1b00b13ad1b10415a4780229ef71a5549"}, - {file = "websocket_client-0.57.0.tar.gz", hash = "sha256:d735b91d6d1692a6a181f2a8c9e0238e5f6373356f561bb9dc4c7af36f452010"}, -] - -[package.dependencies] -six = "*" +docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] +test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8) ; platform_python_implementation == \"PyPy\" or platform_python_implementation == \"GraalVM\" or platform_python_implementation == \"CPython\" and sys_platform == \"win32\" and python_version >= \"3.13\"", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10) ; platform_python_implementation == \"CPython\""] [metadata] -lock-version = "2.0" -python-versions = "^3.9" -content-hash = "4901e7fb4702261fe012a23d1378ab716023faed725fd8e0178ee91bfb2921d5" +lock-version = "2.1" +python-versions = "^3.11" +content-hash = "02e3335edeea832d1ec8747c019d764b884c05704b1ab292c7d2d27b2e21d86b" diff --git a/pyproject.toml b/pyproject.toml index 21e33a98..7331b8b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,10 +6,9 @@ description = "Docker Odoo Base, a highly opinionated image ready to put Odoo in authors = ["Tecnativa"] [tool.poetry.dependencies] -python = "^3.9" +python = "^3.11" [tool.poetry.group.dev.dependencies] -docker-compose = "^1.27.4" plumbum = "^1.6.9" pre-commit = "^2.9.3" diff --git a/tests/__init__.py b/tests/__init__.py index 0cfcff66..27612e64 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Run tests for this base image. @@ -28,9 +27,12 @@ # are migrated to the next release. It is used in situations where Doodba is # preparing the pre-release for the next version of Odoo, which hasn't been # released yet. +# prerelease_skip = unittest.skipIf( +# ODOO_VERSIONS & {"16.0"}, "Tests not supported in pre-release" +# ) prerelease_skip = unittest.skipIf( - ODOO_VERSIONS & {"16.0"}, "Tests not supported in pre-release" -) + False, "Tests not supported in pre-release" +) # No pre-releases to test def matrix( @@ -54,7 +56,7 @@ def matrix( class ScaffoldingCase(unittest.TestCase): def setUp(self): super().setUp() - self.compose_run = ("docker-compose", "run", "--rm", "odoo") + self.compose_run = ("docker", "compose", "run", "--rm", "odoo") def popen(self, *args, **kwargs): """Shortcut to open a subprocess and ensure it works.""" @@ -62,7 +64,7 @@ def popen(self, *args, **kwargs): self.assertFalse(Popen(*args, **kwargs).wait()) def compose_test(self, workdir, sub_env, *commands): - """Execute commands in a docker-compose environment. + """Execute commands in a docker compose environment. :param workdir: Path where the docker compose commands will be executed. It should @@ -70,10 +72,10 @@ def compose_test(self, workdir, sub_env, *commands): :param dict sub_env: Specific environment variables that will be appended to current - ones to execute the ``docker-compose`` tests. + ones to execute the ``docker compose`` tests. You can set in this dict a ``COMPOSE_FILE`` key to choose different - docker-compose files in the same directory. + docker compose files in the same directory. :param tuple()... commands: List of commands to be tested in the odoo container. @@ -81,14 +83,16 @@ def compose_test(self, workdir, sub_env, *commands): full_env = dict(environ, **sub_env) with self.subTest(PWD=workdir, **sub_env): try: - self.popen(("docker-compose", "build"), cwd=workdir, env=full_env) + self.popen(("docker", "compose", "build"), cwd=workdir, env=full_env) for command in commands: with self.subTest(command=command): self.popen( self.compose_run + command, cwd=workdir, env=full_env ) finally: - self.popen(("docker-compose", "down", "-v"), cwd=workdir, env=full_env) + self.popen( + ("docker", "compose", "down", "-v"), cwd=workdir, env=full_env + ) def _check_addons(self, scaffolding_dir, odoo_skip): project_dir = join(SCAFFOLDINGS_DIR, scaffolding_dir) @@ -315,9 +319,6 @@ def test_smallest(self): smallest_dir, sub_env, *commands, ("python", "-c", "import watchdog") ) - # HACK https://github.com/itpp-labs/misc-addons/issues/1014 - # TODO Remove decorator - @prerelease_skip def test_addons_env(self): """Test environment variables in addons.yaml""" # The test is hacking ODOO_VERSION to pin a commit @@ -335,7 +336,7 @@ def test_addons_env(self): ("test", "-e", "auto/addons/crm"), ("test", "-d", "auto/addons/crm/migrations"), ) - for sub_env in matrix(odoo_skip={"11.0", "12.0", "13.0", "18.0"}): + for sub_env in matrix(odoo_skip={"11.0", "12.0", "13.0"}): self.compose_test( join(SCAFFOLDINGS_DIR, "addons_env_ou"), sub_env, @@ -476,12 +477,12 @@ def test_dependencies_ge_16(self): "dependencies_ge_16", {"11.0", "12.0", "13.0", "14.0", "15.0"} ) - # TODO: Remove decorator when base_search_fuzzy is migrated to 17.0 - @prerelease_skip def test_dependencies_base_search_fuzzy(self): """Test dependencies installation.""" dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies_base_search_fuzzy") - for sub_env in matrix(odoo_skip={"17.0", "18.0"}): + # TODO: Remove 18.0 from the matrix skip when 'base_search_fuzzy' + # is available for that version + for sub_env in matrix(odoo_skip={"18.0"}): self.compose_test( dependencies_dir, sub_env, @@ -790,12 +791,15 @@ def test_screencasts(self): self.compose_test( test_artifacts_dir, dict(sub_env, UID=str(os.getuid()), GID=str(os.getgid())), - # remove artifacts from previous tests + # remove artifacts from previous tests (ignores .gitkeep) ( "find", "/opt/odoo/auto/test-artifacts", "-type", "f", + "!", + "-name", + ".gitkeep", "-exec", "rm", "-v", diff --git a/tests/scaffoldings/addons_env/docker-compose.yaml b/tests/scaffoldings/addons_env/docker-compose.yaml index 5cb154cd..e75ddf87 100644 --- a/tests/scaffoldings/addons_env/docker-compose.yaml +++ b/tests/scaffoldings/addons_env/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -14,7 +13,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -22,7 +21,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/addons_env_double/docker-compose.yaml b/tests/scaffoldings/addons_env_double/docker-compose.yaml index bccd0a99..ff30cf7e 100644 --- a/tests/scaffoldings/addons_env_double/docker-compose.yaml +++ b/tests/scaffoldings/addons_env_double/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -15,7 +14,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -23,7 +22,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/addons_env_ou/docker-compose.yaml b/tests/scaffoldings/addons_env_ou/docker-compose.yaml index 5cb154cd..e75ddf87 100644 --- a/tests/scaffoldings/addons_env_ou/docker-compose.yaml +++ b/tests/scaffoldings/addons_env_ou/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -14,7 +13,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -22,7 +21,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/aggregate_permissions/docker-compose.yaml b/tests/scaffoldings/aggregate_permissions/docker-compose.yaml index b5c3c5b4..fd52ee3b 100644 --- a/tests/scaffoldings/aggregate_permissions/docker-compose.yaml +++ b/tests/scaffoldings/aggregate_permissions/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -19,7 +18,7 @@ services: entrypoint: "" # we are calling autoaggregate inside the tests volumes: - ./custom/src/:/opt/odoo/custom/src:rw,z - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo volumes: filestore: diff --git a/tests/scaffoldings/dependencies/docker-compose.yaml b/tests/scaffoldings/dependencies/docker-compose.yaml index 5cb154cd..e75ddf87 100644 --- a/tests/scaffoldings/dependencies/docker-compose.yaml +++ b/tests/scaffoldings/dependencies/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -14,7 +13,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -22,7 +21,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/dependencies_base_search_fuzzy/docker-compose.yaml b/tests/scaffoldings/dependencies_base_search_fuzzy/docker-compose.yaml index 5cb154cd..e75ddf87 100644 --- a/tests/scaffoldings/dependencies_base_search_fuzzy/docker-compose.yaml +++ b/tests/scaffoldings/dependencies_base_search_fuzzy/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -14,7 +13,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -22,7 +21,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/dependencies_ge_16/docker-compose.yaml b/tests/scaffoldings/dependencies_ge_16/docker-compose.yaml index 5cb154cd..e75ddf87 100644 --- a/tests/scaffoldings/dependencies_ge_16/docker-compose.yaml +++ b/tests/scaffoldings/dependencies_ge_16/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -14,7 +13,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -22,7 +21,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/dotd/docker-compose.yaml b/tests/scaffoldings/dotd/docker-compose.yaml index fbbaec8d..06cdb3d5 100644 --- a/tests/scaffoldings/dotd/docker-compose.yaml +++ b/tests/scaffoldings/dotd/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -15,7 +14,7 @@ services: depends_on: - postgresql volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo postgresql: image: tecnativa/postgres-autoconf:${DB_VERSION}-alpine @@ -23,7 +22,7 @@ services: POSTGRES_USER: another_odoo POSTGRES_PASSWORD: anotherodoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/dotd_ge_16/docker-compose.yaml b/tests/scaffoldings/dotd_ge_16/docker-compose.yaml index fbbaec8d..06cdb3d5 100644 --- a/tests/scaffoldings/dotd_ge_16/docker-compose.yaml +++ b/tests/scaffoldings/dotd_ge_16/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -15,7 +14,7 @@ services: depends_on: - postgresql volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo postgresql: image: tecnativa/postgres-autoconf:${DB_VERSION}-alpine @@ -23,7 +22,7 @@ services: POSTGRES_USER: another_odoo POSTGRES_PASSWORD: anotherodoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/entrypoint/docker-compose.yaml b/tests/scaffoldings/entrypoint/docker-compose.yaml index cf15da4b..cd626716 100644 --- a/tests/scaffoldings/entrypoint/docker-compose.yaml +++ b/tests/scaffoldings/entrypoint/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -15,7 +14,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -23,7 +22,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/geoip/docker-compose.yaml b/tests/scaffoldings/geoip/docker-compose.yaml index 066f961d..607fa85f 100644 --- a/tests/scaffoldings/geoip/docker-compose.yaml +++ b/tests/scaffoldings/geoip/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -20,7 +19,7 @@ services: GEOIP_ACCOUNT_ID: $GEOIP_ACCOUNT_ID GEOIP_LICENSE_KEY: $GEOIP_LICENSE_KEY volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -28,7 +27,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/geoip_devel/docker-compose.yaml b/tests/scaffoldings/geoip_devel/docker-compose.yaml index c973e144..402222ef 100644 --- a/tests/scaffoldings/geoip_devel/docker-compose.yaml +++ b/tests/scaffoldings/geoip_devel/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -23,7 +22,7 @@ services: GEOIP_ACCOUNT_ID: $GEOIP_ACCOUNT_ID GEOIP_LICENSE_KEY: $GEOIP_LICENSE_KEY volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo # also use mappings from https://github.com/Tecnativa/doodba-copier-template/blob/main/devel.yaml.jinja to # simulate devel.yaml - ./odoo/custom:/opt/odoo/custom:ro,z @@ -35,7 +34,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/postgres_client_version/docker-compose.yaml b/tests/scaffoldings/postgres_client_version/docker-compose.yaml index f3241e6a..195fbccb 100644 --- a/tests/scaffoldings/postgres_client_version/docker-compose.yaml +++ b/tests/scaffoldings/postgres_client_version/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -16,7 +15,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -24,7 +23,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/repo_merge/docker-compose.yaml b/tests/scaffoldings/repo_merge/docker-compose.yaml index 909657a5..b50f76d4 100644 --- a/tests/scaffoldings/repo_merge/docker-compose.yaml +++ b/tests/scaffoldings/repo_merge/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -13,7 +12,7 @@ services: UNACCENT: "false" entrypoint: "" # we are not using odoo but only checking the repo state here, this skips starting the db volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo volumes: filestore: diff --git a/tests/scaffoldings/settings/docker-compose.yaml b/tests/scaffoldings/settings/docker-compose.yaml index e83fc641..fa31b318 100644 --- a/tests/scaffoldings/settings/docker-compose.yaml +++ b/tests/scaffoldings/settings/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -20,7 +19,7 @@ services: depends_on: - postgresql volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo postgresql: image: postgres:${DB_VERSION}-alpine @@ -29,7 +28,7 @@ services: POSTGRES_PASSWORD: anotherodoopassword command: -p 15432 volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data mailhog: image: mailhog/mailhog diff --git a/tests/scaffoldings/smallest/docker-compose.yaml b/tests/scaffoldings/smallest/docker-compose.yaml index 5cb154cd..e75ddf87 100644 --- a/tests/scaffoldings/smallest/docker-compose.yaml +++ b/tests/scaffoldings/smallest/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -14,7 +13,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -22,7 +21,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/symlinks/docker-compose.yaml b/tests/scaffoldings/symlinks/docker-compose.yaml index 5cb154cd..e75ddf87 100644 --- a/tests/scaffoldings/symlinks/docker-compose.yaml +++ b/tests/scaffoldings/symlinks/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -14,7 +13,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -22,7 +21,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/test_artifacts/docker-compose.yaml b/tests/scaffoldings/test_artifacts/docker-compose.yaml index f228b913..9223a12f 100644 --- a/tests/scaffoldings/test_artifacts/docker-compose.yaml +++ b/tests/scaffoldings/test_artifacts/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -17,7 +16,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo - ./test-artifacts:/opt/odoo/auto/test-artifacts:z db: @@ -26,7 +25,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/uids_1001/docker-compose.yaml b/tests/scaffoldings/uids_1001/docker-compose.yaml index 8b043308..216eff24 100644 --- a/tests/scaffoldings/uids_1001/docker-compose.yaml +++ b/tests/scaffoldings/uids_1001/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -18,7 +17,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -26,7 +25,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/uids_998/docker-compose.yaml b/tests/scaffoldings/uids_998/docker-compose.yaml index a79b428a..65bb28f4 100644 --- a/tests/scaffoldings/uids_998/docker-compose.yaml +++ b/tests/scaffoldings/uids_998/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -18,7 +17,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -26,7 +25,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/uids_default/docker-compose.yaml b/tests/scaffoldings/uids_default/docker-compose.yaml index 57d7953c..ffbe59b3 100644 --- a/tests/scaffoldings/uids_default/docker-compose.yaml +++ b/tests/scaffoldings/uids_default/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -15,7 +14,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -23,7 +22,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: diff --git a/tests/scaffoldings/uids_mac_os/docker-compose.yaml b/tests/scaffoldings/uids_mac_os/docker-compose.yaml index a6d22af9..742d25ba 100644 --- a/tests/scaffoldings/uids_mac_os/docker-compose.yaml +++ b/tests/scaffoldings/uids_mac_os/docker-compose.yaml @@ -1,4 +1,3 @@ -version: "2.1" services: odoo: build: @@ -18,7 +17,7 @@ services: PYTHONOPTIMIZE: "" UNACCENT: "false" volumes: - - filestore:/var/lib/odoo:z + - filestore:/var/lib/odoo db: image: postgres:${DB_VERSION}-alpine @@ -26,7 +25,7 @@ services: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoopassword volumes: - - db:/var/lib/postgresql/data:z + - db:/var/lib/postgresql/data volumes: db: From 56954bb16d56bb99d066ba0e5904ec9c00d14153 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Fri, 16 May 2025 12:12:23 +0200 Subject: [PATCH 239/255] [FIX] Set ubuntu 24.04 on test environment --- .github/workflows/ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 293812ad..6bd89880 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,7 @@ on: jobs: pre-commit: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 @@ -28,7 +28,7 @@ jobs: - uses: pre-commit/action@v3.0.1 test: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: pre-commit strategy: fail-fast: false @@ -79,7 +79,7 @@ jobs: build-push-pr: if: github.event_name == 'pull_request' - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: test strategy: fail-fast: false @@ -181,7 +181,7 @@ jobs: build-push-official: if: github.repository == 'tecnativa/doodba' && github.ref == 'refs/heads/master' - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: test strategy: fail-fast: false From 97023cae3535529f0875b5af08dce8046338375d Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Fri, 16 May 2025 17:20:25 +0200 Subject: [PATCH 240/255] [FIX] Pip packages installation Based on https://github.com/OCA/oca-ci/pull/93 --- build.d/700-odoo-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.d/700-odoo-install b/build.d/700-odoo-install index b895a35a..274ace69 100755 --- a/build.d/700-odoo-install +++ b/build.d/700-odoo-install @@ -7,7 +7,7 @@ log INFO Installing Odoo from $src # For development you could want to avoid installing Odoo to speed up build if [ "$PIP_INSTALL_ODOO" == true ]; then args="--no-cache-dir" - pip install $args --editable $src + pip install $args --editable $src --config-setting=editable_mode=compat else log WARNING Blindly symlinking odoo executable bin=$src/odoo-bin From c070c81ce10263481aea7cbdcca0ad4fd9324823 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Fri, 16 May 2025 17:37:44 +0200 Subject: [PATCH 241/255] [FIX] 15.0 build --- build.d/700-odoo-install | 1 + 1 file changed, 1 insertion(+) diff --git a/build.d/700-odoo-install b/build.d/700-odoo-install index 274ace69..c404bdca 100755 --- a/build.d/700-odoo-install +++ b/build.d/700-odoo-install @@ -7,6 +7,7 @@ log INFO Installing Odoo from $src # For development you could want to avoid installing Odoo to speed up build if [ "$PIP_INSTALL_ODOO" == true ]; then args="--no-cache-dir" + pip install $args psycopg2-binary pip install $args --editable $src --config-setting=editable_mode=compat else log WARNING Blindly symlinking odoo executable From a86f0ddd7eaeb60082c4310b19c91c2a2f1d73a7 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Fri, 16 May 2025 17:55:21 +0200 Subject: [PATCH 242/255] Revert "Merge pull request #658 from Tecnativa/fix-15-build" This reverts commit 6c6da93f5dbbb3f89448af509aedad67f972bab7, reversing changes made to 50ce3706484ffbf22246a45b98a4d3242c61e916. --- build.d/700-odoo-install | 1 - 1 file changed, 1 deletion(-) diff --git a/build.d/700-odoo-install b/build.d/700-odoo-install index c404bdca..274ace69 100755 --- a/build.d/700-odoo-install +++ b/build.d/700-odoo-install @@ -7,7 +7,6 @@ log INFO Installing Odoo from $src # For development you could want to avoid installing Odoo to speed up build if [ "$PIP_INSTALL_ODOO" == true ]; then args="--no-cache-dir" - pip install $args psycopg2-binary pip install $args --editable $src --config-setting=editable_mode=compat else log WARNING Blindly symlinking odoo executable From bd236745cd0f1633b8020194ff0622b2a05a23bd Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Fri, 16 May 2025 17:55:21 +0200 Subject: [PATCH 243/255] Revert "Merge pull request #657 from Tecnativa/fix-pip-packages-installation" This reverts commit 50ce3706484ffbf22246a45b98a4d3242c61e916, reversing changes made to 42b95a7b87a62aa16e85b67bcb98a9c516f61577. --- build.d/700-odoo-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.d/700-odoo-install b/build.d/700-odoo-install index 274ace69..b895a35a 100755 --- a/build.d/700-odoo-install +++ b/build.d/700-odoo-install @@ -7,7 +7,7 @@ log INFO Installing Odoo from $src # For development you could want to avoid installing Odoo to speed up build if [ "$PIP_INSTALL_ODOO" == true ]; then args="--no-cache-dir" - pip install $args --editable $src --config-setting=editable_mode=compat + pip install $args --editable $src else log WARNING Blindly symlinking odoo executable bin=$src/odoo-bin From 967cf64fdd964678e268465eb4ea2a51a7be3469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=2E=20D=C3=ADaz?= Date: Fri, 16 May 2025 21:25:26 +0200 Subject: [PATCH 244/255] [REV] pyproject min python version allowed --- poetry.lock | 16 ++++++++-------- pyproject.toml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/poetry.lock b/poetry.lock index b1fc7bac..bc3083f6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -70,14 +70,14 @@ files = [ [[package]] name = "platformdirs" -version = "4.3.7" +version = "4.3.8" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.9" groups = ["dev"] files = [ - {file = "platformdirs-4.3.7-py3-none-any.whl", hash = "sha256:a03875334331946f13c549dbd8f4bac7a13a50a895a0eb1e8c6a8ace80d40a94"}, - {file = "platformdirs-4.3.7.tar.gz", hash = "sha256:eb437d586b6a0986388f0d6f74aa0cde27b48d0e3d66843640bfb6bdcdb6e351"}, + {file = "platformdirs-4.3.8-py3-none-any.whl", hash = "sha256:ff7059bb7eb1179e2685604f4aaf157cfd9535242bd23742eadc3c13542139b4"}, + {file = "platformdirs-4.3.8.tar.gz", hash = "sha256:3d512d96e16bcb959a814c9f348431070822a6496326a4be0911c40b5a74c2bc"}, ] [package.extras] @@ -217,14 +217,14 @@ files = [ [[package]] name = "virtualenv" -version = "20.30.0" +version = "20.31.2" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.8" groups = ["dev"] files = [ - {file = "virtualenv-20.30.0-py3-none-any.whl", hash = "sha256:e34302959180fca3af42d1800df014b35019490b119eba981af27f2fa486e5d6"}, - {file = "virtualenv-20.30.0.tar.gz", hash = "sha256:800863162bcaa5450a6e4d721049730e7f2dae07720e0902b0e4040bd6f9ada8"}, + {file = "virtualenv-20.31.2-py3-none-any.whl", hash = "sha256:36efd0d9650ee985f0cad72065001e66d49a6f24eb44d98980f630686243cf11"}, + {file = "virtualenv-20.31.2.tar.gz", hash = "sha256:e10c0a9d02835e592521be48b332b6caee6887f332c111aa79a09b9e79efc2af"}, ] [package.dependencies] @@ -238,5 +238,5 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess [metadata] lock-version = "2.1" -python-versions = "^3.11" -content-hash = "02e3335edeea832d1ec8747c019d764b884c05704b1ab292c7d2d27b2e21d86b" +python-versions = "^3.9" +content-hash = "4e323a4a9e17ff1a3a4038e5c65bfa6562caad1b578404c97503461017324860" diff --git a/pyproject.toml b/pyproject.toml index 7331b8b9..2380115e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ description = "Docker Odoo Base, a highly opinionated image ready to put Odoo in authors = ["Tecnativa"] [tool.poetry.dependencies] -python = "^3.11" +python = "^3.9" [tool.poetry.group.dev.dependencies] plumbum = "^1.6.9" From 165073fd999f61a800ebf8f296278eb12cfcbe38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=2E=20D=C3=ADaz?= Date: Sat, 17 May 2025 05:57:23 +0200 Subject: [PATCH 245/255] [IMP] testing onbuild images --- tests/__init__.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/__init__.py b/tests/__init__.py index 27612e64..c0dd6233 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -54,6 +54,27 @@ def matrix( class ScaffoldingCase(unittest.TestCase): + @classmethod + def setUpClass(cls): + # We build the ā€œonbuildā€ images with the latest changes for + # testing instead of relying on the latest published ones. + for ODOO_VER in ODOO_VERSIONS: + print(f"Building ${ODOO_VER}-onbuild image...") + Popen( + ( + "docker", + "build", + "-t", + f"tecnativa/doodba:{ODOO_VER}-onbuild", + "-f", + f"{ODOO_VER}.Dockerfile", + "--target", + "onbuild", + ".", + ), + cwd=os.getcwd(), + ).wait() + def setUp(self): super().setUp() self.compose_run = ("docker", "compose", "run", "--rm", "odoo") From 201237e601c10b3bb77bc0603fbabf176fcca51c Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Fri, 13 Jun 2025 08:06:32 +0200 Subject: [PATCH 246/255] [IMP] Test using PR-build img --- .github/workflows/ci.yaml | 151 ++++++++++++++++++++++++-------------- 1 file changed, 97 insertions(+), 54 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6bd89880..1845bd90 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -27,60 +27,11 @@ jobs: key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} - uses: pre-commit/action@v3.0.1 - test: - runs-on: ubuntu-24.04 - needs: pre-commit - strategy: - fail-fast: false - matrix: - # Test modern Odoo versions with latest Postgres version - odoo_version: ["18.0"] - pg_version: ["16"] - python_version: ["3.10"] - include: - # Older odoo versions don't support latest postgres and Python versions - - odoo_version: "17.0" - pg_version: "15" - python_version: "3.10" - - odoo_version: "16.0" - pg_version: "14" - python_version: "3.10" - - odoo_version: "15.0" - pg_version: "14" - python_version: "3.9" - - odoo_version: "14.0" - pg_version: "14" - python_version: "3.9" - - odoo_version: "13.0" - pg_version: "14" - python_version: "3.9" - env: - # Other variables to configure tests and execution environment - DOCKER_BUILDKIT: 1 - PG_VERSIONS: ${{ matrix.pg_version }} - ODOO_MINOR: ${{ matrix.odoo_version }} - DOCKER_TAG: ${{ matrix.odoo_version }} - steps: - # Prepare - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python_version }} - - uses: docker/setup-compose-action@v1 - with: - version: latest - # Install dev and test dependencies - - run: pip install poetry - - name: Patch $PATH - run: echo "$HOME/.local/bin" >> $GITHUB_PATH - - run: poetry install - # Test - - run: poetry run python -m unittest -v tests - build-push-pr: + # Build & push PR images so tests and local dev can pull them if: github.event_name == 'pull_request' runs-on: ubuntu-24.04 - needs: test + needs: pre-commit strategy: fail-fast: false matrix: @@ -167,8 +118,8 @@ jobs: ${{ github.repository == 'tecnativa/doodba' && github.event.pull_request.head.repo.full_name == github.repository }} tags: | - ${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}-onbuild-pr-${{ github.event.pull_request.number }}-test - ${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }}-onbuild-pr-${{ github.event.pull_request.number }}-test + ${{ env.DOCKER_REPO }}:${{ matrix.odoo_version }}-pr-${{ github.event.pull_request.number }}-test-onbuild + ${{ env.GHCR_HOST }}/${{ env.DOCKER_REPO }}${{ env.DOCKER_REPO_SUFFIX }}:${{ matrix.odoo_version }}-pr-${{ github.event.pull_request.number }}-test-onbuild target: onbuild build-args: | VCS_REF=${{ github.sha }} @@ -179,7 +130,99 @@ jobs: docker system prune -af --volumes || true docker builder prune -af || true + test-pr: + # Run tests in PR using the freshly pushed images + if: github.event_name == 'pull_request' + runs-on: ubuntu-24.04 + needs: build-push-pr + strategy: + fail-fast: false + matrix: + odoo_version: ["18.0"] + pg_version: ["16"] + python_version: ["3.10"] + include: + - odoo_version: "17.0" + pg_version: "15" + python_version: "3.10" + - odoo_version: "16.0" + pg_version: "14" + python_version: "3.10" + - odoo_version: "15.0" + pg_version: "14" + python_version: "3.9" + - odoo_version: "14.0" + pg_version: "14" + python_version: "3.9" + - odoo_version: "13.0" + pg_version: "14" + python_version: "3.9" + env: + DOCKER_BUILDKIT: 1 + PG_VERSIONS: ${{ matrix.pg_version }} + ODOO_MINOR: + ${{ matrix.odoo_version }}-pr-${{ github.event.pull_request.number }}-test + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python_version }} + - uses: docker/setup-compose-action@v1 + with: + version: latest + - run: pip install poetry + - name: Patch $PATH + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - run: poetry install + - run: poetry run python -m unittest -v tests + + test: + if: github.event_name != 'pull_request' + runs-on: ubuntu-24.04 + needs: pre-commit + strategy: + fail-fast: false + matrix: + odoo_version: ["18.0"] + pg_version: ["16"] + python_version: ["3.10"] + include: + - odoo_version: "17.0" + pg_version: "15" + python_version: "3.10" + - odoo_version: "16.0" + pg_version: "14" + python_version: "3.10" + - odoo_version: "15.0" + pg_version: "14" + python_version: "3.9" + - odoo_version: "14.0" + pg_version: "14" + python_version: "3.9" + - odoo_version: "13.0" + pg_version: "14" + python_version: "3.9" + env: + DOCKER_BUILDKIT: 1 + PG_VERSIONS: ${{ matrix.pg_version }} + ODOO_MINOR: ${{ matrix.odoo_version }} + DOCKER_TAG: ${{ matrix.odoo_version }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python_version }} + - uses: docker/setup-compose-action@v1 + with: + version: latest + - run: pip install poetry + - name: Patch $PATH + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - run: poetry install + - run: poetry run python -m unittest -v tests + build-push-official: + # Only publish final images from master after tests pass if: github.repository == 'tecnativa/doodba' && github.ref == 'refs/heads/master' runs-on: ubuntu-24.04 needs: test @@ -202,7 +245,7 @@ jobs: - odoo_version: "13.0" platforms: "linux/amd64" env: - # Indicates what's the equivalent to tecnativa/doodba:latest image + # Indicates what tag matches tecnativa/doodba:latest LATEST_RELEASE: "18.0" # Define the docker hub repository location and github container registry host DOCKER_REPO: tecnativa/doodba From b1ad99357fe2da8ea32a3bbe76cfb34ef85416de Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Mon, 14 Jul 2025 08:08:25 +0200 Subject: [PATCH 247/255] [FIX] Point Buster APT sources to archive --- 13.0.Dockerfile | 2 ++ 14.0.Dockerfile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/13.0.Dockerfile b/13.0.Dockerfile index f8846cf4..52006396 100644 --- a/13.0.Dockerfile +++ b/13.0.Dockerfile @@ -34,6 +34,8 @@ ENV DB_FILTER=.* \ WDB_WEB_PORT=1984 \ WDB_WEB_SERVER=localhost +# Debian buster was moved to archive +RUN sed -i 's,http://deb.debian.org,http://archive.debian.org,g;s,http://security.debian.org,http://archive.debian.org,g' /etc/apt/sources.list # Other requirements and recommendations # See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control RUN apt-get -qq update \ diff --git a/14.0.Dockerfile b/14.0.Dockerfile index 4699c6bc..446eb047 100644 --- a/14.0.Dockerfile +++ b/14.0.Dockerfile @@ -33,6 +33,8 @@ ENV DB_FILTER=.* \ WDB_WEB_PORT=1984 \ WDB_WEB_SERVER=localhost +# Debian buster was moved to archive +RUN sed -i 's,http://deb.debian.org,http://archive.debian.org,g;s,http://security.debian.org,http://archive.debian.org,g' /etc/apt/sources.list # Other requirements and recommendations # See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control RUN apt-get -qq update \ From db33b9c27360ef82e0559c80f2585a9b0202d7c9 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Mon, 14 Jul 2025 10:43:19 +0200 Subject: [PATCH 248/255] [FIX] bump reportlab to 3.6.13 to stop arm64 build segfaults --- 15.0.Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/15.0.Dockerfile b/15.0.Dockerfile index b626dfa8..0e317271 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -139,7 +139,9 @@ RUN build_deps=" \ && DEBIAN_FRONTEND=noninteractive apt-get install -yqq --no-install-recommends $build_deps \ && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ && echo "Setting gevent and greenlet versions to 21.12.0 and 1.1.0 (compatible with Debian Bullseye)" \ - && sed -i -E "s/(gevent==)[0-9\.]+/\121.12.0/; s/(greenlet==)[0-9\.]+/\11.1.0/" requirements.txt \ + && sed -i -E "s/(gevent==)[0-9\.]+/\121.12.0/; \ + s/(greenlet==)[0-9\.]+/\11.1.0/; \ + s/(reportlab==)[0-9\.]+/reportlab==3.6.13/" requirements.txt \ && pip install -r requirements.txt \ 'websocket-client~=0.56' \ astor \ From f7af71ca63088500b0cfff9562d698ca1e19aac1 Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Tue, 19 Aug 2025 11:58:12 +0200 Subject: [PATCH 249/255] [DCK] Use https to get bookworm-pgdg --- 15.0.Dockerfile | 2 +- 16.0.Dockerfile | 2 +- 17.0.Dockerfile | 2 +- 18.0.Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/15.0.Dockerfile b/15.0.Dockerfile index 0e317271..a9146618 100644 --- a/15.0.Dockerfile +++ b/15.0.Dockerfile @@ -71,7 +71,7 @@ RUN apt-get -qq update \ openssh-client \ telnet \ vim \ - && echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + && echo 'deb https://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ diff --git a/16.0.Dockerfile b/16.0.Dockerfile index e9417451..06214d57 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -75,7 +75,7 @@ RUN echo "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFI openssh-client \ telnet \ vim -RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ +RUN echo 'deb https://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ diff --git a/17.0.Dockerfile b/17.0.Dockerfile index 69ba5626..9e057395 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -74,7 +74,7 @@ RUN echo "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFI openssh-client \ telnet \ vim -RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ +RUN echo 'deb https://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ diff --git a/18.0.Dockerfile b/18.0.Dockerfile index 6d366c47..dc97c8c4 100644 --- a/18.0.Dockerfile +++ b/18.0.Dockerfile @@ -74,7 +74,7 @@ RUN echo "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFI openssh-client \ telnet \ vim -RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ +RUN echo 'deb https://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ From a6ebc580f9949f239ae30ac02273064fdd297c97 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 1 Sep 2025 10:12:04 +0200 Subject: [PATCH 250/255] [FIX][16.0][17.0][18.0] Dockerfile: restore single layer install (and cleanup) with https://github.com/Tecnativa/doodba/pull/578 the images for 16.0 and 17.0 were changed to use 2 layers instead of one layer --- 16.0.Dockerfile | 4 ++-- 17.0.Dockerfile | 4 ++-- 18.0.Dockerfile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/16.0.Dockerfile b/16.0.Dockerfile index 06214d57..3a32cea6 100644 --- a/16.0.Dockerfile +++ b/16.0.Dockerfile @@ -74,8 +74,8 @@ RUN echo "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFI npm \ openssh-client \ telnet \ - vim -RUN echo 'deb https://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + vim \ + && echo 'deb https://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ diff --git a/17.0.Dockerfile b/17.0.Dockerfile index 9e057395..2d50f2a3 100644 --- a/17.0.Dockerfile +++ b/17.0.Dockerfile @@ -73,8 +73,8 @@ RUN echo "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFI npm \ openssh-client \ telnet \ - vim -RUN echo 'deb https://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + vim \ + && echo 'deb https://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ diff --git a/18.0.Dockerfile b/18.0.Dockerfile index dc97c8c4..9cf13c18 100644 --- a/18.0.Dockerfile +++ b/18.0.Dockerfile @@ -73,8 +73,8 @@ RUN echo "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFI npm \ openssh-client \ telnet \ - vim -RUN echo 'deb https://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + vim \ + && echo 'deb https://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ && apt-get update \ && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ From 5fbf8f86157c16b06ecdc19ff66c1387f15887bc Mon Sep 17 00:00:00 2001 From: josep-tecnativa Date: Mon, 15 Sep 2025 13:52:25 +0200 Subject: [PATCH 251/255] [ADD] Odoo 19.0 --- .github/workflows/ci.yaml | 35 ++- 19.0.Dockerfile | 259 ++++++++++++++++++ entrypoint.d/50-config-generate | 2 +- tests/__init__.py | 22 +- .../settings/custom/scripts/test_settings.py | 4 +- 5 files changed, 299 insertions(+), 23 deletions(-) create mode 100644 19.0.Dockerfile diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1845bd90..12dd48a1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,10 +36,12 @@ jobs: fail-fast: false matrix: # Test modern Odoo versions with latest Postgres version - odoo_version: ["18.0"] + odoo_version: ["19.0"] platforms: ["linux/amd64,linux/arm64"] include: # Older odoo versions don't support latest postgres and Python versions + - odoo_version: "18.0" + platforms: "linux/amd64,linux/arm64" - odoo_version: "17.0" platforms: "linux/amd64,linux/arm64" - odoo_version: "16.0" @@ -52,7 +54,7 @@ jobs: platforms: "linux/amd64" env: # Indicates what's the equivalent to tecnativa/doodba:latest image - LATEST_RELEASE: "18.0" + LATEST_RELEASE: "19.0" DOCKER_REPO: tecnativa/doodba GHCR_HOST: ghcr.io steps: @@ -138,10 +140,13 @@ jobs: strategy: fail-fast: false matrix: - odoo_version: ["18.0"] - pg_version: ["16"] - python_version: ["3.10"] + odoo_version: ["19.0"] + pg_version: ["17"] + python_version: ["3.12"] include: + - odoo_version: "18.0" + pg_version: "16" + python_version: "3.10" - odoo_version: "17.0" pg_version: "15" python_version: "3.10" @@ -159,9 +164,10 @@ jobs: python_version: "3.9" env: DOCKER_BUILDKIT: 1 - PG_VERSIONS: ${{ matrix.pg_version }} - ODOO_MINOR: + DOCKER_TAG: ${{ matrix.odoo_version }}-pr-${{ github.event.pull_request.number }}-test + PG_VERSIONS: ${{ matrix.pg_version }} + ODOO_MINOR: ${{ matrix.odoo_version }} steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 @@ -183,10 +189,13 @@ jobs: strategy: fail-fast: false matrix: - odoo_version: ["18.0"] - pg_version: ["16"] - python_version: ["3.10"] + odoo_version: ["19.0"] + pg_version: ["17"] + python_version: ["3.12"] include: + - odoo_version: "18.0" + pg_version: "16" + python_version: "3.10" - odoo_version: "17.0" pg_version: "15" python_version: "3.10" @@ -230,10 +239,12 @@ jobs: fail-fast: false matrix: # Test modern Odoo versions with latest Postgres version - odoo_version: ["18.0"] + odoo_version: ["19.0"] platforms: ["linux/amd64,linux/arm64"] include: # Older odoo versions don't support latest postgres and Python versions + - odoo_version: "18.0" + platforms: "linux/amd64,linux/arm64" - odoo_version: "17.0" platforms: "linux/amd64,linux/arm64" - odoo_version: "16.0" @@ -246,7 +257,7 @@ jobs: platforms: "linux/amd64" env: # Indicates what tag matches tecnativa/doodba:latest - LATEST_RELEASE: "18.0" + LATEST_RELEASE: "19.0" # Define the docker hub repository location and github container registry host DOCKER_REPO: tecnativa/doodba GHCR_HOST: ghcr.io diff --git a/19.0.Dockerfile b/19.0.Dockerfile new file mode 100644 index 00000000..f3982476 --- /dev/null +++ b/19.0.Dockerfile @@ -0,0 +1,259 @@ +FROM python:3.12-slim-bookworm AS base + +EXPOSE 8069 8072 + +ARG TARGETARCH +ARG GEOIP_UPDATER_VERSION=6.0.0 +ARG WKHTMLTOPDF_VERSION=0.12.6.1 +ARG WKHTMLTOPDF_AMD64_CHECKSUM='98ba0d157b50d36f23bd0dedf4c0aa28c7b0c50fcdcdc54aa5b6bbba81a3941d' +ARG WKHTMLTOPDF_ARM64_CHECKSUM="b6606157b27c13e044d0abbe670301f88de4e1782afca4f9c06a5817f3e03a9c" +ARG WKHTMLTOPDF_URL="https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}-3/wkhtmltox_${WKHTMLTOPDF_VERSION}-3.bookworm_${TARGETARCH}.deb" +ARG LAST_SYSTEM_UID=499 +ARG LAST_SYSTEM_GID=499 +ARG FIRST_UID=500 +ARG FIRST_GID=500 +ENV DB_FILTER=.* \ + DEPTH_DEFAULT=1 \ + DEPTH_MERGE=100 \ + EMAIL=https://hub.docker.com/r/tecnativa/odoo \ + GEOIP_ACCOUNT_ID="" \ + GEOIP_LICENSE_KEY="" \ + GIT_AUTHOR_NAME=docker-odoo \ + INITIAL_LANG="" \ + LC_ALL=C.UTF-8 \ + LIST_DB=false \ + NODE_PATH=/usr/local/lib/node_modules:/usr/lib/node_modules \ + ODOO_RC=/opt/odoo/auto/odoo.conf \ + PATH="/home/odoo/.local/bin:$PATH" \ + PIP_NO_CACHE_DIR=0 \ + DEBUGPY_ARGS="--listen 0.0.0.0:6899 --wait-for-client" \ + DEBUGPY_ENABLE=0 \ + PUDB_RDB_HOST=0.0.0.0 \ + PUDB_RDB_PORT=6899 \ + PYTHONOPTIMIZE="" \ + UNACCENT=true \ + WAIT_DB=true \ + WDB_NO_BROWSER_AUTO_OPEN=True \ + WDB_SOCKET_SERVER=wdb \ + WDB_WEB_PORT=1984 \ + WDB_WEB_SERVER=localhost + +# Other requirements and recommendations +# See https://github.com/$ODOO_SOURCE/blob/$ODOO_VERSION/debian/control +RUN echo "LAST_SYSTEM_UID=$LAST_SYSTEM_UID\nLAST_SYSTEM_GID=$LAST_SYSTEM_GID\nFIRST_UID=$FIRST_UID\nFIRST_GID=$FIRST_GID" >> /etc/adduser.conf \ + && echo "SYS_UID_MAX $LAST_SYSTEM_UID\nSYS_GID_MAX $LAST_SYSTEM_GID" >> /etc/login.defs \ + && sed -i -E "s/^UID_MIN\s+[0-9]+.*/UID_MIN $FIRST_UID/;s/^GID_MIN\s+[0-9]+.*/GID_MIN $FIRST_GID/" /etc/login.defs \ + && useradd --system -u $LAST_SYSTEM_UID -s /usr/sbin/nologin -d / systemd-network \ + && apt-get -qq update \ + && apt-get install -yqq --no-install-recommends \ + curl \ + && if [ "$TARGETARCH" = "arm64" ]; then \ + WKHTMLTOPDF_CHECKSUM=$WKHTMLTOPDF_ARM64_CHECKSUM; \ + elif [ "$TARGETARCH" = "amd64" ]; then \ + WKHTMLTOPDF_CHECKSUM=$WKHTMLTOPDF_AMD64_CHECKSUM; \ + else \ + echo "Unsupported architecture: $TARGETARCH" >&2; \ + exit 1; \ + fi \ + && curl -SLo wkhtmltox.deb ${WKHTMLTOPDF_URL} \ + && echo "Downloading wkhtmltopdf from: ${WKHTMLTOPDF_URL}" \ + && echo "Expected wkhtmltox checksum: ${WKHTMLTOPDF_CHECKSUM}" \ + && echo "Computed wkhtmltox checksum: $(sha256sum wkhtmltox.deb | awk '{ print $1 }')" \ + && echo "${WKHTMLTOPDF_CHECKSUM} wkhtmltox.deb" | sha256sum -c - \ + && apt-get install -yqq --no-install-recommends \ + ./wkhtmltox.deb \ + chromium \ + ffmpeg \ + fonts-liberation2 \ + gettext \ + git \ + gnupg2 \ + locales-all \ + nano \ + npm \ + openssh-client \ + telnet \ + vim \ + && echo 'deb https://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \ + && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ + && apt-get update \ + && curl --silent -L --output geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb https://github.com/maxmind/geoipupdate/releases/download/v${GEOIP_UPDATER_VERSION}/geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ + && dpkg -i geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ + && rm geoipupdate_${GEOIP_UPDATER_VERSION}_linux_${TARGETARCH}.deb \ + && apt-get autopurge -yqq \ + && rm -Rf wkhtmltox.deb /var/lib/apt/lists/* /tmp/* \ + && sync + +WORKDIR /opt/odoo +COPY bin/* /usr/local/bin/ +COPY lib/doodbalib /usr/local/lib/python3.12/site-packages/doodbalib +COPY build.d common/build.d +COPY conf.d common/conf.d +COPY entrypoint.d common/entrypoint.d +RUN rm -f /opt/odoo/common/conf.d/60-geoip-lt17.conf \ + && mv /opt/odoo/common/conf.d/60-geoip-ge17.conf /opt/odoo/common/conf.d/60-geoip.conf +RUN mkdir -p auto/addons auto/geoip custom/src/private \ + && ln /usr/local/bin/direxec common/entrypoint \ + && ln /usr/local/bin/direxec common/build \ + && chmod -R a+rx common/entrypoint* common/build* /usr/local/bin \ + && chmod -R a+rX /usr/local/lib/python3.12/site-packages/doodbalib \ + && cp -a /etc/GeoIP.conf /etc/GeoIP.conf.orig \ + && mv /etc/GeoIP.conf /opt/odoo/auto/geoip/GeoIP.conf \ + && ln -s /opt/odoo/auto/geoip/GeoIP.conf /etc/GeoIP.conf \ + && sed -i 's/.*DatabaseDirectory .*$/DatabaseDirectory \/opt\/odoo\/auto\/geoip\//g' /opt/odoo/auto/geoip/GeoIP.conf \ + && sync + +# Doodba-QA dependencies in a separate virtualenv +COPY qa /qa +RUN python -m venv --system-site-packages /qa/venv \ + && . /qa/venv/bin/activate \ + && pip install \ + click \ + coverage \ + && deactivate \ + && mkdir -p /qa/artifacts + +ARG ODOO_SOURCE=OCA/OCB +ARG ODOO_VERSION=19.0 +ENV ODOO_VERSION="$ODOO_VERSION" + +# Install Odoo hard & soft dependencies, and Doodba utilities +RUN build_deps=" \ + build-essential \ + libfreetype6-dev \ + libfribidi-dev \ + libghc-zlib-dev \ + libharfbuzz-dev \ + libjpeg-dev \ + liblcms2-dev \ + libldap2-dev \ + libopenjp2-7-dev \ + libpq-dev \ + libsasl2-dev \ + libtiff5-dev \ + libwebp-dev \ + libxml2-dev \ + libxslt-dev \ + tcl-dev \ + tk-dev \ + zlib1g-dev \ + " \ + && apt-get update \ + && apt-get install -yqq --no-install-recommends $build_deps \ + && curl -o requirements.txt https://raw.githubusercontent.com/$ODOO_SOURCE/$ODOO_VERSION/requirements.txt \ + # need to upgrade setuptools, since the fixes for CVE-2024-6345 rolled out in base images we get errors "error: invalid command 'bdist_wheel'" + && pip install --upgrade setuptools \ + && pip install -r requirements.txt \ + 'websocket-client~=0.56' \ + astor \ + click-odoo-contrib \ + debugpy \ + pydevd-odoo \ + git+https://github.com/mailgun/flanker.git@v0.9.15#egg=flanker[validator] \ + geoip2 \ + "git-aggregator==4.0" \ + inotify \ + pdfminer.six \ + pg_activity \ + phonenumbers \ + plumbum \ + pudb \ + pyOpenSSL \ + python-magic \ + watchdog \ + wdb \ + && (python3 -m compileall -q /usr/local/lib/python3.12/ || true) \ + # generate flanker cached tables during install when /usr/local/lib/ is still intended to be written to + # https://github.com/Tecnativa/doodba/issues/486 + && python3 -c 'from flanker.addresslib import address' >/dev/null 2>&1 \ + && apt-get purge -yqq $build_deps \ + && apt-get autopurge -yqq \ + && rm -Rf /var/lib/apt/lists/* /tmp/* + +# Metadata +ARG VCS_REF +ARG BUILD_DATE +ARG VERSION +LABEL org.label-schema.schema-version="$VERSION" \ + org.label-schema.vendor=Tecnativa \ + org.label-schema.license=Apache-2.0 \ + org.label-schema.build-date="$BUILD_DATE" \ + org.label-schema.vcs-ref="$VCS_REF" \ + org.label-schema.vcs-url="https://github.com/Tecnativa/doodba" + +# Onbuild version, with all the magic +FROM base AS onbuild + +# Enable setting custom uids for odoo user during build of scaffolds +ONBUILD ARG UID=1000 +ONBUILD ARG GID=1000 + +# Enable Odoo user and filestore +ONBUILD RUN groupadd -g $GID odoo -o \ + && useradd -l -md /home/odoo -s /bin/false -u $UID -g $GID odoo \ + && mkdir -p /var/lib/odoo \ + && chown -R odoo:odoo /var/lib/odoo /qa/artifacts \ + && chmod a=rwX /qa/artifacts \ + && sync + +# Subimage triggers +ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] +ONBUILD CMD ["/usr/local/bin/odoo"] +ONBUILD ARG AGGREGATE=true +ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" +ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" +ONBUILD ARG DEPTH_DEFAULT=1 +ONBUILD ARG DEPTH_MERGE=100 +ONBUILD ARG CLEAN=true +ONBUILD ARG COMPILE=true +ONBUILD ARG FONT_MONO="Liberation Mono" +ONBUILD ARG FONT_SANS="Liberation Sans" +ONBUILD ARG FONT_SERIF="Liberation Serif" +ONBUILD ARG PIP_INSTALL_ODOO=true +ONBUILD ARG ADMIN_PASSWORD=admin +ONBUILD ARG SMTP_SERVER=smtp +ONBUILD ARG SMTP_PORT=25 +ONBUILD ARG SMTP_USER=false +ONBUILD ARG SMTP_PASSWORD=false +ONBUILD ARG SMTP_SSL=false +ONBUILD ARG EMAIL_FROM="" +ONBUILD ARG PROXY_MODE=false +ONBUILD ARG WITHOUT_DEMO=all +ONBUILD ARG PGUSER=odoo +ONBUILD ARG PGPASSWORD=odoopassword +ONBUILD ARG PGHOST=db +ONBUILD ARG PGPORT=5432 +ONBUILD ARG PGDATABASE=prod + +# Config variables +ONBUILD ENV ADMIN_PASSWORD="$ADMIN_PASSWORD" \ + DEFAULT_REPO_PATTERN="$DEFAULT_REPO_PATTERN" \ + DEFAULT_REPO_PATTERN_ODOO="$DEFAULT_REPO_PATTERN_ODOO" \ + UNACCENT="$UNACCENT" \ + PGUSER="$PGUSER" \ + PGPASSWORD="$PGPASSWORD" \ + PGHOST="$PGHOST" \ + PGPORT=$PGPORT \ + PGDATABASE="$PGDATABASE" \ + PROXY_MODE="$PROXY_MODE" \ + SMTP_SERVER="$SMTP_SERVER" \ + SMTP_PORT=$SMTP_PORT \ + SMTP_USER="$SMTP_USER" \ + SMTP_PASSWORD="$SMTP_PASSWORD" \ + SMTP_SSL="$SMTP_SSL" \ + EMAIL_FROM="$EMAIL_FROM" \ + WITHOUT_DEMO="$WITHOUT_DEMO" +ONBUILD ARG LOCAL_CUSTOM_DIR=./custom +ONBUILD COPY --chown=root:odoo $LOCAL_CUSTOM_DIR /opt/odoo/custom + +# https://docs.python.org/3/library/logging.html#levels +ONBUILD ARG LOG_LEVEL=INFO +ONBUILD RUN [ -d ~root/.ssh ] && rm -r ~root/.ssh; \ + mkdir -p /opt/odoo/custom/ssh \ + && ln -s /opt/odoo/custom/ssh ~root/.ssh \ + && chmod -R u=rwX,go= /opt/odoo/custom/ssh \ + && sync +ONBUILD ARG DB_VERSION=latest +ONBUILD RUN /opt/odoo/common/build && sync +ONBUILD VOLUME ["/var/lib/odoo"] +ONBUILD USER odoo diff --git a/entrypoint.d/50-config-generate b/entrypoint.d/50-config-generate index 93b3da4c..12c66944 100755 --- a/entrypoint.d/50-config-generate +++ b/entrypoint.d/50-config-generate @@ -1,5 +1,5 @@ #!/bin/bash -log INFO Generating $OPENERP_SERVER file. Overriding any existing... +log INFO "Generating ${OPENERP_SERVER:-$ODOO_RC} file. Overriding any existing..." config-generate diff --git a/tests/__init__.py b/tests/__init__.py index c0dd6233..cf1bdade 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -15,8 +15,8 @@ DIR = dirname(__file__) ODOO_PREFIX = ("odoo", "--stop-after-init", "--workers=0") -ODOO_VERSIONS = frozenset(environ.get("DOCKER_TAG", "18.0").split()) -PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "16").split()) +ODOO_VERSIONS = frozenset(environ.get("ODOO_MINOR", "19.0").split()) +PG_VERSIONS = frozenset(environ.get("PG_VERSIONS", "17").split()) SCAFFOLDINGS_DIR = join(DIR, "scaffoldings") GEIOP_CREDENTIALS_PROVIDED = environ.get("GEOIP_LICENSE_KEY", False) and environ.get( "GEOIP_ACCOUNT_ID", False @@ -104,7 +104,12 @@ def compose_test(self, workdir, sub_env, *commands): full_env = dict(environ, **sub_env) with self.subTest(PWD=workdir, **sub_env): try: - self.popen(("docker", "compose", "build"), cwd=workdir, env=full_env) + build_arg = f"ODOO_VERSION={full_env.get('DOCKER_TAG', full_env.get('ODOO_MINOR', '19.0'))}" + self.popen( + ("docker", "compose", "build", "--build-arg", build_arg), + cwd=workdir, + env=full_env, + ) for command in commands: with self.subTest(command=command): self.popen( @@ -222,7 +227,7 @@ def _check_addons(self, scaffolding_dir, odoo_skip): def test_addons_filtered_lt_16(self): """Test addons filtering with ``ONLY`` keyword in ``addons.yaml`` for versions < 16""" - self._check_addons("dotd", {"16.0", "17.0", "18.0"}) + self._check_addons("dotd", {"16.0", "17.0", "18.0", "19.0"}) def test_addons_filtered_ge_16(self): """Test addons filtering with ``ONLY`` keyword in ``addons.yaml`` for versions >= 16""" @@ -357,7 +362,8 @@ def test_addons_env(self): ("test", "-e", "auto/addons/crm"), ("test", "-d", "auto/addons/crm/migrations"), ) - for sub_env in matrix(odoo_skip={"11.0", "12.0", "13.0"}): + # TODO: Review error on 19.0 + for sub_env in matrix(odoo_skip={"11.0", "12.0", "13.0", "19.0"}): self.compose_test( join(SCAFFOLDINGS_DIR, "addons_env_ou"), sub_env, @@ -438,7 +444,7 @@ def _check_dotd(self, scaffolding_dir, odoo_skip): def test_dotd_lt_16(self): """Test environment with common ``*.d`` directories for versions < 16.""" - self._check_dotd("dotd", {"16.0", "17.0", "18.0"}) + self._check_dotd("dotd", {"16.0", "17.0", "18.0", "19.0"}) def test_dotd_ge_16(self): """Test environment with common ``*.d`` directories for versions >= 16.""" @@ -490,7 +496,7 @@ def _check_dependencies(self, scaffolding_dir, odoo_skip): def test_dependencies_lt_16(self): """Test dependencies installation for versions < 16""" - self._check_dependencies("dependencies", {"16.0", "17.0", "18.0"}) + self._check_dependencies("dependencies", {"16.0", "17.0", "18.0", "19.0"}) def test_dependencies_ge_16(self): """Test dependencies installation for versions >= 16""" @@ -503,7 +509,7 @@ def test_dependencies_base_search_fuzzy(self): dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies_base_search_fuzzy") # TODO: Remove 18.0 from the matrix skip when 'base_search_fuzzy' # is available for that version - for sub_env in matrix(odoo_skip={"18.0"}): + for sub_env in matrix(odoo_skip={"18.0", "19.0"}): self.compose_test( dependencies_dir, sub_env, diff --git a/tests/scaffoldings/settings/custom/scripts/test_settings.py b/tests/scaffoldings/settings/custom/scripts/test_settings.py index 84ebb98d..65e5c195 100755 --- a/tests/scaffoldings/settings/custom/scripts/test_settings.py +++ b/tests/scaffoldings/settings/custom/scripts/test_settings.py @@ -10,11 +10,11 @@ def main(env): config = odoo.tools.config assert config.get("email_from") == "test@example.com" assert config.get("limit_memory_soft") == 2097152000 - assert config.get("smtp_password") is False + assert bool(config.get("smtp_password")) is False assert config.get("smtp_port") == 1025 assert config.get("smtp_server") == "mailhog" assert config.get("smtp_ssl") is False - assert config.get("smtp_user") is False + assert bool(config.get("smtp_user")) is False assert config.get("dbfilter") == ".*" From ddd96b7f827ff8432601a4c98362499b25081496 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Wed, 17 Sep 2025 15:12:53 +0200 Subject: [PATCH 252/255] [IMP] tests: activate test_dependencies_base_search_fuzzy for 18.0 --- tests/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index cf1bdade..2a0599da 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -507,9 +507,9 @@ def test_dependencies_ge_16(self): def test_dependencies_base_search_fuzzy(self): """Test dependencies installation.""" dependencies_dir = join(SCAFFOLDINGS_DIR, "dependencies_base_search_fuzzy") - # TODO: Remove 18.0 from the matrix skip when 'base_search_fuzzy' + # TODO: Remove 19.0 from the matrix skip when 'base_search_fuzzy' # is available for that version - for sub_env in matrix(odoo_skip={"18.0", "19.0"}): + for sub_env in matrix(odoo_skip={"19.0"}): self.compose_test( dependencies_dir, sub_env, From 369e9d3fc30c56b934010c843d33a8f556fc138f Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Mon, 22 Sep 2025 13:07:48 +0200 Subject: [PATCH 253/255] [FIX] CI: build image for DOCKER_TAG on test startup if needed in case the image was not pushed to registries in the build-push-pr step. also skip building onbuild images in tests if image got pushed in build-push-pr step. --- .github/workflows/ci.yaml | 4 ++++ tests/__init__.py | 34 ++++++++++++++++++++++++++++------ 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 12dd48a1..037e2f7f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -168,6 +168,10 @@ jobs: ${{ matrix.odoo_version }}-pr-${{ github.event.pull_request.number }}-test PG_VERSIONS: ${{ matrix.pg_version }} ODOO_MINOR: ${{ matrix.odoo_version }} + # signal to tests that they can use the prebuilt images from registries and do not need to build the image in setupClass + USE_PREBUILT_IMAGES: + ${{ github.repository == 'tecnativa/doodba' && + github.event.pull_request.head.repo.full_name == github.repository }} steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 diff --git a/tests/__init__.py b/tests/__init__.py index 2a0599da..6ead999e 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -56,24 +56,46 @@ def matrix( class ScaffoldingCase(unittest.TestCase): @classmethod def setUpClass(cls): - # We build the ā€œonbuildā€ images with the latest changes for - # testing instead of relying on the latest published ones. - for ODOO_VER in ODOO_VERSIONS: - print(f"Building ${ODOO_VER}-onbuild image...") + use_prebuilt_images = ( + os.environ.get("USE_PREBUILT_IMAGES", "false").lower() == "true" + ) + if "DOCKER_TAG" in os.environ and not use_prebuilt_images: + print(f"Building ${os.environ['DOCKER_TAG']}-onbuild image...") Popen( ( "docker", "build", "-t", - f"tecnativa/doodba:{ODOO_VER}-onbuild", + f"tecnativa/doodba:{os.environ['DOCKER_TAG']}-onbuild", "-f", - f"{ODOO_VER}.Dockerfile", + f"{os.environ['ODOO_MINOR']}.Dockerfile", "--target", "onbuild", ".", ), cwd=os.getcwd(), ).wait() + elif not use_prebuilt_images: + # We build the ā€œonbuildā€ images with the latest changes for + # testing instead of relying on the latest published ones. + for ODOO_VER in ODOO_VERSIONS: + print(f"Building ${ODOO_VER}-onbuild image...") + Popen( + ( + "docker", + "build", + "-t", + f"tecnativa/doodba:{ODOO_VER}-onbuild", + "-f", + f"{ODOO_VER}.Dockerfile", + "--target", + "onbuild", + ".", + ), + cwd=os.getcwd(), + ).wait() + else: + logging.info("using prebuilt images") def setUp(self): super().setUp() From 90d37540c52890ddd2d3cc4c52c0c089d381765b Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Wed, 8 Oct 2025 08:14:02 +0200 Subject: [PATCH 254/255] [IMP] tests: assert successful image build before testing --- tests/__init__.py | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 6ead999e..ecd462b9 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -55,45 +55,45 @@ def matrix( class ScaffoldingCase(unittest.TestCase): @classmethod - def setUpClass(cls): - use_prebuilt_images = ( - os.environ.get("USE_PREBUILT_IMAGES", "false").lower() == "true" - ) - if "DOCKER_TAG" in os.environ and not use_prebuilt_images: - print(f"Building ${os.environ['DOCKER_TAG']}-onbuild image...") + def build_base_image(cls, tag, file): + assert ( Popen( ( "docker", "build", "-t", - f"tecnativa/doodba:{os.environ['DOCKER_TAG']}-onbuild", + tag, "-f", - f"{os.environ['ODOO_MINOR']}.Dockerfile", + file, "--target", "onbuild", ".", ), cwd=os.getcwd(), ).wait() + == 0 + ), "Building image for tests failed" + + @classmethod + def setUpClass(cls): + use_prebuilt_images = ( + os.environ.get("USE_PREBUILT_IMAGES", "false").lower() == "true" + ) + if "DOCKER_TAG" in os.environ and not use_prebuilt_images: + print(f"Building {os.environ['DOCKER_TAG']}-onbuild image...") + cls.build_base_image( + f"tecnativa/doodba:{os.environ['DOCKER_TAG']}-onbuild", + f"{os.environ['ODOO_MINOR']}.Dockerfile", + ) elif not use_prebuilt_images: # We build the ā€œonbuildā€ images with the latest changes for # testing instead of relying on the latest published ones. for ODOO_VER in ODOO_VERSIONS: - print(f"Building ${ODOO_VER}-onbuild image...") - Popen( - ( - "docker", - "build", - "-t", - f"tecnativa/doodba:{ODOO_VER}-onbuild", - "-f", - f"{ODOO_VER}.Dockerfile", - "--target", - "onbuild", - ".", - ), - cwd=os.getcwd(), - ).wait() + print(f"Building {ODOO_VER}-onbuild image...") + cls.build_base_image( + f"tecnativa/doodba:{ODOO_VER}-onbuild", + f"{ODOO_VER}.Dockerfile", + ) else: logging.info("using prebuilt images") From f1b2b874293f72e2b000f525493651c10ad45651 Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Wed, 8 Oct 2025 16:25:22 +0200 Subject: [PATCH 255/255] [FIX] README.md: mention ODOO_RC environment variable --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f025b1d9..c686059c 100644 --- a/README.md +++ b/README.md @@ -596,8 +596,8 @@ not expose the debugging port to attackers**. Usage: ### [`git-aggregator`](https://pypi.python.org/pypi/git-aggregator) -We found this one to be the most useful tool for downlading code, merging it and placing -it somewhere. +We found this one to be the most useful tool for downloading code, merging it and +placing it somewhere. ### `autoaggregate` @@ -628,8 +628,8 @@ This [`repos.yaml`][] example merges [several sources][`odoo`]: ### [`odoo`](https://www.odoo.com/documentation/10.0/reference/cmdline.html) -We set an `$OPENERP_SERVER` environment variable pointing to -[the autogenerated configuration file](#optodooautoodooconf) so you don't have to worry +We set an `$OPENERP_SERVER` or `$ODOO_RC` environment variable pointing to +[the autogenerated configuration file](#optodooautoodooconf), so you don't have to worry about it. Just execute `odoo` and it will work fine. Note that version 9.0 has an `odoo` binary to provide forward compatibility (but it has