forked from ckan/ckanext-xloader
-
Notifications
You must be signed in to change notification settings - Fork 1
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
JVickery-TBS:feature/validation support #113
Open
duttonw
wants to merge
25
commits into
develop
Choose a base branch
from
JVickery-TBS/feature/validation-support
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f0a470a
feat(dev): adds validation extension support;
JVickery-TBS a97f4ad
feat(dev): logging;
JVickery-TBS 028e42b
fix(dev): 2.9 support;
JVickery-TBS 77d762e
fix(dev): better conditioning;
JVickery-TBS aec22b9
feat(comments): added comments;
JVickery-TBS cd3c7cc
Merge branch 'master' into feature/validation-support
JVickery-TBS 7e99aa7
fix(dev): misc feedback;
JVickery-TBS 25ea76e
fix(dev): misc fixes;
JVickery-TBS d2720fc
fix(syntax): flake8;
JVickery-TBS e888153
feat(dev): logic and schema config option;
JVickery-TBS 5c07ba4
Merge branch 'master' into feature/validation-support
JVickery-TBS 4612484
feat(dev): better logic and tests;
JVickery-TBS 8ac8db5
fix(logic): fixed some logic;
JVickery-TBS d9bb56c
Merge branch 'master' into feature/validation-support
JVickery-TBS 1ac8090
fix(syntax): made better;
JVickery-TBS 1761ed5
fix(comments): fixed inline comments;
JVickery-TBS e182eb7
feat(dev): started doing sync mode;
JVickery-TBS b386e0e
feat(dev): sync mode cont.;
JVickery-TBS 3200483
feat(dev): sync mode cont.;
JVickery-TBS d225801
Merge branch 'master' into feature/validation-support
JVickery-TBS 4fbdb0d
feat(dev): IPipeValidation implementation;
JVickery-TBS 27d98cf
fix(tests): validation req tests;
JVickery-TBS 378f69f
fix(misc): comments and messages;
JVickery-TBS 6070740
fix(logic): ignore not sysadmin;
JVickery-TBS eab54e4
Merge branch 'develop' into feature/validation-support
duttonw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
|
||
from ckan.model.domain_object import DomainObjectOperation | ||
from ckan.model.resource import Resource | ||
from ckan.model.package import Package | ||
|
||
from . import action, auth, helpers as xloader_helpers, utils | ||
from ckanext.xloader.utils import XLoaderFormats | ||
|
@@ -91,6 +92,7 @@ def receive_validation_report(self, validation_report): | |
sync = toolkit.asbool(toolkit.config.get(u'ckanext.validation.run_on_update_async', True)) | ||
self._submit_to_xloader(res_dict, sync=sync) | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Flake8 generally prefers single blank lines inside a class. |
||
# IDomainObjectModification | ||
|
||
def notify(self, entity, operation): | ||
|
@@ -183,7 +185,7 @@ def before_show(self, resource_dict): | |
def after_update(self, context, resource_dict): | ||
self.after_resource_update(context, resource_dict) | ||
|
||
def _submit_to_xloader(self, resource_dict): | ||
def _submit_to_xloader(self, resource_dict, sync=False): | ||
context = {"ignore_auth": True, "defer_commit": True} | ||
resource_format = resource_dict.get("format") | ||
if not XLoaderFormats.is_it_an_xloader_format(resource_format): | ||
|
@@ -203,14 +205,20 @@ def _submit_to_xloader(self, resource_dict): | |
return | ||
|
||
try: | ||
log.debug( | ||
"Submitting resource %s to be xloadered", resource_dict["id"] | ||
) | ||
if sync: | ||
log.debug( | ||
"xloadering resource %s in sync mode", resource_dict["id"] | ||
) | ||
else: | ||
log.debug( | ||
"Submitting resource %s to be xloadered", resource_dict["id"] | ||
) | ||
toolkit.get_action("xloader_submit")( | ||
context, | ||
{ | ||
"resource_id": resource_dict["id"], | ||
"ignore_hash": self.ignore_hash, | ||
"sync": sync, | ||
}, | ||
) | ||
except toolkit.ValidationError as e: | ||
|
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"to enqueued" -> "to enqueue"