Skip to content

Commit c39ae61

Browse files
committed
Merge main
2 parents ea36136 + cb778fa commit c39ae61

File tree

927 files changed

+83009
-3768
lines changed

Some content is hidden

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

927 files changed

+83009
-3768
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,23 @@ jobs:
150150
fi \
151151
&& ./google-cloud-sdk/bin/gsutil -m rsync -r -c -j html -d ${{ github.workspace }}/public gs://$BUCKET/$bucket_path
152152
153-
versioned_builds=($(find . -type d -regex ".*[0-9-]" -maxdepth 1 | sed -E 's/^.\///'))
154-
for versioned_build in "${versioned_builds[@]}"; do
155-
product=$(grep -Eo '[a-zA-Z]+' <<< $versioned_build)
156-
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/${versioned_build}/operate/${product}"
157-
done
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+
162+
if [[ "$bucket_path" == staging/* ]]
163+
then
164+
versioned_builds=($(find . -type d -regex ".*[0-9-]" -maxdepth 1 | sed -E 's/^.\///'))
165+
for versioned_build in "${versioned_builds[@]}"; do
166+
product=$(grep -Eo '[a-zA-Z]+' <<< $versioned_build)
167+
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/${bucket_path}/${versioned_build}/operate/${product}"
168+
done
169+
fi
158170
159171
- name: End
160172
run: echo "This job's status is ${{ job.status }}."
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/component.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import logging
22
import glob
33
import os
4+
import shutil
5+
46
import semver
57
import uuid
68
from typing import Tuple
@@ -514,13 +516,20 @@ def _copy_examples(self):
514516
if not example_id:
515517
continue
516518

517-
example_metadata = {'source': f}
519+
example_metadata = {
520+
'source': f,
521+
'language': self.get('language').lower()
522+
}
523+
524+
base_path = os.path.join(dst, example_id)
525+
mkdir_p(base_path)
526+
rsync(example_metadata['source'], base_path)
518527

519-
mkdir_p(f'{dst}/{example_id}')
520-
rsync(example_metadata['source'], f'{dst}/{example_id}/')
528+
target_path = os.path.join(base_path, f'{self.get("id")}_{os.path.basename(f)}')
529+
shutil.move(os.path.join(base_path, os.path.basename(f)), target_path)
521530

522-
example_metadata['target'] = f'{dst}/{example_id}/{os.path.basename(f)}'
523-
e = Example(self.get('language'), example_metadata['target'])
531+
example_metadata['target'] = target_path
532+
e = Example(self.get('language'), target_path)
524533
example_metadata['highlight'] = e.highlight
525534
example_metadata['hidden'] = e.hidden
526535
example_metadata['named_steps'] = e.named_steps
@@ -532,7 +541,7 @@ def _copy_examples(self):
532541
examples[example_id] = {}
533542

534543
logging.info(f'Example {example_id} processed successfully.')
535-
examples[example_id][self.get('language')] = example_metadata
544+
examples[example_id][self.get('label')] = example_metadata
536545

537546
def apply(self) -> None:
538547
logging.info(f'Applying client {self._id}')

config.toml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ tagManagerId = "GTM-TKZ6J9R"
4545
gitHubRepo = "https://github.com/redis/docs"
4646

4747
# Display and sort order for client examples
48-
clientsExamples = ["Python", "Node.js", "Java", "Go", "C#", "RedisVL"]
48+
clientsExamples = ["Python", "Node.js", "Java Sync", "Java Async", "Java Reactive", "Go", "C#", "RedisVL"]
4949
searchService = "/convai/api/search-service"
5050
ratingsService = "/docusight/api/rate"
5151

@@ -57,12 +57,14 @@ rdi_db_types = "cassandra|mysql|oracle|postgresql|sqlserver"
5757
rdi_cli_latest = "latest"
5858

5959
[params.clientsConfig]
60-
"Python"={lang="python", quickstartSlug="python/redis-py"}
61-
"Node.js"={lang="javascript", quickstartSlug="nodejs"}
62-
"Java"={lang="java", quickstartSlug="java/jedis"}
63-
"Go"={lang="go", quickstartSlug="go"}
64-
"C#"={lang="C#", quickstartSlug="dotnet"}
65-
"RedisVL"={lang="python", quickstartSlug="python/redis-vl"}
60+
"Python"={quickstartSlug="redis-py"}
61+
"Node.js"={quickstartSlug="nodejs"}
62+
"Java sync"={quickstartSlug="jedis"}
63+
"Java async"={quickstartSlug="lettuce"}
64+
"Java reactive"={quickstartSlug="lettuce"}
65+
"Go"={quickstartSlug="go"}
66+
"C#"={quickstartSlug="dotnet"}
67+
"RedisVL"={quickstartSlug="redis-vl"}
6668

6769
# Markup
6870
[markup]

content/apis/_index.md

Lines changed: 1 addition & 1 deletion
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

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-kill/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ arguments:
7474
optional: true
7575
token: SKIPME
7676
type: oneof
77+
- display_text: maxage
78+
name: maxage
79+
optional: true
80+
since: 7.4.0
81+
token: MAXAGE
82+
type: integer
7783
multiple: true
7884
name: new-format
7985
type: oneof
@@ -110,6 +116,8 @@ history:
110116
- Replaced `slave` `TYPE` with `replica`. `slave` still supported for backward compatibility.
111117
- - 6.2.0
112118
- '`LADDR` option.'
119+
- - 7.4.0
120+
- '`MAXAGE` option.'
113121
linkTitle: CLIENT KILL
114122
since: 2.4.0
115123
summary: Terminates open connections.

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

0 commit comments

Comments
 (0)