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: Add parseGitHubPath() to parse URI in GithubRegistry #656

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ltyu
Copy link
Contributor

@ltyu ltyu commented Mar 7, 2025

Description

Update GithubRegistry to be able to parse branch from URI by using a helper function. The function uses regex instead of split/positional arrays because we may have branches that look like: ltyu/REZ/base-ethereum

Drive-by

Some lint updates

Backward compatibility

Yes - moved the existing parsing logic to a helper function that uses regex instead of positional arrays.

Testing

Unit test

Copy link

changeset-bot bot commented Mar 7, 2025

🦋 Changeset detected

Latest commit: 281fc76

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hyperlane-xyz/registry Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR


this.repoOwner = repoOwner;
this.repoName = repoName;
this.branch = options.branch ?? repoBranch ?? 'main';
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we raise an error if both options.branch and repoBranch are passed?

useProxy: true,
expectedRegistries: [
{ type: GithubRegistry, uri: DEFAULT_GITHUB_REGISTRY, proxyUrl: PROXY_DEPLOYED_URL },
{ type: FileSystemRegistry, uri: localPath },
{ type: GithubRegistry, uri: 'https://github.com/test' },
{ type: GithubRegistry, uri: 'https://github.com/user/test' },
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a test case here that includes the branch in the URL?

@ltyu ltyu force-pushed the ltyu/parse-branch-from-uri branch from abeed73 to 55e7409 Compare March 7, 2025 20:52
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.

2 participants