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

bring the action into the Honeycomb OSS fold #109

Merged
merged 7 commits into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Code owners file.
# This file controls who is tagged for review for any given pull request.

# For anything not explicitly taken by someone else:
* @honeycombio/api-team
10 changes: 10 additions & 0 deletions .github/workflows/apply-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Apply project labels
on: [issues, pull_request_target, label]
jobs:
apply-labels:
runs-on: ubuntu-latest
name: Apply common project labels
steps:
- uses: honeycombio/oss-management-actions/labels@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: kvrhdn/gha-buildevents@v1
- uses: honeycombio/gha-buildevents@v1
with:
apikey: ${{ secrets.BUILDEVENTS_APIKEY }}
dataset: gha-buildevents_integration
Expand All @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: kvrhdn/gha-buildevents@v1
- uses: honeycombio/gha-buildevents@v1
with:
apikey: ${{ secrets.BUILDEVENTS_APIKEY }}
dataset: gha-buildevents_integration
Expand Down
42 changes: 42 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# gha-buildevents changelog

## v1.0.5 [2021-02-27]

### Enhancements

- `BUILDEVENT_FILE` is now an absolute path, allowing you to run the buildevents binary from any directory (#38). (Thanks to [@sargunv](https://github.com/sargunv)!)

## v1.0.4 [2021-02-01]

### Maintenance

- bumped dependencies and set up Dependabot to monitor these for us from now on. | [@kvrhdn](https://github.com/kvrhdn)

## v1.0.3 [2020-12-20[

### Enhancements

Several fixes and enhancements (again, thanks to [@DavidS](https://github.com/DavidS)!):

- Improved handling of `BUILDEVENT_FILE`:
- If the file already exists, properties will be appended instead of overwriting the file #18
- The file is created during the start section, because of this every span will contain the `github.*` fields, not just the last two
- The property `meta.source` is added to every span #19
- The trace ID is now unique, even when re-running a workflow #20
- Improved documentation and logging during run

## v1.0.2 [2020-11-21]

### Enhancements

- Added the `matrix-key` input to support jobs using a matrix configuration. (Thanks to [@DavidS](https://github.com/DavidS)!)

## v1.0.1 [2020-10-01]

### Maintenance

- Updated dependencies following the deprecation of `set-env` and `add-path` in the GitHub Actions runtime ([changelog](https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/)). | [@kvrhdn](https://github.com/kvrhdn)

## v1.0.0 [2020-08-26]

Initial release
5 changes: 5 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Code of Conduct

This project has adopted the Honeycomb User Community Code of Conduct to clarify expected behavior in our community.

https://www.honeycomb.io/honeycomb-user-community-code-of-conduct/
27 changes: 6 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Contributing
# Contributing Guide

All contributions are welcome, whether they are technical in nature or not. Feel free to [start a Discussion](https://github.com/kvrhdn/gha-buildevents/discussions) or [open an issue](https://github.com/kvrhdn/gha-buildevents/issues) to ask questions, discuss issues or propose enhancements.
Please see our [general guide for OSS lifecycle and practices.](https://github.com/honeycombio/home/blob/main/honeycomb-oss-lifecycle-and-practices.md)

All contributions are welcome, whether they are technical in nature or not. Feel free to [start a Discussion](https://github.com/honeycombio/gha-buildevents/discussions) or [open an issue](https://github.com/honeycombio/gha-buildevents/issues) to ask questions, discuss issues or propose enhancements.

## Good to know

Expand All @@ -10,24 +12,7 @@ Before committing any code changes, execute `npm run all` to compile and package

Since this project is highly dependent on both GitHub Actions and Honeycomb, it's difficult to test locally. Instead, the following workflows should be checked _manually_ to ensure functionality is not broken:

- [**Integration**](https://github.com/kvrhdn/gha-buildevents/actions?query=workflow%3AIntegration): this workflow contains two jobs:
- [**Integration**](https://github.com/honeycombio/gha-buildevents/actions?query=workflow%3AIntegration): this workflow contains two jobs:
- **Smoke test** should create a proper trace with a couple of spans. Check to see the additional`github.*` fields are set.
- **Matrix** is a simple workflow using a build matrix. Check each build creates a unique trace.
- [**Integration Failure**](https://github.com/kvrhdn/gha-buildevents/actions?query=workflow%3A%22Integration+Failure%22) : this run should create a trace in Honeycomb, with `job.status` equal to `failure`.

## Release procedure

`gha-buildevents` follows [the recommendation from the GitHub Actions team](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md#versioning): each tag and release has a semantic version (i.e. `v1.0.1`). There is a major version tag (i.e. `v1`) that binds to the latest semantic version. If a new version is released, the major version tag is moved.

Follow these steps to create a new release:

- create a new release from [the Releases page](https://github.com/kvrhdn/gha-buildevents/releases)
- assign it a tag with the new version
- make sure to also publish the release to the GitHub Marketplace
- update the major version tag so it points to the latest release
```shell
# with the latest release checked out locally
git tag -fa v1 -m "Update v1 tag"
git push origin v1 --force
```
- all tags can be seen on [the Tags page](https://github.com/kvrhdn/gha-buildevents/tags), including the commit they reference
- [**Integration Failure**](https://github.com/honeycombio/gha-buildevents/actions?query=workflow%3A%22Integration+Failure%22) : this run should create a trace in Honeycomb, with `job.status` equal to `failure`.
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2019 GitHub Actions
Copyright (c) 2022 Honeycomb
Copyright (c) 2020-2022 Koenraad Verheyden

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions OSSMETADATA
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
osslifecycle=maintained
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# `gha-buildevents` Action

[![CI](https://github.com/kvrhdn/gha-buildevents/workflows/CI/badge.svg)](https://github.com/kvrhdn/gha-buildevents/actions?query=workflow%3ACI)
[![Integration](https://github.com/kvrhdn/gha-buildevents/workflows/Integration/badge.svg)](https://github.com/kvrhdn/gha-buildevents/actions?query=workflow%3AIntegration)
[![OSS Lifecycle](https://img.shields.io/osslifecycle/honeycombio/gha-buildevents?color=success)](https://github.com/honeycombio/home/blob/main/honeycomb-oss-lifecycle-and-practices.md)
[![CI](https://github.com/honeycombio/gha-buildevents/workflows/CI/badge.svg)](https://github.com/honeycombio/gha-buildevents/actions?query=workflow%3ACI)
[![Integration](https://github.com/honeycombio/gha-buildevents/workflows/Integration/badge.svg)](https://github.com/honeycombio/gha-buildevents/actions?query=workflow%3AIntegration)

This GitHub Action instruments your workflows using [Honeycomb's buildevents tool](https://github.com/honeycombio/buildevents). It populates the trace with metadata from the GitHub Actions environment and will always send a trace for the build, even if the build failed.

Expand All @@ -17,7 +18,7 @@ This GitHub Action instruments your workflows using [Honeycomb's buildevents too
Put the action at the start of each job:

```yaml
- uses: kvrhdn/gha-buildevents@v1
- uses: honeycombio/gha-buildevents@v1
with:
# Required: a Honeycomb API key - needed to send traces.
apikey: ${{ secrets.BUILDEVENTS_APIKEY }}
Expand Down Expand Up @@ -51,7 +52,7 @@ Name | Required | Description |

Additionally, the following environment variable will be read:

`BUILDEVENT_FILE`: the path to a file containing additional key-value pairs. Data in this file will be attached to every span sent by buildevents. If this environment variable is not set, `gha-buildevents` will set this to a location outside the working directory.
`BUILDEVENT_FILE`: the path to a file containing additional key-value pairs. Data in this file will be attached to every span sent by buildevents. If this environment variable is not set, `gha-buildevents` will set this to a location outside the working directory.
When setting this environment variable, is recommended to set this [at the beginning of the workflow](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#env).

### Outputs
Expand All @@ -62,7 +63,7 @@ No outputs are set, but the following environment variables are set:
```
<owner>/<repo>-<workflow>-<job>-<run number>-<random number>
```
For example: `kvrhdn/gha-buildevents-Integration-smoke-test-20144-1738717406`.
For example: `honeycombio/gha-buildevents-Integration-smoke-test-20144-1738717406`.

## Example

Expand Down Expand Up @@ -112,3 +113,7 @@ To learn more about buildevents and how to use it, checkout [honeycombio/buildev
## License

This Action is distributed under the terms of the MIT license, see [LICENSE](./LICENSE) for details.

## Contributor Alums ❤️

The buildevents GitHub Action was created for the community and generously bequethed to Honeycomb by Koenraad Verheyden ([@kvrhdn](https://github.com/kvrhdn)).
16 changes: 16 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Releasing

`gha-buildevents` follows [the recommendation from the GitHub Actions team](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md#versioning): each tag and release has a semantic version (i.e. `v1.0.1`). There is a major version tag (i.e. `v1`) that binds to the latest semantic version. If a new version is released, the major version tag is moved.

Follow these steps to create a new release:

- create a new release from [the Releases page](https://github.com/honeycombio/gha-buildevents/releases)
- assign it a tag with the new version
- make sure to also publish the release to the GitHub Marketplace
- update the major version tag so it points to the latest release
```shell
# with the latest release checked out locally
git tag -fa v1 -m "Update v1 tag"
git push origin v1 --force
```
- all tags can be seen on [the Tags page](https://github.com/honeycombio/gha-buildevents/tags), including the commit they reference
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/kvrhdn/gha-buildevents.git"
"url": "git+https://github.com/honeycombio/gha-buildevents.git"
},
"keywords": [
"GitHub",
"Actions",
"Honeycomb.io"
],
"author": "Koenraad Verheyden",
"author": {
"name": "Honeycomb",
"email": "support@honeycomb.io"
},
"license": "MIT",
"homepage": "https://github.com/kvrhdn/gha-buildevents",
"homepage": "https://github.com/honeycombio/gha-buildevents",
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.4",
Expand Down