Skip to content
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: introduces ability to export single environment variables and allow CLI to accept the export format used by the app #3380

Conversation

JoelJacobStephen
Copy link
Contributor

@JoelJacobStephen JoelJacobStephen commented Sep 21, 2023

Ticket

Closes HFE-203

Description

This PR introduces the following features and fixes to the Hoppscotch App and Hoppscotch CLI

Features Added:

  • Added the ability to export single environment variables from the Hoppscotch App
  • CLI can now accept environment variables from the format in which the Hoppscotch App exports.
  • Introduced Zod package into the Hoppscotch CLI to check the validity of the formats for the Environment variables.
  • CLI now informs the user that bulk environment export is not supported by the CLI when the file matches the bulk export format.

Issues Fixes:

  • Fix the malformed environments error when importing a environment file that was exported from the Hoppscotch App to the CLI.
  • Fix the issue when there are are no error messages being given when it is a malformed environment error

Objectives

  • Add ability to export single environment variables
  • On export of environment variables, remove id from environment and send only the name and variables.
  • The CLI should be able to receive the format that is exported when exporting environment variables from the Hoppscotch App.
  • Fix the malformed environments error when importing a environment file that was exported from the app to the CLI.
  • CLI should inform the user that bulk environment export is not supported by the CLI when the file matches the bulk export format.

Note

Requires changes to the Documentation as the CLI can now accept the format that the Hoppscotch App uses to export environment variables. The new format must be mentioned in the documentation. Also need to mention that bulk environment export is not supported by the CLI.

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

@JoelJacobStephen JoelJacobStephen self-assigned this Sep 21, 2023
@JoelJacobStephen JoelJacobStephen changed the title feat: introduces ability to export single environment variables and also allow CLI to accept the export format used by the app feat: introduces ability to export single environment variables and allow CLI to accept the export format used by the app Sep 21, 2023
@JoelJacobStephen JoelJacobStephen marked this pull request as ready for review September 22, 2023 03:45
Copy link
Member

@nivedin nivedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exporting of only personal environments is done we need to implement the same for team environment as well

Copy link
Member

@nivedin nivedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💯

Copy link
Member

@jamesgeorge007 jamesgeorge007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you verify if the CLI accepts the environment exported as a whole? It was throwing when I gave it a shot.

Copy link
Member

@jamesgeorge007 jamesgeorge007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left a few minor comments. As discussed, let's add tests for the changes. Also, please ensure to raise a PR for the docs updates required.

@AndrewBastin AndrewBastin merged commit 185c225 into hoppscotch:release/2023.8.2 Oct 6, 2023
1 check 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.

None yet

4 participants