Closed vr-varad closed 2 months ago
โฑ๏ธ Estimated effort to review: 3 ๐ต๐ต๐ตโชโช |
๐งช No relevant tests |
๐ No security concerns identified |
โก Key issues to review **Possible Bug:** The `EnvironmentController` methods do not handle API responses correctly. The variable `response` is used but never assigned a value from an actual API call, which will lead to runtime errors. **Code Quality:** The methods in `EnvironmentController` are returning `response.data` directly without checking if the response is successful or handling potential errors. **Logging:** The use of `console.log` for outputting results in `EnvironmentCommandImpl` methods is not suitable for production environments. Consider using a more robust logging approach or handling the outputs differently. |
Category | Suggestion | Score |
Possible issue |
Add error handling to manage potential errors in the
___
**Consider adding error handling in the | 8 |
Add error handling to manage potential errors in the
___
**Add error handling in the | 8 | |
Add error handling to manage potential errors in the
___
**Add error handling in the | 8 | |
Add error handling to manage potential errors in the
___
**Add error handling in the | 8 |
Hey @vr-varad! This PR doesn't follow the development conventions for our CLI unfortunately.
Could you please refer to the profile
command to understand how this works?
Feel free to ping us if you feel you are stuck somewhere :) We will never want you to redo everything!
@vr-varad You can use these docs links:
Thanks @rajdip-b working on it
@rajdip-b I have added implementation for list env can u please review it whenever you are free?
@rajdip-b I have made the changes as requested and made a good progress but I am stuck right now
BaseCommand
automatically parses the base URL and API key. You can reference them in any of the subclasses using this.baseUrl
and this.apiKey
. Refer to this to see how to pass in the keys. Also, the profile use <profile_name>
](https://docs.keyshade.xyz/cli/profile) comes in handy to set up a profile and use it. For example, you have created a profile that has your current api key and base url, and set it as the default one. For the subsequent commands that will invoke the API, you wont need to set the global --api-key
, --base-url
or --profile
flags@rajdip-b I have made the required changes from what I could understand. I need a check from you so I can know if I am wrong. what I got if u are creating an env u must have a profile in turn having baseurl and apikey use I use this to fetch both.
@rajdip-b
@rajdip-b
I'll get started with this.
@rajdip-b Thanks bro for helping out.
@rajdip-b done.
@rajdip-b resolved all the requested changes please give it a review whenever you are free and let me know if any changes are required.
@rajdip-b Sorry for not paying attention, won't happen again. Error Resolved
This looks good. I'll test it out locally and let you know
@vr-varad could you please finish up this PR?
Oh @rajdip-b yeah sure.
@vr-varad can you fix the conflict? I've just pushed some new changes. After this, I can test your PR
@vr-varad hey man, I found a lot of errors in the code. I expected you to test them out when you built the feature. I've fixed all the errors and also refactored how responses are dealt with in the api-client.
You have other PRs related to the API client and CLI. I would like you to follow this PR example and implement the changes in there.
Things to note while updating the other PRs:
action
methods.@rajdip-b Thanks for the guidance, I will surely go through this pr and make further changes in those prs. Thanks bro.
User description
Description
Give a summary of the change that you have made
Fixes #300
Dependencies
axios
Future Improvements
will be adding apis
Mentions
Mention and tag the people
Screenshots of relevant screens
Add screenshots of relevant screens
Developer's checklist
If changes are made in the code:
Documentation Update
PR Type
Enhancement, Dependencies
Description
EnvironmentCommand
interface for environment operations.EnvironmentCommand
interface inEnvironmentCommandImpl
class with methods to list, get, create, update, and delete environments.EnvironmentController
class for making API calls related to environments.axios
dependency to handle HTTP requests.pnpm-lock.yaml
to includeaxios
and its dependencies.Changes walkthrough ๐
command.interface.ts
Define `EnvironmentCommand` interface for environment operations
apps/cli/src/commands/command.interface.ts
EnvironmentCommand
interface with methods for environmentoperations.
environment.command.ts
Implement `EnvironmentCommand` interface in `EnvironmentCommandImpl`
apps/cli/src/commands/environment/environment.command.ts
EnvironmentCommand
interface inEnvironmentCommandImpl
class.
project.ts
Create `EnvironmentController` class for environment API calls
apps/cli/src/http/project.ts
EnvironmentController
class with methods for API calls.package.json
Add `axios` dependency and reorder dependencies
package.json
axios
dependency.pnpm-lock.yaml
Update lock file for `axios` dependency
pnpm-lock.yaml - Updated lock file to include `axios` and its dependencies.