fix: pass credential config username to auth callbacks#2346
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a utility to inject per-URL credential usernames from config into auth callbacks; fetch and push now wrap their onAuth/onAuthFailure handlers with this utility. A new fetch test confirms the configured username is passed to onAuth. ChangesCredential Username Configuration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/commands/push.js (1)
109-111: ⚡ Quick winAdd parity test coverage for push auth username injection.
Line 109 and Line 111 introduce the same callback wrapping behavior as fetch, but there’s no matching push-focused test in this PR. A targeted push test (401 flow + callback arg assertion) would lock this in and prevent regressions.
🤖 Prompt for 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. In `@src/commands/push.js` around lines 109 - 111, The push command now wraps onAuth and onAuthFailure with addCredentialUsername (see addCredentialUsername, onAuth, onAuthFailure in src/commands/push.js) but there’s no corresponding test to ensure the username gets injected during a 401 push flow; add a unit/integration test that mirrors the existing fetch auth-tests: simulate a 401 response from the push endpoint, assert the wrapped callback receives the injected username argument and that onAuth/onAuthFailure are called with the augmented credentials, and include a parity test case that verifies the same callback-arg behavior as the fetch tests to prevent regressions.
🤖 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.
Nitpick comments:
In `@src/commands/push.js`:
- Around line 109-111: The push command now wraps onAuth and onAuthFailure with
addCredentialUsername (see addCredentialUsername, onAuth, onAuthFailure in
src/commands/push.js) but there’s no corresponding test to ensure the username
gets injected during a 401 push flow; add a unit/integration test that mirrors
the existing fetch auth-tests: simulate a 401 response from the push endpoint,
assert the wrapped callback receives the injected username argument and that
onAuth/onAuthFailure are called with the augmented credentials, and include a
parity test case that verifies the same callback-arg behavior as the fetch tests
to prevent regressions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1ed42bcd-6ac2-471b-bc81-89c12164f630
📒 Files selected for processing (4)
__tests__/test-fetch.jssrc/commands/fetch.jssrc/commands/push.jssrc/utils/addCredentialUsername.js
|
Tests failed on typechecking:
The error came from |
|
Thanks for the fix. |
|
🎉 This PR is included in version 1.38.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Fixes #800
Tests
Summary by CodeRabbit
New Features
Tests