-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Adds version to about/more and API #2181
Conversation
It might make more sense to add this to the existing "Get current instance information" API endpoint (https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#instances) than to create a new one just for the version. Other than that, looks good! |
Makes sense to me, I'll update 👍 |
Wouldn't it be sensible to use |
I mean, yeah that would make sense too. There's no current |
I thought of this thinking of gem and namespace conventions, this is just a nitpick. |
Gotcha. I'm happy to move it wherever, if that's more idiomatic. |
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 w/ moving it to lib/mastodon/version.rb
.
I had one other comment about using the constant in the views, otherwise looks fine.
app/views/about/_version.html.haml
Outdated
.panel | ||
.panel-header= t 'about.version' | ||
.panel-body | ||
%strong= Mastodon::VERSION |
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.
Minor point, but as a general rule I try to avoid using constants directly in views ... can you wrap this up in InstancePresenter (view it to see how other values are already doing this), and then pass that in to the partial (see how contact
is already doing that)?
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.
Makes sense, will do 👍
Okay, thanks @mjankowski and @badosu for the feedback, I've applied those changes and tested locally, let me know how it looks 👍 |
This looks fine to me - I will defer to @Gargron on final approval here, because he's the one who will have to remember to change that number when he tags releases. |
Makes sense! |
* Adds version. * Cleans up code. * Removes standalone endpoint and adds version to instance endpoint. * Addresses feedback from mastodon#2181.
…upstream Merge upstream changes
This adds a new
lib/version.rb
with a newVERSION
constant string. This string is returned in/api/v1/instances
as well as displayed on the about/more page.(Edit: new screenshot.)
I'm still pretty new to this, so please feel free to point out anything that could be improved.
Fixes #1789.