Skip to content

Bug 2088705 - Record the acting user in flag_activity.who, as a nullable column - #2808

Merged
dklawren merged 1 commit into
mozilla:masterfrom
Xzzz:bug-2088705
Nov 4, 2026
Merged

dklawren merged 1 commit into
mozilla:masterfrom
Xzzz:bug-2088705

Conversation

@Xzzz

@Xzzz Xzzz commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a nullable flag_activity.who column for the user who made each flag change, and writes it on every flag change. Nothing reads it yet, and flag changes are still written to bugs_activity.

First step of 2085398 (#2796), which makes the column NOT NULL and stops writing bugs_activity. Shipped in one deploy, that broke flag changes on the pods still running the old code during the rolling deploy: they insert rows without who, which MySQL (strict mode off) stores as 0, and the foreign key rejects it. Once this is deployed, every pod writes who.

Changes

  • New flag_activity.who column, nullable, with a foreign key to profiles and an index on (who, flag_when). It differs from setter_id when a request is redirected, which keeps the original setter.
  • checksetup fills who = setter_id on the rows without it, on every run: the existing rows, and the ones pods on the old code insert during the deploy.
  • Bugzilla::Flag writes who (the current user, or the setter when there is none) for every flag change.
  • scripts/remove-non-public-data.pl keeps who in the public data dump, and the users it references.
  • New t/flag-activity-who.t.

Test plan

  • Redirect a needinfo to someone else as another user: the new flag_activity row has that user as who and the requester as setter_id
  • checksetup on a database without who: the column, its foreign key and index are added, and the existing rows get who = setter_id
  • Insert a flag_activity row without who: it's saved with who NULL, and the next checksetup fills it

References

@dklawren dklawren left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM r=dkl

@dklawren
dklawren merged commit 866379d into mozilla:master Nov 4, 2026
7 checks passed
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.

2 participants