Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Incr, IncrBy and IncrByFloat commands. (String Commands) #79

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/npm-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,17 @@ jobs:
shell: bash
working-directory: ./node
run: |
npm publish --access public
set +e
# Redirect only stderr
{ npm_publish_err=$(npm publish --access public 2>&1 >&3 3>&-); } 3>&1
if [[ "$npm_publish_err" == *"You cannot publish over the previously published versions"* ]]
then
echo "Skipping publishing, package already published"
elif [[ ! -z "$npm_publish_err" ]]
then
echo "Failed to publish with error: ${npm_publish_err}"
exit 1
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

Expand Down
198 changes: 198 additions & 0 deletions .github/workflows/ort.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@

name: The OSS Review Toolkit (ORT)

on:
schedule:
- cron: "0 0 * * *"
pull_request:
paths:
- .github/workflows/ort.yml
- .github/workflows/run-ort-tools/action.yml
- utils/get_licenses_from_ort.py
workflow_dispatch:
inputs:
branch:
description: 'The branch to run against the ORT tool'
required: true
version:
description: 'The release version of GLIDE'
required: true
jobs:
run-ort:
name: Create attribution files
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
PYTHON_ATTRIBUTIONS: "python/THIRD_PARTY_LICENSES_PYTHON"
NODE_ATTRIBUTIONS: "node/THIRD_PARTY_LICENSES_NODE"
RUST_ATTRIBUTIONS: "glide-core/THIRD_PARTY_LICENSES_RUST"
steps:
- name: Set the release version
shell: bash
run: |
export version=`if ${{ github.event_name == 'schedule' || github.event_name == 'pull_request' }}; then echo '255.255.255'; else echo ${{ github.event.inputs.version }}; fi`
echo "RELEASE_VERSION=${version}" >> $GITHUB_ENV

- name: Set the base branch
run: |
export BASE_BRANCH=`if ${{ github.event_name == 'schedule'}}; then echo 'main'; elif ${{ github.event_name == 'workflow_dispatch'}}; then echo ${{ github.event.inputs.branch }}; else echo "";fi`
echo "Base branch is: ${BASE_BRANCH}"
echo "BASE_BRANCH=${BASE_BRANCH}" >> $GITHUB_ENV

- name: Checkout
uses: actions/checkout@v4
with:
submodules: "true"
ref: ${{ env.BASE_BRANCH }}

- name: Set up JDK 11 for the ORT package
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 11

- name: Cache ORT and Gradle packages
uses: actions/cache@v4
id: cache-ort
with:
path: |
./ort
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-ort

- name: Checkout ORT Repository
if: steps.cache-ort.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: "oss-review-toolkit/ort"
path: "./ort"
ref: main
submodules: recursive

- name: Checkout ORT latest release tag
if: steps.cache-ort.outputs.cache-hit != 'true'
working-directory: ./ort/
run: |
# Get new tags from remote
git fetch --tags
# Get latest tag name
LATEST_TAG=$(git describe --tags "$(git rev-list --tags --max-count=1)")
# Checkout latest tag
git checkout $LATEST_TAG

- name: Install ORT
if: steps.cache-ort.outputs.cache-hit != 'true'
working-directory: ./ort/
run: |
export JAVA_OPTS="$JAVA_OPTS -Xmx8g"
./gradlew installDist

- name: Create ORT config file
run: |
mkdir -p ~/.ort/config
cat << EOF > ~/.ort/config/config.yml
ort:
analyzer:
allowDynamicVersions: true
enabledPackageManagers: [Cargo, NPM, PIP]
EOF
cat ~/.ort/config/config.yml

### NodeJS ###

- name: Set up Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Create package.json file for the Node wrapper
uses: ./.github/workflows/node-create-package-file
with:
release_version: ${{ env.RELEASE_VERSION }}
os: "ubuntu-latest"

- name: Fix Node base NPM package.json file for ORT
working-directory: ./node/npm/glide
run: |
# Remove the glide-rs dependency to avoid duplication
sed -i '/ "glide-rs":/d' ../../package.json
export pkg_name=glide-for-redis-base
export package_version="${{ env.RELEASE_VERSION }}"
export scope=`if [ "$NPM_SCOPE" != '' ]; then echo "$NPM_SCOPE/"; fi`
mv package.json package.json.tmpl
envsubst < package.json.tmpl > "package.json"
cat package.json

- name: Run ORT tools for Node
uses: ./.github/workflows/run-ort-tools
with:
folder_path: "${{ github.workspace }}/node"

### Python ###

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install python-inspector
working-directory: ./python
run: |
python -m pip install --upgrade pip
pip install git+https://github.com/nexB/python-inspector

- name: Run ORT tools for Python
uses: ./.github/workflows/run-ort-tools
with:
folder_path: "${{ github.workspace }}/python"

### Rust ###

- name: Run ORT tools for Rust
uses: ./.github/workflows/run-ort-tools
with:
folder_path: "${{ github.workspace }}/glide-core"

### Process results ###

