Skip to content

refactor: migrate session.query to select API in console controllers#34607

Merged
asukaminato0721 merged 2 commits intolanggenius:mainfrom
aliworksx08:refactor/sqlalchemy-select-controllers
Apr 7, 2026
Merged

refactor: migrate session.query to select API in console controllers#34607
asukaminato0721 merged 2 commits intolanggenius:mainfrom
aliworksx08:refactor/sqlalchemy-select-controllers

Conversation

@aliworksx08
Copy link
Copy Markdown
Contributor

@aliworksx08 aliworksx08 commented Apr 6, 2026

Summary

  • Migrate legacy session.query(Model).where(...).first() to modern
    session.scalar(select(Model).where(...)) in controller files

Part of #22668

Changes

  • controllers/console/workspace/__init__.py — plugin permission lookup
  • controllers/console/app/workflow_trigger.py — webhook trigger lookup
  • controllers/console/datasets/rag_pipeline/rag_pipeline.py — pipeline template lookup
  • controllers/mcp/mcp.py — MCP server, app, and end user lookups

Test plan

  • ruff check passes
  • 12715 unit tests pass
  • make type-check — no new errors

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. refactor labels Apr 6, 2026
@aliworksx08
Copy link
Copy Markdown
Contributor Author

Hi, @asukaminato0721
I just opened a PR. Can you review my PR please?
Thank you.

@aliworksx08 aliworksx08 force-pushed the refactor/sqlalchemy-select-controllers branch from a0876e5 to ca2e12a Compare April 6, 2026 15:42
@aliworksx08 aliworksx08 force-pushed the refactor/sqlalchemy-select-controllers branch from ca2e12a to 4d68421 Compare April 6, 2026 18:06
@aliworksx08 aliworksx08 requested a review from Nov1c444 as a code owner April 6, 2026 18:06
Comment thread api/controllers/console/app/workflow_trigger.py
Comment thread api/controllers/console/datasets/rag_pipeline/rag_pipeline.py Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

Pyrefly Diff

No changes detected.

Comment thread api/controllers/mcp/mcp.py Outdated
Comment thread api/controllers/mcp/mcp.py Outdated
Comment thread api/controllers/mcp/mcp.py
@dosubot dosubot Bot mentioned this pull request Apr 7, 2026
5 tasks
auto-merge was automatically disabled April 7, 2026 03:54

Head branch was pushed to by a user without write access

@aliworksx08
Copy link
Copy Markdown
Contributor Author

Hi, @asukaminato0721 Thanks for your help. Please review my update.

asukaminato0721
asukaminato0721 previously approved these changes Apr 7, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

Pyrefly Diff

No changes detected.

auto-merge was automatically disabled April 7, 2026 04:09

Head branch was pushed to by a user without write access

@aliworksx08 aliworksx08 force-pushed the refactor/sqlalchemy-select-controllers branch from f188f32 to 7228f61 Compare April 7, 2026 04:09
@aliworksx08 aliworksx08 requested a review from laipz8200 as a code owner April 7, 2026 04:09
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Apr 7, 2026
@aliworksx08
Copy link
Copy Markdown
Contributor Author

@asukaminato0721 Sorry. Please rerun CI tests. Thanks

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

Pyrefly Diff

No changes detected.

@asukaminato0721 asukaminato0721 added this pull request to the merge queue Apr 7, 2026
Merged via the queue into langgenius:main with commit 396b39d Apr 7, 2026
27 checks passed
@aliworksx08
Copy link
Copy Markdown
Contributor Author

@asukaminato0721 Thanks for merging this PR. I'll continue.

@aliworksx08 aliworksx08 deleted the refactor/sqlalchemy-select-controllers branch April 7, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer refactor size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants