Skip to content

[Feature Request] Flag to log run info on removal from db #282

Description

@HuntTheSun

Would anyone be interested in a flag (could be handled by an env var also if you prefer) that logs run data to a json before removing the run from the db?

robotdashboard -r 'index=1:3' --log-removed-runs "/var/log/robotdashboard/removed_runs.json"

cat removed_runs.json | jq .
{
  "run_start": "2025-03-13 00:26:36.304669-05:00",
  "full_name": "Other",
  "name": "Other",
  "total": 114,
  "passed": 104,
  "failed": 10,
  "skipped": 0,
  "elapsed_s": "14.655",
  "start_time": "2025-03-13 00:26:36.305700",
  "tags": "prod,project_1",
  "run_alias": "output-20250313-002636",
  "path": "D:\\CodeProjects\\robotframework-dashboard\\.\\tests\\robot\\resources\\outputs\\output-20250313-002636.xml",
  "metadata": "[]",
  "project_version": "2.3"
}
...

# You could then for example use the log for cleaning up leftover log.html files by getting the corresponding run_alias
cat removed_runs.json | jq .run_alias
"output-20250313-002134"
"output-20250313-002151"
"output-20250313-002222"

Would that be something that could be of use to the community or would it not be worth the extra flag in your opinion?
I implemented it roughly to see check much hassle it would be and its not really a hassle or hacky (for my tastes).
I would of course volunteer to implement it if you like the feature.

Thanks in advance!

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions