Skip to content

fix missing pantry logic#81

Merged
jhheider merged 1 commit intomainfrom
fix-ci-runners
Mar 30, 2026
Merged

fix missing pantry logic#81
jhheider merged 1 commit intomainfrom
fix-ci-runners

Conversation

@jhheider
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 30, 2026 15:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts uninstall behavior to handle environments where the pantry lookup is unavailable, falling back to alternate package resolution.

Changes:

  • Wrap hooks.usePantry().find(arg) in a try/catch during uninstall.
  • Add a log message when pantry lookup fails, then fall back to plumbing.which(arg).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

found = (await hooks.usePantry().find(arg))?.[0];
} catch {
console.error(
"%ci pantry not found, trying to find package another way",
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

Log format string looks incorrect: "%ci pantry not found..." will print an extra i (and may not apply styling as intended). If the goal is to color the whole message, it should start with %c immediately followed by the message text.

Suggested change
"%ci pantry not found, trying to find package another way",
"%c pantry not found, trying to find package another way",

Copilot uses AI. Check for mistakes.
Comment on lines +555 to +559
} catch {
console.error(
"%ci pantry not found, trying to find package another way",
"color:blue",
);
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

The bare catch {} will swallow all errors from hooks.usePantry().find(arg), including unexpected I/O or parsing failures, and then proceed to plumbing.which, which can hide real problems and make debugging difficult. Consider catching the error as a variable and only falling back when the error indicates the pantry is missing/unavailable; otherwise rethrow (or at least include the error details in the log).

Suggested change
} catch {
console.error(
"%ci pantry not found, trying to find package another way",
"color:blue",
);
} catch (err) {
console.error(
"%cerror querying pantry, trying to find package another way",
"color:blue",
);
console.error(err);

Copilot uses AI. Check for mistakes.
@jhheider jhheider merged commit 9078e60 into main Mar 30, 2026
3 checks passed
@jhheider jhheider deleted the fix-ci-runners branch March 30, 2026 16:06
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.

2 participants