-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(cli): Add functionality to operate on Environments #324
Conversation
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
Thanks @rajdip-b working on it |
@rajdip-b I have added implementation for list env can u please review it whenever you are free? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The structure looks good. You can continue your work. Here are the things you might want to fix:
- There can be many errors when you are calling the endpoints from the environment controller. It will be best to show the error that the API has send, rather than writing your own error message.
- You forgot to tie up the
EnvironmentCommand
inindex.ts
@rajdip-b I have made the changes as requested and made a good progress but I am stuck right now
|
|
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are my reviews:
- stick to using camelCase names.
- Use the controller from
api-client
package and delete the one you made.
I'll get started with this. |
@vr-varad could you please finish up this PR? |
Oh @rajdip-b yeah sure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would need to initialize and start the spinner BEFORE you make any calls to the API. That way the spinner will actually spin and is good DX. spin.start('')
is what you will use in place of intro
.
@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:
|
@rajdip-b Thanks for the guidance, I will surely go through this pr and make further changes in those prs. |
Co-authored-by: vr-varad <varadgupta21#gmail.com> Co-authored-by: Rajdip Bhattacharya <agentR47@gmail.com>
## [2.4.0](v2.3.0...v2.4.0) (2024-09-05) ### 🚀 Features * **api-client:** Create controller for Event module ([#399](#399)) ([122df35](122df35)) * **api-client:** Create controller for Integration module ([#397](#397)) ([697d38b](697d38b)) * **api-client:** Create controller for Project module ([#370](#370)) ([fa25866](fa25866)) * **api-client:** Create controller for Secret module ([#396](#396)) ([7e929c0](7e929c0)) * **api-client:** Create controller for Variable module ([#395](#395)) ([3e114d9](3e114d9)) * **api:** Add global search in workspace ([c49962b](c49962b)) * **api:** Add max page size ([#377](#377)) ([ed18eb0](ed18eb0)) * **cli:** Add functionality to operate on Environments ([#324](#324)) ([4c6f3f8](4c6f3f8)) * **cli:** Quit on decryption failure ([#381](#381)) ([1349d15](1349d15)) ### 🐛 Bug Fixes * **api-client:** Fixed broken export ([096df2c](096df2c)) * **api:** Add NotFound exception on passing an invalid roleId while inviting user in workspace ([#408](#408)) ([ab441db](ab441db)) * **cli:** Fixed missing module ([f7a091f](f7a091f)) * **platform:** Build failure in platform ([#385](#385)) ([90dcb2c](90dcb2c)) ### 🔧 Miscellaneous Chores * Add api client build script and updated CI ([da0e27a](da0e27a)) * **api:** Reorganized import using path alias ([d5befd1](d5befd1)) * **ci:** Update CLI CI name ([8f4c456](8f4c456)) * **cli:** Add Zod validation to parseInput function ([#362](#362)) ([34e6c39](34e6c39)) * Fixed api client tests and rearranged controllers ([1307604](1307604)) * Housekeeping ([c5f1330](c5f1330)) * **platform:** Added strict null check ([072254f](072254f)) * **web:** Added strict null check ([7e12b47](7e12b47)) ### 🔨 Code Refactoring * **api:** Update logic for forking projects ([#398](#398)) ([4cf3838](4cf3838))
## [2.4.0](keyshade-xyz/keyshade@v2.3.0...v2.4.0) (2024-09-05) ### 🚀 Features * **api-client:** Create controller for Event module ([keyshade-xyz#399](keyshade-xyz#399)) ([122df35](keyshade-xyz@122df35)) * **api-client:** Create controller for Integration module ([keyshade-xyz#397](keyshade-xyz#397)) ([697d38b](keyshade-xyz@697d38b)) * **api-client:** Create controller for Project module ([keyshade-xyz#370](keyshade-xyz#370)) ([fa25866](keyshade-xyz@fa25866)) * **api-client:** Create controller for Secret module ([keyshade-xyz#396](keyshade-xyz#396)) ([7e929c0](keyshade-xyz@7e929c0)) * **api-client:** Create controller for Variable module ([keyshade-xyz#395](keyshade-xyz#395)) ([3e114d9](keyshade-xyz@3e114d9)) * **api:** Add global search in workspace ([c49962b](keyshade-xyz@c49962b)) * **api:** Add max page size ([keyshade-xyz#377](keyshade-xyz#377)) ([ed18eb0](keyshade-xyz@ed18eb0)) * **cli:** Add functionality to operate on Environments ([keyshade-xyz#324](keyshade-xyz#324)) ([4c6f3f8](keyshade-xyz@4c6f3f8)) * **cli:** Quit on decryption failure ([keyshade-xyz#381](keyshade-xyz#381)) ([1349d15](keyshade-xyz@1349d15)) ### 🐛 Bug Fixes * **api-client:** Fixed broken export ([096df2c](keyshade-xyz@096df2c)) * **api:** Add NotFound exception on passing an invalid roleId while inviting user in workspace ([keyshade-xyz#408](keyshade-xyz#408)) ([ab441db](keyshade-xyz@ab441db)) * **cli:** Fixed missing module ([f7a091f](keyshade-xyz@f7a091f)) * **platform:** Build failure in platform ([keyshade-xyz#385](keyshade-xyz#385)) ([90dcb2c](keyshade-xyz@90dcb2c)) ### 🔧 Miscellaneous Chores * Add api client build script and updated CI ([da0e27a](keyshade-xyz@da0e27a)) * **api:** Reorganized import using path alias ([d5befd1](keyshade-xyz@d5befd1)) * **ci:** Update CLI CI name ([8f4c456](keyshade-xyz@8f4c456)) * **cli:** Add Zod validation to parseInput function ([keyshade-xyz#362](keyshade-xyz#362)) ([34e6c39](keyshade-xyz@34e6c39)) * Fixed api client tests and rearranged controllers ([1307604](keyshade-xyz@1307604)) * Housekeeping ([c5f1330](keyshade-xyz@c5f1330)) * **platform:** Added strict null check ([072254f](keyshade-xyz@072254f)) * **web:** Added strict null check ([7e12b47](keyshade-xyz@7e12b47)) ### 🔨 Code Refactoring * **api:** Update logic for forking projects ([keyshade-xyz#398](keyshade-xyz#398)) ([4cf3838](keyshade-xyz@4cf3838))
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
axios
and its dependencies.