Skip to content

Conversation

@Floris272
Copy link
Contributor

@Floris272 Floris272 commented Dec 24, 2025

Fixes #564

Changes

  • fully integrates objecttypes api into objects api
  • removes code used for fetching external objecttypes
  • adds upgrade check to make sure all objecttypes are imported

TODO

  • docs. install & readme

@github-actions
Copy link
Contributor

github-actions bot commented Dec 24, 2025

🐰 Bencher Report

Branchfeature/564-open-objecten
Testbedubuntu-latest

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
performance_test/tests/test_objects_list.py::test_objects_api_list_large_page_size_page_1Latency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
417.18 ms
(+16.55%)Baseline: 357.94 ms
375.84 ms
(111.00%)

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
123.40 ms
(+0.64%)Baseline: 122.61 ms
128.74 ms
(95.85%)
performance_test/tests/test_objects_list.py::test_objects_api_list_filter_one_result📈 view plot
🚷 view threshold
20.25 ms
(-8.44%)Baseline: 22.11 ms
23.22 ms
(87.20%)
performance_test/tests/test_objects_list.py::test_objects_api_list_large_page_size_page_1📈 view plot
🚷 view threshold
🚨 view alert (🔔)
417.18 ms
(+16.55%)Baseline: 357.94 ms
375.84 ms
(111.00%)

performance_test/tests/test_objects_list.py::test_objects_api_list_large_page_size_page_5📈 view plot
🚷 view threshold
330.04 ms
(+4.94%)Baseline: 314.49 ms
330.22 ms
(99.95%)
performance_test/tests/test_objects_list.py::test_objects_api_list_small_page_size_page_20📈 view plot
🚷 view threshold
126.69 ms
(-2.71%)Baseline: 130.22 ms
136.73 ms
(92.66%)
🐰 View full continuous benchmarking report in Bencher

@Floris272 Floris272 force-pushed the feature/564-open-objecten branch from 273b407 to 587f7e5 Compare January 7, 2026 13:24
@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2026

Codecov Report

❌ Patch coverage is 96.86684% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.58%. Comparing base (85f0862) to head (d9f47d4).

Files with missing lines Patch % Lines
src/objects/utils/autoschema.py 33.33% 6 Missing ⚠️
src/objects/core/forms.py 89.18% 3 Missing and 1 partial ⚠️
src/objects/core/models.py 81.81% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #713      +/-   ##
==========================================
+ Coverage   84.98%   85.58%   +0.60%     
==========================================
  Files         141      144       +3     
  Lines        2843     3018     +175     
  Branches      224      238      +14     
==========================================
+ Hits         2416     2583     +167     
- Misses        375      382       +7     
- Partials       52       53       +1     

☔ 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.

'1':
- record__data__leeftijd
- record__data__kiemjaar
# TODO
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed the objecttype setup config thing but because of that you cannot really add permissions anymore, should it be added back and if yes only the required objecttype fields or everything?

Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the reason for removing it? Is it because you can't create ObjectTypes now without specifying the JSON schema?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the original use case was to only set the name and service so that all versions with their json schema's will be accesible, then in a tokenauth fields can be specified.

After the objecttype move, we could keep it as just the name, but then specifying the tokenauth permission fields becomes weird because that the schema cannot be defined in in the setup conf.

So i would propose to either:

  • remove objecttypes from setup config.
  • add the bare minimum (name, name_plural is also required but can be derived) but remove the token auth permission fields.
  • add version and schema to objecttype config but i feel like objecttype versions should not be created like this.

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 go for the second option for now

