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

Remove organization_name from base URL #4331

Merged
merged 32 commits into from
May 16, 2024

Conversation

jp524
Copy link
Contributor

@jp524 jp524 commented May 4, 2024

Resolves #4240

Description

Refer to #4324 for original PR that is now organized into logical and smaller commits.

Type of change

  • New feature (non-breaking change which adds functionality) -> for users that are not super admins
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) -> super admins won’t be able to access routes outside of the /admin namespace (see Discussion section for Remove organization_name from base URL #4324 )

How Has This Been Tested?

Tests files have been updated accordingly.

@jp524 jp524 marked this pull request as draft May 7, 2024 16:16
@jp524 jp524 changed the title Remove organization_name from base URL - Part 1: routes and controllers WIP - Remove organization_name from base URL - Part 1: routes and controllers May 7, 2024
@jp524 jp524 changed the title WIP - Remove organization_name from base URL - Part 1: routes and controllers Remove organization_name from base URL May 10, 2024
@jp524 jp524 marked this pull request as ready for review May 10, 2024 15:55
Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

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

Overall this looks good - congratulations, I don't think I've ever reviewed a PR this big before! 😂 Had a few nits.

@cielf how do we want to proceed with this? I don't think we need a full test of every possible page, but I think we'll need some sanity click-around testing?

app/views/admin/base_items/show.html.erb Outdated Show resolved Hide resolved
app/views/admin/users/_roles.html.erb Outdated Show resolved Hide resolved
spec/requests/organization_requests_spec.rb Outdated Show resolved Hide resolved
spec/requests/product_drives_requests_spec.rb Outdated Show resolved Hide resolved
@dorner
Copy link
Collaborator

dorner commented May 10, 2024

Some of the system tests are failing though.

@cielf
Copy link
Collaborator

cielf commented May 10, 2024

Overall this looks good - congratulations, I don't think I've ever reviewed a PR this big before! 😂 Had a few nits.

@cielf how do we want to proceed with this? I don't think we need a full test of every possible page, but I think we'll need some sanity click-around testing?

We definitely need some manual testing -- what we really are testing for is whether the pages come up, though, right? We don't have to be looking in detail on every page. It shouldn't take too long. But I'n going to wait until the nits are addressed.

@jp524
Copy link
Contributor Author

jp524 commented May 11, 2024

Tests for spec/system/organization_system_spec.rb are still failing at this time. It's odd because I can't reproduce the behaviour when running the app in my local environment - everything works fine.
I'll continue investigating on Monday.

@elasticspoon
Copy link
Collaborator

Tests for spec/system/organization_system_spec.rb are still failing at this time. It's odd because I can't reproduce the behaviour when running the app in my local environment - everything works fine. I'll continue investigating on Monday.

If stuff is failing on CI and not locally and vice versa I usually try running rails assets:precompile and rails db:test:prepare. Often times the either the test javascript or the test db have gotten out of sync with what you have locally.

@dorner
Copy link
Collaborator

dorner commented May 12, 2024

Nits are all addressed! Unfortunately there are now a bunch of conflicts with @elasticspoon 's work. I was kind of worried this would happen, but I'm pretty sure the conflicts should all be pretty straightforward to fix. Maybe merging master will also fix the failing tests?

@jp524
Copy link
Contributor Author

jp524 commented May 13, 2024

Some tests are still failing - I'm looking into it.

@elasticspoon actually the tests also fail locally, but when I try to reproduce the steps that the tests use it works in the browser.

@jp524
Copy link
Contributor Author

jp524 commented May 13, 2024

Almost there! The last failing test is one introduced in commit f158ba9.

@dorner Since you wrote the original test would you be able to have a look when you have the chance? It's spec/events/inventory_aggregate_spec.rb:692

@elasticspoon
Copy link
Collaborator

Almost there! The last failing test is one introduced in commit f158ba9.

@dorner Since you wrote the original test would you be able to have a look when you have the chance? It's spec/events/inventory_aggregate_spec.rb:692

What is happening is when the line item is getting created its also creating a storage location that ends up empty which fails the test. It on this line: https://github.com/jp524/human-essentials/blob/e67744a8d27592005931d51609cb8e1fb851fa4b/spec/events/inventory_aggregate_spec.rb#L702

If you do it like this https://github.com/jp524/human-essentials/blob/e67744a8d27592005931d51609cb8e1fb851fa4b/spec/events/inventory_aggregate_spec.rb#L648

i believe it should work.

@jp524
Copy link
Contributor Author

jp524 commented May 13, 2024

Thank you @elasticspoon!

Now ready for final review.

@jp524 jp524 requested a review from dorner May 13, 2024 18:21
@cielf
Copy link
Collaborator

cielf commented May 13, 2024

Cool! I'll slot in doing some testing over the next couple of days.

@cielf
Copy link
Collaborator

cielf commented May 14, 2024

I did some light manual testing - and didn't find anything broken. @dorner?

Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

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

Looks good to me! 🎉 @cielf any reason to wait on the merge?

@elasticspoon
Copy link
Collaborator

@jp524 sorry, I ended up making a similar fix to the one you did for something else and now you have a conflict to resolve. ☹️

@cielf
Copy link
Collaborator

cielf commented May 15, 2024

I don't know of any reason not to merge once the conflict is resolved.

@jp524
Copy link
Contributor Author

jp524 commented May 15, 2024

@jp524 sorry, I ended up making a similar fix to the one you did for something else and now you have a conflict to resolve. ☹️

No worries! I just merged main.
It looks like there's a test failing at spec/system/partner_system_spec.rb:224. I can't reproduce this locally though so maybe it's just flaky.

@dorner
Copy link
Collaborator

dorner commented May 16, 2024

This is good to go! Thanks so much!

@dorner dorner merged commit 97bb355 into rubyforgood:main May 16, 2024
19 checks passed
@jp524 jp524 deleted the remove_org_name_part_1 branch May 20, 2024 19:49
Copy link
Contributor

@jp524: Your PR Remove organization_name from base URL is part of today's Human Essentials production release: 2024.05.26.
Thank you very much for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove organization_name from URLs
4 participants