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

grizzly/actions/setup GitHub action #374

Closed
wants to merge 3 commits into from
Closed

Conversation

K-Phoen
Copy link
Member

@K-Phoen K-Phoen commented Mar 12, 2024

This PR introduces a GitHub action that can be used to setup Grizzly in a job.

I'm thinking that having two github actions could be nice:

  • one to setup the binary and nothing else, giving complete freedom to the user
  • a second to make "apply" actions easier (it could install grizzly, help configuring it and wrap the apply command)

Both these actions would make it easier to build automation on top of grizzly, in GitHub actions.

Open questions:

  • where should these actions be published? Having them in this repository is convenient, but makes versioning them much harder

@K-Phoen K-Phoen force-pushed the kgz/github-action branch 11 times, most recently from f9e4134 to 543ac16 Compare March 12, 2024 00:57
@K-Phoen K-Phoen changed the title setup GH action WIP grizzly/actions/setup GitHub action Mar 12, 2024
@K-Phoen K-Phoen force-pushed the kgz/github-action branch 8 times, most recently from d821a99 to df7ae72 Compare March 12, 2024 11:01
@K-Phoen K-Phoen marked this pull request as ready for review March 12, 2024 11:03
@K-Phoen K-Phoen requested a review from a team as a code owner March 12, 2024 11:03
@K-Phoen K-Phoen force-pushed the kgz/github-action branch from df7ae72 to 06b223e Compare March 12, 2024 12:13
Copy link
Member

@julienduchesne julienduchesne left a comment

Choose a reason for hiding this comment

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

I feel like we could use a go install composite action and avoid a lot of javascript here

Also, do we have somewhere we want to use this or is this for future use?

@K-Phoen K-Phoen force-pushed the kgz/github-action branch 6 times, most recently from 8676a0a to 7e2ecb2 Compare March 15, 2024 10:43
@K-Phoen K-Phoen force-pushed the kgz/github-action branch 13 times, most recently from 5d8aa04 to c01f190 Compare March 15, 2024 11:15
@K-Phoen
Copy link
Member Author

K-Phoen commented Mar 15, 2024

I feel like we could use a go install composite action and avoid a lot of javascript here

Running go install in a composite action would require us (or the caller) to setup go first, and then we would download Grizzly's dependencies and re-compile the binary every time this action is called.

I wanted to ensure fast runtimes by downloading pre-compiled binaries instead, and taking advantage of GitHub action's "tools cache". That last part is why this action is written in Javascript.

Unfortunately, I also just discovered that this cache isn't persistent across workflow runs :( (see actions/toolkit#58)
That probably means that a composite option that downloads the binary from our releases is a valid option again.

Also, do we have somewhere we want to use this or is this for future use?

Nothing specific in mind, this PR is just me fooling around 😅
I'm still guessing that a "grizzly/setup" action could be a useful thing to offer, for everyone running grizzly in their github pipelines.

Even though it could be made slightly more useful by providing ways to setup Grizzly's configuration/contexts. Something like:

- uses: grafana/grizzly/actions/setup@main
  with:
    version: 'v0.4.0'
    context:
      grafana.url: https://my-instance.grafana.net
      grafana.token: ${{ secrets.GRAFANA_TOKEN }}

- run: grr diff ./resources

Admittedly, this action isn't absolutely necessary to use grizzly in a github action. I just feel like we could provide it to remove some of the boilerplate necessary to set it up 🤷

WDYT?

@K-Phoen K-Phoen force-pushed the kgz/github-action branch from c01f190 to f64e552 Compare March 15, 2024 11:26
@BrendanCoughlan5
Copy link

+1 please land this, i'd love it :)

@K-Phoen K-Phoen force-pushed the kgz/github-action branch from f64e552 to 32cdff8 Compare March 26, 2024 11:16
@K-Phoen K-Phoen requested a review from a team March 26, 2024 13:53
@K-Phoen K-Phoen force-pushed the kgz/github-action branch from 32cdff8 to a6eff79 Compare March 26, 2024 15:42
@BrendanCoughlan5
Copy link

plz land this xD

@mhixon4479
Copy link

+1 to landing this :)

@K-Phoen
Copy link
Member Author

K-Phoen commented Jun 11, 2024

We released this GitHub action in its own repository: https://github.com/grafana/setup-grizzly

@K-Phoen K-Phoen closed this Jun 11, 2024
@K-Phoen K-Phoen deleted the kgz/github-action branch June 11, 2024 11:21
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.

4 participants