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

chore(hybridcloud) Expand OrgMapping update payload #71119

Merged
merged 5 commits into from
May 22, 2024

Conversation

markstory
Copy link
Member

Our schema generation and validation tooling doesn't work well with tuple values. Replace this tuple with an 'Optional' that retains the ability to preserve 'undefined' vs 'defined and none'.

Refs HC-1190

Our schema generation and validation tooling doesn't work well with
tuple values. Replace this tuple with an 'Optional' that retains the
ability to preserve 'undefined' vs 'defined and none'.

Refs HC-1190
@markstory markstory requested a review from a team as a code owner May 17, 2024 16:28
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label May 17, 2024
Copy link

codecov bot commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.91%. Comparing base (8a46387) to head (62502e8).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #71119      +/-   ##
==========================================
+ Coverage   77.89%   77.91%   +0.02%     
==========================================
  Files        6529     6526       -3     
  Lines      290909   290386     -523     
  Branches    50338    50229     -109     
==========================================
- Hits       226591   226254     -337     
+ Misses      58096    57896     -200     
- Partials     6222     6236      +14     
Files Coverage Δ
src/sentry/receivers/outbox/region.py 71.42% <ø> (ø)
...services/hybrid_cloud/organization_mapping/impl.py 73.77% <100.00%> (+4.80%) ⬆️
...ervices/hybrid_cloud/organization_mapping/model.py 100.00% <100.00%> (ø)
...rvices/hybrid_cloud/organization_mapping/serial.py 100.00% <100.00%> (ø)

... and 124 files with indirect coverage changes

Copy link
Member

@GabeVillalobos GabeVillalobos left a comment

Choose a reason for hiding this comment

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

Changes look good, just had a minor question about the param types

@@ -32,7 +36,8 @@ class RpcOrganizationMappingUpdate(RpcModel):
# When not set, no change to customer id performed,
# when set with a tuple, the customer_id set to either None or the string
# that is the first element.
customer_id: tuple[str | None] | None = None
# Using a tuple is deprecated and will be removed.
customer_id: tuple[str | None] | CustomerId | None = None
Copy link
Member

Choose a reason for hiding this comment

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

What's the benefit of using a class here vs just passing an int? Will we be adding more attributes to it in the future?

Copy link
Member Author

Choose a reason for hiding this comment

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

The current implementation uses a single element tuple of str | None to indicate a value/explicit None vs an implicit None because the key is undefined. The class lets us wrap None and maintain the same semantics as the tuple.

@markstory markstory merged commit 85022f8 into master May 22, 2024
49 checks passed
@markstory markstory deleted the chore-orgmapping-rpc-return branch May 22, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants