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 support for downloading only security updates to the update command #349

Conversation

anemirovsky
Copy link

@anemirovsky anemirovsky commented Dec 1, 2023

Fixes #300

Add support for downloading only security updates to the update command.

This adds support for a --security-only flag to allow updates to be run just for modules with security releases. This also adds a way to report on the avaiable updates without actually running them, as well as an alternate output format that supports just listing the modules names. This mimics the behavior of drush pm-updatestatus --format=list which is useful for feeding the output to another process that actually runs the output, like an Ansible playbook.

I'm not sure if it makes sense to combine the --report-only and --output-format into the update command rather than adding a separate updatelist command. I started with a separate one but realized so much of the code is the same. Happy to split it out if that's preferred, though.

anemirovsky and others added 2 commits December 1, 2023 14:30
…mand. (backdrop-contrib#300)

This adds support for a `--security-only` flag to allow updates to be
run just for modules with security releases. This also adds a way to
report on the avaiable updates without actually running them, as well as
an alternate output format that supports just listing the modules names.
This mimics the behavior of `drush pm-updatestatus --format=list` which
is useful for feeding the output to another process that actually runs
the output, like an Ansible playbook.
@yorkshire-pudding
Copy link
Collaborator

yorkshire-pudding commented Dec 6, 2023

Hi @anemirovsky - thanks for this contribution.

I like the idea of the update status and this is better than currently where it shows updates and then asks you to confirm, so you enter 'n'. However, I think it should be a separate command within this update group rather than options in the update command. Please can you remove from this pull request and do a separate pull request for the update status command against issue #350 - an issue I've created for this.

I've had a quick look at the security element and it looks ok, but I'll test and do a thorough review once the other element is removed.

By the way, if you add Fixes #300 at the top of the body of your first PR comment, it will automatically link to the issue and helps to avoid effort duplication as well as making it easier to find.

@anemirovsky
Copy link
Author

I've updated this PR to include just the --security-only option and will submit a separate PR for #350 soon. Thank you!

Copy link
Collaborator

@yorkshire-pudding yorkshire-pudding left a comment

Choose a reason for hiding this comment

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

I've tested this and it works perfectly. Thank you.
There are a couple of minor enhancements suggested: an example of using this, and adding a short version of this option

Also, I've fixed a bug that arose from a recent change in Backdrop that was causing the tests to fail (minor change in commands/dblog.bee.inc) - if you can rebase your branch so it includes that change then the tests should pass. At present, we don't have any tests for this feature, but we want to ensure that any changes we make don't break existing functionality.

commands/update.bee.inc Outdated Show resolved Hide resolved
commands/update.bee.inc Outdated Show resolved Hide resolved
@anemirovsky
Copy link
Author

Done, thank you!

@yorkshire-pudding yorkshire-pudding changed the title Add support for downloading only security updates to the update com… Add support for downloading only security updates to the update command Dec 9, 2023
@yorkshire-pudding yorkshire-pudding merged commit dfd8683 into backdrop-contrib:issue-111-update-command Dec 9, 2023
2 checks passed
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.

Update Command - Allow command to only download security updates
2 participants