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
Introduce CLI update banner #3422
Conversation
1579832
to
b13d99c
Compare
ClientVersion will eventually impement the functionality outlined in exercism#3416. This simply implements the ability to check for a dismissed flash notice on the User record for a hard-coded version number.
b13d99c
to
b2d252a
Compare
lib/exercism/client_version.rb
Outdated
|
||
def notice_when_client_outdated | ||
unless dismissed? | ||
"A new version of the exercism client is available (cli-2.4.0). Run <code>exercism upgrade</code> to get the latest hotness!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm hesitant to hard-code this. I'd rather either:
- get the most recent CLI release when the app boots up and store that in a constant that we can refer to, or
- have a
cli_versions
table and populate it based on what we get from the HTTP header when people submit (only storing each version once, and with a "first seen at" timestamp).
I think that the next CLI release will be a patch release, since changing where the CLI gets the text it displays is more of an implementation detail than a new feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this must stay a short-term thing. I'm just running out of time this week and want to keep it simple, so I can get to the real experiment code. #3416 exists to fix this while the experiment runs. Keep in mind that, in a pinch, we can even just turn the banner off with the feature flag, without having to synchronize a deploy of this repo.
See my edited description for why I guessed at 2.4.0, but I'd be happy to make this 2.3.1 at your discretion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, no you're right. The config option means we'll end up at 2.4.0. Yepp, for the experiment, let's keep it simple.
This is defined in ExercismWeb::Routes::Profile, because it's the most logical subclass of ExercismWeb::Routes::Core that runs on every normal web page request. Defining this before filter in Core itself causes the before filter to run once for each of its many subclasses that load for the page: generally each router that has a partial displayed. Sinatra! Since the user profile nav appears on every page, this is a candidate that works. Also, requests for /icon come through the normal rack stack, and each of those requests also runs before filters. I want this to run and set the flash notice once per page, so this also checks the HTTP_ACCEPT header to see whether or not a text/html page is being loaded.
b2d252a
to
f391e0c
Compare
860dbee
to
2795143
Compare
This has a green build, is manually tested, and should be ready to go. I recommend we release the updated cli now to get people a head start on updating, so we can have as many people on at the beginning of the week as possible with the right version. Next week on Monday morning, we can turn on the feature flag that updates its call to action. |
I just read #3416 (comment). Consider pausing until we get the naming of these fields worked out. |
Rename to client_version_update_notification_dismissed_at as per discussion in exercism#3416.
8657539
to
b0d521f
Compare
Agreed. I'll get that done today. BTW, @nilbus, if you fear that a PR has dropped off my radar for some reason, please don't hesitate to send me an email directly about it. I don't want to accidentally leave something languishing. |
D'oh. Once I saw the names you suggested this felt resolved to me. I forgot that the change actually has to be made. I have not deployed this. Would you mind making an additional PR to fix the names? |
I actually did rename it already in the branch you merged, in b0d521f. |
We're all good. It wasn't an active code path (yet). |
…i-banner" This reverts commit 55c705c, reversing changes made to 57b2a2c. Conflicts: - app/routes/profile.rb [removed relevant lines] - db/migrate/201703212321_add_client_version_notification_dismissed_at_to_users.rb [kept] - lib/exercism/client_version.rb [removed] - test/exercism/client_version_test.rb [removed] The migration was kept and will be reversed in a subsequent commit. Closes exercism#3416
…i-banner" This reverts commit 55c705c, reversing changes made to 57b2a2c. Conflicts: - app/routes/profile.rb [removed relevant lines] - db/migrate/201703212321_add_client_version_notification_dismissed_at_to_users.rb [kept] - lib/exercism/client_version.rb [removed] - test/exercism/client_version_test.rb [removed] The migration was kept and will be reversed in a subsequent commit. Closes exercism#3416
This branch introduces a banner asking people to update to [currently-unreleased] cli version 2.4.0.
I'm guessing 2.4.0 will be the version number according to semantic versioning, because master contains a new configuration option from exercism/cli#366 and debatably the
-m
short option in exercism/cli#359.Feature name:
advertise_cli_update
Todo:
after
hook from running on each request multiple timesClientVersion
tests