Skip to content

chore(repo): Add 1Password CLI script #6168

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

Merged
merged 1 commit into from
Jun 23, 2025
Merged

chore(repo): Add 1Password CLI script #6168

merged 1 commit into from
Jun 23, 2025

Conversation

dstaley
Copy link
Member

@dstaley dstaley commented Jun 20, 2025

Description

This PR adds a new pnpm integration:secrets script that uses the 1Password CLI to setup integration/.env.local and integration/.keys.json automatically from the Clerk Shared vault.

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:

Summary by CodeRabbit

  • New Features

    • Added an automated script to fetch integration environment and key files from 1Password, streamlining test setup.
    • Introduced a new npm script for easy retrieval of integration secrets.
  • Documentation

    • Simplified and updated integration test suite setup instructions for improved clarity and ease of use.

Copy link

vercel bot commented Jun 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2025 7:41pm

Copy link

changeset-bot bot commented Jun 20, 2025

🦋 Changeset detected

Latest commit: f58f3c6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

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

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Contributor

coderabbitai bot commented Jun 20, 2025

📝 Walkthrough

Walkthrough

A new Node.js script was added to automate the retrieval of environment and key files from 1Password using its CLI, with the script placed at scripts/1password-keys.mjs. The package.json file was updated to include a new npm script, integration:secrets, which executes this script. The integration test suite setup instructions in integration/README.md were revised to reflect this automation, replacing manual steps with a single command. Additionally, an empty changeset file was created in the .changeset directory. No changes were made to exported or public entities in the codebase.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
scripts/1password-keys.mjs (3)

3-5: Fix import sorting and unused variables.

The static analysis tools have identified some issues that should be addressed:

  1. Import sorting needs to be fixed
  2. Unused error parameters should be prefixed with underscore

Apply this diff to fix the linting issues:

-import { writeFile } from 'node:fs/promises';
-import { join } from 'node:path';
-import { $ } from 'zx';
+import { join } from 'node:path';
+import { writeFile } from 'node:fs/promises';
+
+import { $ } from 'zx';

22-24: Fix unused error parameter.

The error parameter is unused and should be prefixed with underscore to satisfy linting rules.

Apply this diff:

-  .catch(err => {
+  .catch(_err => {

34-36: Fix unused error parameter.

The error parameter is unused and should be prefixed with underscore to satisfy linting rules.

Apply this diff:

-  .catch(err => {
+  .catch(_err => {
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 52d5e57 and f58f3c6.

📒 Files selected for processing (4)
  • .changeset/odd-doors-sneeze.md (1 hunks)
  • integration/README.md (1 hunks)
  • package.json (1 hunks)
  • scripts/1password-keys.mjs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.md`: Follow all instructions, patterns and conventions that are defined in these MD files.

**/*.md: Follow all instructions, patterns and conventions that are defined in these MD files.

  • integration/README.md
🪛 ESLint
scripts/1password-keys.mjs

[error] 3-5: Run autofix to sort these imports!

(simple-import-sort/imports)


[error] 22-22: 'err' is defined but never used. Allowed unused args must match /^_/u.

(no-unused-vars)


[error] 22-22: 'err' is defined but never used. Allowed unused args must match /^_/u.

(@typescript-eslint/no-unused-vars)


[error] 34-34: 'err' is defined but never used. Allowed unused args must match /^_/u.

(no-unused-vars)


[error] 34-34: 'err' is defined but never used. Allowed unused args must match /^_/u.

(@typescript-eslint/no-unused-vars)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
.changeset/odd-doors-sneeze.md (1)

1-3: LGTM! Standard changeset file structure.

The empty changeset file is appropriate for internal tooling changes that don't require version bumps for published packages.

package.json (1)

18-18: LGTM! Well-named script that follows existing conventions.

The new integration:secrets script is appropriately named and placed among other integration-related scripts.

integration/README.md (1)

27-30: Excellent simplification of the setup process.

The updated documentation significantly improves developer experience by replacing manual steps with a single automated command. The prerequisites are clearly stated and the instructions are easy to follow.

scripts/1password-keys.mjs (3)

7-12: Excellent 1Password CLI validation.

The script properly validates that the 1Password CLI is installed before attempting to use it, with clear error messaging and appropriate exit codes.


14-43: Robust error handling for 1Password operations.

The script handles 1Password CLI failures gracefully by checking exit codes and providing helpful error messages. The fallback to null values and subsequent validation ensures users get clear guidance when the CLI isn't properly configured.


45-48: Secure file writing with appropriate success feedback.

The script writes files to the correct integration directory and provides clear confirmation of successful operation.

Copy link

pkg-pr-new bot commented Jun 20, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@6168

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@6168

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@6168

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@6168

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@6168

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@6168

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@6168

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@6168

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@6168

@clerk/express

npm i https://pkg.pr.new/@clerk/express@6168

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@6168

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@6168

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@6168

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@6168

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@6168

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@6168

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@6168

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@6168

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@6168

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@6168

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@6168

@clerk/types

npm i https://pkg.pr.new/@clerk/types@6168

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@6168

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@6168

commit: f58f3c6

Copy link
Member

@brkalow brkalow left a comment

Choose a reason for hiding this comment

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

🎉

Copy link
Member

@wobsoriano wobsoriano left a comment

Choose a reason for hiding this comment

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

that was ⚡

@dstaley dstaley merged commit e2c874b into main Jun 23, 2025
40 checks passed
@dstaley dstaley deleted the ds.feat/1pass-keys branch June 23, 2025 17:06
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.

5 participants