help_text=_("Incremental index number of the object record."),
)
object = models.ForeignKey(Object, on_delete=models.CASCADE, related_name="records")
version = models.PositiveSmallIntegerField(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

version could become an FK?

@Floris272 Floris272 marked this pull request as ready for review January 8, 2026 10:56
@Floris272 Floris272 requested a review from stevenbal January 8, 2026 10:56
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.

Looks good overall 👍

Comment on lines +166 to +189
UPGRADE_CHECK_PATHS: UpgradePaths = {
"4.0.0": UpgradeCheck(
VersionRange(minimum="3.6.0"),
code_checks=[CommandCheck("check_for_external_objecttypes")],
),
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm a bit confused about this one: I know this check is run before migrations, but we probably have to include this check + the command in 3.6.0 right? Otherwise this code can't be run before you actually upgrade to 4.0.0 and by the time that you do ObjectType.is_imported is already removed from the code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right that is_imported is already removed then, i think the fix is to remove is imported in 4.1.0 and add another check that 4.0.0 becomes the minimum for 4.1.0.

'1':
- record__data__leeftijd
- record__data__kiemjaar
# TODO
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the reason for removing it? Is it because you can't create ObjectTypes now without specifying the JSON schema?

@stevenbal
Copy link
Collaborator

@Floris272 will you do the docs in a separate PR?

@stevenbal stevenbal mentioned this pull request Jan 26, 2026
16 tasks
@Floris272 Floris272 force-pushed the feature/564-open-objecten branch from b4b24a2 to d81a31c Compare January 27, 2026 14:27
Comment on lines -84 to -87
"service",
], # TODO remove service from unique_fields after objecttype migration since it will no longer be part of the ObjectType model.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Command could be kept, Objecttypes will just be unique on their uuid only

@Floris272
Copy link
Contributor Author

@Floris272 will you do the docs in a separate PR?

yes

@Floris272 Floris272 force-pushed the feature/564-open-objecten branch 2 times, most recently from 5a4d32e to d673439 Compare February 3, 2026 09:17
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.

Some small things remaining still, I'd recommend to split off the duplicate UUID stuff into a separate PR, because this PR has been open for quite a while already

for objecttype in ObjectType.objects.iterator():
if not objecttype.is_imported:
external_object_count += 1
service.add(objecttype.service)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This fails currently, because service was removed from the ObjectType model
web-init-1 | File "/app/src/objects/core/management/commands/check_for_external_objecttypes.py", line 23, in handle
web-init-1 | service.add(objecttype.service)
web-init-1 | ^^^^^^^^^^^^^^^^^^
web-init-1 | AttributeError: 'ObjectType' object has no attribute 'service'

Let's instead output the UUID or names of the Objecttypes that were not imported yet

Could you also make sure there is a test for this?

'1':
- record__data__leeftijd
- record__data__kiemjaar
# TODO
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 go for the second option for now

@Floris272 Floris272 force-pushed the feature/564-open-objecten branch from d673439 to 8214fae Compare February 9, 2026 14:16
@Floris272 Floris272 force-pushed the feature/564-open-objecten branch from 5e51c56 to d9f47d4 Compare February 10, 2026 15:15
@github-actions
Copy link
Contributor

🐰 Bencher Report

Branchfeature/564-open-objecten
Testbedubuntu-24.04
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
121.91 ms
(-0.94%)Baseline: 123.07 ms
129.22 ms
(94.34%)
performance_test/tests/test_objects_list.py::test_objects_api_list_filter_one_result📈 view plot
🚷 view threshold
18.55 ms
(-9.86%)Baseline: 20.58 ms
21.61 ms
(85.85%)
performance_test/tests/test_objects_list.py::test_objects_api_list_large_page_size_page_1📈 view plot
🚷 view threshold
327.06 ms
(+4.07%)Baseline: 314.28 ms
329.99 ms
(99.11%)
performance_test/tests/test_objects_list.py::test_objects_api_list_large_page_size_page_5📈 view plot
🚷 view threshold
326.21 ms
(+4.45%)Baseline: 312.31 ms
327.93 ms
(99.48%)
performance_test/tests/test_objects_list.py::test_objects_api_list_small_page_size_page_20📈 view plot
🚷 view threshold
122.65 ms
(-2.78%)Baseline: 126.16 ms
132.47 ms
(92.59%)
🐰 View full continuous benchmarking report in Bencher

@Floris272 Floris272 requested a review from stevenbal February 10, 2026 16:15
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.

OpenObjecten - combine the ObjectsType API into the Objects API

3 participants