Skip to content

Run data: fix tags missing from project and default cache entries#339

Open
ol-nata wants to merge 2 commits into
ts-factory:mainfrom
ol-nata:bugfix/cache
Open

Run data: fix tags missing from project and default cache entries#339
ol-nata wants to merge 2 commits into
ts-factory:mainfrom
ol-nata:bugfix/cache

Conversation

@ol-nata

@ol-nata ol-nata commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

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=None incorrectly captured tags without any category via LEFT JOIN, and category__isnull=True excluded 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=True to correctly match only default categories. 'relevant' contains all tags not in 'important', and 'all' contains every tag in the database.

ol-nata added 2 commits June 27, 2026 02:28
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>
@ol-nata ol-nata force-pushed the bugfix/cache branch 2 times, most recently from d3cd314 to b18188e Compare July 6, 2026 13:30
@ol-nata ol-nata changed the title Run data: fix tags missing from project and default cache entries Cache: extend and fix project and default cache entries Jul 6, 2026
@ol-nata ol-nata changed the title Cache: extend and fix project and default cache entries Run data: fix tags missing from project and default cache entries Jul 6, 2026
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.

1 participant