Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releasing pipeline #35

Merged
merged 67 commits into from
Mar 28, 2024
Merged

Releasing pipeline #35

merged 67 commits into from
Mar 28, 2024

Conversation

itsmylife
Copy link
Collaborator

@itsmylife itsmylife commented Mar 25, 2024

E2E testing CI workflow: https://grafana.com/developers/plugin-tools/e2e-test-a-plugin/ci?current-package-manager=yarn
Backend Testing CI workflow: https://github.com/grafana/clickhouse-datasource/blob/main/.github/workflows/run-backend-tests.yml
Access Policy: https://grafana.com/orgs/grafana/access-policies prometheus-amazon-datasource-plugin

How to release a datasource https://docs.google.com/document/d/1jKH397IEjQsUojaBnA_whSkhiAviVGJ6eIVrpomoPLM/edit (this explains with drone.yml but we don't use it.)

Apparently we also need a drone pipeline too: https://github.com/grafana/enterprise-datasources/wiki/New-plugin-publish-process#setup-drone-pipeline
I'll provide that one in a separate PR

What has been done?

  • Update current scaffolding:
    • I run npx @grafana/create-plugin@latest update See https://www.npmjs.com/package/@grafana/create-plugin
      • It updates .config folder
      • It updates .vscode folder (some indentation changes)
    • Update required nodejs version in .nvmrc to v20.9.0 like grafana/grafana
    • Remove cypress mock test
    • asd
  • Move matchers under src
  • Remove playwright-report/index.html from git cache
  • Update playwright base URL as 3000
  • Remove docker-compose-debug.yml
  • Add prometheus service in docker-compose.yml
  • Add version in src/plugin.json
  • Remove tests-examples
  • Remove unnecessary frontend dependencies
  • Update sign command since the plugin is still private https://grafana.com/developers/plugin-tools/publish-a-plugin/sign-a-plugin#sign-a-private-plugin
  • Add a simple backend unit test

@itsmylife itsmylife changed the title CI/CD pipeline Publishing pipeline Mar 25, 2024
@itsmylife itsmylife changed the title Publishing pipeline WIP: Publishing pipeline Mar 25, 2024
@itsmylife
Copy link
Collaborator Author

itsmylife commented Mar 26, 2024

In CI workflow, Build backend job is waiting for e2e workflow to finish. I don't understand why that's happening.

I enabled buildAll and it takes some time. So wait time is normal. I'll make it linux only for the sake of speed. If we need all we can change it back.

@itsmylife itsmylife changed the title WIP: Publishing pipeline Publishing pipeline Mar 27, 2024
@itsmylife itsmylife changed the title Publishing pipeline Releasing pipeline Mar 27, 2024
Copy link
Collaborator

@bohandley bohandley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all makes sense to me. i like the reorganization of the tests and this is much cleaner, testing multiple Grafana versions. AMAZING WORK!!!!! 🚀🚀🚀🚀🚀

Copy link

@sunker sunker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Added a few comments around the e2e setup.

FYI: In case you experience issues connecting to the Grafana instance in your e2e tests, it may be due to an issue in the Docker dev env. See this thread for more info.

.github/workflows/e2e.yml Outdated Show resolved Hide resolved

- name: Stop grafana docker
run: docker-compose down
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason not to use the example workflow for backend plugins from the this? If not, I suggest replacing the content of this file entirely with the yarn based example.

Grafana has a GCS bucket for e2e artifacts. If you want to, you can publish the Playwright report as part of CI. Then a link to the report for every e2e session will be added in the github workflow summary (see the bottom of the page for this pr for example).

 - name: Publish report to GCS
        if: ${{ (always() && steps.run-tests.outcome == 'success') || (failure() && steps.run-tests.outcome == 'failure') }}
        uses: grafana/plugin-actions/publish-report@main
        with:
          grafana-version: ${{ matrix.GRAFANA_IMAGE.VERSION }}

Just bear in mind that the published report will be public on the Internet, so don't do this in case you use secrets in your e2e tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That wasn't working for me so I had to remove it. It was asking for some kind of env variable which I do not have and don't know how to have it. I'd keep the current version for now 'cause it's working. Maybe later I'll replace it. I'll create an issue for this one.

Copy link
Collaborator Author

@itsmylife itsmylife Mar 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I am using the suggested one with one addition. docker-compose down

playwright.config.ts Show resolved Hide resolved
@itsmylife itsmylife merged commit 4434768 into main Mar 28, 2024
5 checks passed
@itsmylife itsmylife deleted the ismail/build-pipeline branch March 28, 2024 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants