Skip to content

Handle exceptions within harvest revert.#4697

Draft
paul-m wants to merge 1 commit into
2.xfrom
continue-revert-on-exception
Draft

Handle exceptions within harvest revert.#4697
paul-m wants to merge 1 commit into
2.xfrom
continue-revert-on-exception

Conversation

@paul-m
Copy link
Copy Markdown
Contributor

@paul-m paul-m commented Apr 20, 2026

PR against 2.x so I can use it to generate a patch for my application.

Repro:

  • Run a harvest to populate Data nodes for datasets.
  • Delete one of the dataset nodes. Visit the datasets page and delete it using the UI.
  • Try to revert the harvest: drush dkan:harvest:revert YOUR_HARVEST
  • There will be an error that one of the datasets cannot be removed because it does not exist.
  • No other datasets after that one will be removed.
  • Run the harvest again: drush dkan:harvest:run YOUR_HARVEST
  • The status will show that all datasets are unchanged.

There is no way around this, if you want to use harvests to manage the datasets after you've deleted one. The harvest system thinks you still have all the datasets, even though one is missing.

The solution is to handle the dataset not found exception, and let the harvest revert continue to run. This way all the hashes will be removed, which signals to the harvest system that the datasets have not been created.

Fixes [issue#]

Describe your changes

QA Steps

  • Add manual QA steps in checklist format for a reviewer to perform. Be as specific as possible, provide examples if appropriate.

Checklist before requesting review

If any of these are left unchecked, please provide an explanation

  • I have updated or added tests to cover my code
  • I have updated or added documentation

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