Skip to content

Conversation

@jacekradko
Copy link
Member

@jacekradko jacekradko commented Jun 4, 2025

Description

Fixes: SDKI-954

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link

changeset-bot bot commented Jun 4, 2025

⚠️ No Changeset found

Latest commit: 8614418

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@jacekradko jacekradko changed the title feat:brkr-brkr feat: snapi Jun 4, 2025
@vercel
Copy link

vercel bot commented Jun 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Sep 23, 2025 6:53pm

@jacekradko jacekradko marked this pull request as draft June 4, 2025 14:45

async checkoutBranch(branch: string): Promise<void> {
try {
execSync(`git checkout ${branch}`, {

Check warning

Code scanning / CodeQL

Unsafe shell command constructed from library input Medium

This string concatenation which depends on
library input
is later used in a
shell command
.

async getLastCommit(branch: string): Promise<string> {
try {
const commit = execSync(`git rev-parse ${branch}`, {

Check warning

Code scanning / CodeQL

Unsafe shell command constructed from library input Medium

This string concatenation which depends on
library input
is later used in a
shell command
.

Copilot Autofix

AI 6 months ago

To fix the issue, we will replace the use of execSync with string interpolation by using a safer API, execFileSync, which allows passing arguments as an array. This approach avoids shell interpretation of special characters in the input. Specifically:

  1. Replace the execSync call on line 34 with execFileSync, passing branch as an argument in an array.
  2. Ensure that the branch parameter is passed as-is without being interpolated into a shell command string.

No additional dependencies are required for this fix.


Suggested changeset 1
tools/snapi/src/utils/git-manager.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tools/snapi/src/utils/git-manager.ts b/tools/snapi/src/utils/git-manager.ts
--- a/tools/snapi/src/utils/git-manager.ts
+++ b/tools/snapi/src/utils/git-manager.ts
@@ -33,3 +33,3 @@
     try {
-      const commit = execSync(`git rev-parse ${branch}`, {
+      const commit = execSync('git', ['rev-parse', branch], {
         cwd: this.workspaceRoot,
EOF
@@ -33,3 +33,3 @@
try {
const commit = execSync(`git rev-parse ${branch}`, {
const commit = execSync('git', ['rev-parse', branch], {
cwd: this.workspaceRoot,
Copilot is powered by AI and may make mistakes. Always verify output.

async fetchBranch(branch: string): Promise<void> {
try {
execSync(`git fetch origin ${branch}`, {

Check warning

Code scanning / CodeQL

Unsafe shell command constructed from library input Medium

This string concatenation which depends on
library input
is later used in a
shell command
.

Copilot Autofix

AI 6 months ago

To fix the issue, we will replace the use of execSync with a safer alternative. Specifically, we will use child_process.execFileSync, which allows us to pass arguments as an array, avoiding the need for shell interpretation. This approach ensures that special characters in the branch parameter are treated as literal strings rather than being interpreted by the shell.

The changes will involve:

  1. Replacing the string interpolation in the execSync call with an execFileSync call.
  2. Passing the branch parameter as an argument in an array to execFileSync.

Suggested changeset 1
tools/snapi/src/utils/git-manager.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tools/snapi/src/utils/git-manager.ts b/tools/snapi/src/utils/git-manager.ts
--- a/tools/snapi/src/utils/git-manager.ts
+++ b/tools/snapi/src/utils/git-manager.ts
@@ -1,2 +1,2 @@
-import { execSync } from 'child_process';
+import { execSync, execFileSync } from 'child_process';
 
@@ -91,3 +91,3 @@
     try {
-      execSync(`git fetch origin ${branch}`, {
+      execFileSync('git', ['fetch', 'origin', branch], {
         cwd: this.workspaceRoot,
EOF
@@ -1,2 +1,2 @@
import { execSync } from 'child_process';
import { execSync, execFileSync } from 'child_process';

@@ -91,3 +91,3 @@
try {
execSync(`git fetch origin ${branch}`, {
execFileSync('git', ['fetch', 'origin', branch], {
cwd: this.workspaceRoot,
Copilot is powered by AI and may make mistakes. Always verify output.
@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2025

🔍 API Changes Report

✅ No API Changes

CI Status


Summary

✅ No API changes detected in any packages.

All public APIs remain stable and backward compatible.


Next Steps

✅ No API changes detected.

Safe to merge.


This report was generated by the API Breakage Detector. For more information, see the documentation.


🤖 This comment was automatically generated by the API Breakage Detector

@clerk-cookie
Copy link
Collaborator

Hello 👋

We currently close PRs after 60 days of inactivity. It's been 50 days since the last update here. If we missed this PR, please reply here. Otherwise, we'll close this PR in 10 days.

Thanks for being a part of the Clerk community! 🙏

@clerk-cookie
Copy link
Collaborator

Hello 👋

We currently close PRs after 60 days of inactivity. It's been 50 days since the last update here. If we missed this PR, please reply here. Otherwise, we'll close this PR in 10 days.

Thanks for being a part of the Clerk community! 🙏

- Combined both sets of tasks in turbo.json (machine/custom integration tests and api snapshot tasks)
- Regenerated pnpm-lock.yaml to resolve dependency conflicts
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jr.feat/snapi

Comment @coderabbitai help to get the list of available commands and usage tips.

@clerk-cookie
Copy link
Collaborator

Hello 👋

We currently close PRs after 60 days of inactivity. It's been 50 days since the last update here. If we missed this PR, please reply here. Otherwise, we'll close this PR in 10 days.

Thanks for being a part of the Clerk community! 🙏

@clerk-cookie clerk-cookie added Stale and removed Stale labels Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants