Get event environment from tags, not data, when unmerging. (#5505)
Get event environment from tags, not data, when unmerging. (#5505)

My previous assumption here was incorrect. The way environment is
actually processed during ingestion is:

1. https://github.com/getsentry/sentry/blob/a5767ca6f26db209adcc105ebdc1b7083a6b3687/src/sentry/event_manager.py#L306-L311
   If there is a tag that has the `environment` key, set it on the
   `data` mapping instead of passing it through as a tag. If there is an
   existing `environment` attribute, it gets overwritten here.
2. https://github.com/getsentry/sentry/blob/a5767ca6f26db209adcc105ebdc1b7083a6b3687/src/sentry/event_manager.py#L419
   https://github.com/getsentry/sentry/blob/a5767ca6f26db209adcc105ebdc1b7083a6b3687/src/sentry/event_manager.py#L459-L460
   When saving, remove `environment` from the `data` mapping (so it is
   not set as a top level key on the `Event.data` attribute) and store
   it as a local variable, then put it *back* as a tag on the event.
gencer/sentry,mvaled/sentry,looker/sentry,mvaled/sentry,jean/sentry,mvaled/sentry,looker/sentry,jean/sentry,beeftornado/sentry,jean/sentry,ifduyue/sentry,looker/sentry,beeftornado/sentry,mvaled/sentry,ifduyue/sentry,mvaled/sentry,looker/sentry,gencer/sentry,jean/sentry,looker/sentry,ifduyue/sentry,gencer/sentry,beeftornado/sentry,gencer/sentry,mvaled/sentry,jean/sentry,gencer/sentry,ifduyue/sentry,ifduyue/sentry