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

[PR #7468/65f58afb backport][stable-8] Improve performance of the bitwarden lookup plugin #7512

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Nov 11, 2023

This is a backport of PR #7468 as merged into main (65f58af).

SUMMARY

The bitwarden lookup plugin searches through all items using bw list items --search, which takes a lot of time. However, when looking for an item using the item id, there is a much faster way: bw get item <itemid>. This PR introduces this method for every lookup that uses the item's id, while keeping backwards compatibility.

This work is based on #6619. The open review comment there has been addressed.

ISSUE TYPE
  • Feature / Performance Pull Request
COMPONENT NAME

bitwarden

ADDITIONAL INFORMATION

None

* Improve performance of the bitwarden lookup plugin

When looking for items using an item id, we can access the item directly with
bw get item instead of searching through all items. This doubles the lookup
speed.

* Update changelogs/fragments/bitwarden-lookup-performance.yaml

Co-authored-by: Felix Fontein <[email protected]>

* fix indentation

* Ensure backwards compatible behavior in case of errors when doing bitwarden lookup by id

* chore: Link to correct PR in changelog fragment

* Use identity check when comparing with None

---------

Co-authored-by: Richard Klose <[email protected]>
Co-authored-by: Richard Klose <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 65f58af)
@ansibullbot
Copy link
Collaborator

cc @lungj
click here for bot help

@ansibullbot ansibullbot added backport lookup lookup plugin new_contributor Help guide this first time contributor plugins plugin (any type) labels Nov 11, 2023
@felixfontein felixfontein marked this pull request as draft November 11, 2023 11:14
@felixfontein
Copy link
Collaborator

Marking as draft so this won't get merged until the last 8.0.x bugfix release is out.

@ansibullbot ansibullbot added the WIP Work in progress label Nov 11, 2023
@felixfontein felixfontein marked this pull request as ready for review November 13, 2023 19:21
@felixfontein felixfontein merged commit f2e2157 into stable-8 Nov 13, 2023
118 checks passed
@felixfontein felixfontein deleted the patchback/backports/stable-8/65f58afbd9f559dbab50e251e6e8f7184e76d0ee/pr-7468 branch November 13, 2023 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lookup lookup plugin new_contributor Help guide this first time contributor plugins plugin (any type) WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants