Skip to content

Commit 81ba319

Browse files
committed
Merge branch 'main' into DOC-4028
2 parents 4c83b10 + 532f386 commit 81ba319

File tree

896 files changed

+91046
-3379
lines changed

Some content is hidden

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

896 files changed

+91046
-3379
lines changed

.github/workflows/main.yml

Lines changed: 83 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,92 @@ jobs:
3333
echo "ERROR: Invalid branch name ${{ github.ref_name }}!"
3434
exit 1
3535
fi
36-
- name: Configure Hugo
36+
37+
- name: Install dependencies
38+
run: make deps
39+
40+
- name: Build out all versions
3741
run: |
42+
set -x
43+
44+
function setBaseUrl() {
3845
if [[ "${{ github.ref_name }}" == "main" ]]
3946
then
4047
hugo_root_path=docs/staging/dev
4148
elif [[ "${{ github.ref_name }}" == "latest" ]]
4249
then
43-
hugo_root_path="docs/latest"
50+
hugo_root_path="docs/latest"
4451
elif [[ "${{ endsWith(github.ref_name, '-build') }}" == "true" ]]
4552
then
4653
hugo_root_path=`echo docs/version/${{ github.ref_name }} | sed 's/-build$//'`
4754
else
4855
hugo_root_path=docs/staging/${{ github.ref_name }}
4956
fi \
5057
&& sed -i "s#baseURL = \"https://redis.io\"#baseURL = \"https://redis.io/$hugo_root_path\"#g" config.toml
51-
- name: Install dependencies and run Hugo
52-
run: make all
58+
}
59+
60+
setBaseUrl
61+
kubernetes_versions=($(find content/operate/kubernetes/ -maxdepth 1 -type d -regex ".*[0-9-]" | awk -F/ '{print $NF}'))
62+
rs_versions=($(find content/operate/rs/ -maxdepth 1 -type d -regex ".*[0-9-]" | awk -F/ '{print $NF}'))
63+
64+
# build latest
65+
for version in "${kubernetes_versions[@]}"; do
66+
rm -r "content/operate/kubernetes/${version}"
67+
done
68+
for version in "${rs_versions[@]}"; do
69+
rm -r "content/operate/rs/${version}"
70+
done
71+
make all
72+
73+
git checkout .
74+
75+
# build all versions
76+
for version in "${kubernetes_versions[@]}"; do
77+
78+
setBaseUrl
79+
80+
# for each version, remove all other versions before building
81+
versions_to_remove=($(echo "${kubernetes_versions[@]}" "${version}" | tr ' ' '\n' | sort | uniq -u))
82+
for version_to_remove in "${versions_to_remove[@]}"; do
83+
rm -r "content/operate/kubernetes/${version_to_remove}"
84+
done
85+
86+
cp -r "content/operate/kubernetes/${version}"/* content/operate/kubernetes/
87+
rm -r "content/operate/kubernetes/${version}"
88+
sed -i 's/id="versionSelectorKubernetesValue" class="version-selector-control">latest/id="versionSelectorKubernetesValue" class="version-selector-control">v'"${version}"'/' layouts/partials/docs-nav.html
89+
sed -i 's/linkTitle: '"${version}"'/linkTitle: Redis for Kubernetes/' content/operate/kubernetes/_index.md
90+
91+
# inject replace command in meta-links to make sure editURL and issuesURL point to right version
92+
sed -i "11i \{\{ \$gh_file = replaceRE \`\^operate\/kubernetes\/\` \"operate\/kubernetes\/$version\/\" \$gh_file }}" layouts/partials/meta-links.html
93+
94+
hugo -d "kubernetes-${version}"
95+
96+
git checkout .
97+
done
98+
99+
for version in "${rs_versions[@]}"; do
100+
101+
setBaseUrl
102+
103+
# for each version, remove all other versions before building
104+
versions_to_remove=($(echo "${rs_versions[@]}" "${version}" | tr ' ' '\n' | sort | uniq -u))
105+
for version_to_remove in "${versions_to_remove[@]}"; do
106+
rm -r "content/operate/rs/${version_to_remove}"
107+
done
108+
109+
cp -r "content/operate/rs/${version}"/* content/operate/rs/
110+
rm -r "content/operate/rs/${version}"
111+
sed -i 's/id="versionSelectorRsValue" class="version-selector-control">latest/id="versionSelectorRsValue" class="version-selector-control">v'"${version}"'/' layouts/partials/docs-nav.html
112+
sed -i 's/linkTitle: '"${version}"'/linkTitle: Redis Software/' content/operate/rs/_index.md
113+
114+
# inject replace command in meta-links to make sure editURL and issuesURL point to right version
115+
sed -i "11i \{\{ \$gh_file = replaceRE \`\^operate\/rs\/\` \"operate\/rs\/$version\/\" \$gh_file }}" layouts/partials/meta-links.html
116+
117+
hugo -d "rs-${version}"
118+
119+
git checkout .
120+
done
121+
53122
- name: List client examples
54123
run: ls "${{ github.workspace }}/examples"
55124
- name: List files to be published
@@ -80,5 +149,15 @@ jobs:
80149
bucket_path=staging/${{ github.ref_name }}
81150
fi \
82151
&& ./google-cloud-sdk/bin/gsutil -m rsync -r -c -j html -d ${{ github.workspace }}/public gs://$BUCKET/$bucket_path
152+
153+
if [[ "${{ github.ref_name }}" == "latest" ]]
154+
then
155+
versioned_builds=($(find . -type d -regex ".*[0-9-]" -maxdepth 1 | sed -E 's/^.\///'))
156+
for versioned_build in "${versioned_builds[@]}"; do
157+
product=$(grep -Eo '[a-zA-Z]+' <<< $versioned_build)
158+
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/${versioned_build}/operate/${product}"
159+
done
160+
fi
161+
83162
- name: End
84163
run: echo "This job's status is ${{ job.status }}."
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: redis_modules_docs_sync
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # run every day at midnight UTC time
6+
workflow_dispatch: # or run on manual trigger
7+
8+
jobs:
9+
redis_modules_docs_sync:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
actions: write
15+
steps:
16+
- name: 'Checkout'
17+
uses: 'actions/checkout@v3'
18+
19+
- name: 'Fetch commands json files from modules'
20+
env:
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
run: |
23+
branch="redis_modules_docs_sync"
24+
modules_list=("redisjson" "redisbloom" "redistimeseries" "redisearch")
25+
module_change=false
26+
27+
# check if remote branch already exists
28+
git fetch --all
29+
set +e
30+
git ls-remote --exit-code --heads origin "refs/heads/${branch}"
31+
if [ "$?" -eq 0 ]; then
32+
set -e
33+
# if it does, create local branch off existing remote branch
34+
git checkout -b "${branch}" "origin/${branch}"
35+
git branch --set-upstream-to="origin/${branch}" "${branch}"
36+
git pull
37+
else
38+
set -e
39+
# otherwise, create local branch from main
40+
git checkout -b "${branch}"
41+
fi
42+
43+
for module in "${modules_list[@]}"; do
44+
# Find latest version
45+
module_version=$(
46+
curl -Ls \
47+
-H "Accept: application/vnd.github+json" \
48+
-H "Authorization: Bearer ${GH_TOKEN}" \
49+
-H "X-GitHub-Api-Version: 2022-11-28" \
50+
"https://api.github.com/repos/${module}/${module}/releases/latest" \
51+
| jq -r '.tag_name'
52+
)
53+
54+
# Fetch release
55+
gh release download "$module_version" -R "${module}/${module}" -A zip -O "${module}.zip"
56+
unzip "${module}.zip" -d "${module}"
57+
cp ${module}/*/commands.json "data/commands_${module}.json"
58+
59+
modules_commands_is_different=$(git diff "data/commands_${module}.json")
60+
if [[ ! -z $modules_commands_is_different ]]; then
61+
module_change=true
62+
63+
git add "data/commands_${module}.json"
64+
git config user.email "177626021+redisdocsapp[bot]@users.noreply.github.com"
65+
git config user.name "redisdocsapp[bot]"
66+
git commit -m "Update data/commands_${module}.json for release ${module_version}"
67+
fi
68+
done
69+
70+
if [ "$module_change" = true ] ; then
71+
git push origin "${branch}"
72+
73+
# If a pr is not already open, create one
74+
set +e
75+
gh search prs -R redis/docs --state open --match title "redis modules docs sync" | grep -q "redis modules docs sync"
76+
if [ "$?" -eq 1 ]; then
77+
set -e
78+
gh pr create \
79+
--body "redis modules docs sync" \
80+
--title "redis modules docs sync" \
81+
--head "$branch" \
82+
--base "main"
83+
fi
84+
fi
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: update_command_pages
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
paths:
7+
- data/commands_core.json # run when data/commands_core.json is updated on main
8+
workflow_dispatch: # or run on manual trigger
9+
10+
jobs:
11+
update_command_pages:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
actions: write
17+
steps:
18+
- name: 'Checkout'
19+
uses: 'actions/checkout@v3'
20+
21+
- name: Install dependencies
22+
run: make deps
23+
24+
- name: 'Run build/update_cmds.py script'
25+
env:
26+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: |
28+
branch="update_command_pages"
29+
commands_change=false
30+
31+
# check if remote branch already exists
32+
git fetch --all
33+
set +e
34+
git ls-remote --exit-code --heads origin "refs/heads/${branch}"
35+
if [ "$?" -eq 0 ]; then
36+
set -e
37+
# if it does, create local branch off existing remote branch
38+
git checkout -b "${branch}" "origin/${branch}"
39+
git branch --set-upstream-to="origin/${branch}" "${branch}"
40+
git pull
41+
else
42+
set -e
43+
# otherwise, create local branch from main
44+
git checkout -b "${branch}"
45+
fi
46+
47+
python3 build/update_cmds.py
48+
49+
commands_are_different=$(git diff "content/commands/")
50+
51+
if [[ ! -z $commands_are_different ]]; then
52+
commands_change=true
53+
54+
git add "content/commands/"
55+
git config user.email "177626021+redisdocsapp[bot]@users.noreply.github.com"
56+
git config user.name "redisdocsapp[bot]"
57+
git commit -m "Update content/commands/"
58+
fi
59+
60+
if [ "$commands_change" = true ] ; then
61+
git push origin "${branch}"
62+
63+
# If a pr is not already open, create one
64+
set +e
65+
gh search prs -R redis/docs --state open --match title "update command pages" | grep -q "update command pages"
66+
if [ "$?" -eq 1 ]; then
67+
set -e
68+
gh pr create \
69+
--body "update command pages" \
70+
--title "update command pages" \
71+
--head "$branch" \
72+
--base "main"
73+
fi
74+
fi

