Skip to content

Conversation

@CharString
Copy link
Contributor

Fixes #708

@CharString CharString linked an issue Jan 20, 2026 that may be closed by this pull request
@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2026

🐰 Bencher Report

Branch708-support-open-archiefbeheer-destruction-in-objects-api
Testbedubuntu-latest

🚨 4 Alerts

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
performance_test/tests/test_objects_list.py::test_objects_api_list_filter_by_object_typeLatency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
184.44 ms
(+20.68%)Baseline: 152.83 ms
160.48 ms
(114.93%)

performance_test/tests/test_objects_list.py::test_objects_api_list_large_page_size_page_1Latency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
603.94 ms
(+35.27%)Baseline: 446.46 ms
468.79 ms
(128.83%)

performance_test/tests/test_objects_list.py::test_objects_api_list_large_page_size_page_5Latency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
614.05 ms
(+36.38%)Baseline: 450.24 ms
472.75 ms
(129.89%)

performance_test/tests/test_objects_list.py::test_objects_api_list_small_page_size_page_20Latency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
149.95 ms
(+5.73%)Baseline: 141.82 ms
148.91 ms
(100.69%)

Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
performance_test/tests/test_objects_list.py::test_objects_api_list_filter_by_object_type📈 view plot
🚷 view threshold
🚨 view alert (🔔)
184.44 ms
(+20.68%)Baseline: 152.83 ms
160.48 ms
(114.93%)

performance_test/tests/test_objects_list.py::test_objects_api_list_filter_one_result📈 view plot
🚷 view threshold
25.10 ms
(+4.16%)Baseline: 24.09 ms
25.30 ms
(99.20%)
performance_test/tests/test_objects_list.py::test_objects_api_list_large_page_size_page_1📈 view plot
🚷 view threshold
🚨 view alert (🔔)
603.94 ms
(+35.27%)Baseline: 446.46 ms
468.79 ms
(128.83%)

performance_test/tests/test_objects_list.py::test_objects_api_list_large_page_size_page_5📈 view plot
🚷 view threshold
🚨 view alert (🔔)
614.05 ms
(+36.38%)Baseline: 450.24 ms
472.75 ms
(129.89%)

performance_test/tests/test_objects_list.py::test_objects_api_list_small_page_size_page_20📈 view plot
🚷 view threshold
🚨 view alert (🔔)
149.95 ms
(+5.73%)Baseline: 141.82 ms
148.91 ms
(100.69%)

🐰 View full continuous benchmarking report in Bencher

@CharString CharString force-pushed the 708-support-open-archiefbeheer-destruction-in-objects-api branch from b090934 to 5c8f34e Compare January 20, 2026 12:15
@CharString CharString force-pushed the 708-support-open-archiefbeheer-destruction-in-objects-api branch from 5c8f34e to bb131da Compare January 20, 2026 13:17
@CharString CharString force-pushed the 708-support-open-archiefbeheer-destruction-in-objects-api branch from f57913a to 1a8758c Compare January 20, 2026 14:15
@codecov-commenter
Copy link

codecov-commenter commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 93.63636% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.90%. Comparing base (5779e78) to head (775ed20).

Files with missing lines Patch % Lines
src/objects/cloud_events/tasks.py 83.33% 3 Missing and 1 partial ⚠️
src/objects/api/v2/views.py 94.87% 0 Missing and 2 partials ⚠️
src/objects/core/models.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #719      +/-   ##
==========================================
+ Coverage   84.59%   84.90%   +0.31%     
==========================================
  Files         137      140       +3     
  Lines        2733     2829      +96     
  Branches      215      223       +8     
==========================================
+ Hits         2312     2402      +90     
- Misses        373      375       +2     
- Partials       48       52       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CharString CharString requested a review from stevenbal January 20, 2026 14:46
Copy link
Collaborator

@stevenbal stevenbal left a comment

Choose a reason for hiding this comment

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

@CharString could you look into the performance regressions for the list endpoint? There's probably a missing prefetch_related on references #719 (comment)

Comment on lines +432 to +434
type = models.CharField(
max_length=4, choices=ReferenceType.choices, default=ReferenceType.zaak
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of having default zaak, we could probably just make this field required as well?


def perform_destroy(self, instance):
instance.object.delete()
if record := serializer.instance:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a scenario where serializer.instance is not set after super().perform_update(serializer)?

super().perform_create(serializer)
objects_create_counter.add(1)

if record := serializer.instance:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a scenario where serializer.instance is not set after super().perform_create(serializer)?

zaak_references = obj.last_record.references.filter(type=ReferenceType.zaak)

if zaak_urls := list(zaak_references.values_list("url", flat=True)):
if (zaak_url := request.query_params.get("zaak")) and zaak_urls != [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you make sure this query parameter is documented for DELETE in the OAS? Also you could probably switch the ordering of the two if statements to do (zaak_url := request.query_params.get("zaak")) before performing the query to get the zaak references, to avoid unnecessarily doing that query

]:
# OAB is archiving one of many ZAKEN attached to this object;
# just remove this single zaak reference.
zaak_references.filter(url="zaak_url").delete()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you make sure an assertion for this is part of the tests as well? Since the tests currently pass despite this

Suggested change
zaak_references.filter(url="zaak_url").delete()
zaak_references.filter(url=zaak_url).delete()

Comment on lines +204 to +206
response = Response(
{"behouden": [object_url]}, status=status.HTTP_200_OK
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you make sure this response body + status code is also part of the OAS? Open Klant has this documented as well: https://github.com/maykinmedia/open-klant/blob/b07ad28c057228e90d1c97163a69eb0bc2bfadd9/src/openklant/components/klantinteracties/api/viewsets/klantcontacten.py#L343-L349

f"{url}?{urlencode({'zaak': zaak_1})}", *GEO_WRITE_KWARGS
)

self.assertEqual(response.status_code, status.HTTP_200_OK, response.data)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's also add an assertion to verify that the object still exists + that it still has a reference to https://example.com/zaak/2

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.

Support Open Archiefbeheer destruction in Objects API

4 participants