backstage / community-plugins

Community plugins for Backstage
Apache License 2.0
113 stars 84 forks source link

Setup `dev` environment for workspaces #413

Open benjdlambert opened 2 months ago

benjdlambert commented 2 months ago

Since we moved over the plugins from backstage/backstage the migrated plugins maybe do not already have a dev setup.

For a start, we should ensure that all workspaces, and their plugins have the ability to start standalone using yarn start.

This means copying implementations and prior art from backstage/backstage like the following:

auth backend src/dev/index.ts

home frontend src/dev/index.tsx

### Tasks
- [ ] `adr`
- [ ] `airbrake`
- [ ] `allure`
- [ ] `analytics`
- [ ] `apache-airflow`
- [ ] `apollo-explorer`
- [ ] `azure-devops`
- [ ] `azure-sites`
- [ ] `badges`
- [ ] `bazaar`
- [ ] `bitrise`
- [ ] `cicd-statistics`
- [ ] `cloudbuild`
- [ ] `code-climate`
- [ ] `code-coverage`
- [ ] `codescene`
- [ ] `cost-insights`
- [ ] `dynatrace`
- [ ] `entity-feedback` https://github.com/backstage/community-plugins/pull/577
- [ ] `entity-validation`
- [ ] `explore`
- [ ] `firehydrant`
- [ ] `fossa`
- [ ] `gcalendar`
- [ ] `gcp-projects`
- [ ] `git-release-manager`
- [ ] `github-actions`
- [ ] `github-deployments`
- [ ] `github-issues`
- [ ] `github-pull-requests-board`
- [ ] `gitops-profiles`
- [ ] `gocd`
- [ ] `graphiql`
- [ ] `graphql-voyager`
- [ ] `ilert`
- [x] `jenkins` https://github.com/backstage/community-plugins/pull/560
- [ ] `kafka`
- [ ] `lighthouse`
- [ ] `linguist`
- [ ] `microsoft-calendar`
- [ ] `newrelic`
- [ ] `nomad`
- [ ] `octopus-deploy`
- [ ] `opencost`
- [ ] `periskop`
- [ ] `playlist`
- [ ] `puppetdb`
- [ ] `repo-tools`
- [ ] `rollbar`
- [ ] `sentry`
- [ ] `shortcuts`
- [ ] `sonarqube`
- [ ] `splunk`
- [ ] `stack-overflow`
- [ ] `stackstorm`
- [x] `tech-insights`: #524
- [ ] `tech-radar`
- [ ] `todo`
- [ ] `vault` https://github.com/backstage/community-plugins/pull/536
- [ ] `xcmetrics`

Once we have done a few PR's and have examples, this ticket might turn into a good first issue.

KatharinaSick commented 1 month ago

Hi,

I'm currently trying to set up a dev environment for the Jenkins plugin. To do that, I mainly copied from the linguist plugin that @awanlin used to create a sample. I copied all the stuff, created a very simple Backstage app and everything seems to be working fine. I can run frontend & backend separately or just start the full Backstage app with yarn dev. When doing the latter, the app starts & shows me my entities. It only starts to fail when adding the EntityJenkinsRunCard to the EntityPage.tsx:

<Grid item md={6}>
    <EntityLatestJenkinsRunCard
        branch="main,master"
        variant="gridItem"
    />
</Grid>

As soon as the EntityJenkinsRunCard is added, I get the below error in the UI (nothing in the logs though). No matter if the Jenkins annotation is defined or not.

TypeError
Cannot read properties of null (reading 'useContext')

Do you have an idea what could be going on here? Once I manage to resolve this issue, I can contribute the dev setup for Jenkins :)

EDIT: I'm sorry, I didn't check other issues first because I assumed that I did something wrong. I now did that and my problems could be related to https://github.com/backstage/community-plugins/issues/501

vinzscam commented 1 month ago

Hi @KatharinaSick, thank you for looking into this 🙏 Could you share a branch so that we can look better at the issue?

KatharinaSick commented 1 month ago

Of course! Thank you :slightly_smiling_face: I pushed everything to https://github.com/KatharinaSick/backstage-community-plugins/tree/jenkins-dev-env

In my app-config.local.yaml I just have the Jenkins configuration:

jenkins:
  baseUrl: https://jenkins-instance.com
  username: xxx
  apiKey: xxx
vinzscam commented 3 weeks ago

Of course! Thank you 🙂 I pushed everything to https://github.com/KatharinaSick/backstage-community-plugins/tree/jenkins-dev-env

In my app-config.local.yaml I just have the Jenkins configuration:

jenkins:
  baseUrl: https://jenkins-instance.com
  username: xxx
  apiKey: xxx

@KatharinaSick I think the issue was due to a mismatch on the installed dependencies. Running yarn dedupe in workspace/jenkins should fix the issue

ggkoning commented 2 weeks ago

Of course! Thank you 🙂 I pushed everything to https://github.com/KatharinaSick/backstage-community-plugins/tree/jenkins-dev-env

In my app-config.local.yaml I just have the Jenkins configuration:

jenkins:
  baseUrl: https://jenkins-instance.com
  username: xxx
  apiKey: xxx

Hello @KatharinaSick when will you make a pull request on the backstage-comunity repository?

KatharinaSick commented 2 weeks ago

Thanks a lot for your help @vinzscam! :slightly_smiling_face: I just opened a PR.

I'm sorry that it took so long. I was on vacation and then got sick, that's why I was offline for so long.

vinzscam commented 2 weeks ago

Thanks a lot for your help @vinzscam! 🙂 I just opened a PR.

I'm sorry that it took so long. I was on vacation and then got sick, that's why I was offline for so long.

No worries, thank you so much for dedicating your time to this, I hope you feel better!