Next time when you update a dependency, forget about:
- Reading dependency changelogs
- Figuring out breaking changes
- Wondering what code needs to be refactored to work with the latest dependency version
Adaptly will do that for you.
Trigger Adaptly with a simple comment on any PR that updates dependencies:
Then, Adaptly will:
- Flag breaking dependency changes
⚠️ - Highlight code that requires refactoring
‼️
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.
Adaptly can handle multiple dependency updates within a pull request. If additional dependencies are updated mid-process, Adaptly incorporates them into its ongoing analysis.
See Adaptly docs on how to connect it to your repository and save time by letting Adaptly guide you during dependency updates.
Table of contents:
- Use Node.js at the version Adaptly requires:
- Install nvm (Node Version Manager) from here.
- Run “nvm install && nvm use” in the project root.
- Install dependencies using “pnpm”:
- Adaptly uses “pnpm” as the package manager and you can install “pnpm” from here.
- Run “pnpm install” at the project root.
- If it fails, uninstall pnpm and install it again.
- Setup Docker containers:
- Install Docker desktop from here and then start Docker.
- Run “docker-compose up -d” to start Docker containers.
- Setup Doppler for environment variables:
- Sign up for Doppler here.
- Create Doppler project and config with the same names as in “doppler.yaml” in the project root.
- Within the Doppler config setup environment variables required by “source/env.ts”
- Install Doppler CLI from here.
- Authenticate Doppler CLI using “doppler login”
- Run “doppler setup” in project root.
- Setup Local database and Prisma:
- Instantiate tables and run migrations using “pnpm migrate:dev”
- Seed database using “prisma/seed.ts” file
- 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
- Run “npx prisma db seed” to seed database with data
- Build prisma client “pnpm build:prisma”
- To learn how to view database data and apply migrations check “Local development database” section.
- Expose local port 3001 to the internet using ngrok by running “ngrok http 3001”
- 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”
- Run “pnpm dev” to start Adaptly on port 3001. It’s now ready to process GitHub app requests.
This document provides step-by-step instructions to set up and manage your local development database using Prisma and Postgres.
-
Start the Postgres Container
docker-compose up -d
-
Instantiate Tables
Apply all pending migrations to instantiate your tables with:
pnpm migrate:dev
-
Seed database using
prisma/seed.tsfilenpx prisma db seed
-
Build Prisma Client
Sync the Prisma client with your database using the command:
pnpm build:prisma
-
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
-
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.
-
Rebuild Prisma Client
Sync the Prisma client with your updated database using the command:
pnpm build:prisma
Adaptly uses Doppler to manage secrets. Follow steps below to setup Doppler:
- Sign up for Doppler here.
- Create Doppler project and config with the same names as in “doppler.yaml” in the project root.
- Within the Doppler config setup environment variables required by “source/env.ts”
- The GitHub secrets (
GITHUB_ACCESS_TOKEN,GITHUB_APP_IDandGITHUB_APP_PRIVATE_KEY) are from creating a GitHub app.
- The GitHub secrets (
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.
- Build the image:
docker build -t adaptly-app . - 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.
