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

Partial alignment to qld-gov-au 2.10 version #106

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

duttonw
Copy link
Contributor

@duttonw duttonw commented Dec 11, 2024

To begin alignment of the divergent trees, i've taken steps to match the folder/code structure from upstream to qld-gov-au version. There has not been any 'new' code added to this just yet.

Still to do:

  • badges swap from svg to css
  • switch to allow sync or async mode (there is two different styles in these two code bases, need to choose one or see if they are compatible)
  • validations status helpers class to reduce code duplicate
  • 2.10 function splits (part of it is in here but still needs more)
  • logic: ( resource_create, resource_update -> package_patch, resource_show)
  • UX: dynamic show/hide validation Upload|URL|Json - only need one
  • Cucumber - Selenium Testing

@duttonw duttonw requested a review from ThrawnCA December 11, 2024 05:18
@duttonw duttonw self-assigned this Dec 11, 2024
@duttonw duttonw changed the title Alignment to qld-gov-au 2.10 version Partial alignment to qld-gov-au 2.10 version Dec 11, 2024
Copy link
Contributor

@ThrawnCA ThrawnCA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see this happening.

@duttonw
Copy link
Contributor Author

duttonw commented Dec 11, 2024

@JVickery-TBS are you able to provide a co-review in the next day :)

@@ -4,6 +4,18 @@
from ckan.lib.helpers import url_for_static
from ckantoolkit import url_for, _, config, asbool, literal, h

def _get_helpers():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

underscore syntax for python implies that the method should not be imported into another module, but this is used in plugin.py for get_helpers.

change to match the rest of the methods. E.g. get_actions and get_blueprints. So plugins.py imports ckanext.validation.helpers and does helpers.get_helpers

pass


@validation.command()
@validation.command(name='init-db')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name is redundant here as click with automatically make underscores in function into hyphens. Unless if that is not true for older click versions

@@ -59,37 +66,38 @@ def run_validation_job(resource):
{'ignore_auth': True}, {'id': resource['package_id']})

source = None
if resource.get('url_type') == 'upload':
if resource.get(u'url_type') == u'upload':
upload = uploader.get_resource_uploader(resource)
if isinstance(upload, uploader.ResourceUpload):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should check if the upload has a get_path attribute instead, so that other extended ResourceUploaders (like the CloudStorage plugin) can work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if isinstance(upload, uploader.ResourceUpload): -->> if hasattr(upload, 'get_path'):

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.

3 participants