Skip to content

An extension which shows ancestor and descendant PRs on the Github PR page

License

Notifications You must be signed in to change notification settings

BenMatase/chainlink-extension

Repository files navigation

icon-128 png

Chainlink

An extension which shows ancestor and descendant PRs on the Github PR page.

Features

  • Configure Github token in extension options
  • Quickly navigate the tree of PRs in your repo

Terminology

  • ancestor: a PR which is trying to merge the PR's base branch into some other branch
  • descendant: a PR which is trying to merge some other branch into the PR's head branch
  • sibling: a PR which is trying to merge into the same branch the PR

Getting started

Installation

Using the Extension

Generating a token

Token (classic)

Quick link with prefilled data

Or DIY:

  1. Generate a token
  2. Check the box next to repo
Fine Grained Token
  1. Go to https://github.com/settings/personal-access-tokens/new
  2. Choose whichever repositories you want to restrict this extension to. For ease, you can use All repositories
  3. Under Repository Permissions set Pull Requests to Read only

Trying It Out

There is a sister repo called chainlink-sandbox which has some dummy PRs which will illustrate the value of the extension.

Contributing

🛠 Build locally

  1. Run npm install to install all required dependencies
  2. Run npm run build

The build step will create the distribution folder, this folder will contain the generated extension.

🏃 Run the extension

Using web-ext is recommended for automatic reloading and running in a dedicated browser instance. Alternatively you can load the extension manually (see below).

  1. Run npm run watch to watch for file changes and build continuously
  2. Run npm install --global web-ext (only only for the first time)
  3. In another terminal, run web-ext run -t chromium
  4. Check that the extension is loaded by opening the extension options (in Firefox or in Chrome).

Manually

You can also load the extension manually in Chrome or Firefox.

✏️ Make a change

  1. Make your amazing change
  2. Go back to your browser, reload and see the change take effect

Note: Firefox will automatically reload content scripts when the extension is updated, Chrome requires you to reload the page to reload the content scripts.

📕 Read the documentation

Here are some websites you should refer to:

Configuration

The extension doesn't target any specific ECMAScript environment or provide any transpiling by default. The extensions output will be the same ECMAScript you write. This allows us to always target the latest browser version, which is a good practice you should be following.

Parcel 2

Being based on Parcel 2 and its WebExtension transformer, you get all the good parts:

  • Browserlist-based code transpiling (which defaults to just the latest Chrome and Firefox versions)
  • Automatically picks up any new file specified in manifest.json

Auto-syncing options

Options are managed by fregante/webext-options-sync, which auto-saves and auto-restores the options form, applies defaults and runs migrations.

Publishing

It's possible to automatically publish to both the Chrome Web Store and Mozilla Addons at once by adding these secrets on GitHub Actions:

  1. CLIENT_ID, CLIENT_SECRET, and REFRESH_TOKEN from Google APIs.
  2. WEB_EXT_API_KEY, and WEB_EXT_API_SECRET from AMO.

Also include EXTENSION_ID in the secrets (how to find it) and add Mozilla’s gecko.id to manifest.json.

The GitHub Actions workflow will:

  1. Build the extension
  2. Create a version number based on the current UTC date time, like 19.6.16 and sets it in the manifest.json
  3. Deploy it to both stores

Auto-publishing

Thanks to the included GitHub Action Workflows, if you set up those secrets in the repo's Settings, the deployment will automatically happen:

  • on a schedule, by default every week (but only if there are any new commits in the last tag)
  • manually, by clicking "Run workflow" in the Actions tab.

Credits

link icon by Kosong Tujuh from Noun Project CC 3.0 BY

About

An extension which shows ancestor and descendant PRs on the Github PR page

Resources

License

Stars

Watchers

Forks

Packages

No packages published