Skip to content

Remove stored meshes feature from backend and postgres #8554

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

fm3
Copy link
Member

@fm3 fm3 commented Apr 24, 2025

User-supplied meshes stored in postgres were already inaccessible since #6960 removed the frontend code two years ago.

This PR removes the relevant code as well and drops the mesh data from postgres.

This does not change how meshfiles or ad-hoc meshing is handled.

Steps to test:

  • CI should be enough

Issues:


@fm3 fm3 requested a review from frcroth April 24, 2025 13:23
@fm3 fm3 self-assigned this Apr 24, 2025
Copy link
Contributor

coderabbitai bot commented Apr 24, 2025

📝 Walkthrough

Walkthrough

This change set removes all backend support for persisted mesh storage and management. It deletes the mesh-related controller, data model, service, and DAO, as well as all corresponding HTTP routes. The database schema is updated to drop the webknossos.meshes table and its associated view, with migration and reversion scripts added for schema management. Documentation is updated to reflect the removal of mesh storage evolutions. No other backend or unrelated code is modified.

Changes

Files/Paths Change Summary
app/controllers/MeshController.scala, app/models/mesh/Mesh.scala Removed the entire mesh controller, model, service, and DAO, eliminating all backend logic for persisted mesh management and storage.
conf/webknossos.latest.routes Deleted all HTTP route definitions for mesh-related endpoints, removing the ability to interact with mesh resources via the API.
conf/evolutions/131-remove-stored-meshes.sql, conf/evolutions/reversions/131-remove-stored-meshes.sql Added migration script to drop the webknossos.meshes table and view, and a corresponding reversion script to recreate them if needed. Updated schema version as part of the migration process.
tools/postgres/schema.sql Removed the definition of the webknossos.meshes table and its view from the schema, and incremented the schema version to 131.
MIGRATIONS.unreleased.md Updated migration documentation to include the new Postgres evolution script for mesh removal.

Assessment against linked issues

Objective Addressed Explanation
Remove backend support for persisted mesh storage and management (#5633)
Remove mesh-related HTTP endpoints and database schema (#5633)
Update migration documentation and scripts for mesh removal (#5633)

Suggested reviewers

  • normanrz

Poem

A mesh once stored, now hops away,
No more in tables will it stay.
The routes are gone, the code is neat,
The schema’s lighter on its feet.
With every hop, a cleaner view—
Backend bunnies, this one’s for you!
🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6977d6f and 348e5b2.

📒 Files selected for processing (2)
  • conf/messages (0 hunks)
  • conf/webknossos.latest.routes (0 hunks)
💤 Files with no reviewable changes (2)
  • conf/messages
  • conf/webknossos.latest.routes
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: build-smoketest-push
  • GitHub Check: backend-tests
  • GitHub Check: frontend-tests

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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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.

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)
conf/evolutions/131-remove-stored-meshes.sql (2)

1-1: Enforce pre-migration schema version
The DO block correctly asserts that the current schema version is 130 before applying this evolution, preventing out-of-order or duplicate migrations.


3-4: Use IF EXISTS for idempotence
Dropping the view and table without IF EXISTS may cause failures if they’ve already been removed. Consider:

-DROP VIEW webknossos.meshes_;
-DROP TABLE webknossos.meshes;
+DROP VIEW IF EXISTS webknossos.meshes_;
+DROP TABLE IF EXISTS webknossos.meshes;
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 636412e and 6977d6f.

📒 Files selected for processing (7)
  • MIGRATIONS.unreleased.md (1 hunks)
  • app/controllers/MeshController.scala (0 hunks)
  • app/models/mesh/Mesh.scala (0 hunks)
  • conf/evolutions/131-remove-stored-meshes.sql (1 hunks)
  • conf/evolutions/reversions/131-remove-stored-meshes.sql (1 hunks)
  • conf/webknossos.latest.routes (0 hunks)
  • tools/postgres/schema.sql (1 hunks)
💤 Files with no reviewable changes (3)
  • conf/webknossos.latest.routes
  • app/controllers/MeshController.scala
  • app/models/mesh/Mesh.scala
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: backend-tests
  • GitHub Check: build-smoketest-push
  • GitHub Check: frontend-tests
🔇 Additional comments (7)
conf/evolutions/131-remove-stored-meshes.sql (1)

6-6: Bump schema version forward
Updating releaseInformation to 131 aligns the database state with this new evolution.

MIGRATIONS.unreleased.md (1)

13-13: Document new Postgres evolution
Including 131-remove-stored-meshes.sql under “Postgres Evolutions” ensures it’s applied for fresh deployments.

tools/postgres/schema.sql (1)

24-24: Initialize to new baseline version
Adjusting the inserted schemaVersion to 131 makes sure clean installs start at the correct migration level.

conf/evolutions/reversions/131-remove-stored-meshes.sql (4)

1-1: Verify pre-reversion schema version
The assertion ensures the schema is at 131 before running the rollback, preventing misaligned downgrades.


4-12: Recreate meshes table schema
The table definition, including its columns, defaults, and checks, matches the original schema prior to removal.


14-18: Re-establish view and foreign key
Recreating webknossos.meshes_ and re-adding the FK constraint restores the data model for stored meshes.


19-19: Revert schema version back
Downgrading releaseInformation to 130 correctly resets the migration state after undoing the table removal.

Copy link
Member

@frcroth frcroth left a comment

Choose a reason for hiding this comment

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

Please also remove the unused messages from conf/messages

@fm3 fm3 requested a review from frcroth April 29, 2025 09:55
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.

Remove or fix persistent mesh import of "ordinary" STL files
2 participants