Run data: fix tags missing from project and default cache entries#339
Open
ol-nata wants to merge 2 commits into
Open
Run data: fix tags missing from project and default cache entries#339ol-nata wants to merge 2 commits into
ol-nata wants to merge 2 commits into
Conversation
Previously, the tags cache for `project_id=None` relied on `category__project_id=None` which incorrectly captured tags without any category via LEFT JOIN, and `category__isnull=True` which excluded tags categorised in projects from `relevant` and `all`. For the default context, `important` now uses `project_id__isnull=True` to correctly match only default categories. `relevant` contains all tags not in `important`, and `all` contains every tag in the database. Signed-off-by: Natalia Rybchenko <natalia.rybchenko@oktetlabs.ru>
Previously, tags appearing in a project's runs were excluded from the project's cache if they had been categorised in another project, since the uncategorised filter relied on `category__isnull=True`. The cache is now populated from tags actually appearing in that project's runs, filtered via a direct JOIN on `MetaResult` and `TestIterationResult`. Tags not categorised for the project are treated as uncategorised and included in `relevant` and `all`, regardless of whether they are categorised in other projects. Signed-off-by: Natalia Rybchenko <natalia.rybchenko@oktetlabs.ru>
d3cd314 to
b18188e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Tags cache (
_TagsCache) had two issues affecting tag visibility.For projects: tags appearing in a project's runs were invisible if they had been categorized in another project. The uncategorized filter relied on
category__isnull=True, which only captured tags with no category at all, excluding cross-project categorized tags.For default context (
project_id=None):category__project_id=Noneincorrectly captured tags without any category via LEFT JOIN, andcategory__isnull=Trueexcluded tags categorized in projects from 'relevant' and 'all'.Solution
For projects: the cache is now populated from tags actually appearing in that project's runs. Tags not categorized for the project are treated as uncategorized and included in 'relevant' and 'all', regardless of whether they are categorized in other projects.
For default context: 'important' now uses
project_id__isnull=Trueto correctly match only default categories. 'relevant' contains all tags not in 'important', and 'all' contains every tag in the database.