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

Force updates on resources from manifest #3179

Merged
merged 2 commits into from
Aug 14, 2020
Merged

Conversation

dharizza
Copy link
Contributor

@dharizza dharizza commented Aug 12, 2020

Description

The module dkan_periodic_updates provides functionality so that data publishers can upload a manifest file which is used for executing periodic imports of the specified resources. That manifest file is a csv file with format resource_id,frequency,file_url,import_to_datastore.

Currently the manifest supports specifying a frequency that can be daily, weekly or monthly, but sometimes there are urgent changes that need to be pulled into the site so the publishers need to execute the update earlier than specified in the manifest. This PR adds a new drush command to the module dkan_periodic_updates so we can force the update on all of the resources from the manifest (ignoring the frequency).

Steps to test

  • Go to admin/dkan/periodic-updates:
    • Click on the checkbox "Enable periodic updates" and click on the button "Save settings"
    • Upload a manifest that contains some test data (remember the headers should be resource_id,frequency,file_url,import_to_datastore make sure the resource_id is the UUID of an existing resource node, the frequency can be "weekly", "montly" or "daily" and import_to_datastore should have the value "Y" if you want it to be imported), click on "Add file"
  • Go to admin/dkan/periodic-updates/status
    • No file should be imported at this point.
    • Run cron (via drush or cron, it doesn't matter), then reload the status page, all of the resources from the manifest should be updated
    • Run cron again, this time no resources should be updated (make sure the "Last update" date/time isn't changed)
    • Do some changes to the manifest (maybe point to another URL in some resource or just update one of the files).
    • Run the drush command drush dkan-force-resources-update (you can run it with -v for verbose mode).
    • Confirm the elements were updated, "Last update" column should be updated.

@dharizza dharizza requested a review from rhabbachi August 13, 2020 20:25
Copy link
Contributor

@rhabbachi rhabbachi left a comment

Choose a reason for hiding this comment

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

LGTM

@rhabbachi rhabbachi merged commit e20e557 into 7.x-1.x Aug 14, 2020
@dharizza dharizza deleted the periodic-updates-forcing branch August 27, 2020 16:13
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