Canny-Code / rails-new-io

railsnew.io - the simplest way to generate a new Rails app with (or without!) all the bells and whistles.
1 stars 0 forks source link

From rails new to Github push #134

Closed trinitytakei closed 9 hours ago

trinitytakei commented 5 days ago

Objective

Create an orchestration service that coordinates the end-to-end process of generating a Rails application and pushing it to a new Github repository.

Background

We have three existing services that handle individual parts of the workflow:

We need to orchestrate these services into a seamless workflow.

Input

  # the starting point is a GeneratedApp that is created based on the UI 
  # for the duration of this implementation, just create it from the Rails console

  GeneratedApp.create!(name: '...', user_id: trinitytakei, ...) 

  # name has been validated by GithubRepositoryNameValidator
  # ensuring the repository name is available on Github

Workflow Steps

  1. Create Github repository

    • Input: generated_app.name
    • Service: GithubRepositoryService
    • Output: generated_app updated with Github repository details
  2. Generate Rails application

    • Input: Rails new command and generated_app
    • Service: CommandExecutionService
    • Output: Generated app directory path
  3. Push to Github

    • Input: generated_app and directory path from the previous step
    • Service: GithubCodePushService
    • Output: Pushed repository details

Technical Requirements

  1. Create Orchestrator Service
class RailsAppGenerationOrchestrator
  def initialize(generated_app)
    @generated_app = generated_app
  end

  # Orchestration logic here
  # for now sequential and synchronous; 
  # once it's ready and testes, some steps can be parallel
  # and in each case they will run in a background job
  # use the acidic_job gem https://github.com/fractaledmind/acidic_job

end
  1. Error Handling

    • Rely on Acidic job's error handling
  2. Logging

    • Log progress of each step (use AppGeneration::Logger)
    • Track timing information
    • Record any warnings or issues

Acceptance Criteria

Test Requirements

Implementation Notes

• Add monitoring hooks for observability
• Consider adding progress callbacks for UI updates

Dependencies

• GithubRepositoryService
• CommandExecutionService
• GithubCodePushService
• GithubRepositoryNameValidator (pre-requisite)

Out of Scope

• UI implementation
• Authentication handling (assumed to be handled by individual services)
• Repository configuration beyond default settings    
linear[bot] commented 5 days ago

RAI-46 From rails new to Github push

trinitytakei commented 9 hours ago

All good