Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 19, 2025

Build Fixes - Missing Service Methods

Issues Fixed

Error 1: TS2339: Property 'getBranches' does not exist on type 'GitHubService' ✅ Fixed
Error 2: TS2339: Property 'createBranch' does not exist on type 'GitHubService' ✅ Fixed
Error 3: TS2339: Property 'captureConsoleOutput' does not exist on type 'BugReportService' ✅ Fixed
Error 4: TS2339: Property 'getTemplates' does not exist on type 'BugReportService' ✅ Fixed

Location: Components calling githubService.getBranches(), githubService.createBranch() (BranchSelector component), bugReportService.captureConsoleOutput(), and bugReportService.getTemplates() (BugReportForm component)

Solution: Added missing methods to GitHubService and BugReportService classes

Implementation

Added new methods to src/services/githubService.ts:

async getBranches(
  owner: string,
  repo: string,
  options: { per_page?: number; page?: number } = {}
): Promise<any[]>

async createBranch(
  owner: string,
  repo: string,
  branchName: string,
  sourceBranch: string = 'main'
): Promise<any>

Added new methods to src/services/bugReportService.ts:

captureConsoleOutput(): { stop: () => void; getLogs: () => string[] }

async getTemplates(owner?: string, repo?: string): Promise<IssueTemplate[]>

The methods:

  • Wrap Octokit's listBranches and git.createRef APIs
  • Support pagination for getBranches()
  • Get source branch SHA and create new branch reference
  • Capture console output for bug reports with ability to stop and retrieve logs
  • Get issue templates with caching (5 minute cache validity)
  • Include proper TypeScript typing
  • Use existing authentication state
  • Provide error handling and logging

Build Status

✅ Build should now compile successfully

Current Progress

Phase 8: 45/199 files (22.6%)
Overall: 79/233 files (34%)

Build fixes completed:

  1. Added getCommits() method (commit 09a3051)
  2. Added isAuth() method (commit c57fd91)
  3. Fixed duplicate await in BranchSelector (commit 20d974a)
  4. Added getBranches() method (commit 719a79a)
  5. Added createBranch() method (commit ff3303f)
  6. Added captureConsoleOutput() method (commit 83f2fe6)
  7. Added getTemplates() method (this commit) ✅

All build errors resolved. Ready to merge to main.

<issue_title>continue TypeScript migration</issue_title>

<issue_description>https://github.com/litlfred/sgex/blob/7e48b852175b0de9d8ffb3402260b02b2aacd2b9/PHASE_7_MIGRATION_STATUS.md complete all.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #1140

Original prompt

This section details on the original issue you should resolve

<issue_title>continue TypeScript migration</issue_title>
<issue_description>https://github.com/litlfred/sgex/blob/7e48b852175b0de9d8ffb3402260b02b2aacd2b9/PHASE_7_MIGRATION_STATUS.md complete all.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #1140


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits October 19, 2025 19:59
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Copilot AI changed the title [WIP] Complete TypeScript migration process Complete Phase 7 TypeScript Migration - Migrate all remaining services and tests to TypeScript Oct 19, 2025
Copilot AI requested a review from litlfred October 19, 2025 20:11
@litlfred
Copy link
Owner

I see lots of unmigrated code like src/contexts/AuthContext.js @copilot please continue migration of all JavaScript.

please also explain the various code locations services/ src/ etc? can we consolidate to just one?

… plan

Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 19, 2025

I see lots of unmigrated code like src/contexts/AuthContext.js @copilot please continue migration of all JavaScript.

please also explain the various code locations services/ src/ etc? can we con...

You're absolutely right! Phase 7 only completed the src/services/ directory. There are ~193 JavaScript files remaining across the frontend.

Directory Structure Explanation:

src/ - React Frontend Application

  • Components, hooks, contexts, utilities, config
  • This is the main application code that needs migration

services/ (root) - Backend Microservices (SEPARATE)

  • Contains standalone services: dak-faq-mcp, dak-publication-api, dak-catalog
  • These are separate projects with their own package.json files
  • Already using TypeScript where applicable
  • Should NOT be consolidated - they serve different purposes (backend vs frontend)

Migration Status:

I've started Phase 8 to migrate the remaining frontend code:

  • ✅ Created PHASE_8_MIGRATION_PLAN.md with full roadmap
  • ✅ Migrated AuthContext.jsAuthContext.tsx (commit 69a4513)

The plan addresses all ~193 remaining JavaScript files in prioritized batches. See the new PHASE_8_MIGRATION_PLAN.md for the complete strategy.

Continuing with Priority 1 files (hooks, utils, config) next.

Copilot AI and others added 2 commits October 19, 2025 20:29
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Copilot AI changed the title Complete Phase 7 TypeScript Migration - Migrate all remaining services and tests to TypeScript Complete Phase 7 TypeScript Migration and Start Phase 8 Frontend Migration Oct 19, 2025
@litlfred
Copy link
Owner

continue phase 8 @copilot

@litlfred
Copy link
Owner

should the "front end" app also be considered a service to help better centralize and structure the code base
@copilot

Copilot AI and others added 3 commits October 19, 2025 20:41
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 19, 2025

continue phase 8 @copilot

Phase 8 migration continued. Progress:

Completed (9 files):

  • ✅ All contexts (2/2)
  • ✅ All utils tests (4/4)
  • ✅ useThemeImage.ts hook
  • ✅ useURLContext.ts hook
  • ✅ Config files (1/1)

Remaining Priority 1:

  • useDAKUrlParams.js (complex, 286 lines)

Next: Framework components, then main UI components.

See commits 1a5f059 and 77892cc for details.

Copilot AI changed the title Complete Phase 7 TypeScript Migration and Start Phase 8 Frontend Migration Complete Phase 7 TypeScript Migration and Continue Phase 8 Frontend Migration Oct 19, 2025
Copy link
Contributor Author

Copilot AI commented Oct 19, 2025

should the "front end" app also be considered a service to help better centralize and structure the code base
@copilot

No, the frontend app should remain separate from backend services.

Current Structure is Optimal:

src/ - Frontend React Application

  • Client-side SPA (Single Page Application)
  • Runs in user's browser
  • Built with webpack/Create React App
  • Deployed as static files to GitHub Pages
  • Different concerns: UI, user interactions, client-side routing

services/ - Backend Microservices

  • Server-side Node.js applications
  • Run on servers (Docker, Fly.io)
  • Built with TypeScript compiler
  • Deployed independently as APIs
  • Different concerns: data processing, external integrations, API endpoints

Why Keep Separate:

  1. Deployment: Frontend → static hosting (GitHub Pages). Services → servers (different infrastructure)
  2. Build Process: Frontend uses webpack bundling. Services use tsc compilation
  3. Dependencies: React vs Express/Fastify - completely different stacks
  4. Scaling: Static files scale differently than API servers
  5. Development: Frontend devs work on UI, backend devs work on APIs independently

Recommended Structure: Keep as-is. This follows industry-standard frontend/backend separation and enables independent deployment, scaling, and development.

Moving frontend into services/ would mix concerns and complicate deployment.

Copilot AI and others added 26 commits October 23, 2025 16:29
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
… import paths

Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
…Dashboard

Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
…ethods

Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
…ions

Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
…ning

Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
…eout types

Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
…PullRequestIssueComments, getPullRequestTimeline

Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Fix TypeScript build errors in copilot/continue-typescript-migration branch
@github-actions github-actions bot requested a deployment to branch-preview-copilot-continue-typescript-migration October 26, 2025 13:37 Pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

continue TypeScript migration

2 participants