-
Notifications
You must be signed in to change notification settings - Fork 643
Newest updated #1931
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
Newest updated #1931
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jtgeibel (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
This is pretty far from correct 😞 … some discussion on #310. |
I'm much happier with this code. Pretty much everywhere that used to have some concept of max_version now has top_versions which contains both the highest semver version and the most recently updated version. What is not yet here is using the most recently updated version in the user interface. (I don't really know where this is in the code, but I haven't really looked either.) |
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.
Love it! So to finish this up, the frontend for the home page will need to be updated:
- For the Just Updated column, the newest version should be displayed
- For the Most Downloaded column, no version should be displayed (as discussed in the issue, if you agree)
- For the New Crates column, the highest version should be displayed (current behavior)
And the search result/crate list pages should also keep the current behavior of showing the highest version.
There's a frontend test for the front page that's very minimal right now but should be updated to test the new logic.
Currently, the home page template calls the crate-list component, which always displays the max version. I'm not sure the best way to change what's displayed in the various cases, but that's where some change will need to be :)
☔ The latest upstream changes (presumably #1891) made this pull request unmergeable. Please resolve the merge conflicts. |
caec94e
to
5d0fe88
Compare
This looks really good to me so far! A few things I noticed running locally:
To test the end-to-end behavior, I'm looking to publish the following set of crates to staging ( [workspace]
# The comments show the intended publish order
members = [
"prerelease_only", # 0.0.1-alpha.0
"prerelease_then_normal", # 0.0.1-alpha.0, 0.0.1
"normal_then_prerelease", # 0.0.1, 0.1.0-alpha.0
"normal_release_only", # 0.0.1
"normal_releases", # 0.0.1, 0.1.0, 0.1.1, 0.2.0
"normal_and_backport", # 0.1.0, 0.2.0, 0.2.1, 0.1.1
"normal_and_backport2", # 0.1.0, 0.2.0, 0.1.1, 0.2.1
] |
I see the empty version for Just Updated and struggled to understand how |
05a7948
to
11327ae
Compare
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.
Just 2 small questions about consistency. Tried it out locally and it's working!
So… I'm happy with the state of the code and the user interface in this pull request as it currently stands. The main thing I'm uncomfortable about is that the scope of this change has grown well beyond the original issue #310. I am more than willing to trim this back to a narrow scope that only fiddles with the Just Updated column and leaves everything else as it is today. I can imagine some in between places as well. Preferences? |
Sorry about the test failure 😞. Running the front end test locally stopped working and I haven't figured out why. |
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 left a comment for my guess about why the tests might be failing for you locally; if that's not it, I'd be happy to investigate with you (I'll be at Rust Coffee tonight, will you?)
Looking at the failures in Percy, most are expected because of the changes this PR makes to the UI. Are you able to see the Percy diffs? I forget how that works. If not, let me know and I'll post the screenshots here.
The one Percy failure I'm not sure about is for the Acceptance | crate page | is accessible
test; the total number of downloads on the homepage is different. That seems brittle to me because this PR didn't change anything about that part of the page. That test is using the factories, though, and this PR did change the factories, so perhaps we've been relying on coincidence.
On further investigation, I'm not really sure why this test exists; it appears to be testing the home page, but we already have this test for the homepage (that uses the fixtures instead of the factories, so it should be more stable).
Are you up for a tiny bit more scope creep on this PR, just deleting that one crate-test? :)
tests/acceptance/crate-test.js
Outdated
@@ -66,7 +66,7 @@ module('Acceptance | crate page', function(hooks) { | |||
await visit('/'); | |||
await click('[data-test-just-updated] [data-test-crate-link="0"]'); | |||
|
|||
assert.equal(currentURL(), '/crates/nanomsg'); | |||
assert.equal(currentURL(), '/crates/nanomsg/6.8.9'); |
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.
Is this test one that's failing for you locally? I think it's because this test uses the factories, and the version number isn't guaranteed to be the same every time the factory gets called?
This can be fixed by explicitly setting a newest_version
for this particular instance, sort of like this test explicitly sets a max_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.
Running the tests locally crashes fairly badly. I don't have much experience with npm stuffs, so I don't have much clue what is going on. It did work for me. I don't know of having changed anything (although I'm a compulsive brew upgrade
r and that might've broken something).
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.
Yikes! I have occasional luck with removing node_modules
and re-npm install
ing? We can look at it tonight though :)
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.
Locally, I've replaced this test with the following. This should eliminate the dependence on faker data and make the test more robust to future changes. Would you add a final commit with this or a similar update?
test('visiting a crate page from the front page', async function(assert) {
this.server.create('crate', { id: 'nanomsg', newest_version: '0.6.1' });
this.server.create('version', { crate: 'nanomsg', num: '0.6.1' });
await visit('/');
await click('[data-test-just-updated] [data-test-crate-link="0"]');
assert.equal(currentURL(), '/crates/nanomsg/0.6.1');
assert.equal(title(), 'nanomsg - crates.io: Rust Package Registry');
assert.dom('[data-test-heading] [data-test-crate-name]').hasText('nanomsg');
assert.dom('[data-test-heading] [data-test-crate-version]').hasText('0.6.1');
});
I will be at the Rust coffee this evening 🎉 @jtgeibel and I looked at the Percy failures. It seems to be related to auto generated stuff that has interesting cross cutting impact. In some bigger picture, it'd be great to stabilize that stuff. I'm fine with test cleanup. I'm not going to be able to really look at code for several hours. |
550f63d
to
218c3eb
Compare
☔ The latest upstream changes (presumably #2015) made this pull request unmergeable. Please resolve the merge conflicts. |
218c3eb
to
f07b9ef
Compare
☔ The latest upstream changes (presumably #2017) made this pull request unmergeable. Please resolve the merge conflicts. |
f07b9ef
to
57460ba
Compare
☔ The latest upstream changes (presumably #2044) made this pull request unmergeable. Please resolve the merge conflicts. |
57460ba
to
4103c8f
Compare
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.
@bruceadams thanks for the recent rebases! I've finally had a chance to take another pass at this and things are looking really good. I've added a comment with one final suggestion. I'll also accept the graphical changes in percy.
tests/acceptance/crate-test.js
Outdated
@@ -66,7 +66,7 @@ module('Acceptance | crate page', function(hooks) { | |||
await visit('/'); | |||
await click('[data-test-just-updated] [data-test-crate-link="0"]'); | |||
|
|||
assert.equal(currentURL(), '/crates/nanomsg'); | |||
assert.equal(currentURL(), '/crates/nanomsg/6.8.9'); |
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.
Locally, I've replaced this test with the following. This should eliminate the dependence on faker data and make the test more robust to future changes. Would you add a final commit with this or a similar update?
test('visiting a crate page from the front page', async function(assert) {
this.server.create('crate', { id: 'nanomsg', newest_version: '0.6.1' });
this.server.create('version', { crate: 'nanomsg', num: '0.6.1' });
await visit('/');
await click('[data-test-just-updated] [data-test-crate-link="0"]');
assert.equal(currentURL(), '/crates/nanomsg/0.6.1');
assert.equal(title(), 'nanomsg - crates.io: Rust Package Registry');
assert.dom('[data-test-heading] [data-test-crate-name]').hasText('nanomsg');
assert.dom('[data-test-heading] [data-test-crate-version]').hasText('0.6.1');
});
@jtgeibel Your test adjustment makes sense; I added it. The first rebase yesterday took me a while! I was happy the second one was easy! |
☔ The latest upstream changes (presumably #2049) made this pull request unmergeable. Please resolve the merge conflicts. |
Thanks @bruceadams! I hate to say it, but this needs another rebase now, hopeful another easy one though. If you get around to it today, ping me and I'll r+ ASAP. There's been a lot of work on the frontend recently, sorry for the high rate of churn. |
This contains far too much repeated code. It does basically work and the relevant test passes! I'll refactor the redundant code into a shared function.
Where we used to have max_version, we now have two kinds of top versions: - the highest semver version - the most recently updated version.
- For the Just Updated column, the newest version is displayed - For the Most Downloaded column, no version is displayed - For the New Crates column, the highest version is displayed (unchanged)
045b0e8
to
77f0849
Compare
I learned more about Ember.js, including that the documentation is very good even for a reader like me who barely has a clue about Ember.js. |
Thanks Bruce! @bors: r+ |
📌 Commit fb356c4 has been approved by |
Newest updated This PR is working toward addressing #310. This is incomplete. There is a relevant test commented out because it fails.
☀️ Test successful - checks-travis |
This PR is working toward addressing #310. This is incomplete. There is a relevant test commented out because it fails.