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 Oct 31, 2024
1 parent 287810e commit 17444a3
Show file tree
Hide file tree
Showing 24 changed files with 361 additions and 17 deletions.
6 changes: 6 additions & 0 deletions .UPGRADE_INSTRUCTIONS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The `create.diff` file is a recommendation of the changes that you should apply to your project.
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 create.diff
To continue, type:
./upgrade 2.9 11
67 changes: 67 additions & 0 deletions .upgrade.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
# 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
- action: move
from: geoportal/lingua-server.cfg
to: geoportal/lingva-server.cfg
- action: move
from: geoportal/lingua-client.cfg
to: geoportal/lingva-client.cfg
16 changes: 16 additions & 0 deletions CONST_CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ Information to know before starting the upgrade

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

2. RFC 001 - simplification of Ngeo buildtools and custom frontends for GeoMapfish
https://github.com/camptocamp/GeoMapFish/blob/6f8bffaa1e472cdd8ed3de52c8250b5da62d69de/rfcs/rfc_001.md

Important points:
- The `@ngInject` annotation is no more used, you should pass an array in the function or use the `$inject` property,
see related pull request: https://github.com/camptocamp/ngeo/pull/9453
- The build will not anymore inline the svg, If you use that you should do it manually,
see related commit: https://github.com/camptocamp/ngeo/pull/9454/commits/fb3ccfb0bdc8273975cdebfd7dbda401416674c3.
- Remove the custom SASS plugin to load the SCSS files.
You should have one SCSS file per interface, the component will not anymore integrate the related style.
See the related pull request: https://github.com/camptocamp/ngeo/pull/9455.
- Update Webpack to version 5 and remove Babel transpilation to ES05,
See the related pull request: https://github.com/camptocamp/ngeo/pull/9463.
- Update FontAwesome to version 6,
See the related pull request: https://github.com/camptocamp/ngeo/pull/9470

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

Expand Down
2 changes: 1 addition & 1 deletion CONST_create_template/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ENV CONFIG_VARS sqlalchemy.url sqlalchemy.pool_recycle sqlalchemy.pool_size sqla
dbsessions urllogin host_forward_host headers_whitelist headers_blacklist \
smtp c2c.base_path welcome_email \
lingva_extractor interfaces_config interfaces devserver_url api authentication intranet metrics pdfreport \
vector_tiles i18next main_ogc_server
vector_tiles i18next main_ogc_server static_files

COPY . /tmp/config/

Expand Down
2 changes: 1 addition & 1 deletion CONST_create_template/docker-compose.override.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
# - ./../c2cgeoportal/geoportal/c2cgeoportal_geoportal:/opt/c2cgeoportal/geoportal/c2cgeoportal_geoportal
# - ./../c2cgeoportal/admin/c2cgeoportal_admin:/opt/c2cgeoportal/admin/c2cgeoportal_admin
command:
- /usr/local/bin/pserve
- /venv/bin/pserve
- --reload
- c2c:///app/development.ini
environment:
Expand Down
2 changes: 1 addition & 1 deletion CONST_create_template/geoportal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RUN chmod go+w /etc/static-ngeo/

RUN --mount=type=cache,target=/root/.cache \
python3 -m pip install --disable-pip-version-check --editable=/app/ \
&& python3 -m compileall -q /usr/local/lib/python3.* \
&& python3 -m compileall -q /venv/lib/python3.* \
-x '/(ptvsd|.*pydev.*|networkx|scaffolds|yaml_include)/' \
&& python3 -m compileall -q /app/geomapfish_geoportal -x /app/geomapfish_geoportal/static.* \
&& pip freeze > /requirements.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@
'Ihr Browser wird nicht unterstützt, bitte verwenden Sie eine aktuelle Version von Firefox, Chrome oder Edge.'
);
</script>
<script src="<%= htmlWebpackPlugin.options.vars.entry_point %>static-ngeo/vendor.js?<%= htmlWebpackPlugin.options.vars.cache_version %>" crossorigin="anonymous"></script>

