Skip to content

Conversation

@adrianviquez
Copy link
Contributor

@adrianviquez adrianviquez commented Dec 18, 2025

These are types + specifics for how we'll handle certain models/fields on data export.

https://linear.app/getsentry/issue/CCMRG-1991/make-model-exporter-registry

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.


Note

Establishes a registry and types for owner data export.

  • Adds models_registry.py with ordered EXPORTABLE_MODELS (parents before children), TIMESCALE_MODELS, and EXCLUDED_MODELS
  • Defines field handling: NULLIFIED_FIELDS (sensitive nullable fields) and DEFAULT_FIELDS (NOT NULL fields with default/factory values)
  • Adds helpers: get_model_class, get_nullified_fields, get_default_fields
  • Introduces types.py dataclasses: ExportConfig, ExportResult, FinalExportResult for orchestration and result reporting

Written by Cursor Bugbot for commit 28ebcd8. This will update automatically on new commits. Configure here.

@codecov-notifications
Copy link

codecov-notifications bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 0% with 37 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
libs/shared/shared/owner_data_export/types.py 0.00% 21 Missing ⚠️
...shared/shared/owner_data_export/models_registry.py 0.00% 16 Missing ⚠️

📢 Thoughts on this report? Let us know!

@sentry
Copy link

sentry bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 0% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.83%. Comparing base (08a0bd9) to head (28ebcd8).
⚠️ Report is 10 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
libs/shared/shared/owner_data_export/types.py 0.00% 21 Missing ⚠️
...shared/shared/owner_data_export/models_registry.py 0.00% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #620      +/-   ##
==========================================
- Coverage   93.87%   93.83%   -0.04%     
==========================================
  Files        1286     1289       +3     
  Lines       46659    46850     +191     
  Branches     1522     1517       -5     
==========================================
+ Hits        43800    43962     +162     
- Misses       2549     2579      +30     
+ Partials      310      309       -1     
Flag Coverage Δ
apiunit 96.56% <ø> (+<0.01%) ⬆️
sharedintegration 38.74% <0.00%> (-0.11%) ⬇️
sharedunit 88.57% <0.00%> (-0.22%) ⬇️
workerintegration 59.16% <ø> (+0.58%) ⬆️
workerunit 91.30% <ø> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 18, 2025

CodSpeed Performance Report

Merging this PR will improve performance by 29.78%

Comparing adrian/exporter-model-registry (28ebcd8) with main (dad60fb)

Summary

⚡ 1 improved benchmark
✅ 8 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
test_report_carryforward 5.3 ms 4.1 ms +29.78%

@thomasrockhu-codecov thomasrockhu-codecov requested a review from a team January 8, 2026 08:01
"""

success: bool
error: str | None = None
Copy link
Contributor

Choose a reason for hiding this comment

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

is this an error message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, if the export fails. Still subject to change as I go but a loose definition to have smth for now. It would likely be a custom error "failed in Repo export" something like that.

success: bool
download_url: str | None = None
download_expires_at: datetime | None = None
error: str | None = None
Copy link
Contributor

Choose a reason for hiding this comment

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

is this an error message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeap, same as the above ^ but for the final, aggregated export.

"sentry_user_id",
"sentry_user_data",
"account_id",
"user_id",
Copy link
Contributor

Choose a reason for hiding this comment

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

we would need this one still, right? As well as account_id, to maintain proper references

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe not account_id since that's an excluded 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.

Account no, user yes

@adrianviquez adrianviquez added this pull request to the merge queue Jan 8, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 8, 2026
@adrianviquez adrianviquez added this pull request to the merge queue Jan 8, 2026
Merged via the queue into main with commit 8f2c75b Jan 8, 2026
51 of 53 checks passed
@adrianviquez adrianviquez deleted the adrian/exporter-model-registry branch January 8, 2026 22:28
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.

4 participants