-
-
Notifications
You must be signed in to change notification settings - Fork 936
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
Expose Version#built_at on the versions index page #3115
Expose Version#built_at on the versions index page #3115
Conversation
This is great Nikita, thanks for this! I think it's really clear what we were working on and solving here. |
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.
+1, this is great work folks 🚀
One thing that I noticed in the PR that was linked about switching from built_at
to created_at
is that built_at
is an author defined field in the gemspec that doesn't abide by any validations. For instance, I found that from gems with a created_at
on July 25, 2009, there's a handful of gems with a built_at
in the future.
To keep the information as accurate as possible, perhaps for versions before July 25, 2009, we can have the built_at
date but have an asterisk beside those dates. We can specify that these versions were the specified built at date but was pushed to rubygems.org on July 25, 2009.
That makes total sense! I'll make a change |
48fabd3
to
83e5b74
Compare
83e5b74
to
df23d2a
Compare
Also added an additional check to fall back to |
df23d2a
to
601354a
Compare
app/views/versions/index.html.erb
Outdated
@@ -10,4 +10,9 @@ | |||
<%= render @versions %> | |||
</ul> | |||
</div> | |||
<% if @versions.any?(&:rely_on_built_at?) %> |
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.
This makes sense that we only show it if there are old gem versions
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.
We should update line 7 since: nice_date_for .. created_at to use authored_at.
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.
Good catch, going to update it 👍
Thank you!
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.
Thanks @nvasilevski, I just have a couple of questions/suggestions, but otherwise it LGTM!
GitHub ate my email on this, apologies if this goes through twice. Some background/history on this attribute in case we need is on #1353, also @sonalkr132 did a lot of work in this space too and may want to review this. I had a 13 year old code flashback as I remember writing the migration to add |
e4d3478
to
3546074
Compare
Addressed suggestions & rebased on the latest main to remove unrelated translations moves |
My impression is that since created_at was at one point "polluted", or possibly full of data that may have been editable by the author. So on July 25, 2009 that PR made a copy of that data on Although this is quite old, I find this PR incredibly helpful for those of us (like me) who spend a lot of time in "old" ruby and would benefit massively from a possibly more accurate representation of version dates before then. For example with @flavorjones Bundler::AsOf which lets us bundle a gemfile and resolve dependencies from, say, 2008. Thanks for the work and feedback everyone |
This change seems fine to me. Please make sure that we didn't bulk import versions on any other day as well. |
I think this makes sense. As the formal api already returns built_at, so for an issue I'm currently working (and others in this position) we can manually revert to |
a20e441
to
d8f6e25
Compare
klass = ["gem__version__date"] | ||
text = version_authored_date(version) | ||
if version.rely_on_built_at? | ||
klass << "tooltip__text" |
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.
You should be able to add a modifier class to preserve the version number color. As per your screenshot, ones will tooltip are now red.
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.
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.
This looks much better. Thank you.
Co-authored-by: Nick Schwaderer <nick.schwaderer@shopify.com>
d8f6e25
to
3c67f90
Compare
This was deployed to prod. One improvement we can make is update the tooltip icon. [?] on some version and not on others, feels wonky. A better icon could be a superscript * next to version number, which would better covey that some version numbers are special/different. |
Hey folks! Me and @Schwad would like to propose a change to the
Version
index pageWe would like to use a bit more accurate date especially for gems that were imported into rubygems on
July 25, 2009
Currently all gems use
version.created_at
(interestingly it was switched fromversion.built_at
) - #1504but for older versions of gems like
nokogiri
created_at
has not a lot of meaning, for example:https://rubygems.org/gems/nokogiri/versions
Currently on production for nokogiri
So we went with a little verbose but backwards-compatible approach that falls back to
built_at
attribute for gems that we consider "imported", or, literally created onJuly 25th, 2009
Naming was hard so feel free to suggest your options, but we added a new method
authored_at
that performs this fallback by checking whether the version wasseeded?
which just comparescreated_at
date to be equalJuly 25th, 2009
(time part is stripped)Which results in a nicer and more insightful history of older
nokogiri
versions:After using built_at for pre-rubygems gems
Side-to-side comparison