<% for (var js in htmlWebpackPlugin.files.js) { %>
<script src="<%= htmlWebpackPlugin.files.js[js] %>" crossorigin="anonymous"></script>
<% } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
'Ihr Browser wird nicht unterstützt, bitte verwenden Sie eine aktuelle Version von Firefox, Chrome oder Edge.'
);
</script>
<script src="<%= htmlWebpackPlugin.options.vars.entry_point %>static-ngeo/vendor.js?<%= htmlWebpackPlugin.options.vars.cache_version %>" crossorigin="anonymous"></script>

<% for (var js in htmlWebpackPlugin.files.js) { %>
<script src="<%= htmlWebpackPlugin.files.js[js] %>" crossorigin="anonymous"></script>
<% } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
'Ihr Browser wird nicht unterstützt, bitte verwenden Sie eine aktuelle Version von Firefox, Chrome oder Edge.'
);
</script>
<script src="<%= htmlWebpackPlugin.options.vars.entry_point %>static-ngeo/vendor.js?<%= htmlWebpackPlugin.options.vars.cache_version %>" crossorigin="anonymous"></script>

<% for (var js in htmlWebpackPlugin.files.js) { %>
<script src="<%= htmlWebpackPlugin.files.js[js] %>" crossorigin="anonymous"></script>
<% } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
'Ihr Browser wird nicht unterstützt, bitte verwenden Sie eine aktuelle Version von Firefox, Chrome oder Edge.'
);
</script>
<script src="<%= htmlWebpackPlugin.options.vars.entry_point %>static-ngeo/vendor.js?<%= htmlWebpackPlugin.options.vars.cache_version %>" crossorigin="anonymous"></script>

<% for (var js in htmlWebpackPlugin.files.js) { %>
<script src="<%= htmlWebpackPlugin.files.js[js] %>" crossorigin="anonymous"></script>
<% } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
'Ihr Browser wird nicht unterstützt, bitte verwenden Sie eine aktuelle Version von Firefox, Chrome oder Edge.'
);
</script>
<script src="<%= htmlWebpackPlugin.options.vars.entry_point %>static-ngeo/vendor.js?<%= htmlWebpackPlugin.options.vars.cache_version %>" crossorigin="anonymous"></script>

<% for (var js in htmlWebpackPlugin.files.js) { %>
<script src="<%= htmlWebpackPlugin.files.js[js] %>" crossorigin="anonymous"></script>
<% } %>
Expand Down
1 change: 1 addition & 0 deletions CONST_create_template/geoportal/webpack.commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const config = commons({
context: '/usr/lib/',
},
noTs: true,
nodll: true,
});

module.exports = () => config;
9 changes: 8 additions & 1 deletion CONST_create_template/tests/test_app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import time

import pytest
import requests

Expand Down Expand Up @@ -25,7 +27,12 @@
)
def test_url(url: str, params: dict[str, str], timeout: int) -> None:
"""Tests that some URL didn't return an error."""
response = requests.get(url, params=params, verify=False, timeout=timeout) # nosec
for _ in range(6):
response = requests.get(url, params=params, verify=False, timeout=timeout) # nosec
if response.status_code == 503:
time.sleep(1)
continue
break
assert response.status_code == 200, response.text


Expand Down
63 changes: 63 additions & 0 deletions create.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
diff --git a/Dockerfile b/Dockerfile
index 53ec97d..e2538a0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -14,7 +14,7 @@ ENV CONFIG_VARS sqlalchemy.url sqlalchemy.pool_recycle sqlalchemy.pool_size sqla
dbsessions urllogin host_forward_host headers_whitelist headers_blacklist \
smtp c2c.base_path welcome_email \
lingva_extractor interfaces_config interfaces devserver_url api authentication intranet metrics pdfreport \
- vector_tiles i18next main_ogc_server
+ vector_tiles i18next main_ogc_server static_files

COPY . /tmp/config/

diff --git a/docker-compose.override.sample.yaml b/docker-compose.override.sample.yaml
index c70e4d5..52ac887 100644
--- a/docker-compose.override.sample.yaml
+++ b/docker-compose.override.sample.yaml
@@ -12,7 +12,7 @@ services:
# - ./../c2cgeoportal/geoportal/c2cgeoportal_geoportal:/opt/c2cgeoportal/geoportal/c2cgeoportal_geoportal
# - ./../c2cgeoportal/admin/c2cgeoportal_admin:/opt/c2cgeoportal/admin/c2cgeoportal_admin
command:
- - /usr/local/bin/pserve
+ - /venv/bin/pserve
- --reload
- c2c:///app/development.ini
environment:
diff --git a/geoportal/Dockerfile b/geoportal/Dockerfile
index 756233f..2706c3b 100644
--- a/geoportal/Dockerfile
+++ b/geoportal/Dockerfile
@@ -41,7 +41,7 @@ RUN chmod go+w /etc/static-ngeo/

RUN --mount=type=cache,target=/root/.cache \
python3 -m pip install --disable-pip-version-check --editable=/app/ \
- && python3 -m compileall -q /usr/local/lib/python3.* \
+ && python3 -m compileall -q /venv/lib/python3.* \
-x '/(ptvsd|.*pydev.*|networkx|scaffolds|yaml_include)/' \
&& python3 -m compileall -q /app/geomapfish_geoportal -x /app/geomapfish_geoportal/static.* \
&& pip freeze > /requirements.txt
diff --git a/tests/test_app.py b/tests/test_app.py
index f4f246b..c60a3ed 100644
--- a/tests/test_app.py
+++ b/tests/test_app.py
@@ -1,3 +1,5 @@
+import time
+
import pytest
import requests

@@ -25,7 +27,12 @@ import requests
)
def test_url(url: str, params: dict[str, str], timeout: int) -> None:
"""Tests that some URL didn't return an error."""
- response = requests.get(url, params=params, verify=False, timeout=timeout) # nosec
+ for _ in range(6):
+ response = requests.get(url, params=params, verify=False, timeout=timeout) # nosec
+ if response.status_code == 503:
+ time.sleep(1)
+ continue
+ break
assert response.status_code == 200, response.text


28 changes: 26 additions & 2 deletions geoportal/CONST_config-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ mapping:
layout:
type: str
default: ngeo
html_filename:
type: str
interfaces_config:
required: True
type: map
Expand Down Expand Up @@ -205,6 +207,12 @@ mapping:
oauth2_token_expire_minutes:
type: scalar
required: false
oauth2:
type: map
required: false
mapping:
enabled:
type: bool
allowed_hosts:
type: seq
sequence:
Expand All @@ -214,8 +222,8 @@ mapping:
required: false
mapping:
enabled:
type: bool
default: false
type: scalar
# default: false
url:
type: str
required: false
Expand All @@ -239,6 +247,22 @@ mapping:
query_user_info:
type: bool
default: false
create_user:
type: bool
default: false
match_field:
type: str
enum:
- username
- email
update_fields:
type: seq
sequence:
- type: str
enum:
- username
- display_name
- email
user_info_fields:
type: map
mapping:
Expand Down
5 changes: 5 additions & 0 deletions geoportal/CONST_vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ vars:
oauth2_token_expire_minutes: 60
oauth2_authorization_expire_minutes: 10
max_consecutive_failures: 10
openid_connect:
enabled: '{OPENID_CONNECT_ENABLED}'

intranet:
networks: []
Expand Down Expand Up @@ -1389,6 +1391,8 @@ runtime_environment:
default: ''
- name: SENTRY_CLIENT_ENVIRONMENT
default: ''
- name: OPENID_CONNECT_ENABLED
default: 'false'

