Skip to main content

Launchpad

Repository onboarding and webhook handling service for the Rippler impact analysis system.

Architecture Diagram

The following diagram illustrates the internal architecture of the Launchpad service, showing how GitHub webhooks are processed, how PR analysis is orchestrated, and how the service integrates with other Rippler components.

Update the Architecture Diagram

To view and edit the architecture diagram:

  1. Open /docs/architecture/services/launchpad.drawio in diagrams.net or VS Code with the Draw.io extension
  2. The diagram shows the complete webhook handling and orchestration architecture including GitHub integration, repository management, PR analysis coordination, and downstream service communication
  3. After making changes, export to HTML and copy to /website/static/architecture/services/launchpad.drawio.html

Overview

The Launchpad service is the entry point for repositories into Rippler. It handles repository onboarding, GitHub webhook processing, and orchestrates the impact analysis workflow.

Features

  • GitHub Repository Search: Search public GitHub repositories via GitHub REST API
  • Repository Onboarding: Register new repositories for monitoring with one-click setup
  • Webhook Handler: Process GitHub PR events and trigger automated impact analysis
  • PR Analysis: Automatically analyze pull requests using LLM for impact assessment
  • GitHub Notifications: Send PR analysis notifications back to GitHub
  • Metadata Management: Store and manage repository configuration
  • Validation: Comprehensive validation of repository data
  • REST API: Full CRUD operations for repository management
  • Database Persistence: PostgreSQL backend with Flyway migrations
  • Data Security: Encrypted storage for sensitive data (tokens, secrets)

Technology Stack

  • Java 17: Modern Java runtime
  • Spring Boot 3.2: Enterprise application framework
  • Spring Data JPA: Database access layer
  • PostgreSQL: Relational database
  • Flyway: Database migration management
  • Lombok: Reduce boilerplate code
  • Maven: Build and dependency management

API Endpoints

Repository Management

Search GitHub Repositories

GET /api/v1/search/repositories?q={query}

Search for public repositories on GitHub.

Example:

curl "http://localhost:8007/api/v1/search/repositories?q=spring+boot"

Onboard Repository

POST /api/v1/repositories

Register a new repository for monitoring.

Request Body:

{
"name": "my-repo",
"owner": "my-org",
"url": "https://github.com/my-org/my-repo",
"access_token": "ghp_xxxxx",
"webhook_secret": "secret123"
}

Get Repository

GET /api/v1/repositories/{id}

List Repositories

GET /api/v1/repositories

Update Repository

PUT /api/v1/repositories/{id}

Delete Repository

DELETE /api/v1/repositories/{id}

Webhook Handling

GitHub Webhook Endpoint

POST /api/v1/webhooks/github

Receives GitHub webhook events for pull request activities.

Supported Events:

  • pull_request.opened
  • pull_request.synchronize
  • pull_request.reopened

Notifications

Send GitHub Notification

POST /api/v1/notifications/github

Send impact analysis results as a comment on the PR.

Request Body:

{
"repository": "owner/repo",
"pr_number": 123,
"message": "Impact analysis results...",
"status": "success"
}

Health Check

GET /actuator/health

Returns service health status.

Configuration

Environment Variables

VariableDescriptionDefault
SERVER_PORTService port8007
DB_HOSTDatabase hostnamelocalhost
DB_PORTDatabase port5432
DB_NAMEDatabase namerippler_launchpad
DB_USERNAMEDatabase usernamepostgres
DB_PASSWORDDatabase passwordpostgres
GITHUB_TOKENGitHub API token-
ENCRYPTION_KEYData encryption key-

Application Properties

# Server Configuration
server.port=8007

# Database Configuration
spring.datasource.url=jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME}
spring.datasource.username=${DB_USERNAME}
spring.datasource.password=${DB_PASSWORD}

# JPA Configuration
spring.jpa.hibernate.ddl-auto=validate
spring.jpa.show-sql=false

# Flyway Configuration
spring.flyway.enabled=true
spring.flyway.locations=classpath:db/migration

Installation

Prerequisites

  • Java 17 or higher
  • Maven 3.6+
  • PostgreSQL 13+

Local Development

# Start PostgreSQL
docker run -d \
--name launchpad-postgres \
-e POSTGRES_DB=rippler_launchpad \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-p 5432:5432 \
postgres:15

# Build the application
mvn clean install

# Run the application
mvn spring-boot:run

Using Docker

# Build image
docker build -t rippler/launchpad .

# Run container
docker run -d \
-p 8007:8007 \
-e DB_HOST=postgres \
-e GITHUB_TOKEN=your-token \
rippler/launchpad

Using Docker Compose

# From project root
docker-compose up launchpad postgres

Usage

Onboarding a Repository

  1. Search for a repository:
curl "http://localhost:8007/api/v1/search/repositories?q=your-repo"
  1. Onboard the repository:
curl -X POST http://localhost:8007/api/v1/repositories \
-H "Content-Type: application/json" \
-d '{
"name": "my-repo",
"owner": "my-org",
"url": "https://github.com/my-org/my-repo",
"access_token": "ghp_xxxxx"
}'
  1. Configure GitHub webhook:
    • Go to repository settings on GitHub
    • Add webhook with URL: http://your-server:8007/api/v1/webhooks/github
    • Select event: Pull requests
    • Set content type: application/json

Processing PR Events

When a PR is opened or updated:

  1. GitHub sends webhook event to Launchpad
  2. Launchpad validates the event
  3. Extracts PR data (diff, files changed, etc.)
  4. Sends data to Impact Analyzer
  5. Impact Analyzer coordinates with other services
  6. Results are sent back to GitHub as PR comments

Architecture

Workflow

graph LR
GH[GitHub] -->|Webhook| LP[Launchpad]
LP -->|PR Data| IA[Impact Analyzer]
IA -->|Query| DG[Dependency Graph]
IA -->|Analyze| LLM[LLM Service]
IA -->|Results| LP
LP -->|Comment| GH

Database Schema

The service uses PostgreSQL with the following main tables:

  • repositories: Store repository metadata
  • webhook_events: Log incoming webhook events
  • analysis_results: Cache analysis results

Development

Running Tests

# Run unit tests
mvn test

# Run integration tests
mvn verify

Database Migrations

Flyway manages database schema:

# Clean database (dev only)
mvn flyway:clean

# Run migrations
mvn flyway:migrate

# Check migration status
mvn flyway:info

Troubleshooting

Webhook Not Received

  1. Verify webhook URL is accessible from GitHub
  2. Check firewall/network settings
  3. Review webhook delivery logs on GitHub
  4. Check service logs for errors

Database Connection Failed

  1. Verify PostgreSQL is running
  2. Check database credentials
  3. Ensure database exists
  4. Review connection string

Repository

GitHub: launchpad