Giter VIP home page Giter VIP logo

test-on-branch's Introduction

Test repo for GitHub app

This is a Node.js app that includes a simple npm run test that:

  • Expects to find a Postgres connection string in DATABASE_URL env.
  • Creates a users table if it does not exist.
  • Confirms an INSERT increases the table's row count.

How might a customer use this?

This repo contains a .github/workflows file to demo running a test against the newly created Neon branch when a pull request is created.

We expect to see the test row inserted into the newly created Neon branch (not Neon primary branch) when the workflow is run.

The PR should not complete if the test fails.

Expected user experience

Adding the GitHub integration

  • From the Neon console, I add the GitHub integration to my Neon project and select this as the connected repo.
  • In this repo, I will find the GitHub integration has created a main environment.
  • The main environment contains a DATABASE_URL and a DATABASE_URL_UNPOOOLED variable for my Neon primary branch.

Creating a new git branch

  • When a new git branch is created, the GitHub integration does the following.
    • Creates a new Neon branch that reflects the name of the git branch.
    • Creates a new GitHub environment that reflects the name of the git branch.
    • The new GitHub environment contains DATABASE_URL and DATABASE_URL_UNPOOLED variables for the new Neon branch.

Merging a PR/deleting a git branch

  • When a new git branch is delted (e.g. on PR merge), the GitHub integration does the following.
    • Deletes thew Neon branch associuated with the git branch.
    • Deletes the GitHub environment and its variables associated with the deleted branch

Changing the Neon primary branch

  • If the Neon primary branch is changed, the DATABASE_URL and DATABASE_URL_UNPOOLED variables in the main environment will be updated.

test-on-branch's People

Contributors

michrome avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.