-
Notifications
You must be signed in to change notification settings - Fork 13
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
Notifications: logic behind non-latest version #71
Comments
At this point, I think we should implement "the most basic and strict version of semver" first and then allow people to write their javascript function to replace this basic logic. We will never cover all the cases and, in fact, I found that a lot of cases are edge cases:
I think this will give users something that works in a reliable way for specific use case, but also the flexibility to customize it as they want if they have a particular use case. |
The logic I have in mind would be similar to: The simple case, is the ✅ valid version: (
While writing this down, I found it's not super accurate nor easy to explain, but I think this implementation could cover most of the use cases. We can tweak it a little as we go. However, people with strict/different needs (like As examples, our |
@stsewd @agjohnson @ericholscher do you have a better and simpler idea for this? |
Hrm, honestly I'm not sure. Comparing versions that are already semver makes sense, but coercion looks like the wrong tool to rely on here. For every case we get right using coercion, I'm sure there will be plenty others that we get wrong. I'd say if it isn't obviously a semver version, we can't support it with this warning. At least not right now. I still think there is more was could do to give the user the ability to tell us what is latest, instead of us using some amount of magic to guess. We've talked about surfacing this sort of behavior in automation rules, perhaps related to latest/stable rules, which I still think is a really good idea. Actually, thinking more, I sort of just want a |
What about a pretty simple logic to start with?
I think this simple approach can work to start with. In the end, the most accurate approach would be a customized one by the user, but we are not there yet. Also, the implementation for this approach looks pretty simple, and seems easy to explain to users. I think we can start by using simple logic we know and control like stable and latest versions. |
I like this idea if we can allow them to tell this us in an automated way. Otherwise, I think it will become "another tool to update each time a new release is done" and make the process a little more tedious. Making this automated somehow is one of the Read the Docs features that I don't want to loose. |
(from readthedocs/readthedocs.org#5319 (comment)) This makes me think again about the logic behind this addon. Maybe making our logic latest/stable dependent is not a good idea if users have problem understanding how we determine those. This is a good point to avoid this pattern maybe. |
These are all good points. Does offering a configuration option help at all here? I don't quite have a strong opinion here yet, but so far I feel:
|
Yes and no. Ideally, the user should be the one that specify "what's the logic behind this". Originally, I thought this feature in a way the user can "overwrite the javascript function" to tell us what's the highest version to decide whether or not show the notification. However, we are not there yet. I thought a little about this considering "a simple configuration option" but I didn't come up with a great answer that's easy to understand for users. That's why I asked to the user from readthedocs/readthedocs.org#5319 (comment) for ideas.
Yes and no. The library we are using doesn't consider
So, we would need to add extra-logic here for these cases and I'm not sure I want to jump into that path 😅
After reading your comment in the other issue, I'm not 100% convinced that I want to use
|
Oooh, yeah that is very annoying then.
Agreed. This seems like quite advanced usage too, and requires the author customize both JS and HTML to override the version comparison logic. A simple approach would be great here, but it does feel really hard to make something generally useful here. Overall, I feel like automatic (or at least manual to start) flagging of Version objects as outdated feels like the best UX. I don't yet see a good path between what we have now and that UX though. That is, if we implemented a |
I implemented the simple idea exposed in #71. I think we can start with this simple logic that's easy to explain and grow from here if necessary. - on `latest`: a notification to warn the user about some features may not yet be available is shown - on non-`stable` nor `latest` versions: a notification to warn the user about possible reading and old/outdated version is shown Note that both notification are pretty simple, it does not require external dependencies (e.g. `semver`) and it's easy to explain to users. The warning is shown only if `stable` is an active version --since we link to it from both. _However_, I think the best way for users to make usage of this addon is by implementing the logic that fits their needs by themselves. We don't allow users to customize this logic just yet, but we plan to do it in the future when the addons is more settled down. Closes #71
I thought a little more about this and I came back to the idea of using
Note that both notification are pretty simple, it does not require external dependencies and it's easy to explain to users. The warning is shown only if I implemented this idea in #125 |
Also, I think this idea of following core Read the Docs feature's like If we ever implement something like that, this logic behind the addons will keep working fine since it's just based on well-known definitions like |
I really like the idea of making these automation rules. The UX would be better even if these were fairly hardcoded automation rules to start. If we consider the |
I thought about this and I'm not sure. I'm not clearly visualizing the exact workflow for this yet. We should probably talk more about this and define the workflow together.
This is basically the logic that I just implemented. Besides, my implementation shows a warning on
This use case is the one I would like to not implement (right now, at least) and point users to more advanced configuration using JavaScript on their own. I'm saying this because |
Aye, I'm talking more about the ability to control it with configuration though.
Yeah, this is definitely a later feature either way. I'm not super convinced yet on making users do this JS logic on their own, that definitely makes it harder for us to build this into a feature later. That's to say maybe we don't mention anything about customization just yet. But otherwise I agree and we should continue talking here about next steps. I think starting with basic logic for now is the best place to start, and is an improvement over relying on logic outside our native versioning. |
I implemented the simple idea exposed in #71. I think we can start with this simple logic that's easy to explain and grow from here if necessary. - on `latest`: a notification to warn the user about some features may not yet be available is shown - on non-`stable` nor `latest` versions: a notification to warn the user about possible reading and old/outdated version is shown Note that both notification are pretty simple, it does not require external dependencies (e.g. `semver`) and it's easy to explain to users. The warning is shown only if `stable` is an active version --since we link to it from both. ## On `latest`  ## On non-`stable`  ---- _However_, I think the best way for users to make usage of this addon is by implementing the logic that fits their needs by themselves. We don't allow users to customize this logic just yet, but we plan to do it in the future when the addons is more settled down. Closes #71
Would be nice if this was a bit smarter. For example https://docs.kedro.org/en/0.19.0/ is (at the time of writing) exactly the same as https://docs.kedro.org/en/stable/, but the former shows the "This may be an old version" banner. Should I open a new issue? |
@astrojuanlu we already have an issue to track this at #132 😉 |
It seems there is some hidden logic in the old implementation of this feature. This comment called my attention regarding branches vs. tags: fabric/fabric#2255 (comment). There is a link to readthedocs/readthedocs.org#3268 which explains a little bit of the history here.
We should clearly define what's the logic behind our semver comparisons.
The text was updated successfully, but these errors were encountered: