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

[RFC]: Print update information on demand instead of waiting for timer #11597

Open
1 task
pantheredeye opened this issue Sep 22, 2024 · 1 comment
Open
1 task

Comments

@pantheredeye
Copy link
Collaborator

pantheredeye commented Sep 22, 2024

Summary

Desired User Story: To be able to run a command, such as yarn rw upgrade --info|--status|--check from the cli and find out the current project version -> compared to current release version, and to also be able to find a link to the upgrade guide. It is helpful to read the guides prior to upgrading.

Motivation

We want to check for upgrade availability, and more importantly, display the upgrade guide link manually without having to wait 24 hours. The upgrade process, especially majors, usually requires some prep work. Getting this link within the CLI on demand means users will not have to leave their editor and search for this information.

Detailed proposal

Approach

The current update check middleware uses interval timers to check and display only once every 24 hours. Integrating a manual check involves working with or around these timers. It also uses locking mechanisms to prevent duplicate processes from acting on the same files. I would say we want to keep this in place also.

I imagine two ways of triggering the update check manually:

  1. add -force flag that ignores timers
  2. reset the timers to a time past 24 hours ago - then middleware will trigger and run the update check

Additionally, we probably need a new flag added to the [upgrade cli command] (https://github.com/redwoodjs/redwood/blob/main/packages/cli/src/commands/upgrade.js).

The information that the current check outputs is great, it links to the upgrade guide and shows the current version -> upgrade version. No changes needed there.
https://user-images.githubusercontent.com/56300765/202324200-7cd26df4-2e0f-4887-960a-a9cac031038a.png

[Q] It might be worth adding a function to print the upgrade guide link even if no upgrade is needed? I'm not sure why this would be the case, but maybe?

[Q] What about triggering the check for release candidates, etc? Some users do want to upgrade to the rc... how would the new command check for the tag the user wants to upgrade to and display accordingly?

Related Links

Code: CLI Upgrade Command
Code: upgradeCheck Code

PR (6461): An update middleware to detect and notify users of available updates

Are you interested in working on this?

  • I'm interested in working on this
@pantheredeye
Copy link
Collaborator Author

@Josh-Walker-GM would you mind glancing over this and if this seems reasonable, adding the 'good-first-issue' label?

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

No branches or pull requests

1 participant