runtime_postprocess:
- expression: int({})
Expand Down Expand Up @@ -1469,6 +1473,7 @@ runtime_postprocess:
- expression: str({}).lower() in ("true", "yes", "1")
vars:
- authentication.two_factor
- authentication.openid_connect.enabled
- getitfixed.enabled
- layers.geometry_validation
- smtp.ssl
Expand Down
2 changes: 1 addition & 1 deletion geoportal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN chmod go+w /etc/static-ngeo/

RUN --mount=type=cache,target=/root/.cache \
python3 -m pip install --disable-pip-version-check --editable=/app/ \
&& python3 -m compileall -q /usr/local/lib/python3.* \
&& python3 -m compileall -q /venv/lib/python3.* \
-x '/(ptvsd|.*pydev.*|networkx|scaffolds|yaml_include)/' \
&& python3 -m compileall -q /app/geomapfish_geoportal -x /app/geomapfish_geoportal/static.*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@
'Ihr Browser wird nicht unterstützt, bitte verwenden Sie eine aktuelle Version von Firefox, Chrome oder Edge.'
);
</script>
<script src="<%= htmlWebpackPlugin.options.vars.entry_point %>static-ngeo/vendor.js?<%= htmlWebpackPlugin.options.vars.cache_version %>" crossorigin="anonymous"></script>

<% for (var js in htmlWebpackPlugin.files.js) { %>
<script src="<%= htmlWebpackPlugin.files.js[js] %>" crossorigin="anonymous"></script>
<% } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
'Ihr Browser wird nicht unterstützt, bitte verwenden Sie eine aktuelle Version von Firefox, Chrome oder Edge.'
);
</script>
<script src="<%= htmlWebpackPlugin.options.vars.entry_point %>static-ngeo/vendor.js?<%= htmlWebpackPlugin.options.vars.cache_version %>" crossorigin="anonymous"></script>

<% for (var js in htmlWebpackPlugin.files.js) { %>
<script src="<%= htmlWebpackPlugin.files.js[js] %>" crossorigin="anonymous"></script>
<% } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
'Ihr Browser wird nicht unterstützt, bitte verwenden Sie eine aktuelle Version von Firefox, Chrome oder Edge.'
);
</script>
<script src="<%= htmlWebpackPlugin.options.vars.entry_point %>static-ngeo/vendor.js?<%= htmlWebpackPlugin.options.vars.cache_version %>" crossorigin="anonymous"></script>

<% for (var js in htmlWebpackPlugin.files.js) { %>
<script src="<%= htmlWebpackPlugin.files.js[js] %>" crossorigin="anonymous"></script>
<% } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
'Ihr Browser wird nicht unterstützt, bitte verwenden Sie eine aktuelle Version von Firefox, Chrome oder Edge.'
);
</script>
<script src="<%= htmlWebpackPlugin.options.vars.entry_point %>static-ngeo/vendor.js?<%= htmlWebpackPlugin.options.vars.cache_version %>" crossorigin="anonymous"></script>

<% for (var js in htmlWebpackPlugin.files.js) { %>
<script src="<%= htmlWebpackPlugin.files.js[js] %>" crossorigin="anonymous"></script>
<% } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
'Ihr Browser wird nicht unterstützt, bitte verwenden Sie eine aktuelle Version von Firefox, Chrome oder Edge.'
);
</script>
<script src="<%= htmlWebpackPlugin.options.vars.entry_point %>static-ngeo/vendor.js?<%= htmlWebpackPlugin.options.vars.cache_version %>" crossorigin="anonymous"></script>

<% for (var js in htmlWebpackPlugin.files.js) { %>
<script src="<%= htmlWebpackPlugin.files.js[js] %>" crossorigin="anonymous"></script>
<% } %>
Expand Down
Loading

0 comments on commit 17444a3

Please sign in to comment.