Conversation
Generated Code Check ✅All generated code is up to date. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds debugging capabilities and improves segment query performance in the Transitland server, with a focus on development tools and query optimization.
Changes:
- Adds a
--disable-authserver flag to bypass authorization checks for local development - Enables trace-level logging in QueryLogger when log level is set to TraceLevel
- Refactors
SegmentsByFeedVersionIDsto use a more efficient window function approach withROW_NUMBER()instead of LATERAL joins - Introduces a
segmentSelecthelper function for consistent segment queries
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| server/finders/dbfinder/segment.go | Refactors segment queries to use window functions and adds a new segmentSelect helper for better maintainability |
| cmds/server_cmd.go | Adds DisableAuth flag and globalAdminChecker implementation, enables trace logging in QueryLogger |
| doc/cli/transitland_server.md | Documents the new --disable-auth flag |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds debugging capabilities and improvements to the Transitland server, particularly around authorization and segment queries.
Changes
New
--disable-authServer Flag--disable-authcommand-line flag to thetransitland servercommandglobalAdminCheckerthat always returnstrueforCheckGlobalAdminQuery Logger Enhancement
QueryLoggerwhen the log level is set toTraceLevelTrace: trueparameter for more detailed query loggingSegment Query Improvements
SegmentsByFeedVersionIDsto use a more efficient subquery withROW_NUMBER()window functionPARTITION BY feed_version_idto properly limit results per feed versionlateralWrapapproachsegmentSelecthelper function for consistent segment queriesSegmentsByIDsto use the newsegmentSelectfunction instead ofquickSelect