Skip to content

Latest commit

 

History

History
86 lines (55 loc) · 2.96 KB

CONTRIBUTING.md

File metadata and controls

86 lines (55 loc) · 2.96 KB

Building and releasing

How to build the Timestream data source plugin locally

Dependencies

Make sure you have the following dependencies installed first:

Frontend

  1. Install dependencies

    yarn install --pure-lockfile
  2. Build plugin in development mode or run in watch mode

    yarn dev

    or

    yarn watch
  3. Build plugin in production mode

    yarn build

Backend

  1. Build the backend binaries

    build:backend

Golden files

Golden files check that data frames are being generated correctly based on the Timestream API response. They have two parts, the json files represent the raw API response and the golden files represent the expected data frame. Both are generated in executor_test.go.

Re-generating json API response

Note: Only members of the Grafana team can re-generate these files. If you need help with this, ping the @grafana/aws-plugins team on GitHub and they will help out.

  1. Make sure to comment out the t.Skip("Integration Test") line in the executor_test.go file.
  2. Run the TestGenerateTestData. This should regenerate the json files.
  3. Uncomment the t.Skip("Integration Test") again.

Re-generating golden files

  1. Change the last argument in the CheckGoldenDataResponse call to true. This will re-generate the golden files.
  2. Run the test, and then undo the change from step 1.
  3. Re-run the test and they should now pass.

Build a release for the Timestream data source plugin

Pre-requisites

Before doing a release, make sure that the GitHub repository is configured with a GRAFANA_API_KEY to be able to sign the plugin and that the Golang and Node versions in the release.yaml workflow are correct.

Also, make sure that the path to the plugin validator in the release.yaml is correct (this fixes the error pushd: ./plugin-validator/cmd/plugincheck: No such file or directory):

pushd ./plugin-validator/pkg/cmd/plugincheck`

Release

You need to have commit rights to the GitHub repository to publish a release.

  1. Update the version number in the package.json file.
  2. Update the CHANGELOG.md with the changes contained in the release.
  3. Commit the changes to master and push to GitHub.
  4. Follow the Drone release process that you can find here