build/components/example.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,19 @@
1111
GO_OUTPUT = 'Output:'
1212
TEST_MARKER = {
1313
'java': '@Test',
14-
'c#': '\[Fact\]'
14+
'c#': '\[Fact\]|\[SkipIfRedis\(.*\)\]'
1515
}
1616
PREFIXES = {
1717
'python': '#',
1818
'node.js': '//',
1919
'java': '//',
2020
'go': '//',
2121
'c#': '//',
22-
'redisvl': '#'
22+
'redisvl': '#',
23+
'php': '//'
2324
}
2425

26+
2527
class Example(object):
2628
language = None
2729
path = None

content/apis/_index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Redis comes with a wide range of commands that help you to develop real-time app
1818

1919
As a developer, you will likely use one of our supported client libraries for connecting and executing commands.
2020

21-
- [Connect with Redis clients introduction]({{< relref "/develop/connect/clients/" >}})
21+
- [Connect with Redis clients introduction]({{< relref "/develop/clients" >}})
2222

2323
### Programmability APIs
2424

@@ -45,13 +45,13 @@ Redis Cloud is a fully managed Database as a Service offering and the fastest wa
4545

4646
- [Redis Cloud REST API introduction]({{< relref "/operate/rc/api/" >}})
4747
- [Redis Cloud REST API examples]({{< relref "/operate/rc/api/examples/" >}})
48-
- [Redis Cloud REST API reference]({{< relref "/operate/rs/references/rest-api/" >}})
48+
- [Redis Cloud REST API reference](https://api.redislabs.com/v1/swagger-ui.html)
4949

5050

5151
### Redis Enterprise Software API
5252
If you have installed Redis Enterprise Software, you can automate operations with the Redis Enterprise REST API.
5353

54-
- [Redis Enterprise Software REST API introduction]({{< relref "/operate/rc/api/" >}})
54+
- [Redis Enterprise Software REST API introduction]({{< relref "/operate/rs/references/rest-api/" >}})
5555
- [Redis Enterprise Software REST API requests]({{< relref "/operate/rs/references/rest-api/requests/" >}})
5656
- [Redis Enterprise Software REST API objects]({{< relref "/operate/rs/references/rest-api/objects/" >}})
5757

content/commands/client-caching/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ title: CLIENT CACHING
4343
This command controls the tracking of the keys in the next command executed
4444
by the connection, when tracking is enabled in `OPTIN` or `OPTOUT` mode.
4545
Please check the
46-
[client side caching documentation]({{< relref "/develop/connect/clients/client-side-caching" >}}) for
46+
[client side caching documentation]({{< relref "/develop/clients/client-side-caching" >}}) for
4747
background information.
4848

4949
When tracking is enabled Redis, using the [`CLIENT TRACKING`]({{< relref "/commands/client-tracking" >}}) command, it is

content/commands/client-getredir/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ syntax_str: ''
3131
title: CLIENT GETREDIR
3232
---
3333
This command returns the client ID we are redirecting our
34-
[tracking]({{< relref "/develop/connect/clients/client-side-caching#tracking" >}}) notifications to. We set a client
34+
[tracking]({{< relref "/develop/clients/client-side-caching#tracking" >}}) notifications to. We set a client
3535
to redirect to when using [`CLIENT TRACKING`]({{< relref "/commands/client-tracking" >}}) to enable tracking. However in
3636
order to avoid forcing client libraries implementations to remember the
3737
ID notifications are redirected to, this command exists in order to improve

content/commands/client-tracking/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ syntax_str: "[REDIRECT\_client-id] [PREFIX\_prefix [PREFIX prefix ...]] [BCAST]
7575
title: CLIENT TRACKING
7676
---
7777
This command enables the tracking feature of the Redis server, that is used
78-
for [server assisted client side caching]({{< relref "/develop/connect/clients/client-side-caching#tracking" >}}).
78+
for [server assisted client side caching]({{< relref "/develop/clients/client-side-caching#tracking" >}}).
7979

8080
When tracking is enabled Redis remembers the keys that the connection
8181
requested, in order to send later invalidation messages when such keys are

content/commands/client-trackinginfo/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ syntax_fmt: CLIENT TRACKINGINFO
2929
syntax_str: ''
3030
title: CLIENT TRACKINGINFO
3131
---
32-
The command returns information about the current client connection's use of the [server assisted client side caching]({{< relref "/develop/connect/clients/client-side-caching" >}}) feature.
32+
The command returns information about the current client connection's use of the [server assisted client side caching]({{< relref "/develop/clients/client-side-caching" >}}) feature.
3333

3434
Here's the list of tracking information sections and their respective values:
3535

content/commands/ft.config-set/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Set the value of a RediSearch configuration parameter.
3535

3636
Values set using `FT.CONFIG SET` are not persisted after server restart.
3737

38-
RediSearch configuration parameters are detailed in [Configuration parameters]({{< relref "/develop/interact/search-and-query/administration" >}}).
38+
RediSearch configuration parameters are detailed in [Configuration parameters]({{< relref "/develop/interact/search-and-query/basic-constructs/configuration-parameters" >}}).
3939

4040
{{% alert title="Note" color="warning" %}}
4141
As detailed in the link above, not all RediSearch configuration parameters can be set at runtime.

0 commit comments

Comments
 (0)