Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(completion): better handle native errors in completion funcs #373

Merged
merged 1 commit into from
Feb 1, 2025

Conversation

reubeno
Copy link
Owner

@reubeno reubeno commented Feb 1, 2025

This should hopefully make it quicker to track down completion errors in the future. It should also allow completion to degrade a bit more gracefully in this case.

@reubeno reubeno requested a review from Copilot February 1, 2025 07:19

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

brush-core/src/completion.rs:685

  • [nitpick] The error message could be more descriptive. Consider including more context about the error to aid in debugging.
tracing::warn!(target: trace_categories::COMPLETION, "error while running completion function '{function_name}': {e}");

brush-core/src/completion.rs:686

  • [nitpick] The exit code '1' is ambiguous. Consider defining a constant for this exit code to make the code more readable and maintainable.
1 // Report back a non-zero exit code.
Copy link

github-actions bot commented Feb 1, 2025

Test Results

    2 files      9 suites   1m 35s ⏱️
  668 tests   668 ✅ 0 💤 0 ❌
1 322 runs  1 322 ✅ 0 💤 0 ❌

Results for commit 27d8319.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Feb 1, 2025

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
clone_shell_object 18.20 μs 17.90 μs -0.30 μs 🟢 -1.66%
eval_arithmetic 0.17 μs 0.17 μs 0.00 μs ⚪ Unchanged
expand_one_string 1.59 μs 1.58 μs -0.00 μs ⚪ Unchanged
for_loop 22.18 μs 21.80 μs -0.38 μs 🟢 -1.70%
function_call 2.29 μs 2.32 μs 0.03 μs ⚪ Unchanged
instantiate_shell 56.69 μs 56.86 μs 0.17 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 21318.22 μs 21455.70 μs 137.48 μs ⚪ Unchanged
parse_bash_completion 1649.96 μs 1665.46 μs 15.50 μs ⚪ Unchanged
parse_sample_script 1.73 μs 1.79 μs 0.05 μs 🟠 +3.12%
run_echo_builtin_command 14.80 μs 15.04 μs 0.24 μs ⚪ Unchanged
run_one_external_command 2088.28 μs 2153.82 μs 65.55 μs 🟠 +3.14%
tokenize_sample_script 2.84 μs 2.91 μs 0.07 μs 🟠 +2.36%

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/completion.rs 🟠 63.4% 🟠 63.43% 🟢 0.03%
brush-core/src/jobs.rs 🔴 37.07% 🔴 43.1% 🟢 6.03%
Overall Coverage 🟢 77.82% 🟢 77.9% 🟢 0.08%

Minimum allowed coverage is 70%, this run produced 77.9%

@reubeno reubeno merged commit 56eebe6 into main Feb 1, 2025
17 checks passed
@reubeno reubeno deleted the completion-errs branch February 1, 2025 17:22
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