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

QGOV changes, #4 #11

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

ThrawnCA
Copy link

Overview

Changes to become more compatible with qld-gov-au fork, see #4. This includes several feature improvements.

  • Capture Flake8 config in a .flake8 file so it applies to manual runs.
  • Use ckan_cli script so we can run Click or Paster with the same syntax.
  • Fix typos in README.
  • Add more documentation of CLI commands.
  • Add check to ensure that package and resource IDs in URLs match up.
  • Increase use of six for Py2/Py3 compatibility.
  • Add a title to validation report links (just containing the validation timestamp).
  • Use a helper to more robustly detect CKAN 2.9+ in templates, so we're ready for CKAN 3.
  • Encapsulate database access in ValidationStatusHelper so job logic is simpler.
  • Turn custom actions into chained actions so other plugins can customise them further.
  • Update job enqueueing so we only record a resource ID, not the full dictionary (saving memory in Redis).
  • Skip job enqueueing if we already have a job in progress.
  • Don't trigger a new validation job for package_patch calls that don't change any resources.
  • Move the main plugin module up a level, to plugin.py, to simplify paths.
  • Don't validate "sibling" resources when a single resource is updated.
  • Use parameterised logging instead of up-front formatting.
  • Mark broken tests to be skipped, instead of commenting them out.
  • Use io.BytesIO instead of six.BytesIO for fake files, since it's more consistent.
  • Pin ckanext-scheming version for consistent testing.

ThrawnCA added 25 commits July 22, 2022 10:34
- standardise whitespace
- sort imports alphabetically
- refactor code to extract helper functions
- add more doc comments
- put binary operators at start of line instead of end
- use parameterised logging
- this is more consistent, when we're already making our strings binary
- We won't necessarily be instantly compatible with all future versions, we need version control
- It's better to put the shared code into plugin.py than into an __init__.py file,
and putting it at the higher level lets us skip a bunch of '../' paths
- extract both the package ID and resource ID from the URL and ensure it's the right package for the resource
- This will make it easier to adjust and test our exact enqueueing behaviour
since we can examine what is actually sent to the queue
- Passing IDs consumes far less memory on the job queue than entire resource dictionaries
- fix typos
- fix repository URLs
- When using a resource API to update a resource, don't treat it as a package update
- Record only the resource ID, instead of the full resource dict.
This greatly reduces the memory usage on the job queue server.
- Just use the validation timestamp, it's useful information
- Updating a dataset via the web UI should not trigger a validation job
- check for asynchronicity at runtime so we can always hook our action in
- use chained actions so we don't block other customisation
- Unless package_patch provides an update to the resources, there's no need for validation
- Synchronous validation doesn't need to pass just an ID, full dict is fine
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.

1 participant