Skip to content

Commit

Permalink
Interrupted upgrade to master
Browse files Browse the repository at this point in the history
  • Loading branch information
Continuous integration committed Jun 26, 2024
1 parent 26c332e commit bf703a5
Show file tree
Hide file tree
Showing 45 changed files with 486 additions and 164 deletions.
6 changes: 6 additions & 0 deletions .UPGRADE_INSTRUCTIONS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Manually apply the ngeo application changes as shown in the `ngeo.diff` file.
You should apply the changes shown in the diff file on `CONST_create_template/<file>` on your project's `<file>`.
Some advice to be more efficient: if the changes on a file concern a file that you never customize, you can simply copy the new file from `CONST_create_template` (`cp CONST_create_template/<file> <file>`).You can furthermore add this file to the `unmanaged_files` section of the `project.yaml` file, to avoid its contents appearing in the diff file for the next upgrade.
Note that you can also apply them using: git apply --3way ngeo.diff
To continue, type:
./upgrade 2.9 10
40 changes: 30 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
# https://pre-commit.com/hooks.html

ci:
autoupdate_schedule: quarterly
skip:
- ripsecrets

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
args:
- --markdown-linebreak-ext=.md
- id: mixed-line-ending
args:
- --fix=lf
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v3.1.0
hooks:
- id: prettier
additional_dependencies:
- [email protected]
- repo: https://github.com/sbrunner/jsonschema-validator
rev: 0.1.0
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: jsonschema-validator
files: ^ci/config\.yaml$
ci:
skip:
- jsonschema-validator
- id: autoflake
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
61 changes: 61 additions & 0 deletions .upgrade.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
# The list (by include, exclude) of default files that will not be overwritten by the upgrade.
# That that can be extended with managed_files or reduced with unmanaged_files from the
# project.yaml file in the project root directory.
default_project_file:
include:
- geoportal/setup\.py
- geoportal/vars\.yaml
- geoportal/Makefile
- geoportal/geomapfish_geoportal/__init__\.py
- geoportal/geomapfish_geoportal/templates/.*
- geoportal/geomapfish_geoportal/locale/.*
- geoportal/geomapfish_geoportal/static/.*
- geoportal/geomapfish_geoportal/static-ngeo/.*
- print/print-apps/.*
- mapserver/.*
- tilegeneration/config\.yaml\.tmpl
- project\.yaml
- docker-compose\.yaml
- env\.project
- README\.rst
- \.github/workflows/main\.yaml
- \.github/workflows/rebuild\.yaml
exclude:
- mapserver/demo\.map\.tmpl
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/image/favicon\.ico

# Files ignored when creating the diff files => will just be left untouched.
no_diff:
- .*\.po
- CONST_.+
- .*/CONST_.+

# Files that will be present in the CONST_create_template but will not be considered in the upgrade.
# Used to provide the alt applications => does not disturb the user during upgrade.
extra:
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/mobile_alt\.html\.ejs
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/oeedit\.html\.ejs
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/Controllermobile_alt\.js
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/Controlleroeedit\.js
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/sass/mobile_alt\.scss
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/sass/vars_mobile_alt\.scss
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/sass/oeedit\.scss
- geoportal/geomapfish_geoportal/static-ngeo/js/apps/sass/vars_oeedit\.scss
- geoportal/interfaces/desktop_alt\.html\.mako
- geoportal/geomapfish_geoportal/static/images/background-layer-button\.png
- tests/test_testapp.py

# Automated file system operations:
# Remove some files or directories:
# - action: remove
# paths:
# - <one file or directory>
# Move a file:
# - action: move
# from: <src file>
# to: <dst file>
upgrade_files:
- action: remove
paths:
- geoportal/tools/extract-messages.js
24 changes: 19 additions & 5 deletions CONST_CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
This file includes migration steps for each release of c2cgeoportal.

=============
Version 2.8.1
Version 2.9.0
=============

1. Update dependencies to use GDAL 3.7
Information to know before starting the upgrade
===============================================

1. The build command will use Docker Compose version 2 (with the `docker compose` command).

Information
===========

1. Hostname check:
We add a hostname check on the `came_from` parameter, in the oauth2 login, allowed by
`vars.authentication.allowed_hosts` and in the OGC server clear cache, allowed by `vars.allowed_hosts`.
The behavior change a little bit in the `shortener.allowed_hosts` and in the `authorized_referers`.
Now everywhere:
- If the hostname (with port) of the candidate URL equals to the request's header "Host", then it's OK.
- If the hostname (with port) of the candidate URL is in the allowed list, then it's OK.
And they should be netloc (hostname with port) without schema or path.

Use MapServer 8.0 with GDAL 3.7 (instead of 3.6)
Use QGIS server 3.28 with GDAL 3.7 (instead of 3.6)
Use GDAL 3.7 as based image (instead of 3.6)
2. We replace checks (formatting) done by `c2cciutils` by `pre-commit` hooks.
This will me more standard and transparent for the project.

=============
Version 2.8.0
Expand Down
6 changes: 3 additions & 3 deletions CONST_create_template/.github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
timeout-minutes: 10

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# To publish the images to be used on Kubernetes
# - uses: camptocamp/initialise-gopass-summon-action@v2
Expand All @@ -33,8 +33,8 @@ jobs:
# - run: make secrets
# - run: cat env.secrets |grep '^[# A-Z0-9_]\+='|sed -e 's/^[# A-Z0-9_]\+=\(.*\)/::add-mask::\1/g'

- name: Checks
run: c2cciutils-checks
- name: Environment information
run: c2cciutils-env

# - name: Initialize the acceptance tests
# run: make acceptance-init
Expand Down
8 changes: 4 additions & 4 deletions CONST_create_template/.github/workflows/rebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
# Requires CI_GPG_PRIVATE_KEY and GOPASS_CI_GITHUB_TOKEN secrets.
# OPENSHIFT_PROJECT: gs-gmf-geomapfish
# The release branches
HELM_RELEASE_NAMES: int-2-8,prod-2-8
HELM_RELEASE_NAMES: int-2-9,prod-2-9

jobs:
rebuild:
Expand All @@ -22,11 +22,11 @@ jobs:
fail-fast: false
matrix:
branch:
- int-2-8
- prod-2-8
- int-2-9
- prod-2-9

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}

Expand Down
6 changes: 3 additions & 3 deletions CONST_create_template/.github/workflows/update_l10n.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
fail-fast: false
matrix:
include:
- branch: int-2-8
- branch: int-2-9
base_url: int.customer.ch
- branch: prod-2-8
- branch: prod-2-9
base_url: prod.customer.ch

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
token: ${{ secrets.GOPASS_CI_GITHUB_TOKEN }}
Expand Down
35 changes: 35 additions & 0 deletions CONST_create_template/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# https://pre-commit.com/hooks.html

ci:
autoupdate_schedule: quarterly
skip:
- ripsecrets

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
args:
- --markdown-linebreak-ext=.md
- id: mixed-line-ending
args:
- --fix=lf
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
1 change: 0 additions & 1 deletion CONST_create_template/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ RUN \
/usr/local/tomcat/webapps/ROOT/print-apps \
/etc/haproxy_dev \
/etc/haproxy \
&& adduser www-data root \
&& sed 's#bind :80#bind *:443 ssl crt /etc/haproxy_dev/localhost.pem#g' /etc/haproxy/haproxy.cfg.tmpl \
> /etc/haproxy_dev/haproxy.cfg.tmpl \
&& echo ' http-request set-header X-Forwarded-Proto https' >> /etc/haproxy_dev/haproxy.cfg.tmpl
Expand Down
22 changes: 11 additions & 11 deletions CONST_create_template/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,30 @@ update-po-from-url: ## Update the po files from the URL provide by PROJECT_PUBLI
curl --fail --retry 5 --retry-delay 1 \
$(PROJECT_PUBLIC_URL)locale.pot > geoportal/${PACKAGE}_geoportal/locale/${PACKAGE}_geoportal-client${SUFFIX}.pot
sed -i '/^"POT-Creation-Date: /d' geoportal/${PACKAGE}_geoportal/locale/${PACKAGE}_geoportal-client${SUFFIX}.pot
docker-compose run --rm -T tools update-po-only `id --user` `id --group` $(LANGUAGES)
docker compose run --rm -T tools update-po-only `id --user` `id --group` $(LANGUAGES)

