feat: add ek import command#77
Conversation
WalkthroughThis PR adds an import feature: a CLI import command plus parseDotenvContent to parse dotenv files (including quoted, multiline, and escaped values), client methods to select/create workspaces/projects/environments and POST secrets, local per-project config discovery via .enkryptify.json, command registration, and comprehensive unit and integration tests. Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/unit/import.test.ts`:
- Around line 47-49: The test currently reads a machine-specific absolute path;
change the fs.readFile call in tests/unit/import.test.ts to load a committed
fixture using a repo-relative path (build the path using __dirname and path.join
to a fixtures/test.env file) so the test reads the fixture cross-machine; keep
the rest of the test (parseDotenvContent usage) unchanged and ensure the fixture
file is committed under the test fixtures directory referenced.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9c532422-0ce8-4fac-8522-f725a4fdd96c
📒 Files selected for processing (10)
package.jsonsrc/api/client.tssrc/cmd/import.tssrc/cmd/index.tssrc/lib/config.tstests/helpers/fixtures.tstests/helpers/mock-api.tstests/integration/config.test.tstests/integration/import-command.test.tstests/unit/import.test.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/fixtures/test.env`:
- Line 14: Replace the credential-shaped secret value assigned to
STRIPE_SECRET_KEY with an obviously fake placeholder (e.g., use a clearly marked
token like sk_test_FAKE_PLACEHOLDER) and similarly replace any other
real-looking API keys or secrets in this fixture with parser-compatible fake
values; search for tokens that match secret patterns (e.g., STRIPE_SECRET_KEY
and other env entries in the same file) and update them to non-sensitive,
clearly fake placeholders while preserving the original formatting/quoting so
parsers/tests still exercise the same code paths.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 12385aeb-2b32-4e73-94ce-b0c26f5f4bbc
📒 Files selected for processing (2)
tests/fixtures/test.envtests/unit/import.test.ts
Summary by CodeRabbit
New Features
Chores
Tests