Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre commit markdown (with $) #85

Merged
merged 6 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Install Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
image: qgis/qgis:3.34
steps:
- uses: actions/checkout@v4
- name: install system dependencies
- name: install system dependencies
run: apt update && apt install -y python3-poetry python3-flask python3-boto3
- name: Install Python dependencies
working-directory: qsa-api
Expand Down
12 changes: 12 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"no-inline-html": false,
"line-length": false,
"no-duplicate-heading": false,
"no-alt-text": false,
"first-line-heading": false,
"MD014": false,
"globs": [
"docs/**/*.md",
"*.md"
]
}
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: detect-private-key
- id: mixed-line-ending

- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.13.0
hooks:
- id: markdownlint-cli2
100 changes: 48 additions & 52 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,78 +5,74 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [1.1.0] - 2024-09-24

### Added

- Add Python files after installation of dependencies in Dockerfile : https://github.com/pblottiere/QSA/pull/68
- Add basic cache entrypoints : https://github.com/pblottiere/QSA/pull/74
- Add data type and band counts metadata for raster layers : https://github.com/pblottiere/QSA/pull/80
- Add Python files after installation of dependencies in Dockerfile : <https://github.com/pblottiere/QSA/pull/68>
- Add basic cache entrypoints : <https://github.com/pblottiere/QSA/pull/74>
- Add data type and band counts metadata for raster layers : <https://github.com/pblottiere/QSA/pull/80>

### Fixed

- Always create parent directory for internal sqlite database : https://github.com/pblottiere/QSA/pull/73
- Clear MapProxy legends cache : https://github.com/pblottiere/QSA/pull/78

- Always create parent directory for internal sqlite database : <https://github.com/pblottiere/QSA/pull/73>
- Clear MapProxy legends cache : <https://github.com/pblottiere/QSA/pull/78>

## [1.0.0] - 2024-07-31

### Added

- Add qsa-plugin, qsa-cli and doc: https://github.com/pblottiere/QSA/pull/8
- Add raster layer support: https://github.com/pblottiere/QSA/pull/9
- Add a CHANGELOG file: https://github.com/pblottiere/QSA/pull/10
- Add basic badges in README: https://github.com/pblottiere/QSA/pull/11
- Add qsa-cli stats command: https://github.com/pblottiere/QSA/pull/13
- Add PostgreSQL support for storing QGIS projects: https://github.com/pblottiere/QSA/pull/15
- Add doc for raster layer in sandbox: https://github.com/pblottiere/QSA/pull/16
- Add basic support for raster style: https://github.com/pblottiere/QSA/pull/17
- Add support for min/max settings in raster style: https://github.com/pblottiere/QSA/pull/18
- CRS is now optional when adding a layer: https://github.com/pblottiere/QSA/pull/19
- Manage optional CRS when MapProxy is enabled: https://github.com/pblottiere/QSA/pull/20
- Optimize raster cache config: https://github.com/pblottiere/QSA/pull/21
- Add PostGIS support for vector layers: https://github.com/pblottiere/QSA/pull/22
- Add option to build overview if necessary: https://github.com/pblottiere/QSA/pull/24
- Add QSA_LOGLEVEL environment variable: https://github.com/pblottiere/QSA/pull/27
- Add check on epsg code validity: https://github.com/pblottiere/QSA/pull/29
- Optimize MapProxy clear cache: https://github.com/pblottiere/QSA/pull/31
- Homogenize gray band properties with red/green/blue: https://github.com/pblottiere/QSA/pull/32
- Optimize min/max statistics computation: https://github.com/pblottiere/QSA/pull/34
- Update QSA app to be used with a proper WSGI HTTP production server: https://github.com/pblottiere/QSA/pull/38
- Add singleband pseudocolor renderer: https://github.com/pblottiere/QSA/pull/39
- Use QGIS 3.38 in sandbox: https://github.com/pblottiere/QSA/pull/41
- Add support for WMS TIME parameter: https://github.com/pblottiere/QSA/pull/42
- Add gradient stops for singlebandpseudocolor renderer: https://github.com/pblottiere/QSA/pull/43
- Adapt docs how to run tests: https://github.com/pblottiere/QSA/pull/49
- Add /api/processing/raster/calculator entrypoint: https://github.com/pblottiere/QSA/pull/45
- Add /api/processing/raster/histogram: https://github.com/pblottiere/QSA/pull/52
- Activate legend in MapProxy configuration: https://github.com/pblottiere/QSA/pull/53
- CI: add unit test without Postgres dependency: https://github.com/pblottiere/QSA/pull/50
- Add MapProxy s3 cache support: https://github.com/pblottiere/QSA/pull/55
- Move histogram computation in dedicated process: https://github.com/pblottiere/QSA/pull/56
- Build 'dev' container image on push to 'main' branch: https://github.com/pblottiere/QSA/pull/61
- Optimize project opening: https://github.com/pblottiere/QSA/pull/58
- Add global try/except for requests: https://github.com/pblottiere/QSA/pull/62
- Add badge for CI: https://github.com/pblottiere/QSA/pull/63
- Add qsa-plugin, qsa-cli and doc: <https://github.com/pblottiere/QSA/pull/8>
- Add raster layer support: <https://github.com/pblottiere/QSA/pull/9>
- Add a CHANGELOG file: <https://github.com/pblottiere/QSA/pull/10>
- Add basic badges in README: <https://github.com/pblottiere/QSA/pull/11>
- Add qsa-cli stats command: <https://github.com/pblottiere/QSA/pull/13>
- Add PostgreSQL support for storing QGIS projects: <https://github.com/pblottiere/QSA/pull/15>
- Add doc for raster layer in sandbox: <https://github.com/pblottiere/QSA/pull/16>
- Add basic support for raster style: <https://github.com/pblottiere/QSA/pull/17>
- Add support for min/max settings in raster style: <https://github.com/pblottiere/QSA/pull/18>
- CRS is now optional when adding a layer: <https://github.com/pblottiere/QSA/pull/19>
- Manage optional CRS when MapProxy is enabled: <https://github.com/pblottiere/QSA/pull/20>
- Optimize raster cache config: <https://github.com/pblottiere/QSA/pull/21>
- Add PostGIS support for vector layers: <https://github.com/pblottiere/QSA/pull/22>
- Add option to build overview if necessary: <https://github.com/pblottiere/QSA/pull/24>
- Add QSA_LOGLEVEL environment variable: <https://github.com/pblottiere/QSA/pull/27>
- Add check on epsg code validity: <https://github.com/pblottiere/QSA/pull/29>
- Optimize MapProxy clear cache: <https://github.com/pblottiere/QSA/pull/31>
- Homogenize gray band properties with red/green/blue: <https://github.com/pblottiere/QSA/pull/32>
- Optimize min/max statistics computation: <https://github.com/pblottiere/QSA/pull/34>
- Update QSA app to be used with a proper WSGI HTTP production server: <https://github.com/pblottiere/QSA/pull/38>
- Add singleband pseudocolor renderer: <https://github.com/pblottiere/QSA/pull/39>
- Use QGIS 3.38 in sandbox: <https://github.com/pblottiere/QSA/pull/41>
- Add support for WMS TIME parameter: <https://github.com/pblottiere/QSA/pull/42>
- Add gradient stops for singlebandpseudocolor renderer: <https://github.com/pblottiere/QSA/pull/43>
- Adapt docs how to run tests: <https://github.com/pblottiere/QSA/pull/49>
- Add /api/processing/raster/calculator entrypoint: <https://github.com/pblottiere/QSA/pull/45>
- Add /api/processing/raster/histogram: <https://github.com/pblottiere/QSA/pull/52>
- Activate legend in MapProxy configuration: <https://github.com/pblottiere/QSA/pull/53>
- CI: add unit test without Postgres dependency: <https://github.com/pblottiere/QSA/pull/50>
- Add MapProxy s3 cache support: <https://github.com/pblottiere/QSA/pull/55>
- Move histogram computation in dedicated process: <https://github.com/pblottiere/QSA/pull/56>
- Build 'dev' container image on push to 'main' branch: <https://github.com/pblottiere/QSA/pull/61>
- Optimize project opening: <https://github.com/pblottiere/QSA/pull/58>
- Add global try/except for requests: <https://github.com/pblottiere/QSA/pull/62>
- Add badge for CI: <https://github.com/pblottiere/QSA/pull/63>

