Skip to content

fix: treat flatpak as fast manager for live typing#7

Closed
Timmy6942025 wants to merge 1 commit intomasterfrom
fix/flatpak-fast-manager
Closed

fix: treat flatpak as fast manager for live typing#7
Timmy6942025 wants to merge 1 commit intomasterfrom
fix/flatpak-fast-manager

Conversation

@Timmy6942025
Copy link
Copy Markdown
Owner

Summary

Move flatpak from slow to fast manager list in defaultDynamicReloadManagers().

  • Live typing (change: reload) now includes flatpak results alongside apt/bun
  • npm remains slow and requires Ctrl+R for full search
  • Makes live typing results consistent with CLI argument results

Changes

  • cmd/fpf/cli_runtime.go: Remove "flatpak": {} from slow map
  • cmd/fpf/cli_runtime_test.go: Update test expectations
  • tests/smoke.sh: Update smoke test assertions

Testing

  • All Go unit tests pass
  • Build succeeds without errors

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: bd8b29ca-54d1-4757-a10f-5c79f4f8151f

📥 Commits

Reviewing files that changed from the base of the PR and between bcb9b06 and 965dbc6.

📒 Files selected for processing (3)
  • cmd/fpf/cli_runtime.go
  • cmd/fpf/cli_runtime_test.go
  • tests/smoke.sh

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Flatpak and npm package managers are now included in live search/results during dynamic reloads, matching other fast managers.
  • Tests

    • Updated unit and smoke test expectations to include flatpak (and npm where applicable) in the default dynamic manager lists and verify correct invocation behavior.

Walkthrough

The change removes flatpak (and effectively npm) from the "slow managers" exclusion, causing them to be included among dynamically reloaded "fast" managers; tests and a smoke script were updated to expect flatpak in the dynamic-reload manager lists and command output.

Changes

Cohort / File(s) Summary
Runtime manager classification
cmd/fpf/cli_runtime.go
Removed flatpak/npm entries from the slow-managers exclusion map so they are considered for dynamic reload as fast managers.
Unit tests
cmd/fpf/cli_runtime_test.go
Updated expectations for dynamicReloadManagers(allManagers) to include flatpak and npm in the default/invalid-override cases.
Smoke tests
tests/smoke.sh
Adjusted run_dynamic_reload_manager_parity_no_nested_exec_test assertions to expect FPF_IPC_MANAGER_LIST and fzf output to include flatpak and related flatpak search command output.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hopped through code at break of dawn,

