[MDS-6493] Auto index Major Mine conditions#3577
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enables automatic indexing of Major Mine permit conditions (initial extraction and post-verification), uses human-readable filenames in Azure Blob Storage, and exposes a verification_status field throughout the export, search index, and UI (with a warning icon for unverified conditions).
- Pass the original
file.filenamethrough the indexing pipeline and Azure upload component for friendly blob names. - Add
verification_statusto export CSV, Azure Search fields, retrieval pipeline, and the frontend interface/UI. - Introduce and trigger the
export_and_index_single_permit_amendmentCelery task after extraction and upon condition verification.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| services/permits/app/pipelines/permit_condition_search/resources/permit_condition_search_resource.py | Pass file_name to indexing pipeline run |
| services/permits/app/pipelines/permit_condition_search/permit_condition_search_pipeline.py | Add verification_status to pipeline schema and retrieval |
| services/permits/app/pipelines/permit_condition_search/create_search_index.py | Define Azure Search field for verification_status |
| services/permits/app/pipelines/permit_condition_search/components/azure_blob_upload.py | Use provided file_name when constructing blob path |
| services/core-web/src/components/mine/Permit/Search/tests/snapshots/ResultItem.spec.tsx.snap | Update snapshot HTML to include new wrapper |
| services/core-web/src/components/mine/Permit/Search/components/ResultItem.tsx | Render warning icon for unverified conditions |
| services/core-web/src/components/mine/Permit/Search/snapshots/PermitConditionSearch.integration.spec.tsx.snap | Update integration snapshot for UI layout change |
| services/core-api/tests/permits/permit_extraction/test_tasks.py | Add fixture to mock export_and_index_single_permit_amendment |
| services/core-api/tests/permits/permit_conditions/test_condition_tasks.py | Add tests for export_and_index_single_permit_amendment |
| services/core-api/app/cli_commands/export_permit_conditions.py | Include verification_status in CSV headers and rows |
| services/core-api/app/api/search/search/permit_search_service.py | Implement index method to post CSV to search service |
| services/core-api/app/api/mines/permits/permit_extraction/tasks.py | Import and trigger indexing task after extraction success |
| services/core-api/app/api/mines/permits/permit_conditions/tasks.py | Add export_and_index_single_permit_amendment Celery task |
| services/core-api/app/api/mines/permits/permit_conditions/resources/permit_conditions_resource.py | Trigger indexing task on condition verification |
| services/common/src/interfaces/search/facet-search.interface.ts | Update HaystackDocumentMeta to include verification_status and change tenure to string |
Comments suppressed due to low confidence (1)
services/core-api/tests/permits/permit_extraction/test_tasks.py:43
- This test patches
export_and_index_single_permit_amendmentbut does not assert that it was called. Add an assertion, e.g.,export_and_index_single_permit_amendment_mock.delay.assert_called_once_with(task.guid)to cover the new behavior.
def test_poll_update_permit_extraction_status_success(permit_search_service_mock, celery_app, test_client, create_permit_conditions_mock, db_session, export_and_index_single_permit_amendment_mock):
services/permits/app/pipelines/permit_condition_search/components/azure_blob_upload.py
Show resolved
Hide resolved
services/common/src/interfaces/search/facet-search.interface.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
|
|
|
|





Objective
MDS-6493