-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add debug logging for dataset list route #8246
Conversation
📝 WalkthroughWalkthroughThe changes in this pull request focus on enhancing logging and error handling within the Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
app/controllers/DatasetController.scala (1)
179-220
: LGTM! The logging implementation effectively captures the dataset listing process.The added logging statements provide valuable debug information:
- Input parameters logging helps track the request parameters.
- Dataset count logging helps verify the query results.
This implementation aligns well with the PR objective of debugging the
isActive=false
route issue.Consider adding error logging in the error paths to capture failure scenarios. For example:
datasets <- datasetDAO.findAllWithSearch(isActive, isUnreported, organizationIdOpt, folderIdValidated, uploaderIdValidated, searchQuery, recursive.getOrElse(false), limit) ?~> "dataset.list.failed" ?~> "Dataset listing failed" +_ = if (datasets.isEmpty) { + logger.warn(s"No datasets found for the given parameters") +} _ = logger.info(s"Found ${datasets.size} datasets successfully")app/models/dataset/Dataset.scala (1)
223-227
: Enhance the second log message with more contextWhile the logging additions are helpful for debugging, the second log message "Requesting datasets with query" could be more informative.
Consider adding more context to the second log message:
- _ = logger.info("Requesting datasets with query") + _ = logger.info(s"Executing dataset query with limit ${limitOpt.getOrElse("none")}")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
app/controllers/DatasetController.scala
(1 hunks)app/models/dataset/Dataset.scala
(2 hunks)
🔇 Additional comments (1)
app/models/dataset/Dataset.scala (1)
118-125
: LGTM: Improved error messages for better debugging
The addition of specific error messages for each parsing operation enhances debugging capabilities and error traceability. The messages are clear and follow a consistent pattern.
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.
LGTM. We’ll need to remove the logging again after we solve this of course :)
Currently the route
https://webknossos.org/api/datasets?isActive=false
is broken and the bug is not reproducible in a dev environment. Thus, this pr adds logging to that route to give further hints about the causes of the bug.Steps to test:
http://localhost:9000/api/datasets?isActive=false
=> the server console should show more extensive logging