Skip to content

Apply loop update immediately#8

Merged
axeldelafosse merged 1 commit intomainfrom
chore/manual-update-apply-immediately
Feb 22, 2026
Merged

Apply loop update immediately#8
axeldelafosse merged 1 commit intomainfrom
chore/manual-update-apply-immediately

Conversation

@axeldelafosse
Copy link
Copy Markdown
Owner

Summary

  • Make loop update and loop upgrade apply downloaded updates directly instead of staging.
  • Keep startup path unchanged so auto-update still stages and applies on next launch.
  • Update CLI help text for manual update wording.
  • Update tests that previously expected staged files/metadata for manual update.

Validation

  • bun run check

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @axeldelafosse, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the update mechanism to allow manual loop update and loop upgrade commands to apply new versions immediately. This change streamlines the user experience for manual updates by removing the intermediate staging step, while preserving the existing staged update flow for automatic startup updates. The modifications involve introducing new functions for direct binary application and updating the command-line interface messaging and associated tests to align with this new behavior.

Highlights

  • Manual Update Behavior: The loop update and loop upgrade commands now directly apply downloaded updates instead of staging them for the next launch.
  • Auto-update Mechanism: The automatic update process on startup remains unchanged, continuing to stage updates for application on the subsequent run.
  • CLI Help Text: The command-line interface help text has been updated to reflect the immediate application of manual updates.
  • Test Suite Adjustments: Existing tests have been modified to assert the direct application of updates, moving away from checks for staged files and metadata.
Changelog
  • src/loop/constants.ts
    • Updated the CLI help text for loop update to indicate that updates are now applied directly instead of staged.
    • Modified the auto-update description to clarify that manual updates now apply immediately.
  • src/loop/update.ts
    • Introduced a new applyBinary function to handle writing the downloaded binary to the executable path, setting permissions, and renaming.
    • Refactored downloadAndStage into a new downloadBinary function that returns the downloaded buffer, and updated downloadAndStage to use this new function.
    • Modified applyStagedUpdateOnStartup to utilize the new applyBinary function for applying staged updates.
    • Added a new checkAndApply function that fetches the latest release, downloads the binary, verifies its checksum, and immediately applies it using applyBinary.
    • Updated handleManualUpdateCommand to call the new checkAndApply function, enabling direct application of updates.
  • tests/loop/update.test.ts
    • Renamed test descriptions from 'staging' to 'applies update' for manual update command tests.
    • Modified assertions in manual update tests to verify that the update is directly applied to the executable path, rather than checking for the existence of staged binary and metadata files.
    • Updated test cleanup logic to remove the temporary executable path created during testing.
Activity
  • The author, axeldelafosse, created this pull request to modify the update behavior.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request effectively changes the loop update and loop upgrade commands to apply updates directly instead of staging them. The changes are well-implemented, and the tests have been updated to reflect this new behavior. The code is clear and follows good practices. The introduction of applyBinary and downloadBinary functions improves modularity and reusability. The changes to the CLI help text accurately reflect the new functionality.

@axeldelafosse axeldelafosse merged commit ca015bb into main Feb 22, 2026
2 checks passed
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