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: force LMS url to reload when changed #136

Merged
merged 2 commits into from
Jun 13, 2023

Conversation

ghassanmas
Copy link
Member

@ghassanmas ghassanmas commented Apr 18, 2023

What does this change do:

1- This change makes it possible if LMS_BASE_URL is updated by dynamic config to get the latest value. see context below resolved in first commit
2- It make contacte course search url when it's relative resolved in second commit

Testing:

While using tutor-mfe

  1. add new this mfe to the list of MFEs how
  2. Ensure those settings are set, can be done creating file plugin
  3. If you use the master branch it will not work, while when using this branch shall fix it from step 1 you can alter repository and versoin values

More context

Fixes that are simlar to this

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 18, 2023
@openedx-webhooks
Copy link

Thanks for the pull request, @ghassanmas! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@codecov
Copy link

codecov bot commented Apr 18, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.21 🎉

Comparison is base (5db95b0) 95.75% compared to head (8d91a12) 95.96%.

❗ Current head 8d91a12 differs from pull request most recent head ce88d29. Consider uploading reports for the commit ce88d29 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #136      +/-   ##
==========================================
+ Coverage   95.75%   95.96%   +0.21%     
==========================================
  Files         165      170       +5     
  Lines        1436     1486      +50     
  Branches      255      274      +19     
==========================================
+ Hits         1375     1426      +51     
+ Misses         56       55       -1     
  Partials        5        5              
Impacted Files Coverage Δ
...Card/components/CourseCardBanners/CourseBanner.jsx 95.23% <ø> (ø)
src/containers/CourseList/NoCoursesView/index.jsx 100.00% <ø> (ø)
...arnerDashboardHeader/AuthenticatedUserDropdown.jsx 100.00% <ø> (ø)
src/containers/LearnerDashboardHeader/index.jsx 100.00% <ø> (ø)
src/data/redux/hooks/app.js 97.95% <ø> (ø)
src/data/services/lms/api.js 100.00% <ø> (ø)
src/widgets/LookingForChallengeWidget/index.jsx 100.00% <ø> (ø)
src/widgets/RecommendationsPanel/LoadedView.jsx 100.00% <ø> (ø)
...HeaderVariant/CollapsedHeader/CollapseMenuBody.jsx 93.75% <100.00%> (ø)
...nerDashboardHeaderVariant/ExpandedHeader/index.jsx 100.00% <100.00%> (ø)
... and 2 more

... and 15 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@itsjeyd
Copy link

itsjeyd commented Apr 20, 2023

label: core contributor

@github-actions github-actions bot added the core contributor PR author is a Core Contributor (who may or may not have write access to this repo). label Apr 20, 2023
@itsjeyd
Copy link

itsjeyd commented Apr 20, 2023

@ghassanmas Thanks for your contribution!

Except for needing a rebase, it looks like this is ready for review?

@itsjeyd itsjeyd added the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Apr 20, 2023
@ghassanmas
Copy link
Member Author

@itsjeyd yes you are correct, I have rebased it, also fixed a similar issue found while testing it. It's now ready for review.

@itsjeyd itsjeyd removed the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Apr 27, 2023
@itsjeyd
Copy link

itsjeyd commented Apr 27, 2023

@mattcarter This PR is ready for review by Aurora.

@ghassanmas
Copy link
Member Author

For refrence this should be added to:

@ghassanmas ghassanmas force-pushed the dynamic-config-tutor-mfe branch 2 times, most recently from 91eb62d to ded6b25 Compare May 3, 2023 21:03
@ghassanmas
Copy link
Member Author

This branch has been rebased more than 5 times, should I keep an eye on it? is rebasing necessary assuming it doens't cause conflict?

@itsjeyd
Copy link

itsjeyd commented May 9, 2023

@ghassanmas Good question. The PR branch should be up-to-date with master when engineering review starts and when it's about to be merged. But if master is moving fast and it takes a while for engineering review to start, it might not make sense to rebase the changes "every five minutes". Once or twice per week might be more reasonable.

CC @mphilbrick211, in case you have any additional input to share here.

@itsjeyd itsjeyd added the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label May 9, 2023
@ghassanmas
Copy link
Member Author

@itsjeyd Understandable, frankly the situation seems like, you need to wait for the bus in a cold weather, so you plan to leave your house at the time you would wait the least for the bus. Albeit here a timeable for the bus schedule doesn't exist 😄.

@itsjeyd
Copy link

itsjeyd commented May 10, 2023

@ghassanmas You're not wrong 😅

The situation should change once this repo joins the maintainership program.

@mphilbrick211
Copy link

