[PR #5127] [MERGED] feat: add support for version bounded parsing and migration #5070

Closed
opened 2026-03-17 02:33:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5127
Author: @jamesgeorge007
Created: 6/4/2025
Status: Merged
Merged: 6/5/2025
Merged by: @jamesgeorge007

Base: mainHead: feat/versioned-entity-enhancements


📝 Commits (1)

  • 381de9f feat: add support for version bounded parsing and migration

📊 Changes

20 files changed (+446 additions, -102 deletions)

View changed files

📝 packages/hoppscotch-cli/package.json (+2 -2)
📝 packages/hoppscotch-cli/src/__tests__/e2e/commands/test.spec.ts (+18 -0)
packages/hoppscotch-cli/src/__tests__/e2e/fixtures/collections/invalid-mixed-versions-coll.json (+48 -0)
packages/hoppscotch-cli/src/__tests__/e2e/fixtures/collections/valid-mixed-versions-coll.json (+90 -0)
📝 packages/hoppscotch-cli/src/__tests__/unit/fixtures/workspace-access.mock.ts (+76 -2)
📝 packages/hoppscotch-cli/src/__tests__/unit/workspace-access.spec.ts (+24 -6)
📝 packages/hoppscotch-cli/src/utils/workspace-access.ts (+48 -14)
📝 packages/hoppscotch-common/package.json (+1 -1)
📝 packages/hoppscotch-data/package.json (+2 -2)
📝 packages/hoppscotch-data/src/collection/v/1.ts (+5 -5)
📝 packages/hoppscotch-data/src/collection/v/2.ts (+14 -6)
📝 packages/hoppscotch-data/src/collection/v/3.ts (+14 -6)
📝 packages/hoppscotch-data/src/collection/v/4.ts (+17 -7)
📝 packages/hoppscotch-data/src/collection/v/5.ts (+17 -7)
📝 packages/hoppscotch-data/src/collection/v/6.ts (+17 -7)
📝 packages/hoppscotch-data/src/collection/v/7.ts (+17 -7)
📝 packages/hoppscotch-data/src/collection/v/8.ts (+18 -8)
📝 packages/hoppscotch-selfhost-desktop/package.json (+2 -2)
📝 packages/hoppscotch-selfhost-web/package.json (+1 -1)
📝 pnpm-lock.yaml (+15 -19)

📄 Description

This PR introduces enhancements to the CLI Collection runner, including:

  • Support for mixed versions: Allows child collections to be based on different schema versions than the parent collection.
  • Improved compatibility with legacy ID (collection/environment) formats: Enhances support for incoming data using ID formats from older versions.

Closes #5119, HFE-893.

What's changed

  • Onboard enhancements to the HoppCollection versioned entity adding the ability to support children conforming to different version ranges. Leverages the entityRefUptoVersion() function addition on verzod end specifying valid version range for child collections, ref.
  • Bump verzod across packages.
  • Relevant updates to the test suite.
  • Bumps zod under selfhost-desktop.

Notes to reviewers

Try running a collection via the CLI where child collection entries are based on a different version than the parent collection. For instance, the collection here.

P.S: This is intended to be merged straightaway to main to issue a patch release for the CLI and the remaining changes scoped under hoppscotch-common, hoppscotch-selfhost-web, etc will be released separately alongside the usual patch release since they don't have an effect as such due to gracefully handling imports failing schema parsing.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5127 **Author:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Created:** 6/4/2025 **Status:** ✅ Merged **Merged:** 6/5/2025 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `main` ← **Head:** `feat/versioned-entity-enhancements` --- ### 📝 Commits (1) - [`381de9f`](https://github.com/hoppscotch/hoppscotch/commit/381de9f50529c6d75bb7518bb26dca7c63d7283a) feat: add support for version bounded parsing and migration ### 📊 Changes **20 files changed** (+446 additions, -102 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-cli/package.json` (+2 -2) 📝 `packages/hoppscotch-cli/src/__tests__/e2e/commands/test.spec.ts` (+18 -0) ➕ `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/collections/invalid-mixed-versions-coll.json` (+48 -0) ➕ `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/collections/valid-mixed-versions-coll.json` (+90 -0) 📝 `packages/hoppscotch-cli/src/__tests__/unit/fixtures/workspace-access.mock.ts` (+76 -2) 📝 `packages/hoppscotch-cli/src/__tests__/unit/workspace-access.spec.ts` (+24 -6) 📝 `packages/hoppscotch-cli/src/utils/workspace-access.ts` (+48 -14) 📝 `packages/hoppscotch-common/package.json` (+1 -1) 📝 `packages/hoppscotch-data/package.json` (+2 -2) 📝 `packages/hoppscotch-data/src/collection/v/1.ts` (+5 -5) 📝 `packages/hoppscotch-data/src/collection/v/2.ts` (+14 -6) 📝 `packages/hoppscotch-data/src/collection/v/3.ts` (+14 -6) 📝 `packages/hoppscotch-data/src/collection/v/4.ts` (+17 -7) 📝 `packages/hoppscotch-data/src/collection/v/5.ts` (+17 -7) 📝 `packages/hoppscotch-data/src/collection/v/6.ts` (+17 -7) 📝 `packages/hoppscotch-data/src/collection/v/7.ts` (+17 -7) 📝 `packages/hoppscotch-data/src/collection/v/8.ts` (+18 -8) 📝 `packages/hoppscotch-selfhost-desktop/package.json` (+2 -2) 📝 `packages/hoppscotch-selfhost-web/package.json` (+1 -1) 📝 `pnpm-lock.yaml` (+15 -19) </details> ### 📄 Description This PR introduces enhancements to the CLI Collection runner, including: - `Support for mixed versions`: Allows child collections to be based on different schema versions than the parent collection. - `Improved compatibility with legacy ID (collection/environment) formats`: Enhances support for incoming data using ID formats from older versions. Closes #5119, HFE-893. ### What's changed - Onboard enhancements to the `HoppCollection` versioned entity adding the ability to support children conforming to different version ranges. Leverages the `entityRefUptoVersion()` function addition on `verzod` end specifying valid version range for child collections, [ref](https://github.com/AndrewBastin/verzod?tab=readme-ov-file#version-bounded-parsing-and-migration). - Bump `verzod` across packages. - Relevant updates to the test suite. - Bumps `zod` under `selfhost-desktop`. ### Notes to reviewers Try running a collection via the CLI where child collection entries are based on a different version than the parent collection. For instance, the collection [here](https://github.com/hoppscotch/hoppscotch/blob/06d7482e4df3f5f0e7e42fcfb5011dde572e9fa3/packages/hoppscotch-cli/src/__tests__/e2e/fixtures/collections/valid-mixed-versions-coll.json). P.S: This is intended to be merged straightaway to `main` to issue a patch release for the CLI and the remaining changes scoped under `hoppscotch-common`, `hoppscotch-selfhost-web`, etc will be released separately alongside the usual patch release since they don't have an effect as such due to gracefully handling imports failing schema parsing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:33:01 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5070
No description provided.