Skip to content

Add wrappers for HDX data grid, resource flag, QA, fs_check and datastore actions - #123

Merged
mcarans merged 1 commit into
mainfrom
hdx-custom-actions-qa-flags
Oct 19, 2026
Merged

mcarans merged 1 commit into
mainfrom
hdx-custom-actions-qa-flags

Conversation

@mcarans

@mcarans mcarans commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Wraps more of HDX's custom CKAN actions (from the get_actions() of hdx-ckan's ckanext-hdx_* plugins). Several are currently called raw by other repos: hdx_datagrid_show (hdx-pipeline-tracker), hdx_p_coded_resource_update (HDX-JP-SW-PCODE), hdx_mark_resource_in_hapi (hdx-hapi-scheduled-tasks) and hdx_fs_check_resource_revise (gisrestlayer).

Method Action Auth
Location.get_data_grid / invalidate_data_grid hdx_datagrid_show / invalidate_data_completeness_for_location sysadmin
Resource.is_p_coded / set_p_coded hdx_p_coded_resource_update sysadmin or manage p-codes
Resource.is_in_hapi / set_in_hapi hdx_mark_resource_in_hapi (sends yes / no-data) sysadmin or manage in HAPI flag
Resource.is_in_quarantine / set_in_quarantine hdx_mark_resource_in_quarantine sysadmin or manage QA
Resource.qa_patch hdx_qa_resource_patch sysadmin or manage QA
Resource.revise_fs_check / reset_fs_check hdx_fs_check_resource_revise / _reset sysadmin or manage QA
Dataset.set_qa_completed hdx_mark_qa_completed sysadmin or manage QA
Dataset.qa_revise_resources hdx_qa_package_revise_resource sysadmin or manage QA
Dataset.reset_fs_check hdx_fs_check_package_reset sysadmin or manage QA
Resource.push_to_datastore / Dataset.push_to_datastore hdx_push_resource_to_datastore sysadmin
Dataset.is_allowed_for_datastore hdx_is_package_allowed_for_datastore package read
Dataset.get_shape_info shape_info_show package read
Dataset.get_recommended_tags hdx_recommend_tags anyone
hdx_stats.get_user_statistics / get_organization_statistics hdx_user_statistics / hdx_organization_statistics sysadmin

Write methods update the object from the result. For actions that return {package}, a dataset re-initialises its resources and a resource takes its entry from the package.

Testing

  • Mocked unit tests for each method. uv run pytest passes, apart from test_ckan.py, which needs HDX_PIPELINE_GSHEET_AUTH.
  • Run on stage with a sysadmin key against a temporary private dataset (purged afterwards). Each write was confirmed by re-reading from HDX.

…tore actions

- Location.get_data_grid (hdx_datagrid_show) and
  Location.invalidate_data_grid (invalidate_data_completeness_for_location)
- Resource.is_p_coded/set_p_coded (hdx_p_coded_resource_update),
  is_in_hapi/set_in_hapi (hdx_mark_resource_in_hapi),
  is_in_quarantine/set_in_quarantine (hdx_mark_resource_in_quarantine),
  qa_patch (hdx_qa_resource_patch), revise_fs_check
  (hdx_fs_check_resource_revise), reset_fs_check
  (hdx_fs_check_resource_reset) and push_to_datastore
  (hdx_push_resource_to_datastore)
- Dataset.get_shape_info (shape_info_show), get_recommended_tags
  (hdx_recommend_tags), is_allowed_for_datastore
  (hdx_is_package_allowed_for_datastore), push_to_datastore,
  set_qa_completed (hdx_mark_qa_completed), qa_revise_resources
  (hdx_qa_package_revise_resource) and reset_fs_check
  (hdx_fs_check_package_reset)
- hdx_stats.get_user_statistics (hdx_user_statistics) and
  get_organization_statistics (hdx_organization_statistics)
@github-actions

Copy link
Copy Markdown

Test Results

193 tests  +6   193 ✅ +6   1m 14s ⏱️ -7s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 308fce2. ± Comparison against base commit d0a1a95.

@github-actions

Copy link
Copy Markdown

Test Results

193 tests  +6   193 ✅ +6   1m 27s ⏱️ +6s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 308fce2. ± Comparison against base commit d0a1a95.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.308% (-0.01%) from 97.319% — hdx-custom-actions-qa-flags into main

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.308% (-0.01%) from 97.319% — hdx-custom-actions-qa-flags into main

@mcarans
mcarans merged commit 1015e54 into main Oct 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants