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

fix: handle BlobDelete event type in batch_push_results #893

Merged
merged 24 commits into from
May 16, 2024

Conversation

liammoat
Copy link
Collaborator

@liammoat liammoat commented May 13, 2024

Purpose

  • batch_push_results receives, but does not handle, blob delete events.
  • This PR introduces the functionality to delete the search index, when a blob is deleted from Azure Storage

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  1. Run the updated Azure Function
  2. #1 Create a blob, uploading via Azure Storage
  3. #2 Delete the blob from Azure Storage
  4. #3 Trigger `BatchStartProcessing function

What to Check

Verify that the following are valid

  1. #1 BatchPushResults is triggered, and the document is indexed.
  2. #2 BatchPushResults is triggered, and the associated indexes are removed.
  3. #3 BatchPushResults is triggered, as normal, and the documents are indexed.

Other Information

Remaining Actions

The following is outstanding for this PR:

  • Tests

@liammoat liammoat linked an issue May 13, 2024 that may be closed by this pull request
Copy link

github-actions bot commented May 13, 2024

Coverage

Coverage Report •
FileStmtsMissCoverMissing
code/backend/batch
   batch_push_results.py360100% 
   function_app.py17170%1–8, 10, 12–14, 16, 19–22
code/backend/batch/utilities/search
   search_handler_base.py482352%13–15, 18–20, 24, 28, 32, 36, 40, 44, 48, 51–52, 54–56, 58–59, 62–63, 65
TOTAL242468471% 

Tests Skipped Failures Errors Time
201 0 💤 0 ❌ 0 🔥 12.926s ⏱️

@liammoat
Copy link
Collaborator Author

Team - Couple of things to note about this PR:

  1. There is likely a better way to do this - however, I have tried to implement it with as few downstream changes as possible (i.e. I don't want to refactor everything to fix this)
  2. With this change in mind, I propose the admin app should delete the blob, and let the function handle the index.
  3. I will leave this in draft until I have introduce some tests to cover the core behaviour

@liammoat liammoat changed the title [DRAFT] fix: handle BlobDelete event type in batch_push_results fix: handle BlobDelete event type in batch_push_results May 14, 2024
@liammoat liammoat marked this pull request as ready for review May 14, 2024 07:45
@liammoat liammoat self-assigned this May 14, 2024
Copy link
Collaborator

@gaurarpit gaurarpit left a comment

Choose a reason for hiding this comment

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

nice, looks good. some comments.

@superhindupur
Copy link
Collaborator

superhindupur commented May 14, 2024

Team - Couple of things to note about this PR:

  1. There is likely a better way to do this - however, I have tried to implement it with as few downstream changes as possible (i.e. I don't want to refactor everything to fix this)
  2. With this change in mind, I propose the admin app should delete the blob, and let the function handle the index.
  3. I will leave this in draft until I have introduce some tests to cover the core behaviour

Definitely agree with " I propose the admin app should delete the blob, and let the function handle the index." - could you please create an issue to cover this if there isn't one already?

Update: I see that @komalg1 is working on this in #876 - would be worth the two of you catching up.

@superhindupur
Copy link
Collaborator

@liammoat thanks so much for this, really appreciate it! ❤️

@superhindupur superhindupur mentioned this pull request May 14, 2024
2 tasks
adamdougal
adamdougal previously approved these changes May 14, 2024
Copy link
Collaborator

@adamdougal adamdougal left a comment

Choose a reason for hiding this comment

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

LGTM

gaurarpit
gaurarpit previously approved these changes May 14, 2024
liammoat and others added 6 commits May 16, 2024 10:20
Co-authored-by: Arpit Gaur <gaurarpit@gmail.com>
Co-authored-by: Adam Dougal <adamdougal@microsoft.com>
Co-authored-by: Adam Dougal <adamdougal@users.noreply.github.com>
Co-authored-by: Arpit Gaur <arpitgaur@microsoft.com>
@liammoat liammoat dismissed stale reviews from gaurarpit and adamdougal via ada413d May 16, 2024 10:22
.vscode/settings.json Outdated Show resolved Hide resolved
cecheta
cecheta previously approved these changes May 16, 2024
Copy link
Collaborator

@cecheta cecheta left a comment

Choose a reason for hiding this comment

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

Great work

@gaurarpit gaurarpit self-assigned this May 16, 2024
@gaurarpit gaurarpit added this pull request to the merge queue May 16, 2024
Merged via the queue into main with commit f27b68e May 16, 2024
9 checks passed
@gaurarpit gaurarpit deleted the limoat/414/handle-blobdeleted-events branch May 16, 2024 15:26
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.

Handle BlobDeleted events from Event Grid
6 participants