@itsjeyd @ghassanmas If the branch becomes out-of-date because we're waiting on a reviewer, the repo owner/merger should be able to fix the date issue before merging - that way, you don't need to keep rebasing as changes to the master happen. Hope this helps!

@ghassanmas
Copy link
Member Author

@itsjeyd @ghassanmas If the branch becomes out-of-date because we're waiting on a reviewer, the repo owner/merger should be able to fix the date issue before merging - that way, you don't need to keep rebasing as changes to the master happen. Hope this helps!

@mphilbrick211

  • So does that mean the label waiting on author shouldn't stop the reviewer from reviewing the PR? assuming the label is assigend just because of rebase
  • secondaly is that the case for both when the PR is based upon a fork (the current state of this PR) or the original repo?

@mphilbrick211
Copy link

@itsjeyd @ghassanmas If the branch becomes out-of-date because we're waiting on a reviewer, the repo owner/merger should be able to fix the date issue before merging - that way, you don't need to keep rebasing as changes to the master happen. Hope this helps!

@mphilbrick211

  • So does that mean the label waiting on author shouldn't stop the reviewer from reviewing the PR? assuming the label is assigend just because of rebase
  • secondaly is that the case for both when the PR is based upon a fork (the current state of this PR) or the original repo?

@ghassanmas I'm not sure about the fork question (maybe Tim can weigh in here - I'm not sure if it would make a difference if it's a fork or not), but re: Waiting for Author... The LABEL "Waiting for Author" is used when we're waiting on the author to answer a question, usually when the PR is already in review, or in the early stages of the PR if more information is needed.

The STATUS "Waiting for Author" means the PR is still in-progress and not yet ready-for-review.

@ghassanmas
Copy link
Member Author

The STATUS "Waiting for Author" means the PR is still in-progress and not yet ready-for-review.

@mphilbrick211 If I understand you correctly then, this label shall not be used when "branch becomes out-of-date"?

@itsjeyd
Copy link

itsjeyd commented Jun 7, 2023

Sounds good @arbrandes, thanks for the info.

@mattcarter An early heads-up that this will require a second look from Aurora once Adolfo is done with his review.

@arbrandes
Copy link
Contributor

@ghassanmas, do you mind updating this to resolve conflicts? I'm planning to review it ASAP.

@ghassanmas
Copy link
Member Author

@arbrandes I have resolved locally and pushed, but github isn't getting it, checkig the status of github, it seems it's down
https://www.githubstatus.com/

@ghassanmas ghassanmas force-pushed the dynamic-config-tutor-mfe branch 3 times, most recently from 749239a to f17a376 Compare June 7, 2023 18:24
@ghassanmas
Copy link
Member Author

It's ready now, the diff coverage is failing after rebase hence this #152 (comment)

src/data/services/lms/urls.js Outdated Show resolved Hide resolved
src/data/services/lms/urls.js Outdated Show resolved Hide resolved
src/data/services/lms/urls.js Outdated Show resolved Hide resolved
Copy link
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

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

One minor requested change, otherwise LGTM. I tested it with Tutor and it works.

src/data/services/lms/urls.js Outdated Show resolved Hide resolved
@arbrandes
Copy link
Contributor

Oh, and @ghassanmas, is there anything you can do to not reduce the project coverage?

 Just change makes it possible if LMS_BASE_URL is updated by
 dynamic config to get the latest value.
  when platformSettings.courseSearchUrl is relative which is
  returned from a call to api/learner_home/init, use LMS_BASE_URL
  as origin.

  This fixes uses the same pattern which already used for
  different url, this probably wasn't an issue for edx.org given
  platformSettings.courseSearchUrl value is abosulte at edx.org
@ghassanmas
Copy link
Member Author

ghassanmas commented Jun 12, 2023

@arbrandes the diff was because of previous rebaese, now the lastest rebase it might be resolved, otherwise we see what we can do.

@ghassanmas
Copy link
Member Author

@arbrandes it's now ready the code cov is back as it was hence #136 (comment) it was just edited and previous negative diff comment got delete.

Copy link
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

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

Can't find anything else to object to, thanks @ghassanmas!

@muselesscreator, what do you think?

Copy link
Contributor

@muselesscreator muselesscreator left a comment

Choose a reason for hiding this comment

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

seems reasonable to me :-)

@arbrandes arbrandes merged commit f92bd9c into openedx:master Jun 13, 2023
@openedx-webhooks
Copy link

@ghassanmas 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@arbrandes
Copy link
Contributor

@ghassanmas, mind backporting to Palm?

sambapete pushed a commit to EDUlib/frontend-app-learner-dashboard that referenced this pull request Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants