Skip to content

Commit 7023753

Browse files
committed
Merge branch 'main' into DOC-5527
2 parents 6a9df27 + 4ea1a9c commit 7023753

File tree

86 files changed

+3514
-3227
lines changed

Some content is hidden

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

86 files changed

+3514
-3227
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+
CREATE_COMMENT_URL="https://api.github.com/repos/${REPO}/issues/${PR_NUMBER}/comments"
26+
27+
JIRA_TICKET=$(grep -Eo '^DOC-[0-9]+' <<< "$BRANCH_NAME")
28+
JIRA_LINK="https://redislabs.atlassian.net/browse/${JIRA_TICKET}"
29+
COMMENT="[${JIRA_TICKET}](${JIRA_LINK})"
30+
31+
generate_post_data()
32+
{
33+
cat <<EOF
34+
{
35+
"body": "$COMMENT"
36+
EOF
37+
}
38+
39+
if [[ "$BRANCH_NAME" == DOC-* ]]; then
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}"

config.toml

Lines changed: 2 additions & 1 deletion
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-Sync", "Java-Async", "Java-Reactive", "Go", "C#", "RedisVL"]
48+
clientsExamples = ["Python", "Node.js", "Java-Sync", "Java-Async", "Java-Reactive", "Go", "C#", "RedisVL", "PHP"]
4949
searchService = "/convai/api/search-service"
5050
ratingsService = "/docusight/api/rate"
5151

@@ -66,6 +66,7 @@ rdi_current_version = "1.12.3"
6666
"Go"={quickstartSlug="go"}
6767
"C#"={quickstartSlug="dotnet"}
6868
"RedisVL"={quickstartSlug="redis-vl"}
69+
"PHP"={quickstartSlug="php"}
6970

7071
# Markup
7172
[markup]

content/commands/bitop.md

Lines changed: 58 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ arguments:
2121
name: not
2222
token: NOT
2323
type: pure-token
24+
- display_text: diff
25+
name: diff
26+
token: DIFF
27+
type: pure-token
28+
- display_text: diff1
29+
name: diff1
30+
token: DIFF1
31+
type: pure-token
32+
- display_text: andor
33+
name: andor
34+
token: ANDOR
35+
type: pure-token
36+
- display_text: one
37+
name: one
38+
token: ONE
39+
type: pure-token
2440
name: operation
2541
type: oneof
2642
- display_text: destkey
@@ -78,26 +94,45 @@ key_specs:
7894
linkTitle: BITOP
7995
since: 2.6.0
8096
summary: Performs bitwise operations on multiple strings, and stores the result.
81-
syntax_fmt: BITOP <AND | OR | XOR | NOT> destkey key [key ...]
97+
syntax_fmt: "BITOP <AND | OR | XOR | NOT | DIFF | DIFF1 | ANDOR | ONE> destkey key [key ...]"
8298
syntax_str: destkey key [key ...]
8399
title: BITOP
84100
---
85101
Perform a bitwise operation between multiple keys (containing string values) and
86102
store the result in the destination key.
87103

88-
The `BITOP` command supports four bitwise operations: **AND**, **OR**, **XOR**
89-
and **NOT**, thus the valid forms to call the command are:
104+
The `BITOP` command supports eight bitwise operations: `AND`, `OR`, `XOR`,
105+
`NOT`, `DIFF`, `DIFF1`, `ANDOR`, and `ONE`. The valid forms to call the command are:
90106

91107

92108
* `BITOP AND destkey srckey1 srckey2 srckey3 ... srckeyN`
109+
110+
A bit in `destkey` is set only if it is set in all source bitmaps.
93111
* `BITOP OR destkey srckey1 srckey2 srckey3 ... srckeyN`
112+
113+
A bit in `destkey` is set only if it is set in at least one source bitmap.
94114
* `BITOP XOR destkey srckey1 srckey2 srckey3 ... srckeyN`
115+
116+
Mostly used with two source bitmaps, a bit in `destkey` is set only if its value differs between the two source bitmaps.
95117
* `BITOP NOT destkey srckey`
96118

