Skip to content

chore: weekly workflow to bump pinned redis/docs commands SHA#5956

Closed
dantovska wants to merge 1 commit into
mainfrom
chore/commands-pin-bump-workflow
Closed

chore: weekly workflow to bump pinned redis/docs commands SHA#5956
dantovska wants to merge 1 commit into
mainfrom
chore/commands-pin-bump-workflow

Conversation

@dantovska
Copy link
Copy Markdown
Contributor

@dantovska dantovska commented May 21, 2026

Summary

Adds a scheduled workflow + Node script that watches redis/docs for changes to the commands_*.json files that the Command Helper depends on, and opens a PR bumping the pinned commit SHA when anything actually changes.

  • scripts/bump-commands-pin.mjs — reads REDIS_DOCS_COMMANDS_SHA from redisinsight/api/config/default.ts, fetches the latest commit on redis/docs main, diffs all 5 commands_*.json files at both SHAs, and rewrites the constant if (and only if) JSON content actually changed. SHA-only moves are skipped — no noise.
  • .github/workflows/bump-commands-pin.yml — runs weekly (Mon 06:00 UTC) and on manual dispatch. When the script reports changes, opens (or updates) a PR chore/bump-commands-pin via peter-evans/create-pull-request@v6.

The PR body the bot opens lists, per file: commands added, commands removed, and commands whose argument/schema changed — so a reviewer can scan whether the bump is safe to merge.

Dependency

Depends on the REDIS_DOCS_COMMANDS_SHA constant introduced in #5955. Merge that first; this workflow is a no-op without it.

Test plan

  • After RI-8197: Command Helper - Vector Set commands support #5955 merges, trigger `Bump redis/docs commands pin` via the Actions tab (workflow_dispatch). Verify it either reports "already up to date" or opens a PR with a populated diff summary.
  • Locally: `node scripts/bump-commands-pin.mjs --check` should print the diff summary without writing files.
  • Push a deliberate stale SHA to confirm the PR body lists real changes.

Note

Low Risk
Low-risk automation change that only adds a scheduled GitHub Action and script, but it can create recurring PR noise or fail if the expected REDIS_DOCS_COMMANDS_SHA constant is missing/changes format.

Overview
Adds a scheduled/manual GitHub Actions workflow to automatically bump the pinned redis/docs commit used for Command Helper command specs, opening/updating a PR when the upstream commands_*.json content changes.

Introduces scripts/bump-commands-pin.mjs, which fetches the latest redis/docs SHA, diffs the five commands_*.json files against the currently pinned SHA, skips SHA-only moves with no JSON changes, and (when changed) updates the pin and writes a generated markdown diff summary for the bot PR body.

Reviewed by Cursor Bugbot for commit a5eb09e. Bugbot is set up for automated code reviews on this repo. Configure here.

@dantovska dantovska requested a review from a team as a code owner May 21, 2026 09:42
@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented May 21, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ae61c9d. Configure here.

body-path: commands-pin-diff.md
labels: |
dependencies
delete-branch: true
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated summary file accidentally committed to repository

Medium Severity

The peter-evans/create-pull-request@v6 action commits all new and modified files by default. Since commands-pin-diff.md is written to the repo root and is not in .gitignore, it will be committed alongside the config change. The file is only intended as a temporary artifact for the PR body (via body-path), not as a tracked file in the repository. The workflow needs an add-paths option to restrict the commit to only redisinsight/api/config/default.ts.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ae61c9d. Configure here.

Adds scripts/bump-commands-pin.mjs and a scheduled workflow that runs
weekly (Mon 06:00 UTC) plus on manual dispatch. The script reads the
current REDIS_DOCS_COMMANDS_SHA from redisinsight/api/config/default.ts,
fetches the latest commit on redis/docs main, diffs all five
commands_*.json files at the two SHAs, and only opens a PR when the JSON
content actually changed (SHA-only moves are skipped). The PR body
summarises commands added / removed / schema-changed per file so a
reviewer can decide whether to merge.

Requires the REDIS_DOCS_COMMANDS_SHA constant introduced in #5955.
@dantovska dantovska force-pushed the chore/commands-pin-bump-workflow branch from ae61c9d to a5eb09e Compare May 21, 2026 13:58
@github-actions
Copy link
Copy Markdown
Contributor

Code Coverage - Backend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 92.67% 15636/16872
🟡 Branches 74.84% 4935/6594
🟢 Functions 86.75% 2435/2807
🟢 Lines 92.51% 14944/16154

Test suite run success

3436 tests passing in 307 suites.

Report generated by 🧪jest coverage report action from a5eb09e

@github-actions
Copy link
Copy Markdown
Contributor

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟡 Statements 79.44% 17542/22080
🟡 Branches 61.86% 8037/12991
🟡 Functions 67.94% 2433/3581
🟡 Lines 79.01% 16497/20879

@github-actions
Copy link
Copy Markdown
Contributor

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 82.86% 24710/29821
🟡 Branches 68.08% 10377/15242
🟡 Functions 78.08% 6679/8554
🟢 Lines 83.32% 24128/28959

Test suite run success

6965 tests passing in 802 suites.

Report generated by 🧪jest coverage report action from a5eb09e

@dantovska dantovska self-assigned this May 21, 2026

- uses: actions/setup-node@v4
with:
node-version: '20'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Do we need to explicitly set this?


- name: Open / update PR
if: steps.bump.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v6
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Is there an "official" action that we can use, instead of something 3rd party?

@dantovska
Copy link
Copy Markdown
Contributor Author

closing this. decided to go with different implementation

@dantovska dantovska closed this May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants