Skip to content

Commit 6834c29

Browse files
authored
Merge branch 'main' into xray-sampler-pr0
2 parents efdb8b3 + e6869cd commit 6834c29

File tree

36 files changed

+1496
-109
lines changed

36 files changed

+1496
-109
lines changed

.github/workflows/generate_workflows_lib/src/generate_workflows_lib/lint.yml.j2

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
env:
17-
CORE_REPO_SHA: main
17+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
18+
# For PRs you can change the inner fallback ('main')
19+
# For pushes you change the outer fallback ('main')
20+
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
21+
CORE_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
22+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
23+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
24+
'main'
25+
) || 'main' }}{% endraw %}
1826
CONTRIB_REPO_SHA: main
1927
PIP_EXISTS_ACTION: w
2028

.github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
env:
17-
CORE_REPO_SHA: main
17+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
18+
# For PRs you can change the inner fallback ('main')
19+
# For pushes you change the outer fallback ('main')
20+
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
21+
CORE_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
22+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
23+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
24+
'main'
25+
) || 'main' }}{% endraw %}
1826
CONTRIB_REPO_SHA: main
1927
PIP_EXISTS_ACTION: w
2028

.github/workflows/generate_workflows_lib/src/generate_workflows_lib/test.yml.j2

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
env:
17-
CORE_REPO_SHA: main
17+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
18+
# For PRs you can change the inner fallback ('main')
19+
# For pushes you change the outer fallback ('main')
20+
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
21+
CORE_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
22+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
23+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
24+
'main'
25+
) || 'main' }}{% endraw %}
1826
CONTRIB_REPO_SHA: main
1927
PIP_EXISTS_ACTION: w
2028

.github/workflows/lint_0.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
env:
17-
CORE_REPO_SHA: main
17+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
18+
# For PRs you can change the inner fallback ('main')
19+
# For pushes you change the outer fallback ('main')
20+
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
21+
CORE_REPO_SHA: ${{ github.event_name == 'pull_request' && (
22+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
23+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
24+
'main'
25+
) || 'main' }}
1826
CONTRIB_REPO_SHA: main
1927
PIP_EXISTS_ACTION: w
2028

.github/workflows/misc_0.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
env:
17-
CORE_REPO_SHA: main
17+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
18+
# For PRs you can change the inner fallback ('main')
19+
# For pushes you change the outer fallback ('main')
20+
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
21+
CORE_REPO_SHA: ${{ github.event_name == 'pull_request' && (
22+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
23+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
24+
'main'
25+
) || 'main' }}
1826
CONTRIB_REPO_SHA: main
1927
PIP_EXISTS_ACTION: w
2028

.github/workflows/prepare-patch-release.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
run: .github/scripts/use-cla-approved-github-bot.sh
7272

7373
- name: Create pull request
74+
id: create_pr
7475
env:
7576
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
7677
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
@@ -80,7 +81,15 @@ jobs:
8081
8182
git commit -a -m "$message"
8283
git push origin HEAD:$branch
83-
gh pr create --title "[$GITHUB_REF_NAME] $message" \
84+
pr_url=$(gh pr create --title "[$GITHUB_REF_NAME] $message" \
8485
--body "$message." \
8586
--head $branch \
86-
--base $GITHUB_REF_NAME
87+
--base $GITHUB_REF_NAME)
88+
echo "pr_url=$pr_url" >> $GITHUB_OUTPUT
89+
90+
- name: Add prepare-release label to PR
91+
if: steps.create_pr.outputs.pr_url != ''
92+
env:
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
run: |
95+
gh pr edit ${{ steps.create_pr.outputs.pr_url }} --add-label "prepare-release"

.github/workflows/prepare-release-branch.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ jobs:
9494
run: .github/scripts/use-cla-approved-github-bot.sh
9595

9696
- name: Create pull request against the release branch
97+
id: create_release_branch_pr
9798
env:
9899
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
99100
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
@@ -103,10 +104,18 @@ jobs:
103104
104105
git commit -a -m "$message"
105106
git push origin HEAD:$branch
106-
gh pr create --title "[$RELEASE_BRANCH_NAME] $message" \
107+
pr_url=$(gh pr create --title "[$RELEASE_BRANCH_NAME] $message" \
107108
--body "$message." \
108109
--head $branch \
109-
--base $RELEASE_BRANCH_NAME
110+
--base $RELEASE_BRANCH_NAME)
111+
echo "pr_url=$pr_url" >> $GITHUB_OUTPUT
112+
113+
- name: Add prepare-release label to PR
114+
if: steps.create_release_branch_pr.outputs.pr_url != ''
115+
env:
116+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
run: |
118+
gh pr edit ${{ steps.create_release_branch_pr.outputs.pr_url }} --add-label "prepare-release"
110119
111120
create-pull-request-against-main:
112121
runs-on: ubuntu-latest
@@ -179,6 +188,7 @@ jobs:
179188
run: .github/scripts/use-cla-approved-github-bot.sh
180189

181190
- name: Create pull request against main
191+
id: create_main_pr
182192
env:
183193
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
184194
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
@@ -189,7 +199,15 @@ jobs:
189199
190200
git commit -a -m "$message"
191201
git push origin HEAD:$branch
192-
gh pr create --title "$message" \
202+
pr_url=$(gh pr create --title "$message" \
193203
--body "$body" \
194204
--head $branch \
195-
--base main
205+
--base main)
206+
echo "pr_url=$pr_url" >> $GITHUB_OUTPUT
207+
208+
- name: Add prepare-release label to PR
209+
if: steps.create_main_pr.outputs.pr_url != ''
210+
env:
211+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
212+
run: |
213+
gh pr edit ${{ steps.create_main_pr.outputs.pr_url }} --add-label "prepare-release"

.github/workflows/test_0.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
env:
17-
CORE_REPO_SHA: main
17+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
18+
# For PRs you can change the inner fallback ('main')
19+
# For pushes you change the outer fallback ('main')
20+
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
21+
CORE_REPO_SHA: ${{ github.event_name == 'pull_request' && (
22+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
23+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
24+
'main'
25+
) || 'main' }}
1826
CONTRIB_REPO_SHA: main
1927
PIP_EXISTS_ACTION: w
2028

.github/workflows/test_1.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
env:
17-
CORE_REPO_SHA: main
17+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
18+
# For PRs you can change the inner fallback ('main')
19+
# For pushes you change the outer fallback ('main')
20+
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
21+
CORE_REPO_SHA: ${{ github.event_name == 'pull_request' && (
22+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
23+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
24+
'main'
25+
) || 'main' }}
1826
CONTRIB_REPO_SHA: main
1927
PIP_EXISTS_ACTION: w
2028

.github/workflows/test_2.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
env:
17-
CORE_REPO_SHA: main
17+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
18+
# For PRs you can change the inner fallback ('main')
19+
# For pushes you change the outer fallback ('main')
20+
# The logic below is used during releases and depends on having an equivalent branch name in the core repo.
21+
CORE_REPO_SHA: ${{ github.event_name == 'pull_request' && (
22+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
23+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
24+
'main'
25+
) || 'main' }}
1826
CONTRIB_REPO_SHA: main
1927
PIP_EXISTS_ACTION: w
2028

0 commit comments

Comments
 (0)