Skip to content

Commit 6845c6c

Browse files
committed
Merge branch 'main' into release-rs-gilboa
2 parents bbc24b3 + b2ac49d commit 6845c6c

File tree

398 files changed

+13706
-7077
lines changed

Some content is hidden

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

398 files changed

+13706
-7077
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: autocomment_jira_link
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
permissions:
8+
pull-requests: write
9+
contents: read
10+
11+
jobs:
12+
auto-comment:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: 'Checkout'
16+
uses: 'actions/checkout@v3'
17+
18+
- name: Create Comment
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
PR_NUMBER: ${{ github.event.pull_request.number }}
22+
REPO: ${{ github.repository }}
23+
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
24+
run: |
25+
generate_post_data()
26+
{
27+
cat <<EOF
28+
{
29+
"body": "$COMMENT"
30+
EOF
31+
}
32+
33+
if [[ "$BRANCH_NAME" == DOC-* ]]; then
34+
CREATE_COMMENT_URL="https://api.github.com/repos/${REPO}/issues/${PR_NUMBER}/comments"
35+
36+
JIRA_TICKET=$(grep -Eo '^DOC-[0-9]+' <<< "$BRANCH_NAME")
37+
JIRA_LINK="https://redislabs.atlassian.net/browse/${JIRA_TICKET}"
38+
COMMENT="[${JIRA_TICKET}](${JIRA_LINK})"
39+
40+
# Write comment on pull request
41+
curl -Ls \
42+
-X POST \
43+
-H "Accept: application/vnd.github+json" \
44+
-H "X-GitHub-Api-Version: 2022-11-28" \
45+
-H "Authorization: token ${GITHUB_TOKEN}" \
46+
$CREATE_COMMENT_URL \
47+
--data "$(generate_post_data)" 1>/dev/null
48+
49+
printf '%s\n' 'Comment written!'
50+
fi

.github/workflows/autocomment.yaml renamed to .github/workflows/autocomment_staging_links.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Auto Comment on PR
1+
name: autocomment_staging_links
22

33
on:
44
pull_request:
@@ -38,7 +38,7 @@ jobs:
3838
-H "X-GitHub-Api-Version: 2022-11-28" \
3939
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
4040
$CREATE_COMMENT_URL \
41-
| jq -r '.[] | select(.user.login == "github-actions[bot]")'
41+
| jq -r '.[] | select(.user.login == "github-actions[bot]" and ((.body // "") | contains("Staging links:")))'
4242
)
4343
EXISTING_COMMENT_ID=$(jq -r '.id' <<<"$EXISTING_COMMENT_JSON")
4444
EXISTING_COMMENT=$(jq -r '.body' <<<"$EXISTING_COMMENT_JSON")
@@ -50,7 +50,7 @@ jobs:
5050
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
5151
$FILES_URL \
5252
| jq -r --arg prefix $BRANCH_NAME/ '.[] | select(((.filename | test("content/(?!.*embed).*\\.md")) and .status != "removed")) | ($prefix + .filename)' \
53-
| sed -E -e 's|(^[^/]+/)([^/]+/)|\1|' -e 's|^|https://redis.io/docs/staging/|' -e 's|(_?index)?\.md||' \
53+
| sed -E -e 's|(^[^/]+/)([^/]+/)|\1|' -e 's|^|https://redis.io/docs/staging/|' -e 's|(\/_?index)?\.md|\/|' \
5454
| sort \
5555
| uniq)
5656

.github/workflows/k8s_apis_sync.yaml

Lines changed: 80 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
run: |-
5151
mkdir artifacts
5252
mkdir templates
53-
cp content/operate/kubernetes/reference/kubernetes-api-reference-template.tmpl templates/template.tmpl
53+
cp content/operate/kubernetes/reference/api/kubernetes-api-reference-template.tmpl templates/template.tmpl
5454
5555
crdoc --resources crds/reaadb_crd.yaml --output artifacts/redis_enterprise_active_active_database_api.md --template templates/template.tmpl
5656
sed -E -i 's/^### RedisEnterpriseActiveActiveDatabase\./### /g' artifacts/redis_enterprise_active_active_database_api.md
@@ -80,6 +80,80 @@ jobs:
8080
sed -E -i 's/\[index\]/\[\]/g' artifacts/redis_enterprise_remote_cluster_api.md
8181
awk '/(#[^")]+)index/ {gsub(/index/,"")}; {print}' artifacts/redis_enterprise_remote_cluster_api.md > _tmp.md && mv _tmp.md artifacts/redis_enterprise_remote_cluster_api.md
8282
83+
- name: 'Remove fields without description'
84+
run: |-
85+
file="artifacts/redis_enterprise_cluster_api.md"
86+
empty_fields_file="content/operate/kubernetes/reference/api/redis_enterprise_cluster_empty_fields"
87+
88+
# Read empty fields and process them
89+
while IFS= read -r field; do
90+
# Skip empty lines and comments
91+
[[ -z "$field" || "$field" =~ ^# ]] && continue
92+
93+
# Convert field path to section header pattern
94+
section_pattern="${field}"
95+
96+
# Remove subsections that go deeper than [index] level
97+
# Keep: spec.extraEnvVars
98+
# Keep: spec.extraEnvVars[index]
99+
# Remove: spec.extraEnvVars[index].valueFrom
100+
# Remove: spec.extraEnvVars[index].valueFrom.fieldRef
101+
awk -v base_pattern="${section_pattern}" '
102+
BEGIN { skip = 0 }
103+
/^### / {
104+
# Check if this line matches a pattern we want to remove
105+
section = $0
106+
gsub(/^### /, "", section)
107+
108+
# If it starts with our base pattern
109+
if (index(section, base_pattern) == 1) {
110+
remainder = substr(section, length(base_pattern) + 1)
111+
112+
# If remainder is empty, keep it (main section)
113+
if (remainder == "") {
114+
skip = 0
115+
}
116+
# If remainder is just [index], keep it
117+
else if (remainder == "[index]") {
118+
skip = 0
119+
}
120+
# If remainder starts with [index]. (has more after [index]), remove it
121+
else if (index(remainder, "[index].") == 1) {
122+
skip = 1
123+
next
124+
}
125+
# If remainder starts with . (direct subsection), remove it
126+
else if (index(remainder, ".") == 1) {
127+
skip = 1
128+
next
129+
}
130+
# If remainder starts with []. (direct subsection), remove it
131+
else if (index(remainder, "[].") == 1) {
132+
skip = 1
133+
next
134+
}
135+
# Otherwise keep it
136+
else {
137+
skip = 0
138+
}
139+
} else {
140+
# Different section, stop skipping
141+
skip = 0
142+
}
143+
}
144+
145+
skip == 0 { print }
146+
' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
147+
148+
done < "$empty_fields_file"
149+
150+
- name: 'Fix link titles'
151+
run: |-
152+
sed -E -i 's/linkTitle: RedisEnterpriseActiveActiveDatabase API Reference/linkTitle: REAADB API/g' artifacts/redis_enterprise_active_active_database_api.md
153+
sed -E -i 's/linkTitle: RedisEnterpriseCluster API Reference/linkTitle: REC API/g' artifacts/redis_enterprise_cluster_api.md
154+
sed -E -i 's/linkTitle: RedisEnterpriseDatabase API Reference/linkTitle: REDB API/g' artifacts/redis_enterprise_database_api.md
155+
sed -E -i 's/linkTitle: RedisEnterpriseRemoteCluster API Reference/linkTitle: RERC API/g' artifacts/redis_enterprise_remote_cluster_api.md
156+
83157
- name: 'Generate YAML snippets'
84158
run: |-
85159
function formatYamlSnippet() {
@@ -128,14 +202,12 @@ jobs:
128202
129203
git checkout -b "${BRANCH}"
130204
131-
cp artifacts/redis_enterprise_active_active_database_api.md content/operate/kubernetes/reference/
132-
cp artifacts/redis_enterprise_cluster_api.md content/operate/kubernetes/reference/
133-
cp artifacts/redis_enterprise_database_api.md content/operate/kubernetes/reference/
134-
cp artifacts/redis_enterprise_remote_cluster_api.md content/operate/kubernetes/reference/
135-
136-
git apply content/operate/kubernetes/reference/kubernetes-api-reference-frontmatter.patch
205+
cp artifacts/redis_enterprise_active_active_database_api.md content/operate/kubernetes/reference/api/
206+
cp artifacts/redis_enterprise_cluster_api.md content/operate/kubernetes/reference/api/
207+
cp artifacts/redis_enterprise_database_api.md content/operate/kubernetes/reference/api/
208+
cp artifacts/redis_enterprise_remote_cluster_api.md content/operate/kubernetes/reference/api/
137209
138-
git add content/operate/kubernetes/reference/
210+
git add content/operate/kubernetes/reference/api/
139211
git add content/embeds/k8s/
140212
141213
git commit -m "k8s api docs ${RELEASE}"

.github/workflows/main.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,28 +202,38 @@ jobs:
202202
then
203203
versioned_builds=($(find . -type d -regex ".*[0-9-]" -maxdepth 1 | sed -E 's/^.\///'))
204204
for versioned_build in "${versioned_builds[@]}"; do
205-
product=$(awk 'BEGIN{FS=OFS="-"}{NF--; print}' <<< $versioned_build)
205+
read product version <<< "$(awk -F- '{print $1 " " $2}' <<<"$versioned_build")"
206+
206207
if [[ "${product}" == "redis-data-integration" ]]; then
207208
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}" "gs://${BUCKET}/${versioned_build}/integrate/${product}"
208-
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}" "gs://${BUCKET}/docs/${versioned_build}/integrate/${product}"
209+
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}/${version}" "gs://${BUCKET}/docs/$bucket_path/integrate/${product}/${version}"
209210
else
210211
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/${versioned_build}/operate/${product}"
211-
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/docs/${versioned_build}/operate/${product}"
212+
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}/${version}" "gs://${BUCKET}/docs/$bucket_path/operate/${product}/${version}"
212213
fi
213214
done
215+
216+
# Prepare custom 404 page for Cloud Connector
217+
hugo_root_path="docs/latest"
218+
sed -i "s#baseURL = \"https://redis.io\"#baseURL = \"https://redis.io/$hugo_root_path\"#g" config.toml
219+
make hugo
220+
sed -i "s#/docs/latest/scss/#https://storage.googleapis.com/$BUCKET/docs/latest/scss/#g" public/404.html
221+
sed -i "s#/docs/latest/css/#https://storage.googleapis.com/$BUCKET/docs/latest/css/#g" public/404.html
222+
gsutil cp public/404.html gs://$BUCKET/docs/
214223
fi
215224
216225
if [[ "$bucket_path" == staging/* ]]
217226
then
218227
versioned_builds=($(find . -type d -regex ".*[0-9-]" -maxdepth 1 | sed -E 's/^.\///'))
219228
for versioned_build in "${versioned_builds[@]}"; do
220-
product=$(awk 'BEGIN{FS=OFS="-"}{NF--; print}' <<< $versioned_build)
229+
read product version <<< "$(awk -F- '{print $1 " " $2}' <<<"$versioned_build")"
230+
221231
if [[ "${product}" == "redis-data-integration" ]]; then
222232
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}" "gs://${BUCKET}/${bucket_path}/${versioned_build}/integrate/${product}"
223-
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}" "gs://${BUCKET}/docs/${bucket_path}/${versioned_build}/integrate/${product}"
233+
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}/${version}" "gs://${BUCKET}/docs/${bucket_path}/integrate/${product}/${version}"
224234
else
225235
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/${bucket_path}/${versioned_build}/operate/${product}"
226-
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/docs/${bucket_path}/${versioned_build}/operate/${product}"
236+
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}/${version}" "gs://${BUCKET}/docs/${bucket_path}/operate/${product}/${version}"
227237
fi
228238
done
229239
fi

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/data/versions.json
99
/data/components_local/
1010
/examples
11-
build/components/__pycache__/
11+
**/__pycache__/
1212
venv/**
1313
node_modules/
1414
package-lock.json

assets/css/index.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,41 @@ select {
521521
@apply w-10 h-10;
522522
}
523523

524+
/* YAML embed download button styles */
525+
.download-yaml-btn {
526+
@apply transition-colors;
527+
}
528+
529+
.download-yaml-btn:disabled {
530+
@apply opacity-75 cursor-not-allowed;
531+
}
532+
533+
.download-yaml-btn svg {
534+
@apply w-4 h-4;
535+
}
536+
537+
/* Make long code blocks scrollable */
538+
.yaml-embed-container .highlight {
539+
max-height: 800px;
540+
overflow-y: auto;
541+
}
542+
543+
.yaml-embed-container .highlight::-webkit-scrollbar {
544+
width: 8px;
545+
}
546+
547+
.yaml-embed-container .highlight::-webkit-scrollbar-track {
548+
@apply bg-slate-700 rounded;
549+
}
550+
551+
.yaml-embed-container .highlight::-webkit-scrollbar-thumb {
552+
@apply bg-slate-500 rounded;
553+
}
554+
555+
.yaml-embed-container .highlight::-webkit-scrollbar-thumb:hover {
556+
@apply bg-slate-400;
557+
}
558+
524559
#download-redis > h3,
525560
#download-redis-stack > h3 {
526561
@apply mt-2;

0 commit comments

Comments
 (0)