Skip to content

SEP-1847: Drop dead owner filter from task-history reads - #1376

Open
olucasandrade wants to merge 4 commits into
mainfrom
SEP-1847
Open

SEP-1847: Drop dead owner filter from task-history reads#1376
olucasandrade wants to merge 4 commits into
mainfrom
SEP-1847

Conversation

@olucasandrade

@olucasandrade olucasandrade commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove the unused owner query parameter from get_task_history and the five task-history read routes (/files, /files/.../download, /stream-logs, /stream-logs/.../execution-events, /execution-events). Task.owner is an app namespace, not a user identity; the parameter only produced 404s.
  • Pin the existing visibility contract in the dependency docstring and tests: any authenticated user can read any task history. Attribution stays on executed_by. get_task_by_name / make_task_dep() are unchanged.
  • Relates to SEP-1847 and SEP-1838.

Tested

  • Log in at http://localhost:5174 (backend and frontend already running from the SEP-1847 worktree).
  • Open a completed run executed by someone else — local data has history 1310 (local-pg-backup-e2e, owner BACKUP_PG, executed_by a user UUID, status SUCCESS). Task Manager or PostgreSQL backups → that run.
  • Open logs for that run. The log stream loads (not a 404).
  • Open the run's files list. Files load (not a 404).
  • In DevTools, replay GET /files/1310 and GET /stream-logs/1310 with ?owner=ALTERS added. Both still succeed (200 / SSE), not 404.
  • Confirm an anonymous GET http://localhost:8000/files/1310?owner=ALTERS is still 401.
  • Confirm /api/openapi.json lists no owner query param on the five routes, while /api/apps/tasks/{task_name} still has owner.

Checklist

  • New/modified functions have type hints and rST docstrings
  • New tests added for new features or bug fixes
  • Covering tests pass locally (pytest on deps + shared-route-auth + files/logs/events + make_task_dep — 181 passed). Full make test was 9843 passed / 82 failed / 429 skipped; failures are pre-existing (tests/sidecar/test_settings_env.py and one xtrabackup AES round-trip) and unrelated to this change
  • Pre-commit hooks pass (make run-pre-commit)
  • Database migrations generated if models changed (make makemigrations) (N/A)
  • User-facing changes documented (README, inline help, UI text) (N/A — API/OpenAPI + changelog only)
  • Configuration changes documented with examples (N/A)
  • Changelog fragment added under changelog.d/ if the change is user-facing (make changelog-add), or confirmed N/A (internal-only change, or a same-release-cycle fix for an unreleased sibling ticket)

Task.owner is an app namespace, not a user identity; the query parameter
only produced 404s and never authorized anything. Pin team-wide read
visibility in the dependency docstring and tests.
@olucasandrade olucasandrade added the qa passed Tests for this PR are completed and successful. label Aug 20, 2026
@olucasandrade
olucasandrade marked this pull request as ready for review August 20, 2026 15:58
@olucasandrade
olucasandrade requested a review from nachodd as a code owner August 20, 2026 15:58
Copilot AI balanced review requested due to automatic review settings August 20, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This focused PR removes the misleading task-owner filter while preserving authenticated, team-wide task-history access.

Changes:

  • Removes owner filtering from get_task_history.
  • Updates OpenAPI types/specification and route coverage.
  • Documents the user-facing API change.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/sep/deps.py Removes history owner filtering and clarifies visibility.
tests/app/sep/test_deps.py Updates dependency-level coverage.
tests/app/sep/routes/test_shared_route_auth.py Covers all five routes and their schema.
frontend/packages/api/specs/sep.json Removes owner query parameters.
frontend/packages/api/src/generated/sep.ts Regenerates TypeScript API types.
changelog.d/SEP-1847.changed.md Records the API change.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/app/sep/test_deps.py Outdated
Comment thread tests/app/sep/test_deps.py Outdated
Comment thread tests/app/sep/routes/test_shared_route_auth.py Outdated
@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  app/sep
  deps.py
  inventory.py
  app/sep/routes
  stream_logs.py
  app/sep/sync/syncers
  pmm.py
Project Total  

This report was generated by python-coverage-comment-action

olucasandrade and others added 2 commits August 20, 2026 19:33
Drop the docstring wording assertion, build histories via the response factory, and reuse FastAPI status constants.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend python qa passed Tests for this PR are completed and successful.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants