Skip to content

Fix bug where environments/releases not properly updated on event ingest

james kiger requested to merge fix-sql-joins into master

We have had a couple reports of an issue with environments not showing up in users' environment filter on their issue pages. I determined that the "environment project" was not being created when there was an existing environment with the same name. This was caused by our recent SQL optimizations. Because the new queries were using a left join, the where statement was being executed on the entirety of the left table (environments), meaning that if any environment at all exists with that name, it would be returned (and down the line, no new environment project would be created, hence the bug). I switched this to an inner join, so that the where statement is only executed on the overlapping results of the environment and environment project tables. I noticed that the same format of query was used for releases and confirmed that a similar issue was happening there with a unit test, so I adjusted that as well.

Edited by james kiger

Merge request reports