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

ref(flags): allow launchdarkly member to be null #83054

Merged
merged 8 commits into from
Jan 8, 2025

Conversation

michellewzhang
Copy link
Member

@michellewzhang michellewzhang commented Jan 7, 2025

LaunchDarkly can have an undefined value for member in its payload, which means we have nothing to set in our created_by value in the audit log. However, the createdBy column is currently required. This PR migrates the model to allow for null values for the created by and created by type.

@michellewzhang michellewzhang requested a review from a team as a code owner January 7, 2025 22:03
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 7, 2025
@michellewzhang michellewzhang requested a review from aliu39 January 7, 2025 22:04
Copy link
Contributor

github-actions bot commented Jan 7, 2025

This PR has a migration; here is the generated SQL for src/sentry/flags/migrations/0003_allow_null_created_by.py ()

--
-- Alter field created_by on flagauditlogmodel
--
ALTER TABLE "flags_audit_log" ALTER COLUMN "created_by" DROP NOT NULL;
--
-- Alter field created_by_type on flagauditlogmodel
--
ALTER TABLE "flags_audit_log" ALTER COLUMN "created_by_type" DROP NOT NULL;

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #83054       +/-   ##
===========================================
+ Coverage   33.13%   87.59%   +54.46%     
===========================================
  Files        7988     9429     +1441     
  Lines      446878   536264    +89386     
  Branches    21113    21063       -50     
===========================================
+ Hits       148082   469757   +321675     
+ Misses     298437    66147   -232290     
- Partials      359      360        +1     

Copy link
Member

@cmanallen cmanallen left a comment

Choose a reason for hiding this comment

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

Great job Michelle! Last item is to update the blueprint so clients know this field can be null now.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

@michellewzhang
Copy link
Member Author

Great job Michelle! Last item is to update the blueprint so clients know this field can be null now.

updated:

SCR-20250108-jjfk

Copy link

codecov bot commented Jan 8, 2025

Bundle Report

Bundle size has no change ✅

src/sentry/flags/docs/api.md Outdated Show resolved Hide resolved
michellewzhang added a commit that referenced this pull request Jan 8, 2025
)

merge before #83054

it looks like we weren't using the `createdBy` or `createdByType` field
anywhere
@michellewzhang michellewzhang merged commit 59cf25e into master Jan 8, 2025
50 checks passed
@michellewzhang michellewzhang deleted the mz/migrate-created-by-cols branch January 8, 2025 22:25
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 Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate createdBy column to allow null value
2 participants