Skip to content

feat: add credential setup guidance#23

Merged
utkarsh232005 merged 2 commits into
KDM-cli:mainfrom
fizyxbt:add-credential-setup-guidance
May 14, 2026
Merged

feat: add credential setup guidance#23
utkarsh232005 merged 2 commits into
KDM-cli:mainfrom
fizyxbt:add-credential-setup-guidance

Conversation

@fizyxbt
Copy link
Copy Markdown
Contributor

@fizyxbt fizyxbt commented May 14, 2026

Summary

  • show Discord webhook setup steps before asking for the webhook URL
  • show SMTP setup guidance before asking for email settings
  • move the SMTP password notice before the prompts and cover the guidance output in tests

Closes #22

Validation

  • npm test -- --run src/__tests__/config.test.ts
  • npm test
  • npm run build
  • git diff --check

Summary by CodeRabbit

  • New Features

    • The kdm config setup command now displays step-by-step setup guides for Discord webhooks and Email SMTP before prompting for credentials.
  • Tests

    • Expanded automated tests to assert the new guide messages appear and to verify their ordering relative to the first interactive prompt.

Review Change Stack

@fizyxbt fizyxbt requested a review from utkarsh232005 as a code owner May 14, 2026 12:25
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 571c3186-c65d-4902-af0f-4c53593f7506

📥 Commits

Reviewing files that changed from the base of the PR and between aaeb0a7 and 302e8e5.

📒 Files selected for processing (1)
  • src/__tests__/config.test.ts

📝 Walkthrough

Walkthrough

Prints step-by-step Discord webhook and Email SMTP guides to the console before prompting for credentials in kdm config setup; tests were extended to assert the guide messages and their ordering relative to the first interactive prompt.

Changes

Setup Guides for Service Configuration

Layer / File(s) Summary
Guide helper functions and flow integration
src/commands/config.ts
Two new non-exported helpers (printDiscordWebhookGuide, printEmailSmtpGuide) output formatted setup instructions. The config setup action calls the appropriate guide immediately after service selection and before credential prompts; the prior single-line SMTP password warning was removed.
Test helpers and assertions
src/__tests__/config.test.ts
Adds local test helpers to capture console.log and tui.input invocation order. Discord and Email setup tests now assert presence of additional guide messages (Discord: webhook setup and Integrations > Webhooks; Email: SMTP setup and KDM_SMTP_PASSWORD) and verify the guide logs occur before the first prompt.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • KDM-cli/kdm-cli#14: Introduced the base kdm config setup notification-setup flow extended here with guided credential instructions.

Poem

🔐 A prompt appears, then guides unfurl,
Discord and SMTP, step-by-step swirl.
Console lines lead before you reply,
No guesswork left — just copy and try. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding credential setup guidance for services before prompting for input.
Linked Issues check ✅ Passed The PR fully implements the requirements from issue #22: displaying step-by-step guidance for Discord and Email services before credential prompts, with corresponding test coverage.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #22—adding credential guidance for Discord and Email flows with tests; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📋 Issue Planner

Built with CodeRabbit's Coding Plans for faster development and fewer bugs.

View plan used: #22

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

Copy link
Copy Markdown
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: 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 `@src/__tests__/config.test.ts`:
- Around line 65-66: Update config.test.ts to assert ordering and add validation
edge-case tests: locate the tests that use consoleLogSpy (the expectations with
expect.stringMatching(/Discord webhook setup/i) and
expect.stringContaining('Integrations > Webhooks')) and replace/add assertions
that verify the guide log appears before the first credential prompt by
comparing indices in consoleLogSpy.mock.calls (e.g., find call index for the
guide message and the credential prompt message and assert guideIndex <
promptIndex). Also add separate tests exercising invalid Discord URL and missing
SMTP host paths (call the same setup/config loader used in these tests) and
assert they produce the expected validation error logs/messages or throw/exit
behavior (matching the project's existing error handling), using spies on
console.error or the process-exit behavior used elsewhere in the suite.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 22ed4e33-c6ed-481f-b6ea-a6b79194334a

📥 Commits

Reviewing files that changed from the base of the PR and between 53f57a1 and aaeb0a7.

📒 Files selected for processing (2)
  • src/__tests__/config.test.ts
  • src/commands/config.ts

Comment thread src/__tests__/config.test.ts
Comment thread src/commands/config.ts
Comment thread src/commands/config.ts
@utkarsh232005
Copy link
Copy Markdown
Member

@fizyxbt please add requested changes,thankyou!!

@utkarsh232005 utkarsh232005 merged commit 3582231 into KDM-cli:main May 14, 2026
2 checks passed
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.

Feature Request: Add Guided Credential Setup Instructions for Services

2 participants