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

Add filter to list, and use that to make resolve command work. #49

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

stefan-mysten
Copy link
Collaborator

By name -- which is the same as mvr resolve @mvr-tst/first-app

➜  mvr-cli git:(add_filter_to_list) ./target/debug/mvr list --filter @mvr-tst/first-app
 Package:  @mvr-tst/first-app 

  [testnet]
     Registered address not found    

  [mainnet]
     Package Address  0xd94df18bd28e31c65241e2db942920cd6d92f69531b7bff5eccebdaf8fcfc8bf 
     Upgrade Cap      0x764aa368ce52fd7e5612fc6c244b01b0eea232cbdc22a1661785d24e2d252a3e 
     Version          1                                                                  
     Repository       https://github.com/MystenLabs/demo-package-for-testing             
     Tag              main                                                               
     Path             0x7328/demo-mainnet                 
     

By address

mvr-cli git:(add_filter_to_list) ./target/debug/mvr list --filter 0xd94df18bd28e31c65241e2db942920cd6d92f69531b7bff5eccebdaf8fcfc8bf
 Package:  @mvr-tst/first-app 

  [testnet]
     Registered address not found    

  [mainnet]
     Package Address  0xd94df18bd28e31c65241e2db942920cd6d92f69531b7bff5eccebdaf8fcfc8bf 
     Upgrade Cap      0x764aa368ce52fd7e5612fc6c244b01b0eea232cbdc22a1661785d24e2d252a3e 
     Version          1                                                                  
     Repository       https://github.com/MystenLabs/demo-package-for-testing             
     Tag              main                                                               
     Path             0x7328/demo-mainnet          

Resolve by name

➜  mvr-cli git:(add_filter_to_list) ./target/debug/mvr resolve @mvr-tst/first-app
 Package:  @mvr-tst/first-app 

  [testnet]
     Registered address not found    

  [mainnet]
     Package Address  0xd94df18bd28e31c65241e2db942920cd6d92f69531b7bff5eccebdaf8fcfc8bf 
     Upgrade Cap      0x764aa368ce52fd7e5612fc6c244b01b0eea232cbdc22a1661785d24e2d252a3e 
     Version          1                                                                  
     Repository       https://github.com/MystenLabs/demo-package-for-testing             
     Tag              main                                                               
     Path             0x7328/demo-mainnet                                                

Wrong name

➜  mvr-cli git:(add_filter_to_list) ./target/debug/mvr resolve @mvr-tst/first-ap
No registered apps found

Copy link

vercel bot commented Oct 8, 2024

@stefan-mysten is attempting to deploy a commit to the Sui Foundation team on Vercel, but is not a member of this team. To resolve this issue, you can:

  • Make your repository public. Collaboration is free for open source and public repositories.
  • Add @stefan-mysten as a member. A Pro subscription is required to access Vercel's collaborative features.
    • If you're the owner of the team, click here and add @stefan-mysten as a member.
    • If you're the user who initiated this build request, click here to request access.
    • If you're already a member of the Sui Foundation team, make sure that your Vercel account is connected to your GitHub account.

To read more about collaboration on Vercel, click here.

Comment on lines +1228 to +1265
if let Some(ref filter) = filter {
if is_name(filter) {
if &name == filter {
return Ok(CommandOutput::List(vec![App {
name: name.clone(),
package_info: vec![
(PackageInfoNetwork::Testnet, pkg_testnet),
(PackageInfoNetwork::Mainnet, pkg_mainnet),
],
}]));
}
}
// it is an address
else {
if let Some(ref pkg) = pkg_testnet {
if &pkg.package_address.to_string() == filter {
return Ok(CommandOutput::List(vec![App {
name: name.clone(),
package_info: vec![
(PackageInfoNetwork::Testnet, pkg_testnet),
(PackageInfoNetwork::Mainnet, pkg_mainnet),
],
}]));
}
}
if let Some(ref pkg) = pkg_mainnet {
if &pkg.package_address.to_string() == filter {
return Ok(CommandOutput::List(vec![App {
name: name.clone(),
package_info: vec![
(PackageInfoNetwork::Testnet, pkg_testnet),
(PackageInfoNetwork::Mainnet, pkg_mainnet),
],
}]));
}
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can reduce the nesting here, but nonblocking and I'll merge and fix up. want to get these changes in before doing a rebase

Copy link
Contributor

@rvantonder rvantonder left a comment

Choose a reason for hiding this comment

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

thanks!

@rvantonder rvantonder merged commit d4c433d into main Oct 9, 2024
1 check failed
@rvantonder rvantonder deleted the add_filter_to_list branch October 9, 2024 04:27
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