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 deploy to CLI, including start of CLI refactor #213

Merged
merged 13 commits into from
Sep 24, 2024

Conversation

mixmix
Copy link
Contributor

@mixmix mixmix commented Aug 1, 2024

This adds deploy to the CLI

This PR also start to add a new pattern for how to CLI which is "one file per major command"
It shows how we're gonna do subcommands too

  • I have performed a self-review of my code.
  • [N/A] I have added tests.
  • I have commented my code.
  • I have included a CHANGELOG.md entry.
  • I have updated documentation in github.com:entropyxyz/entropy-docs, where necessary.

@mixmix mixmix requested a review from rh0delta August 1, 2024 04:56
@mixmix
Copy link
Contributor Author

mixmix commented Aug 1, 2024

@rh0delta I reckon the pattern here for cli could really help split out the tui/cli clutter.

@rh0delta
Copy link
Contributor

rh0delta commented Aug 2, 2024

@rh0delta I reckon the pattern here for cli could really help split out the tui/cli clutter.

Yeah i agree, i do like the degree of separation here, but will this be the same as how we want to handle the tui as well?

@mixmix
Copy link
Contributor Author

mixmix commented Aug 21, 2024

I'm not sure how the TUI will end up....
I imagined functions that would call commands?

@mixmix
Copy link
Contributor Author

mixmix commented Aug 22, 2024

TODO:

@mixmix mixmix changed the base branch from dev to naynay/file-restructure August 22, 2024 22:01
src/cli.ts Outdated Show resolved Hide resolved
src/cli.ts Outdated Show resolved Hide resolved
src/program/command.ts Outdated Show resolved Hide resolved
src/cli.ts Outdated Show resolved Hide resolved
@mixmix
Copy link
Contributor Author

mixmix commented Sep 23, 2024

Hey @rh0delta can I have a re-review?
In particular I changed the config handling because ... tests were failing and I didn't like how get was having side effects (note it was actually getAndInitialize ... which made it quite hard to test and work with.

Through some closer looking I discovered that config.init was not actually being called anywhere! Now it is

src/config/index.ts Outdated Show resolved Hide resolved
src/cli.ts Outdated Show resolved Hide resolved
src/common/utils-cli.ts Outdated Show resolved Hide resolved
src/cli.ts Outdated Show resolved Hide resolved
src/cli.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@rh0delta rh0delta left a comment

Choose a reason for hiding this comment

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

couple of questions, and some changes may be needed, otherwise looks good so far

@rh0delta
Copy link
Contributor

Hey @rh0delta can I have a re-review? In particular I changed the config handling because ... tests were failing and I didn't like how get was having side effects (note it was actually getAndInitialize ... which made it quite hard to test and work with.

Through some closer looking I discovered that config.init was not actually being called anywhere! Now it is

How was it that config.init was never called? really curious about this. I thought we had it initialized at the same point as initializing wasm.

@mixmix mixmix changed the base branch from naynay/file-restructure to mixmix/fix-config September 24, 2024 04:09
@mixmix
Copy link
Contributor Author

mixmix commented Sep 24, 2024

Yeah I don't know what happened! I assume it just got lost in the refactoring.

Comment on lines +11 to +15
// .addCommand(entropyProgramGet())
// .addCommand(entropyProgramListDeployed())
// .addCommand(entropyProgramAdd())
// .addCommand(entropyProgramRemove())
// .addCommand(entropyProgramList())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanna do these in a different PR. Maybe even after we do a new release.
This is "feature completeness", not "refactor"

Comment on lines +56 to +65
async get (programPointer: string): Promise<any> {
this.logger.debug(`program pointer: ${programPointer}`, `${FLOW_CONTEXT}::PROGRAM_PRESENCE_CHECK`);
return this.entropy.programs.dev.getProgramInfo(programPointer)
}

async listDeployed () {
const address = this.entropy.keyring.accounts.registration.address
// QUESTION: will we always be wanting this address?
return this.entropy.programs.dev.get(address)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NOTE: I think these are about to change with the next SDK release (just reviewing these)

Base automatically changed from mixmix/fix-config to naynay/file-restructure September 24, 2024 04:33
@mixmix mixmix merged commit 34e4c69 into naynay/file-restructure Sep 24, 2024
2 checks passed
@mixmix mixmix deleted the mixmix/deploy_cli branch September 24, 2024 04:34
@github-actions github-actions bot locked and limited conversation to collaborators Sep 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants