Merged
Conversation
Member
linakrisztian
left a comment
There was a problem hiding this comment.
Looks good to me, thanks.
Maybe just think about reasonable tests for new project parameter?
Member
Author
|
I added one test - the different usage of project per config or per input parameter is not directly visible, but now the file if postbody.get("inputs").get("project"):
project_name = postbody.get("inputs").get("project") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes how the GRASS GIS project in which to run the process can be defined.
We do not stick to the convention introduced in actinia-org/actinia-module-plugin#64 (project name must be set in template). Instead a default project is configured which can be overwritten as input at process execution. This input is also added to each process description.
Example for process description
{ "categories": [ "actinia-module", "global-template" ], "description": "Imports point and polygon and checks if point is in polygon.", "id": "point_in_polygon", "parameters": [ { "description": "The input source that may be a landsat scene name, a sentinel2 scene name, a postGIS database string, or an URL that points to an accessible raster or vector file [generated from import_descr_source]", "name": "url_to_geojson_point", "optional": true, "schema": { "type": "string" } }, { "description": "Name of GRASS GIS project to use", "name": "project", "optional": false, "schema": { "type": "string" }, "default": "nc_spm_08" } ], "projects": [ "nc_spm_08" ], "returns": [] }Processing Examples
Project given as input
{ "inputs": { "url_to_geojson_point": "https://raw.githubusercontent.com/mmacata/pagestest/gh-pages/pointInBonn.geojson", "project": "nc_spm_08" }, "outputs": { "result": { "transmissionMode": "reference" } }, "response": "document" }Will lead to HTTP POST to "http://actinia-core:8088/api/v3/projects/nc_spm_08/processing_export"
Non exiting project given as input
If the project does not exist, it will return
{ "processID": "resource_id-7d04d408-c98e-4c7a-becf-3d4392e01d05", "type": "process", "jobID": "7d04d408-c98e-4c7a-becf-3d4392e01d05", "status": "failed", "message": "GrassInitError: Error while executing the grass module. The following error message was logged:\nERROR: MAPSET PERMANENT not found at /actinia_core/workspace/temp_db/gisdbase_083533fc70cb4cb5b4a2d4ad2697a069/nc_spm_088\n", "created": "2026-02-17T14:20:33+00:00", "finished": "2026-02-17T14:20:51+00:00", "updated": "2026-02-17T14:20:51+00:00", "progress": 0, "links": [ { "href": "http://localhost:4044/jobs/7d04d408-c98e-4c7a-becf-3d4392e01d05", "rel": "self" } ] }No project given as input, default is used
If no project is given, the default project will be used (configurable).