Skip to content

Conversation

fm3
Copy link
Member

@fm3 fm3 commented Sep 4, 2025

full datasource validation now also runs when reading datasource-properties.jsons from disk. The result is shown in the dashboard on “show error”.

The same validation also runs in the reserveManualUpload route

This also fixes a regression from #8844 where you could no longer hit reload on unusable datasets.

It has, however, been slightly relaxed (no more path checks as those have been moved elsewhere in #8844 )

Steps to test:

  • Edit datasource on disk, making it invalid (e.g. introduce duplicate layer names or mags)

Issues:


  • Added changelog entry (create a $PR_NUMBER.md file in unreleased_changes or use ./tools/create-changelog-entry.py)
  • Considered common edge cases
  • Needs datastore update after deployment

Copy link
Contributor

coderabbitai bot commented Sep 4, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch datasource-validation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@MichaelBuessemeyer MichaelBuessemeyer left a comment

Choose a reason for hiding this comment

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

Code looks good & testing went good as well.

I left 1 question :)

case (Full(newUsableFromDB), _) => Fox.successful(newUsableFromDB)
case (_, Some(dataSourceFromDir)) => Fox.successful(dataSourceFromDir)
case _ => Fox.failure("DataSource not found") ~> NOT_FOUND
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add this change? Is there a possible scenario where the datasource cannot be retrieved from the cache but exists on disk / in dir?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the cache only handles usable datasources. If the existing datasource is unusable due to an error, the cache will just return a Failure. However, in this context, we want to re-read the one from disk in this case, re-validate it, and sent it to webknossos if it is now usable. Only after that, it will also be available through the cache. So this part is actually the bugfix for the reload button in the dashboard (for non-virtual datasets). Does that make sense?

@fm3 fm3 merged commit 578445b into reserve-manual Sep 17, 2025
5 checks passed
@fm3 fm3 deleted the datasource-validation branch September 17, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants