Skip to content
Open
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
24 changes: 24 additions & 0 deletions .github/workflows/rerun-workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Rerun Failed Workflows"
on:
issue_comment:
types:
- created

permissions: read-all

jobs:
rerun-failed:
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/rerun') && github.repository_owner == 'open-telemetry' }}
permissions:
actions: write
checks: read
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- name: Run rerun-failed-workflows.sh
run: ./.github/workflows/scripts/rerun-failed-workflows.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
COMMENT: ${{ github.event.comment.body }}
SENDER: ${{ github.event.comment.user.login }}
44 changes: 44 additions & 0 deletions .github/workflows/scripts/rerun-failed-workflows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
#
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
#

set -euo pipefail

if [[ -z "${PR_NUMBER:-}" || -z "${COMMENT:-}" || -z "${SENDER:-}" ]]; then
echo "PR_NUMBER, COMMENT, or SENDER not set"
exit 0
fi

if [[ ${COMMENT:0:6} != "/rerun" ]]; then
echo "Not a rerun command"
exit 0
fi

PR_DATA=$(gh pr view "${PR_NUMBER}" --json headRefOid,author)
HEAD_SHA=$(echo "${PR_DATA}" | jq -r '.headRefOid')
PR_AUTHOR=$(echo "${PR_DATA}" | jq -r '.author.login')

if [[ "${SENDER}" != "${PR_AUTHOR}" ]]; then
echo "Only PR author can rerun workflows"
exit 0
fi

echo "Finding failed workflows for commit: ${HEAD_SHA}"

FAILED_RUNS=$(gh run list \
--commit "${HEAD_SHA}" \
--status failure \
--json databaseId \
--jq '.[].databaseId')

if [[ -z "${FAILED_RUNS}" ]]; then
echo "No failed workflows found"
exit 0
else
for RUN_ID in ${FAILED_RUNS}; do
echo "Rerunning workflow: ${RUN_ID}"
gh run rerun "${RUN_ID}" --failed
done
fi
18 changes: 14 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ Example label comment:
/label help-wanted -arm64
```

### Rerunning Failed Workflows

PR authors can rerun failed GitHub Actions workflows by commenting `/rerun` on the pull request. This will automatically rerun all failed workflow runs for the PR's latest commit.

Example rerun comment:

```
/rerun
```

## How to contribute

### Before you start
Expand All @@ -144,7 +154,7 @@ Comment on the issue that you want to work on so we can assign it to you and
clarify anything related to it.

If you would like to work on something that is not listed as an issue
(e.g. a new feature or enhancement) please first read our [vision](docs/vision.md)
(e.g. a new feature or enhancement) please first read our [vision](docs/vision.md)
to make sure your proposal aligns with the goals of the
Collector, then create an issue and describe your proposal. It is best to do this
in advance so that maintainers can decide if the proposal is a good fit for
Expand Down Expand Up @@ -320,7 +330,7 @@ locally. Ensure that you execute these commands from the root of the repository:

The actual name of the binary will depend on your platform, adjust accordingly
(e.g., `./bin/otelcorecol_darwin_arm64`).

Replace `otel-config.yaml` with the appropriate configuration file as needed.

3. Verify that your changes are reflected in the Collector's behavior by testing
Expand Down Expand Up @@ -415,10 +425,10 @@ running the default common target for each module as well as additional repo-lev
When a new OTLP version is published, the following steps are required to update this code base:

1. Edit the top-level Makefile's `OPENTELEMETRY_PROTO_VERSION` variable
2. Run `make genproto`
2. Run `make genproto`
3. Inspect modifications to the generated code in `pdata/internal/data/protogen`
4. When new fields are added in the protocol, make corresponding changes in `pdata/internal/cmd/pdatagen/internal`
5. Run `make genpdata`
5. Run `make genpdata`
6. Inspect modifications to the generated code in `pdata/*`
7. Run `make genproto-cleanup`, to remove temporary files
8. Update the supported OTLP version in [README.md](./README.md).
Expand Down
Loading