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

Move getRegistry to registry package #5403

Open
nambrot opened this issue Feb 7, 2025 · 1 comment · May be fixed by #5491
Open

Move getRegistry to registry package #5403

nambrot opened this issue Feb 7, 2025 · 1 comment · May be fixed by #5491
Assignees
Milestone

Comments

@nambrot
Copy link
Contributor

nambrot commented Feb 7, 2025

Move https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/nambrot/infra-checker-use-registry/node_modules/@hyperlane-xyz/cli/src/context/context.ts#L191 into the registry package, as it is not CLI specific

@mshojaei-txfusion
Copy link
Collaborator

I created these two PRs, one with OOP and the other one with functions,
@nambrot please take a look and let me know which one makes more sense so I would use it for mono-repo PR.

[I did this because registry code is implemented with classes and OOP, And IMO as we are moving more stuff from mono-repo to registry, that could be good idea to make a registry factory class for this case]

@nambrot nambrot added this to the Warp Speed milestone Feb 20, 2025
@cmcewen cmcewen moved this from Sprint to In Review in Hyperlane Tasks Feb 25, 2025
github-merge-queue bot pushed a commit to hyperlane-xyz/hyperlane-registry that referenced this issue Mar 6, 2025
### Description

This PR introduces and refactors registry utility functions:

1. Adds a unified `getRegistry` utility that:
- Creates a `MergedRegistry` containing appropriate registry instances
(Github/FileSystem) based on URIs
   - Handles proxy support for canonical Github repositories
   - Properly manages logging for all registry instances
   - Filters out empty URIs and trims whitespace
2. Introduces `PROXY_DEPLOYED_URL` constant for standardized proxy
endpoint

### Backward compatibility

Yes

### Related issues
hyperlane-xyz/hyperlane-monorepo#5403
[issue would resolved after
[https://github.com/hyperlane-xyz/hyperlane-monorepo/pull/5491](https://github.com/hyperlane-xyz/hyperlane-monorepo/pull/5491)
merge]

### Testing

The changes have been extensively tested through unit tests covering:
- Registry creation scenarios
- Proxy support with canonical repository
- URL validation and error handling
- Different registry type combinations (Github/FileSystem)
- Empty URI handling and validation
- Logger propagation to all registry instances
- Proper MergedRegistry instantiation for all cases

All functionality maintains compatibility with existing use cases while
providing a more streamlined API.
mshojaei-txfusion added a commit to txfusion/hyperlane-registry that referenced this issue Mar 6, 2025
### Description

This PR introduces and refactors registry utility functions:

1. Adds a unified `getRegistry` utility that:
- Creates a `MergedRegistry` containing appropriate registry instances
(Github/FileSystem) based on URIs
   - Handles proxy support for canonical Github repositories
   - Properly manages logging for all registry instances
   - Filters out empty URIs and trims whitespace
2. Introduces `PROXY_DEPLOYED_URL` constant for standardized proxy
endpoint

### Backward compatibility

Yes

### Related issues
hyperlane-xyz/hyperlane-monorepo#5403
[issue would resolved after
[https://github.com/hyperlane-xyz/hyperlane-monorepo/pull/5491](https://github.com/hyperlane-xyz/hyperlane-monorepo/pull/5491)
merge]

### Testing

The changes have been extensively tested through unit tests covering:
- Registry creation scenarios
- Proxy support with canonical repository
- URL validation and error handling
- Different registry type combinations (Github/FileSystem)
- Empty URI handling and validation
- Logger propagation to all registry instances
- Proper MergedRegistry instantiation for all cases

All functionality maintains compatibility with existing use cases while
providing a more streamlined API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Review
Development

Successfully merging a pull request may close this issue.

2 participants