Skip to content

Your copilot for software dependency updates

License

Notifications You must be signed in to change notification settings

donutegg/adaptly

 
 

Repository files navigation

a-hero

Website Docs


Next time when you update a dependency, forget about:

  1. Reading dependency changelogs
  2. Figuring out breaking changes
  3. Wondering what code needs to be refactored to work with the latest dependency version

Adaptly will do that for you.

b-benefits


How it works

Trigger Adaptly with a simple comment on any PR that updates dependencies:

spacer

Then, Adaptly will:

  1. Flag breaking dependency changes  ⚠️
  2. Highlight code that requires refactoring  ‼️

spacer


Features

Seamless Version Transition

Adaptly safely guides you from the current version to the target version, pausing at versions that require codebase refactors. After addressing issues, trigger Adaptly again to continue from where it stopped.

Flexible Dependency Handling

Adaptly can handle multiple dependency updates within a pull request. If additional dependencies are updated mid-process, Adaptly incorporates them into its ongoing analysis.

Languages supported

Getting started

See Adaptly docs on how to connect it to your repository and save time by letting Adaptly guide you during dependency updates.


Local development

Table of contents:

  1. Local development setup
  2. Running Adaptly locally
  3. Local development database
  4. Self-hosting

Local development setup

  1. Use Node.js at the version Adaptly requires:
    1. Install nvm (Node Version Manager) from here.
    2. Run “nvm install && nvm use” in the project root.
  2. Install dependencies using “pnpm”:
    1. Adaptly uses “pnpm” as the package manager and you can install “pnpm” from here.
    2. Run “pnpm install” at the project root.
      1. If it fails, uninstall pnpm and install it again.
  3. Setup Docker containers:
    1. Install Docker desktop from here and then start Docker.
    2. Run “docker-compose up -d” to start Docker containers.
  4. Setup Doppler for environment variables:
    1. Sign up for Doppler here.
    2. Create Doppler project and config with the same names as in “doppler.yaml” in the project root.
    3. Within the Doppler config setup environment variables required by “source/env.ts”
    4. Install Doppler CLI from here.
    5. Authenticate Doppler CLI using “doppler login”
    6. Run “doppler setup” in project root.
  5. Setup Local database and Prisma:
    1. Instantiate tables and run migrations using “pnpm migrate:dev”
    2. Seed database using “prisma/seed.ts” file
      1. In production Adaptly is connected to a specific repository. In development we need to simulate it, so replace “owner” and “name” in “prisma/seed.ts” by repository
      2. Run “npx prisma db seed” to seed database with data
    3. Build prisma client “pnpm build:prisma”
    4. To learn how to view database data and apply migrations check “Local development database” section.

Running Adaptly locally

  1. Expose local port 3001 to the internet using ngrok by running “ngrok http 3001”
  2. In GitHub app settings set “Callback URL” and “Webhook URL” to the one provided by ngrok, but for “Webhook URL” append “/webhook” at the end of it. For example “https://78xx-82-132-200-100.ngrok-free.app/webhook
  3. Run “pnpm dev” to start Adaptly on port 3001. It’s now ready to process GitHub app requests.

Local development database

This document provides step-by-step instructions to set up and manage your local development database using Prisma and Postgres.

  1. Start the Postgres Container

    docker-compose up -d
    
  2. Instantiate Tables

    Apply all pending migrations to instantiate your tables with:

    pnpm migrate:dev
    
  3. Seed database using prisma/seed.ts file

    npx prisma db seed
    
  4. Build Prisma Client

    Sync the Prisma client with your database using the command:

    pnpm build:prisma
    
  5. View Database

    Open TablePlus and connect to your local Postgres database. The default user and password should be 'postgres' and connect to local host. Alternatively, you can view your local development database in your web browser by running Prisma Studio:

    pnpm prisma-studio
    
  6. Modify and Migrate Schema

    If you make changes to your Prisma schema, create a new migration and apply it with:

    pnpm migrate:dev
    

    Remember to commit and push the migration files to your version control system.

  7. Rebuild Prisma Client

    Sync the Prisma client with your updated database using the command:

    pnpm build:prisma
    

Self-hosting

Adaptly uses Doppler to manage secrets. Follow steps below to setup Doppler:

  1. Sign up for Doppler here.
  2. Create Doppler project and config with the same names as in “doppler.yaml” in the project root.
  3. Within the Doppler config setup environment variables required by “source/env.ts”
    1. The GitHub secrets (GITHUB_ACCESS_TOKEN, GITHUB_APP_ID and GITHUB_APP_PRIVATE_KEY) are from creating a GitHub app.

Make sure you have Docker installed before running the following commands.

You are going to need a DOPPLER_TOKEN that you can get by following these steps.

  1. Build the image: docker build -t adaptly-app .
  2. Run it: docker run -p 3001:3001 -d -e DOPPLER_TOKEN="$DOPPLER_TOKEN" --name adaptly-container adaptly-app

You should be able to navigate to your browser and check localhost:3001/ping is alive.

Once the server is running locally, you can expose it as you want, with ngrok or running it on any cloud providers and you can then update your GitHub app settings to point to it.

The entry webhook for the app is located at: <YOUR_APP_URL>/webhook.

About

Your copilot for software dependency updates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.3%
  • Other 0.7%