### Fixed

- Fix projects in cache in qsa-plugin: https://github.com/pblottiere/QSA/pull/12
- Fix docs: https://github.com/pblottiere/QSA/pull/14
- Deactivate multithreading: https://github.com/pblottiere/QSA/pull/23
- Fix get style for raster (and homogenize vector style): https://github.com/pblottiere/QSA/pull/25
- Remove log in staticmethod: https://github.com/pblottiere/QSA/pull/30
- Remove useless print in tests: https://github.com/pblottiere/QSA/pull/54

- Fix projects in cache in qsa-plugin: <https://github.com/pblottiere/QSA/pull/12>
- Fix docs: <https://github.com/pblottiere/QSA/pull/14>
- Deactivate multithreading: <https://github.com/pblottiere/QSA/pull/23>
- Fix get style for raster (and homogenize vector style): <https://github.com/pblottiere/QSA/pull/25>
- Remove log in staticmethod: <https://github.com/pblottiere/QSA/pull/30>
- Remove useless print in tests: <https://github.com/pblottiere/QSA/pull/54>

## [0.0.2] - 2024-02-15

### Added

- Support simple symbol properties for lines and polygons: https://github.com/pblottiere/QSA/pull/1
- Add support for simple marker style: https://github.com/pblottiere/QSA/pull/2

- Support simple symbol properties for lines and polygons: <https://github.com/pblottiere/QSA/pull/1>
- Add support for simple marker style: <https://github.com/pblottiere/QSA/pull/2>

## [0.0.1] - 2024-02-12

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Components:
* `qsa-cli`: Command line tool

Main features:

* Create and manage QGIS projects stored on filesystem or in PostgreSQL
* Create and update vector and raster layers: symbology, theme, ...
* Inspect online QGIS Server instances
* Cache management with MapProxy


See QGIS Server Administration tool's [documentation](https://pblottiere.github.io/QSA/) for more details.
25 changes: 20 additions & 5 deletions docs/src/DEVELOPERS.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,46 @@
# Developers

Documentation:
## Documentation

```` console
$ mdbook build docs
````

Unit tests:
## Unit tests

```` console
$ cat ~/.pg_service.conf
Ensure you have a valid `qsa_test` section in `~/.pg_service.conf`:

```` conf
[qsa_test]
host=localhost
port=5432
dbname=qsa_test
user=myusername
password=
````

Run the tests with:

```` console
$ createdb qsa_test
$ cd qsa-api
$ pytest -sv tests
````

Integration tests:
## Integration tests

```` console
$ cd sandbox
$ docker-compose up -d
$ cd ../qsa-api
$ QSA_GEOTIFF="/landsat_4326.tif" QSA_GPKG="/data.gpkg" QSA_HOST=127.0.01 QSA_PORT=5000 pytest -sv tests
````

## Quality tests

