Skip to content
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

Add organizations to user profile #5583

Merged
merged 6 commits into from
Jan 27, 2020
Merged

Add organizations to user profile #5583

merged 6 commits into from
Jan 27, 2020

Conversation

websebdev
Copy link
Contributor

@websebdev websebdev commented Jan 19, 2020

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Added organizations to user profile in the right-hand sidebar.

Related Tickets & Documents

Closes #4672

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

Added to documentation?

  • docs.dev.to
  • readme
  • no documentation needed

@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Jan 19, 2020
@claassistantio
Copy link

claassistantio commented Jan 19, 2020

CLA assistant check
All committers have signed the CLA.

rhymes
rhymes previously approved these changes Jan 19, 2020
Copy link
Contributor

@rhymes rhymes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice! Thanks a lot @seb1441!

I've added a screenshot for the other reviewers:

Screenshot_2020-01-19 rhymes - DEV(local) Community 👩‍💻👨‍💻

the "organizations" box sits at the top right

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Jan 19, 2020
Copy link
Contributor

@benhalpern benhalpern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

One issue is that this area is cached within a higher level fragment cache.

As you can see in that cache key, there is a key called github_repos_updated_at which indicates when something has changed about a user's GitHub repos.

We should have a similar attribute on users: organization_info_updated_at which is touched when a user joins a new org.

If you can create that column and add it to this cache key I think we're good to go!

@pr-triage pr-triage bot added PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Jan 19, 2020
@websebdev websebdev requested a review from a team January 19, 2020 22:20
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes labels Jan 19, 2020
@websebdev
Copy link
Contributor Author

@benhalpern Oops my bad, I did not notice the higher level fragment cache.
As you suggested, I added the organization_info_updated_at column and cache key that will be touched with after_create and after_destroy callbacks of OrganizationMembership model.

Thank you!

@websebdev websebdev force-pushed the master branch 2 times, most recently from 9285367 to 1cbe333 Compare January 20, 2020 00:10
@rhymes rhymes requested a review from mstruve January 20, 2020 11:18
@websebdev
Copy link
Contributor Author

@rhymes Fixed the 3 failing tests by updating the organization_memberships factory:

  • Changed the random user_id and organization_id with real associations.
  • Skipped the update_user_organization_info_updated_at callback because stubbed models are not allowed to access the database (touch).

@citizen428
Copy link
Contributor

Very nice PR @seb1441, thanks for this! 👏

@rhymes
Copy link
Contributor

rhymes commented Jan 22, 2020

@seb1441 I went ahead and resolved the conflict (the schema file wasn't up to date).

Keep in mind that it's better to use a branching model than to submit PRs from your own master. You can check the contributing guide on how to do it in the future!

@websebdev
Copy link
Contributor Author

@rhymes Thank you!
Ok for the branching, I will do that for my future PRs :)

Also, I was wondering, when we create a PR, are we expected to keep it up-to-date all the time?
I did rebase from upstream and force push every time that I made a new commit and also had to fix schema conflict in one of these rebases.

@rhymes
Copy link
Contributor

rhymes commented Jan 22, 2020

@seb1441 no, unless you need to explicitly merge something from master or rebase a schema conflict you're not expected to track master during the lifetime of the PR :)

Unfortunately the build failed because rails-assets.org is going up and down since yesterday and if we can't reach it we can't build it.

Right now we've merged #5643 to fix that, so I'm afraid you'll have to rebase to make sure.

I'm sorry for the mishap and thanks for the patience!

Copy link
Contributor

@mstruve mstruve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once performance suggestion otherwise this is looking great!

app/views/users/_organizations_area.html.erb Show resolved Hide resolved
Copy link
Contributor

@rhymes rhymes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a note about the schema, we're almost there!

Thanks for the patience @sebach1!

db/schema.rb Outdated Show resolved Hide resolved
@pr-triage pr-triage bot added PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Jan 23, 2020
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes labels Jan 23, 2020
Copy link
Contributor

@rhymes rhymes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thanks @seb1441!

@rhymes rhymes requested review from citizen428, mstruve and benhalpern and removed request for benhalpern January 23, 2020 14:44
Copy link
Contributor

@rhymes rhymes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @seb1441!

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Jan 23, 2020
Copy link
Contributor

@mstruve mstruve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Jan 23, 2020
@rhymes
Copy link
Contributor

rhymes commented Jan 23, 2020

Sorry everyone who reviewed, after merging #5624 a conflict was introduced here. I had to resolve it

Copy link
Contributor

@citizen428 citizen428 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, excellent first contribution @seb1441 😃 Thanks for fixing the conflict @rhymes.

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Jan 27, 2020
@mstruve mstruve dismissed benhalpern’s stale review January 27, 2020 14:15

Requested changes have been implemented

Copy link
Contributor

@benhalpern benhalpern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. Nice work everybody involved in the review.

@benhalpern benhalpern merged commit a25446b into forem:master Jan 27, 2020
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Jan 27, 2020
@websebdev websebdev mentioned this pull request Jan 29, 2020
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add organization affiliations to profile pages
6 participants