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

Merged
merged 8 commits into from
Dec 11, 2024
Merged

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 :)

ckanext/validation/helpers.py Outdated Show resolved Hide resolved
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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd say its best to not have ambiguity here as people may be searching for the init-db and not find this due to the function being init_db.

@@ -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'):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will come in the next cut

also will do upload check from qld-gov-au,

def is_uploaded_file(upload):
    return isinstance(upload,
                      uploader.ALLOWED_UPLOAD_TYPES) and upload.filename

@duttonw duttonw merged commit a142055 into develop Dec 11, 2024
4 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.

3 participants