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

admin: Add pause-identifier and unpause-account subcommands #7668

Merged
merged 16 commits into from
Aug 22, 2024

Conversation

pgporada
Copy link
Member

@pgporada pgporada commented Aug 15, 2024

Implements tooling in admin that allows an operator to administratively pause a pairing of account,identifierType,identifierValues... from a CSV file and unpause a list of registration ID/account IDs from a file.

There are two new subcommands: pause-identifier and unpause-account whose help functions are written below.

Usage of pause-identifier:
  -batch-file string
        Path to a CSV file containing (account ID, identifier type, list of identifier strings)
Usage of unpause-account:
  -account int
        A single account ID to unpause
  -batch-file string
        Path to a file containing multiple account IDs where each is separated by a newline

Relates to #7406
Fixes #7618

@pgporada pgporada requested a review from a team as a code owner August 15, 2024 19:24
@pgporada pgporada requested a review from aarongable August 15, 2024 19:24
Copy link
Contributor

@pgporada, this PR appears to contain configuration and/or SQL schema changes. Please ensure that a corresponding deployment ticket has been filed with the new values.

cmd/admin/pause.go Fixed Show fixed Hide fixed
cmd/admin/pause.go Outdated Show resolved Hide resolved
cmd/admin/pause.go Outdated Show resolved Hide resolved
cmd/admin/pause.go Outdated Show resolved Hide resolved
cmd/admin/testdata/test_pause_data_invalid_noDomain.csv Outdated Show resolved Hide resolved
cmd/admin/testdata/test_pause_data_valid.csv Outdated Show resolved Hide resolved
@beautifulentropy
Copy link
Member

This is looks really good. I'm going to give this a better look tomorrow morning. Thanks @pgporada!

@beautifulentropy beautifulentropy self-requested a review August 15, 2024 19:52
Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

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

Overarching comment is that I think the input format for unpausing should just be a list of accounts, not a list of account-identifier pairs. I think that if you make that simplification, then the pausing and unpausing code will become completely independent code paths that could live in separate files, like the other subcommands.

cmd/admin/main.go Outdated Show resolved Hide resolved
cmd/admin/pause.go Outdated Show resolved Hide resolved
cmd/admin/pause.go Outdated Show resolved Hide resolved
cmd/admin/pause.go Outdated Show resolved Hide resolved
cmd/admin/pause.go Outdated Show resolved Hide resolved
@pgporada pgporada changed the title admin: Add pause-batch and unpause-batch subcommands admin: Add pause-identifier and unpause-account subcommands Aug 16, 2024
@pgporada pgporada requested a review from aarongable August 16, 2024 20:38
@pgporada pgporada dismissed beautifulentropy’s stale review August 19, 2024 14:21

These had been addressed.

cmd/admin/pauseIdentifier.go Outdated Show resolved Hide resolved
cmd/admin/pauseIdentifier.go Outdated Show resolved Hide resolved
cmd/admin/pauseIdentifier.go Outdated Show resolved Hide resolved
cmd/admin/testdata/test_pause_data_valid.csv Outdated Show resolved Hide resolved
cmd/admin/pauseIdentifier.go Outdated Show resolved Hide resolved
cmd/admin/unpauseAccount.go Outdated Show resolved Hide resolved
cmd/admin/unpauseAccount.go Outdated Show resolved Hide resolved
@pgporada pgporada requested a review from aarongable August 21, 2024 16:34
},
},
}
response, err := a.sac.PauseIdentifiers(ctx, &req)
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that the PauseIdentifiers gRPC method can take many identifiers as input. Maybe collect rows from the CSV into batches of 100, and then send those in a single request?

Even better, make the batch size controllable with a command line flag that defaults to 100 or so, sort of like the -parallelism flag on other admin subcommands.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am going to skip this for now. This sounds like a good future improvement.

cmd/admin/pause_identifier.go Outdated Show resolved Hide resolved
cmd/admin/pause_identifier_test.go Outdated Show resolved Hide resolved
return "Administratively unpause an account to allow certificate issuance attempts"
}

func (u *subcommandUnpauseAccount) Flags(flag *flag.FlagSet) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Totally optional suggestion: implement a parallelism flag, like some of the other subcommands have.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am going to skip this for now. This sounds like a good future improvement.

cmd/admin/unpause_account_test.go Outdated Show resolved Hide resolved
@pgporada pgporada requested a review from aarongable August 21, 2024 20:32
aarongable
aarongable previously approved these changes Aug 21, 2024
Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

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

LGTM!

cmd/admin/pause_identifier_test.go Outdated Show resolved Hide resolved
@aarongable aarongable merged commit c7a04e8 into main Aug 22, 2024
12 checks passed
@aarongable aarongable deleted the admin-portal-2l branch August 22, 2024 15:31
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.

Implement admin tooling for manually pausing and unpausing (account, identifier) pairs in batches.
3 participants