Skip to content

[Bug] Overview and remove-runs "amount"/"limit" filters apply globally instead of per project, hiding or deleting whole projects #347

Description

@MatheusAssisNeves

Summary

Since #322 ("apply filter in overview"), the Overview page groups projects from filteredRuns — the fully filtered run list, including the global "amount" (last-N-runs) slice. That slice is applied across all runs from all projects combined, not per project. With multiple projects producing runs at different frequencies, a project whose runs are all older than the global last-N cutoff disappears entirely from the Overview (not just reduced — its whole section is missing), even though its data is still in the database. Default --quantity is 20, so this reproduces easily with 3+ projects of uneven run frequency.

The same "global instead of per-project" pattern exists in the retention/cleanup feature (--removeruns limit=N and the admin page's "remove by limit" field, _remove_by_limit() in database.py): it keeps the N newest runs globally unless the caller manually adds tag scoping (limit=10;tag=nightly). Used without scoping — the common case — "remove by limit" can silently wipe out the entire history of a low-frequency project while barely touching a high-frequency one.

Steps to reproduce (Overview)

  1. Generate a dashboard with 2+ projects (distinguished by run name or project_* tag), where one project has far fewer/older runs than the others combined.
  2. Open Overview with default settings (--quantity default = 20).
  3. The low-frequency project's card section is missing from Overview entirely.

Expected vs actual

  • Expected: Overview shows all projects, with the "amount" filter (if applied at all in this context) scoped per project — e.g. "last N runs of each project."
  • Actual: the "amount" filter is applied once to the combined run list before grouping by project, so it can hide whole projects.

Known workaround and why it's not a real fix

Passing a large --quantity (e.g. --quantity 999999) works around the Overview symptom, since filter_amount() clamps to runs.length. But #amount is a single global input shared by Overview and the Dashboard/Tables tabs (filteredRuns/filteredSuites/filteredTests/filteredKeywords are all derived from it), so this also forces the Dashboard tab to render far more data by default and noticeably slows it down.

Suggested fix

  • Overview: apply the "amount" limit per project when building projects_by_name/projects_by_tag in prepare_projects_grouped_data() (js/graph_creation/overview.js), instead of slicing the flat run list before grouping. Or exclude Overview grouping from the amount stage of the pipeline.
  • _remove_by_limit() / admin & CLI retention: consider making project scoping automatic (e.g. default to per-project-tag/per-run-name grouping) rather than relying on the caller to manually pass matching tag= filters, or at minimum warn when an un-scoped limit is applied across multiple distinct projects.

References

  • robotframework_dashboard/js/graph_creation/overview.js — prepare_projects_grouped_data(), create_project_overview()
  • robotframework_dashboard/js/filter.js — filter_amount()
  • robotframework_dashboard/arguments.py — --quantity (default 20)
  • robotframework_dashboard/database.py — _remove_by_limit()
  • Introduced/exposed by feat: apply filter in overview (#301) #322 (Overview grouping now consumes filteredRuns)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions