Skip to content

Add direct backup download action to executions menu#177

Open
Prains wants to merge 2 commits into
eduardolat:mainfrom
Prains:direct-execution-download
Open

Add direct backup download action to executions menu#177
Prains wants to merge 2 commits into
eduardolat:mainfrom
Prains:direct-execution-download

Conversation

@Prains

@Prains Prains commented Jun 27, 2026

Copy link
Copy Markdown

Summary

  • add a Download backup action to each downloadable execution row menu on /dashboard/executions
  • reuse the existing /dashboard/executions/{id}/download route/handler
  • keep the details modal download action intact and add regression coverage for row visibility

Closes #176

Verification

  • /tmp/go1.26.4/go/bin/gofmt -w internal/view/web/dashboard/executions/list_executions.go internal/view/web/dashboard/executions/show_execution.go internal/view/web/dashboard/executions/show_execution_test.go
  • PATH=/tmp/go1.26.4/go/bin:$PATH /tmp/go1.26.4/go/bin/go test ./internal/view/web/dashboard/executions ./...
  • PATH=/tmp/go1.26.4/go/bin:$PATH /tmp/go1.26.4/go/bin/go build -o ./dist/app ./cmd/app/.
  • PATH=/tmp/go1.26.4/go/bin:$PATH /tmp/go1.26.4/go/bin/go build -o ./dist/change-password ./cmd/changepw/.
  • npm run prettier -- --check . --ignore-path .prettierignore.tmp (local .omx/ and generated tmp/ excluded)
  • git diff --check

Notes

  • Docker daemon was not available locally, so verification used a temporary Go toolchain plus project npm dependencies instead of the Docker dev image.

Summary by CodeRabbit

  • New Features
    • Added a download option to each execution’s action menu, making it easier to access execution output from the list view.
    • Improved the execution detail page so the download link opens in a new tab and is shown only when the execution is available to download.
  • Tests
    • Added coverage to ensure the download option renders correctly for downloadable executions and is hidden for non-downloadable cases.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ef7f186c-447d-4cbe-ac23-6b810cf80a79

📥 Commits

Reviewing files that changed from the base of the PR and between b711efa and ce1eb2b.

📒 Files selected for processing (1)
  • internal/view/web/dashboard/executions/show_execution_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/view/web/dashboard/executions/show_execution_test.go

📝 Walkthrough

Walkthrough

Adds a reusable download-link helper for execution views, wires a download action into the executions row menu, and adds test coverage for when the menu item renders.

Changes

Execution download action

Layer / File(s) Summary
Download link helper
internal/view/web/dashboard/executions/show_execution.go
Extracts the execution download anchor into a helper and reuses it for the details-page download button.
Row menu download action
internal/view/web/dashboard/executions/list_executions.go, internal/view/web/dashboard/executions/show_execution_test.go
Adds the executions row dropdown download entry and verifies it renders only for downloadable executions.

Estimated review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A bunny hopped through dashboard glows,
A download carrot now clearly shows.
One helper keeps the path aligned,
One menu hop for backups signed,
Hooray—my floppy ears approve these flows! 🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states the new direct download action in the executions menu.
Linked Issues check ✅ Passed The PR adds a row-menu download action, reuses the existing download route, and hides it when unavailable.
Out of Scope Changes check ✅ Passed The changes stay focused on the executions download action and its tests.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
internal/view/web/dashboard/executions/show_execution_test.go (1)

15-49: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Exercise listExecutions with a named table, not just the helper.

This only tests downloadExecutionDropdownButton in isolation, so it would still pass if the row-menu wiring at Line 82 in internal/view/web/dashboard/executions/list_executions.go disappeared. Converting this into a named slice-of-structs table that renders the row menu would both cover the PR’s regression target and satisfy the test-file convention. As per coding guidelines, **/*_test.go: Write table-driven tests using t.Run with a slice of structs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/view/web/dashboard/executions/show_execution_test.go` around lines
15 - 49, The current test only covers downloadExecutionDropdownButton directly,
so it misses regressions in listExecutions row-menu wiring. Refactor this into a
named table-driven test using t.Run with a slice of structs that exercises
listExecutions and renders the row menu, not just the helper, so the dashboard
executions menu behavior is covered end-to-end. Use the existing symbols
listExecutions and downloadExecutionDropdownButton to locate the relevant code
and keep the assertions focused on the rendered menu output.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/view/web/dashboard/executions/show_execution_test.go`:
- Around line 29-33: The execution download link assertion in
show_execution_test.go is hardcoding the unprefixed route, so it should be
updated to match the production URL construction used by the dashboard view. Use
pathutil.BuildPath with the execution download route and executionID when
building the expected href in the test, so the assertion remains correct when a
path prefix is configured. Locate the check around the Download backup link in
TestShowExecution.

---

Nitpick comments:
In `@internal/view/web/dashboard/executions/show_execution_test.go`:
- Around line 15-49: The current test only covers
downloadExecutionDropdownButton directly, so it misses regressions in
listExecutions row-menu wiring. Refactor this into a named table-driven test
using t.Run with a slice of structs that exercises listExecutions and renders
the row menu, not just the helper, so the dashboard executions menu behavior is
covered end-to-end. Use the existing symbols listExecutions and
downloadExecutionDropdownButton to locate the relevant code and keep the
assertions focused on the rendered menu output.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4de0e07f-7a89-4966-b373-a35c0efb5fba

📥 Commits

Reviewing files that changed from the base of the PR and between 70e0d9e and b711efa.

📒 Files selected for processing (3)
  • internal/view/web/dashboard/executions/list_executions.go
  • internal/view/web/dashboard/executions/show_execution.go
  • internal/view/web/dashboard/executions/show_execution_test.go

Comment thread internal/view/web/dashboard/executions/show_execution_test.go
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.

Add direct backup download action to executions menu

1 participant