flatpak joined the sprint, the slow tag gone.
Tests clap their paws, the reloads prance,
Bun and npm now dance the dance. 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: treat flatpak as fast manager for live typing' accurately summarizes the main change: reclassifying flatpak from slow to fast managers to improve live typing functionality.
Description check ✅ Passed The description is well-related to the changeset, explaining the rationale (live typing consistency), listing affected files, and documenting testing verification.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/flatpak-fast-manager

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/smoke.sh`:
- Around line 1405-1408: The test contains a duplicated assertion using
assert_fzf_line_contains for "FPF_IPC_MANAGER_LIST=apt,flatpak,bun" (the two
consecutive calls); remove the redundant assert_fzf_line_contains call (or if
both are intentionally checking different fzf invocations, disambiguate by
adding a short comment explaining why both are needed) and keep the updated
assert_contains "flatpak search --columns=application,description rip" as-is;
look for the duplicate calls to assert_fzf_line_contains in the tests/smoke.sh
snippet to make the change.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9f29d1b6-90c4-4675-b51c-1b9c5b7a76d5

📥 Commits

Reviewing files that changed from the base of the PR and between 26b17cd and bcb9b06.

📒 Files selected for processing (3)
  • cmd/fpf/cli_runtime.go
  • cmd/fpf/cli_runtime_test.go
  • tests/smoke.sh
📜 Review details
🧰 Additional context used
🪛 GitHub Actions: test
cmd/fpf/cli_runtime.go

[error] 1-1: Execution failed with "Permission denied" when running /home/runner/work/fpf-cli/fpf-cli/fpf (exit code 126).

cmd/fpf/cli_runtime_test.go

[error] 1-1: Execution failed with "Permission denied" when running /home/runner/work/fpf-cli/fpf-cli/fpf (exit code 126).

tests/smoke.sh

[error] 883-883: Smoke test failed: unable to execute ./fpf binary due to permission error: "Permission denied". Process completed with exit code 126.

🔇 Additional comments (3)
cmd/fpf/cli_runtime.go (1)

803-817: Reclassifying flatpak as a fast manager looks reasonable given the caching layer.

The flatpak search implementation in search_entries.go prioritizes the local cache (flatpak.ShouldUseDirectCache() / flatpak.LoadBest()), which should provide fast responses when warm. However, when the cache is cold or missing, the code falls back to flatpak search or flatpak remote-ls which spawn blocking external processes.

Consider whether users on first-run or with stale caches might experience slower live-typing responsiveness. If this becomes an issue, you could add a check like flatpak.IsCacheWarm() to conditionally classify it.

cmd/fpf/cli_runtime_test.go (1)

100-124: Test expectations correctly updated to reflect flatpak reclassification.

The updated assertions properly verify:

  1. Default behavior now includes flatpak in the fast subset
  2. Invalid override correctly falls back to the new default (apt,flatpak,bun)

The test coverage for dynamicReloadManagers remains comprehensive.

tests/smoke.sh (1)

6-6: Add a build step to the CI workflow before running smoke tests.

The CI pipeline runs npm test (which executes smoke.sh) without first building the fpf binary. The smoke.sh script expects the binary at ${ROOT_DIR}/fpf, but the build process is never triggered. Either add a go build ./cmd/fpf -o ./fpf step to the test workflow before running npm test, or invoke the build script that already exists at scripts/build-go-binaries.sh.

Comment thread tests/smoke.sh
Comment on lines +1405 to +1408
assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,flatpak,bun"
assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,flatpak,bun"
assert_contains "bun search rip"
assert_not_contains "flatpak search --columns=application,description rip"
assert_contains "flatpak search --columns=application,description rip"
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.

🧹 Nitpick | 🔵 Trivial

Test assertions correctly updated; duplicate assertion on lines 1405-1406.

Lines 1405 and 1406 both assert FPF_IPC_MANAGER_LIST=apt,flatpak,bun. If this duplication is intentional (e.g., checking different fzf invocations), consider adding a comment. Otherwise, remove the redundant line.

The assertion change on line 1408 from assert_not_contains to assert_contains correctly reflects that flatpak is now queried during live typing.

🔧 Remove duplicate assertion if unintentional
     assert_not_contains "--feed-search"
     assert_contains "apt-cache dumpavail"
     assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,flatpak,bun"
-    assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,flatpak,bun"
     assert_contains "bun search rip"
     assert_contains "flatpak search --columns=application,description rip"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,flatpak,bun"
assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,flatpak,bun"
assert_contains "bun search rip"
assert_not_contains "flatpak search --columns=application,description rip"
assert_contains "flatpak search --columns=application,description rip"
assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,flatpak,bun"
assert_contains "bun search rip"
assert_contains "flatpak search --columns=application,description rip"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/smoke.sh` around lines 1405 - 1408, The test contains a duplicated
assertion using assert_fzf_line_contains for
"FPF_IPC_MANAGER_LIST=apt,flatpak,bun" (the two consecutive calls); remove the
redundant assert_fzf_line_contains call (or if both are intentionally checking
different fzf invocations, disambiguate by adding a short comment explaining why
both are needed) and keep the updated assert_contains "flatpak search
--columns=application,description rip" as-is; look for the duplicate calls to
assert_fzf_line_contains in the tests/smoke.sh snippet to make the change.

Move flatpak and npm from slow to fast manager list in defaultDynamicReloadManagers().
Now live typing (change: reload) includes ALL managers - no Ctrl+R needed.

This makes live typing results consistent with CLI argument results.

Updated tests to reflect new behavior.
@Timmy6942025 Timmy6942025 force-pushed the fix/flatpak-fast-manager branch from bcb9b06 to 965dbc6 Compare March 27, 2026 17:41
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