.PHONY: update-po
update-po: ## Update the po files from the running composition
docker-compose exec -T tools sh -c "USER_ID=`id --user` GROUP_ID=`id --group` make --directory=geoportal update-po"
docker compose exec -T tools sh -c "USER_ID=`id --user` GROUP_ID=`id --group` make --directory=geoportal update-po"

.PHONY: checks
checks: prospector eslint ## Runs the checks

.PHONY: prospector
prospector: ## Runs the Prospector checks
docker-compose run --entrypoint= --no-deps --rm --volume=$(CURDIR)/geoportal:/app geoportal \
docker compose run --entrypoint= --no-deps --rm --volume=$(CURDIR)/geoportal:/app geoportal \
prospector --output-format=pylint --die-on-tool-error

.PHONY: eslint
eslint: ## Runs the eslint checks
docker-compose run --entrypoint= --no-deps --rm --volume=$(CURDIR)/geoportal:/app geoportal \
docker compose run --entrypoint= --no-deps --rm --volume=$(CURDIR)/geoportal:/app geoportal \
eslint $(find geomapfish -type f -name '*.js' -print 2> /dev/null)
docker-compose run --entrypoint= --no-deps --rm --volume=$(CURDIR)/geoportal:/app geoportal \
docker compose run --entrypoint= --no-deps --rm --volume=$(CURDIR)/geoportal:/app geoportal \
eslint $(find geomapfish -type f -name '*.ts' -print 2> /dev/null)

.PHONY: qgis
qgis: ## Run QGIS desktop
docker-compose -f docker-compose.yaml -f docker-compose-qgis.yaml run --rm qgis
docker compose -f docker-compose.yaml -f docker-compose-qgis.yaml run --rm qgis

secrets.tar.bz2.gpg: env.secrets ## Encrypt the secrets for committing changes
tar -jcf secrets.tar.bz2 $^
Expand All @@ -57,14 +57,14 @@ secrets: ## Decrypt the secrets.tar.bz2.gpg file

.PHONY: acceptance-init
acceptance-init: ## Initialize the acceptance tests
docker-compose --file=docker-compose.yaml --file=docker-compose-db.yaml up -d db tools
docker-compose exec -T tools wait-db
docker-compose exec -T tools psql --command="DROP EXTENSION IF EXISTS postgis CASCADE"
docker compose --file=docker-compose.yaml --file=docker-compose-db.yaml up -d db tools
docker compose exec -T tools wait-db
docker compose exec -T tools psql --command="DROP EXTENSION IF EXISTS postgis CASCADE"
scripts/db-restore --docker-compose-file=docker-compose.yaml --docker-compose-file=docker-compose-db.yaml \
--arg=--clean --arg=--if-exists --arg=--verbose $(DUMP_FILE)
docker-compose --file=docker-compose.yaml --file=docker-compose-db.yaml up -d
docker compose --file=docker-compose.yaml --file=docker-compose-db.yaml up -d

.PHONY: acceptance
acceptance: ## Run the acceptance tests
docker-compose exec -T tools pytest -vv tests/
docker compose exec -T tools pytest -vv tests/
ci/docker-compose-check
4 changes: 2 additions & 2 deletions CONST_create_template/README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
demo_geomapfish project
===================

Read the `Documentation <https://camptocamp.github.io/c2cgeoportal/2.8/>`_
Read the `Documentation <https://camptocamp.github.io/c2cgeoportal/2.9/>`_

Checkout
--------
Expand All @@ -24,6 +24,6 @@ Run

.. code::
docker-compose up -d
docker compose up -d
.. Feel free to add project-specific things.
Loading

0 comments on commit bf703a5

Please sign in to comment.