Ensure your changes are correctly formatted with `pre-commit` (see [installation](https://pre-commit.com/#installation)):

```` console
# activate in repository
$ pre-commit install
````
3 changes: 2 additions & 1 deletion docs/src/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Welcome to QGIS Server Administration tool's documentation.


[QGIS Server](https://docs.qgis.org/3.34/en/docs/server_manual/introduction.html) is
a map-server based on the QGIS core library and rendering engine which provides
numerous classical services like WMS, WFS, WCS, WMTS and OGC API Features.
Expand All @@ -15,6 +14,7 @@ Components:
* [QSA cli](qsa-cli/): Command line tool

Features:

* Create and manage QGIS projects stored on the filesystem or in PostgreSQL
* Create and update vector and raster layers : symbology, theme, ...
* Inspect online QGIS Server instances
Expand All @@ -23,6 +23,7 @@ Features:
![QSA](images/qsa_archi.png)

Roadmap:

* Add more documentation
* Add PostgreSQL support to store QGIS styles and QSA internals data
* Publish `qsa-cli` on PyPI
Expand Down
1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[Introduction](README.md)

- [QSA REST API](qsa-api/README.md)
- [Installation](qsa-api/installation.md)
- [Configuration](qsa-api/configuration.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/images/qsa_archi.excalidraw
Original file line number Diff line number Diff line change
Expand Up @@ -943,4 +943,4 @@
"viewBackgroundColor": "#ffffff"
},
"files": {}
}
}
9 changes: 4 additions & 5 deletions docs/src/qsa-api/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ QSA web server can be configured thanks to the next environment variables:
| No | `QSA_MAPPROXY_CACHE_S3_BUCKET` | Activate S3 cache for MapProxy if bucket is set |
| No | `QSA_MAPPROXY_CACHE_S3_DIR` | S3 cache directory for MapProxy. Default to `/mapproxy/cache` |


<div class="warning">
MapProxy

Time dimension caching is not supported with S3 backend storage.
</div>


## PostgreSQL support {#postgresql-support}

When PostgreSQL support is enabled to store QGIS projects thanks to the
Expand All @@ -30,10 +28,11 @@ well as QGIS QML styles.

The PostgreSQL support relies on a `service` defined in a [PostgreSQL connection
service file](https://www.postgresql.org/docs/current/libpq-pgservice.html).
For example with `QSA_QGISSERVER_PROJECTS_PSQL_SERVICE=qsa_projects`:

```` shell
$ cat ~/.pg_service.conf
For example with `QSA_QGISSERVER_PROJECTS_PSQL_SERVICE=qsa_projects`, a proper
`qsa_projects` section is needed in `~/.pg_service.conf`:

```` conf
[qsa_projects]
host=localhost
port=5432
Expand Down
4 changes: 2 additions & 2 deletions docs/src/qsa-api/endpoints/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ The QSA REST API provides several endpoints:
* [/api/instances](instances.md)
* [/api/processing](processing.md)

### PostgreSQL schema
## PostgreSQL schema

When PostgreSQL support is enabled, a query string parameter `schema` may be
used to specify the schema in which the QGIS project is stored in the database
(`public` is used by default).

```` shell
```` console
# call a specific endpoint using projects stored in PostgreSQL schema named `myschema`
$ curl "http://localhost/api/xxx/yyy?schema=myschema"
````
1 change: 0 additions & 1 deletion docs/src/qsa-api/endpoints/instances.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# QSA REST API : /api/instances


When `qsa-plugin` is installed, an `/api/instances` endpoint is available to
retrieve information about QGIS Server underlying instances.

Expand Down
4 changes: 1 addition & 3 deletions docs/src/qsa-api/endpoints/processing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ rasters or get histogram for raster layers.
| POST | `/api/processing/raster/histogram/{project}/{layer}` | Return an histogram in JSON |
| POST | `/api/processing/raster/calculator/{project}` | Create a raster based on an `expression` and an `output` filename |


Examples:

``` shell
``` console
# create a new layer based on a QGIS expression
$ curl "http://localhost/api/projects/" \
-X POST \
Expand All @@ -22,7 +21,6 @@ $ curl "http://localhost/api/projects/" \
}'
```


<div class="warning">
Processing

Expand Down
Loading
Loading