Skip to content

Conversation

fm3
Copy link
Member

@fm3 fm3 commented Jul 8, 2025

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • abc

TODOs:

  • ...

Issues:

  • fixes #

(Please delete unneeded items, merge only when none are left open)

  • Added changelog entry (create a $PR_NUMBER.md file in unreleased_changes or use ./tools/create-changelog-entry.py)
  • Added migration guide entry if applicable (edit the same file as for the changelog)
  • Updated documentation if applicable
  • Adapted wk-libs python client if relevant API parts change
  • Removed dev-only changes like prints and application.conf edits
  • Considered common edge cases
  • Needs datastore update after deployment

Copy link
Contributor

coderabbitai bot commented Jul 8, 2025

📝 Walkthrough

Walkthrough

This update finalizes the 25.07.0 WEBKNOSSOS release, aggregating changelog and migration guide entries from individual files. It introduces performance instrumentation and logging for agglomerate ID retrieval across multiple services, updates method signatures for logging control, and adds new features and fixes as documented in the released changelog and migration guide.

Changes

Files / Grouped Paths Change Summary
CHANGELOG.released.md, MIGRATIONS.released.md Aggregated and updated for the 25.07.0 release, summarizing new features, improvements, bug fixes, and migration notes including thread pool size changes and new Postgres evolution scripts.
unreleased_changes/*.md (multiple files) Removed individual unreleased changelog and migration guide entry files, now aggregated into the released changelog and migration guide. Entries covered features like tree duplication, per-user annotation state, mesh opacity reload, new Account Settings page, zarr3 and remote storage support, bug fixes, and process changes for changelog management.
util/src/main/scala/com/scalableminds/util/time/Instant.scala Updated logSince to return the current instant and added an optional silentIfBelow parameter to suppress logs for short durations.
webknossos-datastore/app/com/scalableminds/webknossos/datastore/controllers/DataSourceController.scala Added timing instrumentation to agglomerateIdsForSegmentIds for performance logging.
webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/Hdf5AgglomerateService.scala Mixed in LazyLogging and added timing and cache usage logs to agglomerate ID lookup methods and cache initialization.
webknossos-tracingstore/app/com/scalableminds/webknossos/tracingstore/TSRemoteDatastoreClient.scala Modified getAgglomerateIdsForSegmentIds to early-return on empty input, added a log parameter, and included timing instrumentation for remote calls.
webknossos-tracingstore/app/com/scalableminds/webknossos/tracingstore/controllers/EditableMappingController.scala Added timing instrumentation and logging to agglomerateIdsForSegments, and passed a log = true parameter to mapping generation.
webknossos-tracingstore/app/com/scalableminds/webknossos/tracingstore/tracings/editablemapping/EditableMappingService.scala Added timing instrumentation and a log parameter to mapping-related methods, with conditional debug logging for specific tracing IDs.

Possibly related PRs

  • scalableminds/webknossos#8677: Both PRs address annotation creation in dataset view mode and segmentation layer selection, indicating direct workflow and UI changes.
  • scalableminds/webknossos#8662: Both PRs implement and document the tree duplication feature in skeleton annotations, affecting tracing actions and reducers.
  • scalableminds/webknossos#8698: Both PRs are directly related via the process for managing individual changelog/migration guide entry files and their aggregation into the released changelog.

Suggested labels

backend, refactoring

Poem

🐇✨
A hop, a skip, a log or two—
Timings tracked as rabbits do!
Changelogs bundled, features bloom,
Trees duplicate with extra room.
With zarr and mesh, and settings neat,
This bunny’s code is hard to beat!
Release 25.07.0—complete!


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@fm3 fm3 marked this pull request as ready for review July 8, 2025 14:02
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (2)
CHANGELOG.released.md (2)

14-17: Consider dropping duplicate bullets to keep the changelog concise.

The two bullets

- Added the ability to duplicate trees in skeleton annotations …
- Added a new Account Settings page …

appear once under Highlights (L14-17) and again under Added (L22-24).
Including them in Highlights is enough—repeating them verbatim below adds noise without new information.

@@
- - Added the ability to duplicate trees in skeleton annotations. Users can create a copy of any tree (including all nodes, edges, and properties) via the context menu in the skeleton tab. [#8662](https://github.com/scalableminds/webknossos/pull/8662)
- - Added a new Account Settings page for managing user preferences, passwords and authentication methods. [#8672](https://github.com/scalableminds/webknossos/pull/8672)

Also applies to: 22-24


36-38: Placement of “Improved efficiency …” bullet seems off.

“Improved efficiency of saving bounding box related annotation changes” is listed under Fixed (L36-38) but it describes a performance optimisation rather than a bug fix.
Moving it to Changed (or keeping only the Highlights entry) would better align with Keep-a-Changelog conventions and avoid confusion.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dd8c34c and b77eaac.

📒 Files selected for processing (40)
  • CHANGELOG.released.md (1 hunks)
  • MIGRATIONS.released.md (2 hunks)
  • unreleased_changes/8492.md (0 hunks)
  • unreleased_changes/8518.md (0 hunks)
  • unreleased_changes/8542.md (0 hunks)
  • unreleased_changes/8598.md (0 hunks)
  • unreleased_changes/8622.md (0 hunks)
  • unreleased_changes/8633.md (0 hunks)
  • unreleased_changes/8638.md (0 hunks)
  • unreleased_changes/8662.md (0 hunks)
  • unreleased_changes/8672.md (0 hunks)
  • unreleased_changes/8676.md (0 hunks)
  • unreleased_changes/8677.md (0 hunks)
  • unreleased_changes/8679.md (0 hunks)
  • unreleased_changes/8682.md (0 hunks)
  • unreleased_changes/8683.md (0 hunks)
  • unreleased_changes/8686.md (0 hunks)
  • unreleased_changes/8687.md (0 hunks)
  • unreleased_changes/8688.md (0 hunks)
  • unreleased_changes/8695.md (0 hunks)
  • unreleased_changes/8698.md (0 hunks)
  • unreleased_changes/8702.md (0 hunks)
  • unreleased_changes/8703.md (0 hunks)
  • unreleased_changes/8705.md (0 hunks)
  • unreleased_changes/8709.md (0 hunks)
  • unreleased_changes/8710.md (0 hunks)
  • unreleased_changes/8716.md (0 hunks)
  • unreleased_changes/8720.md (0 hunks)
  • unreleased_changes/8721.md (0 hunks)
  • unreleased_changes/8725.md (0 hunks)
  • unreleased_changes/8726.md (0 hunks)
  • unreleased_changes/8727.md (0 hunks)
  • unreleased_changes/8728.md (0 hunks)
  • unreleased_changes/8733.md (0 hunks)
  • util/src/main/scala/com/scalableminds/util/time/Instant.scala (1 hunks)
  • webknossos-datastore/app/com/scalableminds/webknossos/datastore/controllers/DataSourceController.scala (1 hunks)
  • webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/Hdf5AgglomerateService.scala (4 hunks)
  • webknossos-tracingstore/app/com/scalableminds/webknossos/tracingstore/TSRemoteDatastoreClient.scala (2 hunks)
  • webknossos-tracingstore/app/com/scalableminds/webknossos/tracingstore/controllers/EditableMappingController.scala (2 hunks)
  • webknossos-tracingstore/app/com/scalableminds/webknossos/tracingstore/tracings/editablemapping/EditableMappingService.scala (3 hunks)
💤 Files with no reviewable changes (32)
  • unreleased_changes/8720.md
  • unreleased_changes/8622.md
  • unreleased_changes/8725.md
  • unreleased_changes/8492.md
  • unreleased_changes/8726.md
  • unreleased_changes/8733.md
  • unreleased_changes/8662.md
  • unreleased_changes/8598.md
  • unreleased_changes/8721.md
  • unreleased_changes/8686.md
  • unreleased_changes/8716.md
  • unreleased_changes/8728.md
  • unreleased_changes/8633.md
  • unreleased_changes/8703.md
  • unreleased_changes/8676.md
  • unreleased_changes/8710.md
  • unreleased_changes/8695.md
  • unreleased_changes/8518.md
  • unreleased_changes/8677.md
  • unreleased_changes/8679.md
  • unreleased_changes/8705.md
  • unreleased_changes/8727.md
  • unreleased_changes/8542.md
  • unreleased_changes/8687.md
  • unreleased_changes/8688.md
  • unreleased_changes/8638.md
  • unreleased_changes/8702.md
  • unreleased_changes/8672.md
  • unreleased_changes/8709.md
  • unreleased_changes/8683.md
  • unreleased_changes/8682.md
  • unreleased_changes/8698.md
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: MichaelBuessemeyer
PR: scalableminds/webknossos#8221
File: CHANGELOG.unreleased.md:14-14
Timestamp: 2024-11-25T14:52:23.201Z
Learning: For the `webknossos` project, changelog entries in `CHANGELOG.unreleased.md` should be concise and avoid unnecessary detailed explanations.
webknossos-datastore/app/com/scalableminds/webknossos/datastore/controllers/DataSourceController.scala (1)
Learnt from: frcroth
PR: scalableminds/webknossos#8609
File: app/models/dataset/Dataset.scala:753-775
Timestamp: 2025-05-12T13:07:29.637Z
Learning: In the `updateMags` method of DatasetMagsDAO (Scala), the code handles different dataset types distinctly:
1. Non-WKW datasets have `magsOpt` populated and use the first branch which includes axisOrder, channelIndex, and credentialId.
2. WKW datasets will have `wkwResolutionsOpt` populated and use the second branch which includes cubeLength.
3. The final branch is a fallback for legacy data.
This ensures appropriate fields are populated for each dataset type.
webknossos-tracingstore/app/com/scalableminds/webknossos/tracingstore/controllers/EditableMappingController.scala (2)
Learnt from: frcroth
PR: scalableminds/webknossos#8236
File: webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/mesh/MeshFileService.scala:170-173
Timestamp: 2025-04-23T08:51:57.756Z
Learning: In the webknossos codebase, classes extending `FoxImplicits` have access to an implicit conversion from `Option[A]` to `Fox[A]`, where `None` is converted to an empty Fox that fails gracefully in for-comprehensions.
Learnt from: MichaelBuessemeyer
PR: scalableminds/webknossos#8352
File: app/models/organization/CreditTransactionService.scala:0-0
Timestamp: 2025-01-27T12:06:42.865Z
Learning: In Scala's for-comprehension with Fox (Future-like type), the `<-` operator ensures sequential execution. If any step fails, the entire chain short-circuits and returns early, preventing subsequent operations from executing. This makes it safe to perform validation checks before database operations.
util/src/main/scala/com/scalableminds/util/time/Instant.scala (3)
Learnt from: frcroth
PR: scalableminds/webknossos#8236
File: webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/mesh/MeshFileService.scala:170-173
Timestamp: 2025-04-23T08:51:57.756Z
Learning: In the webknossos codebase, classes extending `FoxImplicits` have access to an implicit conversion from `Option[A]` to `Fox[A]`, where `None` is converted to an empty Fox that fails gracefully in for-comprehensions.
Learnt from: MichaelBuessemeyer
PR: scalableminds/webknossos#8352
File: app/models/organization/CreditTransactionService.scala:0-0
Timestamp: 2025-01-27T12:06:42.865Z
Learning: In Scala's for-comprehension with Fox (Future-like type), the `<-` operator ensures sequential execution. If any step fails, the entire chain short-circuits and returns early, preventing subsequent operations from executing. This makes it safe to perform validation checks before database operations.
Learnt from: frcroth
PR: scalableminds/webknossos#8236
File: webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/mesh/NeuroglancerPrecomputedMeshFileService.scala:161-166
Timestamp: 2025-04-28T14:18:04.368Z
Learning: In Scala for-comprehensions with the Fox error handling monad, `Fox.fromBool()` expressions should use the `<-` binding operator instead of the `=` assignment operator to properly propagate error conditions. Using `=` will cause validation failures to be silently ignored.
MIGRATIONS.released.md (1)
Learnt from: MichaelBuessemeyer
PR: scalableminds/webknossos#8221
File: CHANGELOG.unreleased.md:14-14
Timestamp: 2024-11-25T14:52:23.201Z
Learning: For the `webknossos` project, changelog entries in `CHANGELOG.unreleased.md` should be concise and avoid unnecessary detailed explanations.
webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/Hdf5AgglomerateService.scala (1)
Learnt from: frcroth
PR: scalableminds/webknossos#8202
File: webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/DatasetErrorLoggingService.scala:68-72
Timestamp: 2024-11-25T10:02:03.702Z
Learning: In `DatasetErrorLoggingService.scala`, prefer using `TextUtils.stackTraceAsString(exception)` when logging exceptions instead of passing the exception directly to `logger.error`.
webknossos-tracingstore/app/com/scalableminds/webknossos/tracingstore/TSRemoteDatastoreClient.scala (3)
Learnt from: frcroth
PR: scalableminds/webknossos#8236
File: webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/mesh/MeshFileService.scala:170-173
Timestamp: 2025-04-23T08:51:57.756Z
Learning: In the webknossos codebase, classes extending `FoxImplicits` have access to an implicit conversion from `Option[A]` to `Fox[A]`, where `None` is converted to an empty Fox that fails gracefully in for-comprehensions.
Learnt from: MichaelBuessemeyer
PR: scalableminds/webknossos#8236
File: webknossos-datastore/app/com/scalableminds/webknossos/datastore/datareaders/precomputed/NeuroglancerPrecomputedShardingUtils.scala:23-28
Timestamp: 2025-04-25T11:06:13.275Z
Learning: AlfuCache in the WebKnossos codebase has default configured TTL (time-to-live) and size limits, providing automatic protection against unbounded memory growth.
Learnt from: MichaelBuessemeyer
PR: scalableminds/webknossos#8352
File: app/models/organization/CreditTransactionService.scala:0-0
Timestamp: 2025-01-27T12:06:42.865Z
Learning: In Scala's for-comprehension with Fox (Future-like type), the `<-` operator ensures sequential execution. If any step fails, the entire chain short-circuits and returns early, preventing subsequent operations from executing. This makes it safe to perform validation checks before database operations.
CHANGELOG.released.md (1)

undefined

<retrieved_learning>
Learnt from: MichaelBuessemeyer
PR: #8221
File: CHANGELOG.unreleased.md:14-14
Timestamp: 2024-11-25T14:52:23.201Z
Learning: For the webknossos project, changelog entries in CHANGELOG.unreleased.md should be concise and avoid unnecessary detailed explanations.
</retrieved_learning>

webknossos-tracingstore/app/com/scalableminds/webknossos/tracingstore/tracings/editablemapping/EditableMappingService.scala (1)
Learnt from: MichaelBuessemeyer
PR: scalableminds/webknossos#8352
File: app/models/organization/CreditTransactionService.scala:0-0
Timestamp: 2025-01-27T12:06:42.865Z
Learning: In Scala's for-comprehension with Fox (Future-like type), the `<-` operator ensures sequential execution. If any step fails, the entire chain short-circuits and returns early, preventing subsequent operations from executing. This makes it safe to perform validation checks before database operations.
🪛 LanguageTool
MIGRATIONS.released.md

[grammar] ~10-~10: Use proper spacing conventions.
Context: ...eases/tag/25.07.0) - 2025-07-01 Commits - The default thread pool size was increas...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~12-~12: Use proper spacing conventions.
Context: ...ed slightly more memory because of this. ### Postgres Evolutions - [134-dataset-layer...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)


[grammar] ~16-~16: Use proper spacing conventions.
Context: ....sql) - 135-neuroglancer-attachment.sql ## [25.06.2](https://github.com/scalablemind...

(QB_NEW_EN_OTHER_ERROR_IDS_000007)

🔇 Additional comments (16)
MIGRATIONS.released.md (1)

9-17: LGTM - Well-documented release entry.

The migration entry properly documents the thread pool size increase and new Postgres evolutions. The note about potential memory usage increase is helpful for administrators.

Minor spacing improvements can be made based on static analysis feedback, but these are cosmetic.

webknossos-datastore/app/com/scalableminds/webknossos/datastore/controllers/DataSourceController.scala (1)

365-376: Excellent timing instrumentation implementation.

The timing code correctly uses the Fox monad with <- for the initial timing capture and appropriately logs elapsed time at key checkpoints without altering the existing control flow.

This aligns well with the performance monitoring improvements across the agglomerate ID retrieval pipeline.

webknossos-tracingstore/app/com/scalableminds/webknossos/tracingstore/controllers/EditableMappingController.scala (1)

74-89: Consistent and well-implemented timing instrumentation.

The timing implementation follows the same pattern as the datastore controller, properly using Fox monads and logging at appropriate checkpoints. The log = true parameter enables detailed performance logging in the service layer.

The empty lines improve log readability, which is helpful for debugging performance issues.

util/src/main/scala/com/scalableminds/util/time/Instant.scala (1)

72-81: Smart refactoring that improves usability.

The changes to logSince provide two valuable improvements:

  1. Better chaining: Returning the current Instant enables the timing patterns used throughout the codebase
  2. Conditional logging: The silentIfBelow parameter prevents log noise for quick operations

The refactoring maintains backward compatibility while enabling the timing instrumentation patterns used in the datastore and tracingstore layers.

webknossos-datastore/app/com/scalableminds/webknossos/datastore/services/Hdf5AgglomerateService.scala (4)

5-5: LGTM: Clean import additions for instrumentation.

The imports for Instant, LazyLogging, and DurationInt are properly added to support the timing and logging functionality introduced in this PR.

Also applies to: 23-23, 30-30


32-32: LGTM: Proper LazyLogging integration.

Adding LazyLogging trait to enable logging capabilities is correctly implemented.


116-123: LGTM: Well-implemented timing instrumentation.

The timing implementation follows good practices:

  • Uses Instant.now for precise timing
  • Conditional logging with silentIfBelow threshold prevents noise
  • Includes meaningful context (segment ID and cache class)
  • Non-intrusive addition that doesn't affect core logic

The 1 millisecond threshold is appropriate for filtering out very fast operations.


304-304: LGTM: Informative cache type logging.

The logging messages clearly indicate which cache implementation is being used (cumsum-based vs standard block cache), which will be valuable for debugging and performance analysis.

Also applies to: 307-307

webknossos-tracingstore/app/com/scalableminds/webknossos/tracingstore/TSRemoteDatastoreClient.scala (3)

8-8: LGTM: Required import for timing functionality.

Proper addition of the Instant import to support the timing instrumentation.


82-84: LGTM: Excellent early return optimization.

The early return for empty input lists is a smart optimization that avoids unnecessary RPC calls. The addition of the optional log parameter maintains backward compatibility while enabling detailed logging when needed.


85-97: LGTM: Comprehensive timing instrumentation.

The implementation effectively captures timing for both key operations:

  • Remote layer URI resolution
  • RPC call execution

The conditional logging based on the log parameter allows for detailed performance analysis without affecting normal operations. The use of Instant.nowFox for Fox-compatible timing is appropriate for the async context.

webknossos-tracingstore/app/com/scalableminds/webknossos/tracingstore/tracings/editablemapping/EditableMappingService.scala (5)

271-271: LGTM: Debug prefix for targeted logging.

The debug ID prefix allows for selective detailed logging of specific tracing operations, which is useful for debugging without overwhelming the logs.


232-232: LGTM: Timing instrumentation for chunk retrieval.

The timing measurement around getSegmentToAgglomerateChunkFiltered provides visibility into the performance of chunk-based operations, including the number of chunks processed.

Also applies to: 235-235


275-275: LGTM: Conditional fossil DB call timing.

The selective logging based on the debug prefix prevents log noise while still capturing timing for specific operations. The fossil DB call timing will help identify performance bottlenecks in the data retrieval layer.

Also applies to: 278-279


285-304: LGTM: Comprehensive method instrumentation.

The addition of the log parameter and timing instrumentation provides excellent observability:

  • Times the editable mapping retrieval step
  • Times the base mapping retrieval step
  • Uses conditional logging based on both the log parameter and debug prefix
  • Maintains backward compatibility with default parameter

The tracing ID is included in log messages for correlation.


359-368: LGTM: Consistent parameter threading.

The addition of the log parameter to getBaseSegmentToAgglomerate and its proper threading to the downstream getAgglomerateIdsForSegmentIds call maintains consistency across the instrumentation changes.

@fm3 fm3 marked this pull request as draft July 9, 2025 07:05
@fm3 fm3 self-assigned this Jul 9, 2025
@fm3 fm3 closed this Jul 10, 2025
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