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

fix: prioritize current site setting for org value #189

Conversation

navinkarkera
Copy link
Contributor

@navinkarkera navinkarkera commented Oct 9, 2023

Description

If multiple tenant configs are enabled for a given org, fetching value from site config for the organization should return current site config value if the org is included in the org_filter.

Private-ref: BB-7927

Testing instructions

See open-craft#3

Checklist for Merge

  • Tested in a remote environment
  • Updated documentation
  • Rebased master/main
  • Squashed commits

Copy link

@kaustavb12 kaustavb12 left a comment

Choose a reason for hiding this comment

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

👍

@kaustavb12
Copy link

@navinkarkera Could you please add our internal ticket number here too as private ref, for easy reference.

@bra-i-am
Copy link
Contributor

Hello @navinkarkera and @kaustavb12, I hope you are doing well. We thank you for contributing to this project and apologize for the delay in reviewing it due to some urgent matters.

The solution seems logical. However, before moving forward, I would like to test it to gain a more comprehensive understanding of the expected behavior and the match with all the use cases.

I followed the steps in the referenced PR open-craft#3, but it didn't work for me. In order to be more specific, here are the steps I followed:

  1. Ran make {lms,cms}-up
  2. Cloned your repo fork (to be allowed to use the branch navin/upstream/current-site-priority-for-org-value), went into the shells in the LMS & CMS, and ran the pip install -e command to the repo
  3. Ran the two migrations despite only the LMS executed the changes (expected behavior)
  4. Created the two Routes with their corresponding tenant configs the same as you did
  5. Updated the redirect URLs in thestudio-sso application
  6. Added the setting in the private.py files
  7. Reseted

This is what I receive when I try to see the link when View live is hovered:
PR SCREEN

These are my tenant configs with the settings you told in open-craft#3 and there are shown the domains I use too
image

To test this PR I mounted a new environment in devstack, please let me know if maybe you have any other setting/configuration I'm missing or maybe you have an idea about what can I do to run this PR properly.

Perhaps, if you have tested this PR using Tutor, could you please guide us a little through the process you followed?

I will be closely monitoring your response to continue with my review or provide any more information if needed.

Thank you so much ✨

@navinkarkera navinkarkera force-pushed the navin/upstream/current-site-priority-for-org-value branch 2 times, most recently from 96a5abd to 0b43889 Compare March 7, 2024 10:37
@navinkarkera
Copy link
Contributor Author

navinkarkera commented Mar 7, 2024

Hello @bra-i-am, I just rebased the branch with master and followed the steps mentioned in open-craft#3 to test in master devstack. It worked for me and I did not do anything special.

lacolhost-screenshot
localhost-screenshot

Please make sure that you are using open-craft:navin/upstream/current-site-priority-for-org-value branch

Copy link
Contributor

@bra-i-am bra-i-am left a comment

Choose a reason for hiding this comment

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

@navinkarkera, thank you so much for your answer. I could not reproduce the behavior before because of some config mistakes I made with my routes, but I finally got to solve them.

The change introduced in this PR makes all the sense to me and according to some tests I ran, there are no conflicts with other test cases. I'll announce this to my teammates to continue with the merge.

Thanks a lot for your contribution ✨

Evidence

image

=====================================

FYI

  • I ran the PR using Tutor in dev mode changing the variable CMS_HOST same as LMS_HOST in the config.yml file (e.g. CMS_HOST: local.overhang.io)
  • I created the routes tenant-a.local.overhang.io and tenant-b.local.overhang.io
  • I created the Tenant Configs according to the shown here but I changed the URL to the one of the route that is being configured. For example the lms_configs for the Tenant A:
{
  "EDNX_USE_SIGNAL": true,
  "LMS_BASE": "tenant-a.local.overhang.io:8000",
  "LMS_ROOT_URL": "http://tenant-a.local.overhang.io:8000",
  "SOCIAL_AUTH_EDX_OAUTH2_PUBLIC_URL_ROOT": "http://tenant-a.local.overhang.io:8000",
  "course_org_filter": [
    "edX"
  ]
}

Copy link
Contributor

@MaferMazu MaferMazu 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. I will change the commit to fix because we are changing the previous behavior.

@MaferMazu MaferMazu changed the title refactor: prioritize current site setting for org value fix: prioritize current site setting for org value Mar 17, 2024
@MaferMazu
Copy link
Contributor

@navinkarkera, can you sign your commit, please?

Ref: https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification

@navinkarkera navinkarkera force-pushed the navin/upstream/current-site-priority-for-org-value branch from 0b43889 to 2e5f574 Compare March 18, 2024 06:51
If multiple tenant configs are enabled for a given org, fetching value
from site config for the organization should return current site config
value if the org is included in the org_filter.
@navinkarkera navinkarkera force-pushed the navin/upstream/current-site-priority-for-org-value branch from 2e5f574 to baef168 Compare March 18, 2024 06:54
@navinkarkera
Copy link
Contributor Author

@MaferMazu Done.

@MaferMazu MaferMazu merged commit e17e7b0 into eduNEXT:master Mar 18, 2024
4 checks passed
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.

4 participants