Skip to content

Commit 4f25eb5

Browse files
authored
Add Issue templates and automation scripts (#777)
1 parent 0220d78 commit 4f25eb5

12 files changed

+435
-0
lines changed
+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Bug report
2+
description: Create a report to help us improve
3+
labels: ["bug", "triage:needs-triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this bug report! Please make sure to fill out the entire form below, providing as much context as you can in order to help us triage and track down your bug as quickly as possible.
9+
10+
Before filing a bug, please be sure you have searched through [existing bugs](https://github.com/open-telemetry/semantic-conventions/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug) to see if an existing issue covers your bug.
11+
- type: dropdown
12+
id: area
13+
attributes:
14+
label: Area(s)
15+
description: Which area(s) does your bug report concern? If none fits, please select `area:other`
16+
multiple: true
17+
options:
18+
- area:other
19+
# NOTE: The list below is autogenerated using `make generate-gh-issue-templates`
20+
# DO NOT manually edit it.
21+
# Start semconv area list
22+
- area:android
23+
- area:browser
24+
- area:client
25+
- area:cloud
26+
- area:code
27+
- area:container
28+
- area:db
29+
- area:destination
30+
- area:device
31+
- area:disk
32+
- area:dns
33+
- area:error
34+
- area:exception
35+
- area:faas
36+
- area:host
37+
- area:http
38+
- area:k8s
39+
- area:messaging
40+
- area:network
41+
- area:oci
42+
- area:os
43+
- area:process
44+
- area:rpc
45+
- area:server
46+
- area:source
47+
- area:thread
48+
- area:tls
49+
- area:url
50+
- area:user-agent
51+
# End semconv area list
52+
- type: textarea
53+
attributes:
54+
label: What happened?
55+
description: Please provide as much detail as you reasonably can.
56+
value: |
57+
## Description
58+
59+
## Steps to Reproduce (if any)
60+
61+
## Expected Result
62+
63+
## Actual Result
64+
validations:
65+
required: true
66+
67+
- type: input
68+
attributes:
69+
label: Semantic convention version
70+
description: What version did you use? (e.g., `v1.24.0`, `1eb551b`, etc)
71+
validations:
72+
required: true
73+
74+
- type: textarea
75+
attributes:
76+
label: Additional context
77+
description: Any additional information you think may be relevant to this issue.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Propose changes to existing conventions
2+
description: Propose changes you'd like to be added to existing conventions
3+
labels: ["enhancement", "triage:needs-triage"]
4+
body:
5+
- type: dropdown
6+
id: area
7+
attributes:
8+
label: Area(s)
9+
description: Which area(s) does your change request concern?
10+
multiple: true
11+
options:
12+
# NOTE: The list below is autogenerated using `make generate-gh-issue-templates`
13+
# DO NOT manually edit it.
14+
# Start semconv area list
15+
- area:android
16+
- area:browser
17+
- area:client
18+
- area:cloud
19+
- area:code
20+
- area:container
21+
- area:db
22+
- area:destination
23+
- area:device
24+
- area:disk
25+
- area:dns
26+
- area:error
27+
- area:exception
28+
- area:faas
29+
- area:host
30+
- area:http
31+
- area:k8s
32+
- area:messaging
33+
- area:network
34+
- area:oci
35+
- area:os
36+
- area:process
37+
- area:rpc
38+
- area:server
39+
- area:source
40+
- area:thread
41+
- area:tls
42+
- area:url
43+
- area:user-agent
44+
# End semconv area list
45+
- type: textarea
46+
attributes:
47+
label: Is your change request related to a problem? Please describe.
48+
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
49+
validations:
50+
required: true
51+
- type: textarea
52+
attributes:
53+
label: Describe the solution you'd like
54+
description: A clear and concise description of what you want to happen.
55+
validations:
56+
required: true
57+
- type: textarea
58+
attributes:
59+
label: Describe alternatives you've considered
60+
description: A clear and concise description of any alternative solutions or features you've considered.
61+
- type: textarea
62+
attributes:
63+
label: Additional context
64+
description: Add any other context or screenshots about the feature request here.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Propose new semantic conventions
2+
description: Propose new conventions you'd like to be part of the OpenTelemetry project
3+
labels: ["enhancement", "triage:needs-triage", "experts needed"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Please make sure to fill out the entire form below, providing as much context as you can in order to help us triage the proposal as quickly as possible.
9+
10+
Before filing the proposal, please be sure you have searched through [existing issues](https://github.com/open-telemetry/semantic-conventions/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Aenhancement+label%3Aarea:new) to see if an existing issue covers your proposal.
11+
12+
Additionally, make sure to read and follow the guidelines on [Project Proposal](https://github.com/open-telemetry/community/blob/main/project-management.md#project-management), in case the proposal is for a new set of conventions/working group.
13+
- type: dropdown
14+
id: area
15+
attributes:
16+
label: Area(s)
17+
description: Which area(s) does your new conventions concern? If none fits, please select `area:new`
18+
multiple: true
19+
options:
20+
- area:new
21+
# NOTE: The list below is autogenerated using `make generate-gh-issue-templates`
22+
# DO NOT manually edit it.
23+
# Start semconv area list
24+
- area:android
25+
- area:browser
26+
- area:client
27+
- area:cloud
28+
- area:code
29+
- area:container
30+
- area:db
31+
- area:destination
32+
- area:device
33+
- area:disk
34+
- area:dns
35+
- area:error
36+
- area:exception
37+
- area:faas
38+
- area:host
39+
- area:http
40+
- area:k8s
41+
- area:messaging
42+
- area:network
43+
- area:oci
44+
- area:os
45+
- area:process
46+
- area:rpc
47+
- area:server
48+
- area:source
49+
- area:thread
50+
- area:tls
51+
- area:url
52+
- area:user-agent
53+
# End semconv area list
54+
- type: textarea
55+
attributes:
56+
label: Is your change request related to a problem? Please describe.
57+
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
58+
validations:
59+
required: true
60+
- type: textarea
61+
attributes:
62+
label: Describe the solution you'd like
63+
description: A clear and concise description of what you want to happen.
64+
validations:
65+
required: true
66+
- type: textarea
67+
attributes:
68+
label: Describe alternatives you've considered
69+
description: A clear and concise description of any alternative solutions or features you've considered.
70+
- type: textarea
71+
attributes:
72+
label: Additional context
73+
description: Add any other context or screenshots about the feature request here.

.github/workflows/checks.yml

+9
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,12 @@ jobs:
9797
- uses: actions/checkout@v1
9898
- name: verify schemas
9999
run: make schema-check
100+
101+
areas-dropdown-check:
102+
runs-on: ubuntu-latest
103+
steps:
104+
- uses: actions/checkout@v1
105+
- name: Components dropdown in issue templates
106+
run: |
107+
make generate-gh-issue-templates
108+
git diff --exit-code '.github/ISSUE_TEMPLATE' || (echo 'Dropdowns in issue templates is out of date, please run "make generate-gh-issue-templates" and commit the changes in this PR.' && exit 1)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: 'Generate registry area labels'
2+
on:
3+
push:
4+
branches: [main]
5+
paths:
6+
- model/registry/**
7+
- ./.github/workflows/generate-registry-area-labels.yml
8+
- ./.github/workflows/scripts/generate-registry-area-labels.sh
9+
workflow_dispatch:
10+
11+
jobs:
12+
generate-component-labels:
13+
runs-on: ubuntu-latest
14+
if: ${{ github.repository_owner == 'open-telemetry' }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Run update permissions
19+
run: chmod +x ./.github/workflows/scripts/generate-registry-area-labels.sh
20+
21+
- name: Generate registry area labels
22+
run: ./.github/workflows/scripts/generate-registry-area-labels.sh
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: 'Prepare new issue'
2+
on:
3+
issues:
4+
types: [opened]
5+
6+
jobs:
7+
prepare-new-issue:
8+
runs-on: ubuntu-latest
9+
if: ${{ github.repository_owner == 'open-telemetry' }}
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Run update permissions
14+
run: chmod +x ./.github/workflows/scripts/prepare-new-issue.sh
15+
16+
- name: Run prepare-new-issue.sh
17+
run: ./.github/workflows/scripts/prepare-new-issue.sh
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
ISSUE: ${{ github.event.issue.number }}
21+
BODY: ${{ github.event.issue.body }}
22+
OPENER: ${{ github.event.issue.user.login }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright The OpenTelemetry Authors
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Create labels for all semantic convention areas that are in model/registry.
7+
# Existing labels are not affected.
8+
#
9+
# Note that there is a 50-character limit on labels, so some areas may
10+
# not have a corresponding label.
11+
12+
set -euo pipefail
13+
14+
CUR_DIRECTORY=$(dirname "$0")
15+
AREAS=$(sh "${CUR_DIRECTORY}/get-registry-areas.sh")
16+
17+
echo -e "\nStarting to create area labels"
18+
echo -e "--------------------------------\n"
19+
20+
for AREA in ${AREAS}; do
21+
LABEL_NAME=$(basename "${AREA}" .yaml)
22+
23+
if (( "${#LABEL_NAME}" > 50 )); then
24+
echo "'${LABEL_NAME}' exceeds GitHubs 50-character limit on labels, skipping"
25+
continue
26+
fi
27+
echo "area:${LABEL_NAME}"
28+
29+
# gh label create "area:${LABEL_NAME}" -c "#425cc7"
30+
done
31+
32+
echo -e "\nLabels created successfully"
33+
echo -e "--------------------------------\n"
34+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright The OpenTelemetry Authors
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Get a list of the semantic conventions areas from the registry.
7+
8+
CUR_DIRECTORY=$(dirname "$0")
9+
REPO_DIR="$( cd "$CUR_DIRECTORY/../../../" && pwd )"
10+
REGISTRY_DIR="$( cd "$REPO_DIR/model/registry" && pwd )"
11+
12+
13+
for entry in $(ls $REGISTRY_DIR | egrep '\.yaml$' | sort)
14+
do
15+
echo "$entry"
16+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright The OpenTelemetry Authors
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
#
7+
8+
# This script extracts the "Area" from the issue body and adds it as a label
9+
# on newly created issues. The area from the issue body comes from
10+
# the "Area" drop-down field in the ISSUE_TEMPLATE, which is auto-generated
11+
# from the files inside model/registry.
12+
13+
# TODO: This script can be later used to also auto-assign the correct code-owner
14+
# once that is implemented.
15+
16+
set -euo pipefail
17+
18+
if [[ -z "${ISSUE:-}" || -z "${BODY:-}" || -z "${OPENER:-}" ]]; then
19+
echo "Missing one of ISSUE, BODY, or OPENER, please ensure all are set."
20+
exit 0
21+
fi
22+
23+
LABELS=""
24+
AREAS_SECTION_START=$( (echo "${BODY}" | grep -n '### Area(s)' | awk '{ print $1 }' | grep -oE '[0-9]+') || echo '-1' )
25+
BODY_AREAS=""
26+
27+
if [[ "${AREAS_SECTION_START}" != '-1' ]]; then
28+
BODY_AREAS=$(echo "${BODY}" | sed -n $((AREAS_SECTION_START+2))p)
29+
fi
30+
31+
for AREA in ${BODY_AREAS}; do
32+
# Areas are delimited by ', ' and the for loop separates on spaces, so remove the extra comma.
33+
AREA=${AREA//,/}
34+
35+
if (( "${#AREA}" > 50 )); then
36+
echo "'${AREA}' exceeds GitHub's 50-character limit on labels, skipping adding a label"
37+
continue
38+
fi
39+
40+
if [[ -n "${LABELS}" ]]; then
41+
LABELS+=","
42+
fi
43+
LABELS+="${AREA}"
44+
done
45+
46+
if [[ -v PINGED_AREAS[@] ]]; then
47+
echo "The issue was associated with areas:" "${!PINGED_AREAS[@]}"
48+
else
49+
echo "No related areas were given"
50+
fi
51+
52+
if [[ -n "${LABELS}" ]]; then
53+
# Notes on this call:
54+
# 1. Labels will be deduplicated by the GitHub CLI.
55+
# 2. The call to edit the issue will fail if any of the
56+
# labels doesn't exist. We can be reasonably sure that
57+
# all labels will exist since they come from a known set.
58+
echo "Adding the following labels: ${LABELS//,/ /}"
59+
gh issue edit "${ISSUE}" --add-label "${LABELS}" || true
60+
else
61+
echo "No labels were found to add"
62+
fi

0 commit comments

Comments
 (0)