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

Show warning when Cake is out of date #2260

Open
jnm2 opened this issue Aug 30, 2018 · 5 comments
Open

Show warning when Cake is out of date #2260

jnm2 opened this issue Aug 30, 2018 · 5 comments

Comments

@jnm2
Copy link
Contributor

jnm2 commented Aug 30, 2018

When you pin the Cake version which is a recommended practice, there's nothing to remind you when it is out of date. I've seen this result in folks working within the constraints of old versions of Cake without realizing there is new goodness available.
If there was a warning shown at the end of each script execution, it would provide awareness to folks who aren't thinking about loading up the Cake website to check manually. Cake scripts in active projects would be less likely to stay behind at very old versions of Cake.

Could a warning be too strong? Information might be a better fit except that it might fail in its purpose of drawing attention during a normal script execution. On the other hand, there's occasionally a CVE associated with a new update.

Since the update check isn't mission-critical, it could be started asynchronously before compiling the script. If there is no network connectivity, the check can time out silently or be canceled silently when the script execution is finished.

There should be a configuration setting for folks to opt out.

@sgrassie
Copy link

sgrassie commented Oct 7, 2021

I've been considering this. One approach could to be to write a small class (e.g. IRemoteVersionResolver) to pull the release details from https://docs.github.com/en/rest/reference/repos#releases and add that as a dependency to VersionFeature.

VersionFeature already resolves the current local cake version and a comparison could be made to determine if Cake is out of date.

Of course, you might prefer the remote version check to be encapsulated in its own class, taking in the IVersionResolver, a IRemoteVersionResolver implementation as I mentioned above, and whichever object it is that holds the configuration settings so whether to actually perform the update check can be controller.

Thoughts?

@augustoproiete
Copy link
Member

augustoproiete commented Oct 7, 2021

@sgrassie At first glance seems like this needs to be its own separate feature that you start asynchronously as early as possible, without waiting/blocking the main thread, then after the build finished, check if the async call finished and make a decision:

  • If the async call finished successfully, we have the remote version number, and it's higher, then display the warning (otherwise ignore)
  • If the async call finished with errors, ignore
  • If the async call is still running, abort it, and let the build finish normally

@mohamedtmismail
Copy link

Hey, is this still open for contribution?

@augustoproiete
Copy link
Member

@secretMeedo Yes.

@mohamedtmismail
Copy link

@augustoproiete Thank you for the quick response, I'll have a look this weekend and let you know if I can do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants