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

Chore: port ConsumerRemovalProposal handler to main #429

Merged
merged 10 commits into from
Nov 4, 2022

Conversation

sainoe
Copy link
Contributor

@sainoe sainoe commented Nov 4, 2022

Port ConsumerRemovalProposal proposal handler and cli command from v0.1.4 to main

Copy link
Contributor

@mpoke mpoke left a comment

Choose a reason for hiding this comment

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

LGTM

@shaspitz
Copy link
Contributor

shaspitz commented Nov 4, 2022

Nice catch, thanks!

@MSalopek MSalopek force-pushed the sainoe/consumer-removal-cli branch from dc973ca to 1cf7297 Compare November 4, 2022 16:35
@MSalopek
Copy link
Contributor

MSalopek commented Nov 4, 2022

Added integration tests.

@MSalopek MSalopek marked this pull request as ready for review November 4, 2022 16:37

//#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments.
bz, err = exec.Command("docker", "exec", tr.containerConfig.instanceName,
"/bin/bash", "-c", fmt.Sprintf(`echo '%s' > %s`, jsonStr, "/temp-proposal.json")).CombinedOutput()

Check failure

Code scanning / CodeQL

Potentially unsafe quoting

If this [JSON value](1) contains a single quote, it could break out of the enclosing quotes.
Copy link
Contributor

Choose a reason for hiding this comment

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

closed this alert, seen it before. Shouldn't matter for tests

tests/integration/actions.go Outdated Show resolved Hide resolved
tests/integration/actions.go Outdated Show resolved Hide resolved
tests/integration/state.go Show resolved Hide resolved
tests/difference/core/node_modules/.yarn-integrity Outdated Show resolved Hide resolved
// queryConsumerChainRemoved checks if provided consumerChain
// was removed from the list of consumer chains on the provider.
// If a chain was not removed a panic will be raised.
// getConsumerChains returns a list of consumer chains that're being secured by the provider chain,
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor

@shaspitz shaspitz left a comment

Choose a reason for hiding this comment

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

couple small nits, added them myself, LGTM 🚀

@@ -82,7 +82,7 @@ func stepsStartChains(consumerName string, setupTransferChan bool) []Step {
state: State{
chainID("provi"): ChainState{
Proposals: &map[uint]Proposal{
1: ConsumerProposal{
1: ConsumerAdditionProposal{
Copy link
Contributor

Choose a reason for hiding this comment

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

@MSalopek great opportunity to improve these consumer chain addition tests by adding in your new ConsumerChains: &map[chainID]bool{"consu": true} state accessor!

Copy link
Contributor

@jtremback jtremback left a comment

Choose a reason for hiding this comment

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

LGTM

@jtremback jtremback merged commit 9241d1f into main Nov 4, 2022
@jtremback jtremback deleted the sainoe/consumer-removal-cli branch November 4, 2022 20:24
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.

5 participants