Skip to content

Commit

Permalink
Label all new issues with triage:needs-triage label (open-telemetry…
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova authored Jan 20, 2025
1 parent 77f0b70 commit 0e109d2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug report
description: Create a report to help us improve
labels: ["bug", "triage:needs-triage"]
labels: ["bug"]
body:
- type: markdown
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/change_proposal.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Propose changes to existing conventions
description: Propose changes you'd like to be added to existing conventions
labels: ["enhancement", "triage:needs-triage"]
labels: ["enhancement"]
body:
- type: dropdown
id: area
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/new-conventions.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Propose new semantic conventions
description: Propose new conventions you'd like to be part of the OpenTelemetry project
labels: ["enhancement", "triage:needs-triage", "experts needed"]
labels: ["enhancement", "experts needed"]
body:
- type: markdown
attributes:
Expand Down
29 changes: 11 additions & 18 deletions .github/workflows/scripts/prepare-new-issue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if [[ -z "${ISSUE:-}" || -z "${BODY:-}" || -z "${OPENER:-}" ]]; then
exit 0
fi

LABELS=""
LABELS="triage:needs-triage"
AREAS_SECTION_START=$( (echo "${BODY}" | grep -n '### Area(s)' | awk '{ print $1 }' | grep -oE '[0-9]+') || echo '-1' )
BODY_AREAS=""

Expand All @@ -45,26 +45,19 @@ for AREA in ${BODY_AREAS}; do
continue
fi

if [[ -n "${LABELS}" ]]; then
LABELS+=","
fi
LABELS+="${AREA}"
LABELS+=",${AREA}"
done

if [[ -v PINGED_AREAS[@] ]]; then
echo "The issue was associated with areas:" "${!PINGED_AREAS[@]}"
if [[ -v BODY_AREAS[@] ]]; then
echo "The issue was associated with areas:" "${!BODY_AREAS[@]}"
else
echo "No related areas were given"
fi

if [[ -n "${LABELS}" ]]; then
# Notes on this call:
# 1. Labels will be deduplicated by the GitHub CLI.
# 2. The call to edit the issue will fail if any of the
# labels doesn't exist. We can be reasonably sure that
# all labels will exist since they come from a known set.
echo "Adding the following labels: ${LABELS//,/ /}"
gh issue edit "${ISSUE}" --add-label "${LABELS}" || true
else
echo "No labels were found to add"
fi
# Notes on this call:
# 1. Labels will be deduplicated by the GitHub CLI.
# 2. The call to edit the issue will fail if any of the
# labels doesn't exist. We can be reasonably sure that
# all labels will exist since they come from a known set.
echo "Adding the following labels: ${LABELS//,/ /}"
gh issue edit "${ISSUE}" --add-label "${LABELS}" || true

0 comments on commit 0e109d2

Please sign in to comment.