Skip to content

Commit 6790062

Browse files
authored
Merge branch 'main' into watcher.put_watcher
2 parents e2d5c73 + 4bb435c commit 6790062

File tree

1,327 files changed

+58007
-13294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,327 files changed

+58007
-13294
lines changed

.github/validate-pr/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async function run () {
5353
per_page: 100
5454
})
5555
if (data.length > 0) {
56-
files.push(...data.map(entry => entry.filename))
56+
files.push(...data.filter(entry => entry.status !== 'deleted').map(entry => entry.filename))
5757
page += 1
5858
} else {
5959
break
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types: [labeled, unlabeled, opened, reopened, synchronize]
8+
9+
permissions:
10+
pull-requests: "read"
11+
12+
jobs:
13+
check-backport-label:
14+
name: backport label
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: "Check backport label"
19+
env:
20+
GH_TOKEN: ${{ github.token }}
21+
run: |
22+
json_pr_labels='${{ toJSON(github.event.pull_request.labels) }}'
23+
readarray -t pr_labels < <(echo "${json_pr_labels}" | jq -r -c '.[].name')
24+
25+
json_all_labels="$(gh label list --repo ${{ github.repository }} --json name --search "backport" --limit 1000)"
26+
readarray -t all_labels < <(echo "${json_all_labels}" | jq -r -c '.[].name')
27+
28+
declare -A all_backport_labels=()
29+
declare -A all_floating_majors=()
30+
31+
backport_regex="^backport ([0-9])+\.([0-9]+|x)$"
32+
33+
echo "::group::Available Labels"
34+
echo "skip-backport"
35+
36+
for label in "${all_labels[@]}"; do
37+
if [[ "${label}" =~ ${backport_regex} ]]; then
38+
major="${BASH_REMATCH[1]}"
39+
minor="${BASH_REMATCH[2]}"
40+
all_backport_labels["${label}"]=1
41+
echo "${label}"
42+
43+
if [ "${minor}" = "x" ]; then
44+
all_floating_majors["${major}"]=1
45+
fi
46+
fi
47+
done
48+
49+
echo "::endgroup::"
50+
51+
has_backport_label=false
52+
has_skip_backport_label=false
53+
declare -A pr_exact_majors=()
54+
declare -A pr_floating_majors=()
55+
56+
echo "::group::Detected Labels"
57+
58+
for pr_label in "${pr_labels[@]}"; do
59+
if [ "${pr_label}" = "skip-backport" ]; then
60+
has_skip_backport_label=true
61+
echo "${pr_label}"
62+
continue
63+
fi
64+
65+
if [ -z "${all_backport_labels[${pr_label}]}" ]; then
66+
continue
67+
fi
68+
69+
has_backport_label=true
70+
71+
if [[ "${pr_label}" =~ ${backport_regex} ]]; then
72+
major="${BASH_REMATCH[1]}"
73+
minor="${BASH_REMATCH[2]}"
74+
if [ "${minor}" != "x" ]; then
75+
pr_exact_majors["${major}"]=1
76+
else
77+
pr_floating_majors["${major}"]=1
78+
fi
79+
fi
80+
81+
echo "${pr_label}"
82+
done
83+
84+
echo "::endgroup::"
85+
86+
if [ "${has_skip_backport_label}" = true ] && [ "${has_backport_label}" = true ]; then
87+
echo "::error::The 'skip-backport' not be used in combination with another backport"\
88+
"label."
89+
exit 1
90+
fi
91+
92+
if [ "${has_skip_backport_label}" != true ] && [ "${has_backport_label}" != true ]; then
93+
echo "::error::No backport label found. Please add at least one of the"\
94+
"'backport {major}.{minor|x}' labels or use 'skip-backport',"\
95+
"if this PR should not be backported."
96+
exit 1
97+
fi
98+
99+
# Validate that a floating backport label exists for each exact backport label major
100+
# version.
101+
102+
has_required_floating_labels=true
103+
104+
for pr_major in "${!pr_exact_majors[@]}"; do
105+
if [ -z "${all_floating_majors[${pr_major}]}" ]; then
106+
# There is no floating version branch for the given major version.
107+
continue
108+
fi
109+
110+
if [ -z "${pr_floating_majors[${pr_major}]}" ]; then
111+
has_required_floating_labels=false
112+
echo "::error::Missing floating backport label for '${pr_major}.x'"
113+
fi
114+
done
115+
116+
if [ "${has_required_floating_labels}" != true ]; then
117+
exit 1
118+
fi

.github/workflows/gh-pages-report.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/update-rest-api-json.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
branch: ['main', '8.x', '8.16', '8.17', 7.17']
16+
branch: ['main', '8.x', '8.16', '8.17', '7.17']
1717

1818
steps:
1919
- uses: actions/checkout@v4

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ filter-for-serverless: ## Generate the serverless version from the compiled sche
5757
dump-routes: ## Create a new schema with all generics expanded
5858
@npm run dump-routes --prefix compiler
5959

60-
contrib: | generate license-check spec-format-fix transform-to-openapi filter-for-serverless ## Pre contribution target
61-
6260
overlay-docs: ## Apply overlays to OpenAPI documents
6361
@npx bump overlay "output/openapi/elasticsearch-serverless-openapi.json" "docs/overlays/elasticsearch-serverless-openapi-overlays.yaml" > "output/openapi/elasticsearch-serverless-openapi.tmp1.json"
6462
@npx bump overlay "output/openapi/elasticsearch-serverless-openapi.tmp1.json" "docs/overlays/elasticsearch-shared-overlays.yaml" > "output/openapi/elasticsearch-serverless-openapi.tmp2.json"
@@ -78,6 +76,8 @@ lint-docs-errs: ## Lint the OpenAPI documents after overlays and return only err
7876
lint-docs-serverless: ## Lint only the serverless OpenAPI document after overlays
7977
@npx @stoplight/spectral-cli lint output/openapi/elasticsearch-serverless-openapi.examples.json --ruleset .spectral.yaml
8078

79+
contrib: | generate license-check spec-format-fix transform-to-openapi filter-for-serverless lint-docs-errs ## Pre contribution target
80+
8181
help: ## Display help
8282
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
8383
#------------- <https://suva.sh/posts/well-documented-makefiles> --------------

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ If you are using MacOS, run the following command to fix the issue:
305305
brew install coreutils
306306
```
307307

308-
### I need to modify che compiler, help!
308+
### I need to modify the compiler, help!
309309

310310
Take a look at the [compiler documentation](./docs/compiler.md).
311311

0 commit comments

Comments
 (0)