Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds the ability to control feed visibility (public/private) during DMFR sync operations. New command-line flags --set-public and --set-private allow administrators to explicitly set the public/private state of feeds during synchronization, with sensible defaults: new feeds are public by default, and existing feeds retain their current state unless explicitly changed.
Key Changes
- Added
--set-publicand--set-privatecommand-line flags with mutual exclusivity validation - Modified
UpdateFeed()to accept an optionalsetPublicparameter for controlling visibility - Implemented
UpdateFeedStatePublic()function to create or update feed state visibility with conditional logic
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
cmds/sync_cmd.go |
Added command-line flags and validation for mutually exclusive public/private options |
sync/sync.go |
Added SetPublic field to Options struct and passed it through to UpdateFeed |
sync/sync_feed.go |
Modified UpdateFeed signature to accept setPublic parameter and call UpdateFeedStatePublic |
stats/dbutil.go |
Implemented new UpdateFeedStatePublic function with conditional create/update logic |
sync/sync_test.go |
Updated test calls to pass nil for the new setPublic parameter |
doc/cli/transitland_sync.md |
Updated CLI documentation to describe new flags and default behavior |
testdata/server/test_supplement.pgsql |
Added SQL to set all feed states to private by default in test data |
server/auth/authz/azpb_grpc.pb.go |
Regenerated with protoc v6.33.2 (was v6.32.0) |
server/auth/authz/azpb.pb.go |
Regenerated with protoc v6.33.2 (was v6.32.0) |
rt/pb/gtfs-realtime.pb.go |
Regenerated with protoc v6.33.2 (was v6.32.0) |
💡 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.
Previous: New feed states defaulted to [public = false]
Now: New feed states default to [public = true]
Mitigation: Users can use --set-private flag with sync if they want the old behavior.