2.6.0 • Published 1 month ago

@roadiehq/backstage-plugin-github-pull-requests v2.6.0

Weekly downloads
2,159
License
Apache-2.0
Repository
-
Last release
1 month ago

GitHub Pull Requests Plugin for Backstage

a list of pull requests in the GitHub Pull Requests

Features

  • List Pull Requests for your repository, with filtering and search.
  • Show basic statistics widget about pull requests for your repository.
    • Average time of PR until merge
    • Merged to closed ratio
    • Average size of PR (the average lines of changes in the PR)
    • Average amount of file changed in a PR
  • It has two homepage plugin componenets
    • Review requests
    • Open pull requests

Plugin Configuration Requirements

This plugin relies on the GitHub Authentication Provider for its access to GitHub.

Search filter works the same way it works in GitHub, but roadie-backstage-pull-requests/default-filter annotation needs to be provided in component configuration. Adding a filter will result in applying that filter per default.

If this annotation is left out, no default filter will be applied when running the app.

Install the plugin

cd packages/app
yarn add @roadiehq/backstage-plugin-github-pull-requests

Add plugin API to your Backstage instance:

// packages/app/src/components/catalog/EntityPage.tsx
import {
  EntityGithubPullRequestsContent,
  isGithubPullRequestsAvailable,
} from '@roadiehq/backstage-plugin-github-pull-requests';
...

const serviceEntityPage = (
  <EntityLayout>
    ...
    <EntityLayout.Route
      path="/pull-requests"
      title="Pull Requests"
      // Uncomment the line below if you'd like to only show the tab on entities with the correct annotations already set
      // if={isGithubPullRequestsAvailable}
    >
      <EntityGithubPullRequestsContent />
    </EntityLayout.Route>
    ...
  </EntityLayout>
  1. Run backstage app with yarn start and navigate to services tabs.

Widget setup

a list of pull requests in the GitHub Pull Requests

  1. You must install plugin by following the steps above to add widget to your Overview

  2. Add widget to your Overview tab:

// packages/app/src/components/catalog/EntityPage.tsx
import { EntityGithubPullRequestsOverviewCard, isGithubPullRequestsAvailable } from '@roadiehq/backstage-plugin-github-pull-requests';

...

const overviewContent = (
  <Grid container spacing={3}>
    ...
    <EntitySwitch>
      <EntitySwitch.Case if={isGithubPullRequestsAvailable}>
        <Grid item md={6}>
          <EntityGithubPullRequestsOverviewCard />
        </Grid>
      </EntitySwitch.Case>
    </EntitySwitch>
    ...
  </Grid>
);

Group Widget setup

a list of pull requests assigned to this team

  1. You must install plugin by following the steps above to add widget to your Group Entity Page

  2. Add widget to your group page:

import {
  EntityGithubGroupPullRequestsCard,
  isGithubTeamPullRequestsAvailable,
} from '@roadiehq/backstage-plugin-github-pull-requests';

...

const groupPage = (
  <Grid container spacing={3}>
    ...
    <EntitySwitch>
      <EntitySwitch.Case if={isGithubTeamPullRequestsAvailable}>
        <Grid item md={5} xs={12}>
          <EntityGithubGroupPullRequestsCard/>
        </Grid>
      </EntitySwitch.Case>
    </EntitySwitch>
    ...
  </Grid>
);

Add Homepage components to your homepage

A preview image of the components

If you didn't set up the HomePage plugin you can see the official documentation about it here. You'll need to have it setup to be able to include this plugin.

A reasonable default will be used as a search term for both cards but you may have reasonable to provide your own query. This can be done through the query prop available for both cards.

TIP: You might want to filter by a specific Github org if you have users who share a single Github account for work and personal usage.

You can build up a query using Github Advanced Search and once you hit "Search", the query in the search bar is what you'll want to provide as your query prop.

//packages/app/src/components/home/HomePage.tsx

import {
  HomePageRequestedReviewsCard,
  HomePageYourOpenPullRequestsCard,
} from '@roadiehq/backstage-plugin-github-pull-requests';


export const HomePage = () => {
  return (
    ...

      <Grid item md={6} xs={12}>
        <HomePageRequestedReviewsCard />
      </Grid>

      <Grid item md={6} xs={12}>
        <HomePageYourOpenPullRequestsCard query="org:RoadieHQ is:pr language:CSS" />
      </Grid>
    ...
  );
};

Features

  • List Pull Requests for your repository, with filtering and search (The searchbar is working like in github).
  • Show basic statistics widget about pull requests for your repository.
  • Possibility to add a variable on the backstage configuration of a catalog entity allowing to add a default search filter on github pull requests

Links

2.6.0

1 month ago

2.5.30

2 months ago

2.5.31

1 month ago

2.5.29

2 months ago

2.5.28

3 months ago

2.5.27

4 months ago

2.5.26

6 months ago

2.5.25

8 months ago

2.5.24

9 months ago

2.5.23

9 months ago

2.5.18

1 year ago

2.5.19

1 year ago

2.5.14

1 year ago

2.5.15

1 year ago

2.5.16

1 year ago

2.5.17

1 year ago

2.5.20

12 months ago

2.5.13

1 year ago

2.5.10

2 years ago

2.5.11

1 year ago

2.5.12

1 year ago

2.5.6

2 years ago

2.5.5

2 years ago

2.5.8

2 years ago

2.5.7

2 years ago

2.5.9

2 years ago

2.5.0

2 years ago

2.5.2

2 years ago

2.5.1

2 years ago

2.5.4

2 years ago

2.5.3

2 years ago

2.4.1

2 years ago

2.4.0

2 years ago

2.4.3

2 years ago

2.4.2

2 years ago

2.3.0

2 years ago

2.2.8

2 years ago

2.2.7

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

2.2.6

2 years ago

2.1.4

2 years ago

2.1.2

3 years ago

2.1.3

2 years ago

2.1.1

3 years ago

2.1.0

3 years ago

1.4.6

3 years ago

1.4.5

3 years ago

2.0.0

3 years ago

1.5.0

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.0

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.2.0

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.9

3 years ago

1.0.10

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.7.9

4 years ago

0.7.8

4 years ago

0.7.7

4 years ago

0.7.6

4 years ago

0.7.5

4 years ago

0.7.4

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.3

4 years ago

0.6.8

4 years ago

0.6.4

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.4

4 years ago

0.4.3

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.4.2

4 years ago

0.3.2

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago