Git integration

Default branch becomes locked

When connected to a git repository, the default branch becomes read-only. You have to create branches to make changes and apply them via pull-requests. The default branch is automatically up-to-date with merges happening on the git repository.

WebComponents.dev offers Git integrations to four different providers:

github, gitlab, azure and bitbucket logo presented in a row for selecting a provider

Set-up

You can use any of these providers to create a repository and WebComponents.dev will complete the set-up upon creation, either via registering webhooks on your repository, or via the provider's app installation (i.e. Github).

Token usage

We have defined and set up different OAuth clients for each provider in WebComponents.dev.

WebComponents.dev uses each of these Oauth integrations to retrieve, generate and refresh tokens, in order to accomplish tasks on your behalf.

For Github: WebComponents.dev uses the Github app's token.

You can revoke tokens at anytime, WebComponents.dev will try to refresh with your authenticated user.

Git usage

WebComponents.dev uses integrations as bare Git client, allowing you to:

  • Push a commit to a remote repository
  • Pull a branch from a remote repository
  • Hard reset of a branch from a remote repository

API Provider usage

  • List repositories for a specific provider
  • Get username of the user within a provider
  • Create and update a Pull/Merge request based on a commit
Window with a text area filled with a commit message and button for creating a pull request

Events usage

After correctly setting up your repository, WebComponents.dev will automatically register webhooks (or application events for Github), in order to be notified of certain events.

Specifically, WebComponents.dev will listen for:

  • Merge events
  • Pull/Merge request events

Merge events

WebComponents.dev uses these events to keep your default branch up-to-date in WebComponents.dev.

It will also allow you to:

  • Keep track of the baseline when you need to create a new branch inside WebComponents.dev
  • Keep track of the baseline for visual screenshots

Once WebComponents.dev receives a merge event from the configured Git provider on the default branch, WebComponents.dev captures the sha of the default branch and WebComponents.dev stores it, to be able to later fetch the default branch in c

Pull/Merge request events

WebComponents.dev uses every create, update and delete events to populate the list of the Pull/Merge requests available inside WebComponents.dev.