mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #3912] [MERGED] feat: add extended support for versioned entities in the CLI #4587
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#4587
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/3912
Author: @jamesgeorge007
Created: 3/19/2024
Status: ✅ Merged
Merged: 3/20/2024
Merged by: @AndrewBastin
Base:
release/2024.3.0← Head:feat/cli-support-versioning📝 Commits (3)
99ad3e5feat: add extended support for versioned entities in the CLI1e3aca0test: increase coveragecd76cf5chore: cleanup📊 Changes
14 files changed (+352 additions, -159 deletions)
View changed files
📝
packages/hoppscotch-cli/src/__tests__/commands/test.spec.ts(+86 -16)➖
packages/hoppscotch-cli/src/__tests__/functions/checks/isRESTCollection.spec.ts(+0 -84)➕
packages/hoppscotch-cli/src/__tests__/samples/collections/coll-v1-req-v0.json(+27 -0)➕
packages/hoppscotch-cli/src/__tests__/samples/collections/coll-v1-req-v1.json(+48 -0)➕
packages/hoppscotch-cli/src/__tests__/samples/collections/coll-v2-req-v2.json(+54 -0)➕
packages/hoppscotch-cli/src/__tests__/samples/collections/coll-v2-req-v3.json(+54 -0)📝
packages/hoppscotch-cli/src/__tests__/samples/collections/collection-level-headers-auth-coll.json(+6 -6)➕
packages/hoppscotch-cli/src/__tests__/samples/collections/sample-coll.json(+26 -0)➕
packages/hoppscotch-cli/src/__tests__/samples/environments/env-v0.json(+9 -0)➕
packages/hoppscotch-cli/src/__tests__/samples/environments/env-v1.json(+10 -0)📝
packages/hoppscotch-cli/src/options/test/env.ts(+1 -1)📝
packages/hoppscotch-cli/src/utils/checks.ts(+0 -44)📝
packages/hoppscotch-cli/src/utils/mutators.ts(+29 -5)📝
packages/hoppscotch-data/src/collection/index.ts(+2 -3)📄 Description
Description
The public data structures like
collections,requests&environmentsfollow versioning where the new fields being added are introduced as new versioned entities, Ref #3457. When a collection/environment file is imported into the app, it is translated to the latest version, so that the same variant of the incoming data can be consumed across from that point without ambiguities. For the CLI, this was the case for environments, but not with collections, especially withRESTrequests, previously it would expect the incoming request entry to conform to the latest schema and rejects if not.github.com/hoppscotch/hoppscotch@faab1d20fd/packages/hoppscotch-cli/src/utils/mutators.ts (L70-L76)github.com/hoppscotch/hoppscotch@faab1d20fd/packages/hoppscotch-cli/src/utils/checks.ts (L37-L41)github.com/hoppscotch/hoppscotch@faab1d20fd/packages/hoppscotch-data/src/rest/index.ts (L189-L191)This PR extends the support for versioned entities in the CLI by ensuring the supplied collection contents come in via verzod and are translated to the latest version before consumption.
Closes HFE-452.
Changes
vfield parsing for theHoppCollectionversioned entity. The intended type isnumber.isHoppRESTCollectionhelper and related test suite in favor of verzod based parsing.Checks
Note to reviewers
Please refer to the test suite and associated fixtures for sample collections & environment export files following different version ranges to verify the behavior.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.