- name: Check for diff
run: |
cp python/ort_results/NOTICE_DEFAULT $PYTHON_ATTRIBUTIONS
cp node/ort_results/NOTICE_DEFAULT $NODE_ATTRIBUTIONS
cp glide-core/ort_results/NOTICE_DEFAULT $RUST_ATTRIBUTIONS
GIT_DIFF=`git diff $PYTHON_ATTRIBUTIONS $NODE_ATTRIBUTIONS $RUST_ATTRIBUTIONS`
if [ -n "$GIT_DIFF" ]; then
echo "FOUND_DIFF=true" >> $GITHUB_ENV
else
echo "FOUND_DIFF=false" >> $GITHUB_ENV
fi

- name: Retrieve licenses list
working-directory: ./utils
run: |
{
echo 'LICENSES_LIST<<EOF'
python3 get_licenses_from_ort.py
echo EOF
} >> "$GITHUB_ENV"

### Create PR ###

- name: Create pull request
if: ${{ env.FOUND_DIFF == 'true' && github.event_name != 'pull_request' }}
run: |
export BRANCH_NAME=`if ${{ github.event_name == 'schedule' || github.event_name == 'pull_request' }}; then echo "scheduled-ort"; else echo "ort-v${{ github.event.inputs.version }}"; fi`
echo "Creating pull request from branch ${BRANCH_NAME} to branch ${{ env.BASE_BRANCH }}"
git config --global user.email "[email protected]"
git config --global user.name "ort-bot"
git checkout -b ${BRANCH_NAME}

git add $PYTHON_ATTRIBUTIONS $NODE_ATTRIBUTIONS $RUST_ATTRIBUTIONS
git commit -m "Updated attribution files"
git push --set-upstream origin ${BRANCH_NAME} -f
title="Updated attribution files for ${BRANCH_NAME}"
gh pr create -B ${{ env.BASE_BRANCH }} -H ${BRANCH_NAME} --title "${title}" --body 'Created by Github action.\n${{ env.LICENSES_LIST }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/run-ort-tools/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Run the OSS review tool

inputs:
folder_path:
description: "The root folder to run the ORT tool from"
required: true
type: string

runs:
using: "composite"
steps:
- name: Run ORT tools
working-directory: ./ort/
shell: bash
run: |
echo "Running ORT tools for ${{ inputs.folder_path }}"
FOLDER=${{ inputs.folder_path }}
mkdir $FOLDER/ort_results
# Analyzer (analyzer-result.json)
./gradlew cli:run --args="analyze -i $FOLDER -o $FOLDER/ort_results -f JSON"

# NOTICE DEFAULT
./gradlew cli:run --args="report -i $FOLDER/ort_results/analyzer-result.json -o $FOLDER/ort_results/ -f PlainTextTemplate"
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
## 0.1.0
## 0.2.0 (2024-02-11)

#### Changes
* Python, Node: Added ZCARD command ([#877](https://github.com/aws/glide-for-redis/pull/885), [#885](https://github.com/aws/glide-for-redis/pull/885))
* Python, Node: Added ZADD and ZADDINCR commands ([#814](https://github.com/aws/glide-for-redis/pull/814), [#830](https://github.com/aws/glide-for-redis/pull/830))
* Python, Node: Added ZREM command ([#834](https://github.com/aws/glide-for-redis/pull/834), [#831](https://github.com/aws/glide-for-redis/pull/831))
* Python, Node: Added ZSCORE command ([#885](https://github.com/aws/glide-for-redis/pull/885), [#871](https://github.com/aws/glide-for-redis/pull/871))
* Use jemalloc as default allocator. ([#847](https://github.com/aws/glide-for-redis/pull/847))
* Python, Node: Added RPOPCOUNT and LPOPCOUNT to transaction ([#874](https://github.com/aws/glide-for-redis/pull/874))
* Standalone client: Improve connection errors. ([#854](https://github.com/aws/glide-for-redis/pull/854))
* Python, Node: When recieving LPOP/RPOP with count, convert result to Array. ([#811](https://github.com/aws/glide-for-redis/pull/811))

#### Features
* Python, Node: Added support in Lua Scripts ([#775](https://github.com/aws/glide-for-redis/pull/775), [#860](https://github.com/aws/glide-for-redis/pull/860))
* Node: Allow chaining function calls on transaction. ([#902](https://github.com/aws/glide-for-redis/pull/902))

#### Fixes
* Core: Fixed `Connection Refused` error not to close the client ([#872](https://github.com/aws/glide-for-redis/pull/872))
* Socket listener: fix identifier for closed reader error. ([#853](https://github.com/aws/glide-for-redis/pull/853))
* Node: Fix issues with type import & exports ([#767](https://github.com/aws/glide-for-redis/pull/767))
* Core: Added handling to "?" and NULL hostnames in CLUSTER SLOTS ([#104](https://github.com/amazon-contributing/redis-rs/pull/104))
* Core: Cluster connection now reconnects after full disconnect. ([#100](https://github.com/amazon-contributing/redis-rs/pull/100))

## 0.1.0 (2024-01-17)

Preview release of **GLIDE for Redis** a Polyglot Redis client.

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ async fn get_connection(args: &Args) -> Client {
}

async fn single_benchmark_task(
connections: &Vec<Client>,
connections: &[Client],
counter: Arc<AtomicUsize>,
number_of_operations: usize,
number_of_concurrent_tasks: usize,
Expand Down
Loading
Loading