You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We reviewed changes in e34608a...074fd63 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.
- Drop internal/secrets/ package and keychain integration
- Simplify config manager to use TOML-only token storage
- Default host when config is empty, backfill user from server
- Fix subcommand help delegation
Signed-off-by: Jai Pradeesh <jai@deepsource.io>
- Remove redundant godoc and inline comments across codebase
- Extract auth status into smaller helper methods
- Add BackfillUser and default host logic to config manager
- Add tests for login edge cases, auth status, and config manager
The reason will be displayed to describe this comment to others. Learn more.
Test passes on error when it should fail
The test logic in TestLoginConfigLoadError is flawed. If cfgMgr.Load() returns an error after cmd.Execute(), it means the application failed to overwrite the corrupt configuration file with a valid one. The test currently logs this error and passes, masking a potential bug.
The test should instead fail explicitly if the configuration cannot be loaded after the login command has run. Replace the if err != nil block with a check that fails the test, for example using t.Fatalf().
The reason will be displayed to describe this comment to others. Learn more.
Function parameter `query` is declared but unused
The function assigned to mock.QueryFunc declares a parameter named query which is never used inside the function implementation. Unused parameters can confuse readers or indicate incomplete refactoring.
Rename or replace the unused query parameter with _ (underscore) to mark it explicitly as unused and improve code clarity and maintainability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.