97-
As you can see **NOT** is special as it only takes an input key, because it
98-
performs inversion of bits so it only makes sense as a unary operator.
119+
`NOT` is a unary operator and only supports a single source bitmap; set the bit to the inverse of its value in the source bitmap.
120+
* `BITOP DIFF destkey X [Y1 Y2 ...]` <sup>[1](#list-note-1)</sup>
121+
122+
A bit in `destkey` is set if it is set in `X`, but not in any of `Y1, Y2, ...` .
123+
* `BITOP DIFF1 destkey X [Y1 Y2 ...]` <sup>[1](#list-note-1)</sup>
99124

100-
The result of the operation is always stored at `destkey`.
125+
A bit in `destkey` is set if it is set in one or more of `Y1, Y2, ...`, but not in `X`.
126+
* `BITOP ANDOR destkey X [Y1 Y2 ...]` <sup>[1](#list-note-1)</sup>
127+
128+
A bit in `destkey` is set if it is set in `X` and also in one or more of `Y1, Y2, ...`.
129+
* `BITOP ONE destkey X1 [X2 X3 ...]` <sup>[1](#list-note-1)</sup>
130+
131+
A bit in `destkey` is set if it is set in exactly one of `X1, X2, ...`.
132+
133+
The result of each operation is always stored at `destkey`.
134+
135+
1. <a name="list-note-1"></a> Added in Redis 8.2.
101136

102137
## Handling of strings with different lengths
103138

@@ -110,13 +145,27 @@ zero bytes up to the length of the longest string.
110145

111146
## Examples
112147

148+
1. Basic usage example using the `AND` operator:
149+
113150
{{% redis-cli %}}
114-
SET key1 "foobar"
115-
SET key2 "abcdef"
151+
BITFIELD key1 SET i8 #0 255
152+
BITFIELD key2 SET i8 #0 85
116153
BITOP AND dest key1 key2
117-
GET dest
154+
BITFIELD dest GET i8 #0
118155
{{% /redis-cli %}}
119156

157+
2. Suppose you want to expose people to a book-related ad. The target audience is people who love to read books and are interested in fantasy, adventure, or science fiction. Assume you have the following bitmaps:
158+
159+
* `LRB` - people who love to read books.
160+
* `B:F` - people interested in fantasy.
161+
* `B:A` - people interested in adventure.
162+
* `B:SF` - people interested in science fiction.
163+
164+
To create a bitmap representing the target audience, use the following command:
165+
166+
```
167+
BITOP ANDOR TA LRB B:F B:A B:SF
168+
```
120169

121170
## Pattern: real time metrics using bitmaps
122171

content/commands/client-no-evict.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,23 @@ When turned on and client eviction is configured, the current connection will be
5050
When turned off, the current client will be re-included in the pool of potential clients to be evicted (and evicted if needed).
5151

5252
See [client eviction]({{< relref "/develop/reference/clients" >}}#client-eviction) for more details.
53+
54+
## Return information
55+
56+
{{< multitabs id="client-no-evict-return-info"
57+
tab1="RESP2"
58+
tab2="RESP3" >}}
59+
60+
One of the following:
61+
62+
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` if the command was successful.
63+
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: wrong number of or invalid arguments.
64+
65+
-tab-sep-
66+
67+
One of the following:
68+
69+
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` if the command was successful.
70+
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: wrong number of or invalid arguments.
71+
72+
{{< /multitabs >}}

content/commands/client-no-touch.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,23 @@ The `CLIENT NO-TOUCH` command controls whether commands sent by the client will
4747
When turned on, the current client will not change LFU/LRU stats, unless it sends the [`TOUCH`]({{< relref "/commands/touch" >}}) command.
4848

4949
When turned off, the client touches LFU/LRU stats just as a normal client.
50+
51+
## Return information
52+
53+
{{< multitabs id="client-no-touch-return-info"
54+
tab1="RESP2"
55+
tab2="RESP3" >}}
56+
57+
One of the following:
58+
59+
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` if the command was successful.
60+
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: wrong number of or invalid arguments.
61+
62+
-tab-sep-
63+
64+
One of the following:
65+
66+
* [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` if the command was successful.
67+
* [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: wrong number of or invalid arguments.
68+
69+
{{< /multitabs >}}

0 commit comments

Comments
 (0)