-
Notifications
You must be signed in to change notification settings - Fork 587
[FR] Add --force flag to update-lock-versions #3693
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM. IINM, for custom rule management, this is needed. We typically use build-release --update-version-lock
but we decided not to add registry information. This allows us to still manage the version lock in CI without needing additional package registry info, and bypasses the interactive click confirmation.
@@ -334,7 +334,8 @@ def prune_staging_area(target_stack_version: str, dry_run: bool, exception_list: | |||
|
|||
@dev_group.command('update-lock-versions') | |||
@click.argument('rule-ids', nargs=-1, required=False) | |||
def update_lock_versions(rule_ids): | |||
@click.option('--force', is_flag=True, help='Force update without confirmation') | |||
def update_lock_versions(rule_ids: Tuple[str, ...], force: bool): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a nitpick: Tuple
typehint is a bit too click-specific here, Sequence
would be a better choice, if it is really not a list :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that Sequence
is more appropriate; however, we do not use Sequence
in the code elsewhere for type hinting and we do use Tuple[str, ...]
. For consistency, I think we should update to Sequence in a different PR where we can modify all of the relevant type hints all at once.
* Add --force flag to update-lock-versions * Add type hinting (cherry picked from commit 707ca32)
* Add --force flag to update-lock-versions * Add type hinting (cherry picked from commit 707ca32)
* Add --force flag to update-lock-versions * Add type hinting (cherry picked from commit 707ca32)
* Add --force flag to update-lock-versions * Add type hinting (cherry picked from commit 707ca32)
* Add --force flag to update-lock-versions * Add type hinting (cherry picked from commit 707ca32)
* Add --force flag to update-lock-versions * Add type hinting (cherry picked from commit 707ca32)
* Add --force flag to update-lock-versions * Add type hinting (cherry picked from commit 707ca32)
* Add --force flag to update-lock-versions * Add type hinting (cherry picked from commit 707ca32)
* Add --force flag to update-lock-versions * Add type hinting (cherry picked from commit 707ca32)
* Add --force flag to update-lock-versions * Add type hinting (cherry picked from commit 707ca32)
* Add --force flag to update-lock-versions * Add type hinting (cherry picked from commit 707ca32)
* Add --force flag to update-lock-versions * Add type hinting (cherry picked from commit 707ca32)
Issues
Summary
This PR adds a
--force
flag to lock versions to allow this command to be run in CI such that users can lock versions without needing to build a package.Testing
python -m detection_rules dev update-lock-versions --force
should not have a confirm prompt.