-
-
Notifications
You must be signed in to change notification settings - Fork 293
feat(bridge): add SourceHut todo bridge implementation #1499
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
Draft
mcepl
wants to merge
17
commits into
git-bug:trunk
Choose a base branch
from
openSUSE-Python:todosrht
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
8c0d156 to
e76ef40
Compare
Fixes 'concurrent map read and map write' error in TestImporter by wrapping memfs with a RWMutex for synchronized access.
- Add complete todosrht bridge with GraphQL client and API integration - Implement full CRUD operations for tickets, comments, labels, and events - Add comprehensive test suite with mock client and authentication - Update bridge registry to include TodoSourceHut implementation - Add configuration management and validation for SourceHut instances - Include import/export functionality for bidirectional sync - Update documentation with man pages and usage guides - Add proper error handling and pagination support Fixes: git-bug#1024 Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
Add support for full URL parsing and enhance error reporting for better user experience: * Add parseTodoURL() to extract base URL and tracker from full URLs like https://todo.sr.ht/~owner/tracker * Implement two-step validation: check tracker existence first, then verify credentials separately * Add TrackerExists() method for public tracker access checking * Improve error messages to distinguish between "tracker doesn't exist" vs "invalid credentials" * Add todo.sr.ht example to bridge new command help documentation * Update mock client to implement the new interface Users can now use the more intuitive --url flag with full todo.sr.ht URLs and receive clearer feedback when configuration fails. Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
gokart seems to be completely dead these days
1. GraphQL query restructuring: Fixed queries to use me.trackers and me.tracker structure 2. Submitter field handling: Changed to *json.RawMessage with new GetSubmitter() method for proper type unmarshaling 3. API parameter changes: GetTickets() now uses trackerName instead of trackerID 4. URL parsing fix: Extract only tracker name from owner-prefixed URLs 5. Error handling: Added tracker validation and better submitter parsing
…r access - Replace me.trackers query with tracker(name: String!) query - Add getTrackerByNameQuery for public tracker access - Fixes blocking bug preventing bridge configuration for public trackers Resolves issue where users couldn't access trackers they don't own
- Add CreateLabel, DeleteLabel, AssignUser, UnassignUser methods - Completes client interface for full todo.sr.ht API coverage - Enables label creation and user assignment functionality
- Add CreateLabel, DeleteLabel, AssignUser, UnassignUser mock methods - Completes mock client interface for full API coverage
- Add createTodoSRHTLabel helper function with validation - Auto-create missing labels during export with default colors - Improve error messages for label operations - Add input validation for label names - Enhance error handling with detailed messages Resolves issue where missing labels caused export failures
- Handle Assignment events in ensureEvent function - Map assigner and assignee to git-bug identities - Emit warnings for assignment events (git-bug has no native assignment) - Completes import coverage for all todo.sr.ht event types
- Add json import for JSON marshaling - Fix mock function signatures to match interface - Convert User entities to JSON raw messages for API compatibility - Resolves compilation errors in test suite
- Add TestTrackerExists for public tracker access validation - Add TestCreateLabel for label creation functionality - Add TestAssignUser for user assignment operations - Add TestDeleteLabel for label deletion operations - Provides complete test coverage for all new client methods
- Add MockCreateLabel, MockDeleteLabel, MockAssignUser, MockUnassignUser - Update mock client to support all new GraphQL mutations - Enables testing of label creation and user assignment functionality
- Add comprehensive feature list with import/export capabilities - Document new label creation and user assignment functionality - Add troubleshooting section for common issues - Include usage examples for all major operations - Document advanced features and error handling improvements
The GraphQL query for GetEvents was updated to correctly traverse the schema via `me.tracker.ticket` instead of a direct top-level `ticket` query. This change aligns the client with the current todo.sr.ht API structure. The `GetEvents` function signature and its mock implementation were updated to accept `trackerName` as a parameter. Corresponding call sites in `import.go` and `import_test.go` were also adjusted to pass this new parameter. A minor whitespace adjustment was also made in `doc/usage/todosrht.md`.
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 is completely vibe coded. I plan to review this code completely and test thoroughly, but if somebody who knows Golang and git-bug API better me (i.e., almost anybody), I am all ears for any suggestions.
Fixes: #1024