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 CLI command to replace DataProviders duchy list #970

Merged
merged 14 commits into from
May 16, 2023

Conversation

jojijac0b
Copy link
Contributor

@jojijac0b jojijac0b commented Apr 26, 2023

Create CLI command to replace DataProviders duchy list. The two required arguments are 1) data-provider-id and 2) required-duchies.

https://rally1.rallydev.com/#/604612930531d/iterationstatus?detail=%2Ftask%2F697342537849

@wfa-reviewable
Copy link

This change is Reviewable

Copy link
Collaborator

@stevenwarejones stevenwarejones left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @jojijac0b and @Marco-Premier)


src/main/kotlin/org/wfanet/measurement/kingdom/deploy/tools/CreateResource.kt line 343 at r2 (raw file):

    require(dataProviderId.toLongOrNull() != null)
    val request =
      ReplaceDataProviderRequiredDuchiesRequest()

you can do this with kotlin dsls

replaceDataProviderRequiredDuchiesRequest {
   requiredExternalDuchyIds += requiredDuchies
   externalDataProviderId = dataProviderId.toLong()
}

Copy link
Contributor

@Marco-Premier Marco-Premier left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @stevenwarejones)


src/main/kotlin/org/wfanet/measurement/kingdom/deploy/tools/CreateResource.kt line 343 at r2 (raw file):

Previously, stevenwarejones (Steven Ware Jones) wrote…

you can do this with kotlin dsls

replaceDataProviderRequiredDuchiesRequest {
   requiredExternalDuchyIds += requiredDuchies
   externalDataProviderId = dataProviderId.toLong()
}

+1

Copy link
Collaborator

@stevenwarejones stevenwarejones left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @jojijac0b)

@jojijac0b jojijac0b requested a review from SanjayVas April 27, 2023 15:31
Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jojijac0b)


src/main/kotlin/org/wfanet/measurement/kingdom/deploy/tools/CreateResource.kt line 318 at r3 (raw file):

}

@Command(

This should go in the MeasurementSystem CLI tool, not this one.

Copy link
Contributor

@Marco-Premier Marco-Premier left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @SanjayVas)


src/main/kotlin/org/wfanet/measurement/kingdom/deploy/tools/CreateResource.kt line 318 at r3 (raw file):

Previously, SanjayVas (Sanjay Vasandani) wrote…

This should go in the MeasurementSystem CLI tool, not this one.

Are the 2 CLI tool used by different actors @SanjayVas ?
Trying to understand why replace_data_provider_duchies command should be part of a different CLI tool compared to data-provider command.

@SanjayVas SanjayVas requested a review from Marco-Premier April 27, 2023 20:08
Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Marco-Premier)


src/main/kotlin/org/wfanet/measurement/kingdom/deploy/tools/CreateResource.kt line 318 at r3 (raw file):

Previously, Marco-Premier (marcopremier) wrote…

Are the 2 CLI tool used by different actors @SanjayVas ?
Trying to understand why replace_data_provider_duchies command should be part of a different CLI tool compared to data-provider command.

Yes. This CLI tool is for Kingdom operators and calls the internal API. Some method such as CreateDataProvider are intentionally not exposed in the public API, as these operations are not intended to be self-service.

The MeasurementSystem CLI tool is for the public API.

Copy link
Contributor

@Marco-Premier Marco-Premier left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jojijac0b)


src/main/kotlin/org/wfanet/measurement/kingdom/deploy/tools/CreateResource.kt line 318 at r3 (raw file):

Previously, SanjayVas (Sanjay Vasandani) wrote…

Yes. This CLI tool is for Kingdom operators and calls the internal API. Some method such as CreateDataProvider are intentionally not exposed in the public API, as these operations are not intended to be self-service.

The MeasurementSystem CLI tool is for the public API.

Oh I see now. thanks for sharing this.
@jojijac0b we can move this into Measurement System then

Copy link
Contributor Author

@jojijac0b jojijac0b left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @Marco-Premier, @SanjayVas, and @stevenwarejones)


src/main/kotlin/org/wfanet/measurement/kingdom/deploy/tools/CreateResource.kt line 343 at r2 (raw file):

Previously, Marco-Premier (marcopremier) wrote…

+1

Done.


src/main/kotlin/org/wfanet/measurement/kingdom/deploy/tools/CreateResource.kt line 318 at r3 (raw file):

Previously, Marco-Premier (marcopremier) wrote…

Oh I see now. thanks for sharing this.
@jojijac0b we can move this into Measurement System then

Done.

Copy link
Collaborator

@stevenwarejones stevenwarejones left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @SanjayVas)

Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jojijac0b)


src/main/kotlin/org/wfanet/measurement/api/v2alpha/tools/MeasurementSystem.kt line 1015 at r4 (raw file):

}

@Command(

This CLI is organized into subcommands by resource. Add this as a replace-required-duchies subcommand of a data-providers command.

jojijac0b added 2 commits May 4, 2023 07:45
…ss-media-measurement into jojijacob-cli-for-replace-data-provider-duchy-list
Copy link
Collaborator

@stevenwarejones stevenwarejones left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 2 files reviewed, 2 unresolved discussions (waiting on @jojijac0b)


src/main/kotlin/org/wfanet/measurement/api/v2alpha/tools/MeasurementSystem.kt line 1063 at r5 (raw file):

  }

  @Command

was this meant to be added?

Copy link
Contributor Author

@jojijac0b jojijac0b left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 2 files reviewed, 2 unresolved discussions (waiting on @stevenwarejones)


src/main/kotlin/org/wfanet/measurement/api/v2alpha/tools/MeasurementSystem.kt line 1063 at r5 (raw file):

Previously, stevenwarejones (Steven Ware Jones) wrote…

was this meant to be added?

it was a mistake. must remove

Copy link
Contributor Author

@jojijac0b jojijac0b left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 2 files reviewed, 2 unresolved discussions (waiting on @stevenwarejones)


src/main/kotlin/org/wfanet/measurement/api/v2alpha/tools/MeasurementSystem.kt line 1063 at r5 (raw file):

Previously, jojijac0b wrote…

it was a mistake. must remove

Done.

Copy link
Contributor Author

@jojijac0b jojijac0b left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 2 files reviewed, 2 unresolved discussions (waiting on @SanjayVas and @stevenwarejones)


src/main/kotlin/org/wfanet/measurement/api/v2alpha/tools/MeasurementSystem.kt line 1015 at r4 (raw file):

Previously, SanjayVas (Sanjay Vasandani) wrote…

This CLI is organized into subcommands by resource. Add this as a replace-required-duchies subcommand of a data-providers command.

Done.

@SanjayVas SanjayVas requested a review from stevenwarejones May 5, 2023 17:27
Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r7, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @jojijac0b and @stevenwarejones)

a discussion (no related file):
Update the unit test.



src/main/kotlin/org/wfanet/measurement/api/v2alpha/tools/MeasurementSystem.kt line 1030 at r7 (raw file):

  @Command(
    name = "replace-data-provider-duchies",

The DataProvider subject is implied

Suggestion:

replace-required-duchies

Copy link
Collaborator

@stevenwarejones stevenwarejones left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r7, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jojijac0b)

Copy link
Contributor Author

@jojijac0b jojijac0b left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @Marco-Premier, @SanjayVas, and @stevenwarejones)

a discussion (no related file):

Previously, SanjayVas (Sanjay Vasandani) wrote…

Update the unit test.

Done.



src/main/kotlin/org/wfanet/measurement/api/v2alpha/tools/MeasurementSystem.kt line 1030 at r7 (raw file):

Previously, SanjayVas (Sanjay Vasandani) wrote…

The DataProvider subject is implied

Done.

Copy link
Contributor

@Marco-Premier Marco-Premier left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r4, 2 of 2 files at r8, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @SanjayVas)

Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r8, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @jojijac0b)

@jojijac0b jojijac0b enabled auto-merge (squash) May 16, 2023 14:36
@jojijac0b jojijac0b merged commit ab8f967 into main May 16, 2023
@jojijac0b jojijac0b deleted the jojijacob-cli-for-replace-data-provider-duchy-list branch May 16, 2023 14:42
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