Commit Graph

6 Commits

Author SHA1 Message Date
zhenyi 15b875e18d perf(issues): replace N+1 queries with batch operations
- Add Repo::find_by_ids() batch query using WHERE id = ANY($1)
- Replace 3 sequential validation loops (repos, labels, assignees)
  with batch queries using ANY($1)
- Replace 3 sequential INSERT loops with single INSERT...SELECT
  FROM unnest() statements
- Extract 7 helper methods: validate_issue_repos,
  validate_issue_labels, validate_issue_assignees,
  validate_issue_milestone, insert_issue_repo_relations,
  insert_issue_label_relations, insert_issue_assignees
- Reduce issue_create() from ~243 lines to ~80 lines
2026-06-10 18:49:00 +08:00
zhenyi 3a22c4265d feat(api): add pull request and wiki API endpoints with OpenAPI generator
- Add gen_openapi binary for generating OpenAPI specification
- Implement comprehensive pull request API endpoints including core operations
- Add pull request reviews, check runs, labels, assignees, and events APIs
- Include pull request status and merge strategy management endpoints
- Add wiki page CRUD operations with revision history and comparison
- Update OpenAPI documentation with Pull Requests and Wiki tags
- Modify workspace find function visibility for external access
- Integrate new API modules into main OpenAPI router configuration
2026-06-07 19:58:02 +08:00
zhenyi 4028f0d943 refactor(api): reorder imports and update code formatting across repository endpoints
- Reordered actix-web imports to standardize import order
- Reordered crate module imports to follow alphabetical ordering
- Updated function calls to use multi-line formatting for better readability
- Standardized blank lines around documentation comments
- Applied consistent formatting to response handling methods
- Normalized import organization across all repository-related API files
- Improved code consistency and maintainability through standardized formatting
- Applied formatting updates to all repository endpoint implementations
2026-06-07 19:41:33 +08:00
zhenyi 7368ba676c feat(api): add comprehensive repository management API endpoints
- Introduce new repo module with complete repository functionality
- Add endpoints for repository CRUD operations (create, get, update, archive, delete)
- Implement branch management with create, list, delete and protection features
- Add tag management with create, list and delete operations
- Include release management with create, update and delete capabilities
- Support repository forking with sync functionality
- Implement starring and watching mechanisms for repositories
- Add member management with roles and invitations
- Provide deploy key management for CI/CD integration
- Create webhook management for external integrations
- Implement branch protection rules with approval requirements
- Add commit status and comment functionality for code reviews
- Include merge checking logic for pull requests
- Register all new endpoints in OpenAPI documentation
- Configure routes to handle new repository-specific paths
2026-06-07 19:19:53 +08:00
zhenyi dca717be10 refactor(workspace): pass workspace object instead of id to service methods
- Replace workspace_id parameter with Workspace object reference in all workspace service methods
- Remove redundant find_workspace_by_id calls that were duplicated in each method
- Update all method signatures across approval, audit, billing, branding, core, settings and stats modules
- Modify SQL queries to bind ws.id instead of separate workspace_id parameter
- Add Workspace import to all affected modules
- Adjust method calls in API handlers to pass workspace object instead of id
- Consolidate workspace retrieval logic to single location per operation flow
2026-06-07 18:44:01 +08:00
zhenyi 563381c1ca feat: init 2026-06-07 11:30:56 +08:00