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

Upgrade frontend-build to v14 #1052

Merged
merged 23 commits into from
Jun 21, 2024

Conversation

pomegranited
Copy link
Contributor

@pomegranited pomegranited commented May 28, 2024

Description

Upgrades dependencies for frontend-build, frontend-package.

Package Change Type
@edx/frontend-platform 7.0.1 -> 8.0.3 major
@edx/frontend-component-footer 13.0.2 -> 14.0.3 major
@edx/react-unit-test-utils 2.0.0 -> 2.1.1 minor
@edx/frontend-component-header 5.1.0 -> 5.3.3 minor
@openedx/frontend-plugin-framework 1.1.0 -> 1.2.1 minor
@openedx/paragon 22.2.1 -> 22.5.1 minor
classnames 2.2.6 -> 2.5.1 minor
core-js 3.8.1 -> 3.37.1 minor
formik 2.2.6 -> 2.4.6 minor
moment 2.29.4 -> 2.30.1 minor
react-router 6.16.0 -> 6.23.1 minor
react-router-dom 6.16.0 -> 6.23.1 minor
react-textarea-autosize 8.4.1 > 8.5.3 minor
@edx/brand 1.2.2 -> 1.2.3 patch
@edx/frontend-component-ai-translations 2.0.0 -> TBD, PR patch
@edx/frontend-lib-content-components 2.1.9 -> TBD, PR patch

Supporting information

#1034

Private-ref: FAL-3750

Dependencies

Blocked by:

Based on these PRs, which are likely to merge quickly:

Testing instructions

CI should cover most of the functionality, but manual testing is needed to ensure essential features are not broken.

  1. Enable all the new_studio toggles.
  2. Visit as many pages in the Course Authoring MFE as you can, and check for errors.

@openedx-webhooks
Copy link

openedx-webhooks commented May 28, 2024

Thanks for the pull request, @pomegranited! 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.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label May 28, 2024
@@ -49,7 +49,7 @@ const RootWrapper = () => (
</AppProvider>
);

describe('<StudioHome />', async () => {
describe('<StudioHome />', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wow, were these tests even running? Probably not...

@bradenmacdonald
Copy link
Contributor

@pomegranited If you'd like, it might make sense to cherry-pick some of these commits into separate PRs that can be merged ASAP and independently, like "warnings about Duplicate message id" or "ensure all act() calls are async"

[WARN] [FormatJS CLI] Duplicate message id: "course-authoring.content-tags-drawer.content-tags-collapsible.custom-menu.placeholder-text", but the `description` and/or `defaultMessage` are different.                                                                                                                                                                          [WARN] [FormatJS CLI] Duplicate message id: "authoring.alert.error.connection", but the `description` and/or `defaultMessage` are different.
[WARN] [FormatJS CLI] Duplicate message id: "course-authoring.import.page.title", but the `description` and/or `defaultMessage` are different.
[WARN] [FormatJS CLI] Duplicate message id: "course-authoring.course-outline.card.menu.delete", but the `description` and/or `defaultMessage` are different.
[WARN] [FormatJS CLI] Duplicate message id: "course-authoring.course-outline.page-alerts.discussionNotificationLearnMore", but the `description` and/or `defaultMessage` are different.
[WARN] [FormatJS CLI] Duplicate message id: "course-authoring.course-outline.status-bar.video-sharing.title", but the `description` and/or `defaultMessage` are different.
[WARN] [FormatJS CLI] Duplicate message id: "course-authoring.course-outline.subsection.button.new-unit", but the `description` and/or `defaultMessage` are different.
[WARN] [FormatJS CLI] Duplicate message id: "course-authoring.course-team.member.button.remove", but the `description` and/or `defaultMessage` are different.
[WARN] [FormatJS CLI] Duplicate message id: "course-authoring.files-and-uploads..deleteConfirmation.message", but the `description` and/or `defaultMessage` are different.
[WARN] [FormatJS CLI] Duplicate message id: "course-authoring.files-and-videos.sort-and-filter.modal.filter.activeCheckbox.label", but the `description` and/or `defaultMessage` are different.                                                                                                                                                                                 [WARN] [FormatJS CLI] Duplicate message id: "course-authoring.files-and-videos.sort-and-filter.modal.filter.inactiveCheckbox.label", but the `description` and/or `defaultMessage` are different.                                                                                                                                                                               [WARN] [FormatJS CLI] Duplicate message id: "course-authoring.course-outline.configure-modal.advanced-tab.timed-description", but the `description` and/or `defaultMessage` are different.
[WARN] [FormatJS CLI] Duplicate message id: "course-authoring.course-outline.configure-modal.advanced-tab.timed-description", but the `description` and/or `defaultMessage` are different.
[WARN] [FormatJS CLI] Duplicate message id: "course-authoring.course-outline.configure-modal.advanced-tab.timed-description", but the `description` and/or `defaultMessage` are different.
[WARN] [FormatJS CLI] Duplicate message id: "course-authoring.export.stepper.header.title", but the `description` and/or `defaultMessage` are different.
[WARN] [FormatJS CLI] Duplicate message id: "authoring.loading", but the `description` and/or `defaultMessage` are different.
Returning a Promise from "describe" is not supported.
Previous commit revealed several issues with these tests:

* Don't nest userAction.click in act() -- nested act() statements have
  indeterminent behaviour.
* Use getBy* instead of findBy* with userAction to avoid nested act() statements
* Always await userEvent.click
* Use fireEvent.click when the onClick handlers need to be called
* Use queryBy* instead of getBy* when using .toBeInTheDocument or waitForElementToBeRemoved
  queryBy* return null when the element is not found.
pomegranited and others added 8 commits May 31, 2024 15:45
Warning: React does not recognize the `data-testId` prop on a DOM
element. If you intentionally want it to appear in the DOM as a custom
attribute, spell it as lowercase `data-testid` instead.
* Don't nest userAction.click in act() -- nested act() statements have
  indeterminent behaviour.
test: Use useLocation to test route changes
* remove "indent" setting from .eslintrc.js
  Using default config for indent instead of our custom setting.
* add @typescript-eslint/ prefix to eslint-disable-line statements where flagged by linter
* changed stylelint setting import-notation to "string"
  The alternative "url" setting doesn't work for all of our imports.
@pomegranited pomegranited force-pushed the jill/frontend-build-14 branch from c68e81a to 48cda53 Compare May 31, 2024 12:21
@pomegranited pomegranited marked this pull request as ready for review June 4, 2024 05:28
@pomegranited pomegranited requested a review from a team as a code owner June 4, 2024 05:28
@pomegranited pomegranited requested a review from yusuf-musleh June 4, 2024 05:28
Copy link

codecov bot commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 84.23773% with 61 lines in your changes missing coverage. Please review.

Project coverage is 92.60%. Comparing base (3936737) to head (0197c1d).

Files Patch % Lines
src/course-outline/utils.jsx 75.00% 13 Missing ⚠️
...ng-settings/assignment-section/utils/validation.js 64.00% 7 Missing and 2 partials ⚠️
src/course-updates/hooks.jsx 50.00% 8 Missing ⚠️
src/course-outline/utils/getChecklistValues.js 75.00% 6 Missing ⚠️
src/course-outline/hooks.jsx 81.81% 4 Missing ⚠️
src/generic/configure-modal/ConfigureModal.jsx 85.71% 4 Missing ⚠️
src/generic/drag-helper/DraggableList.jsx 86.66% 4 Missing ⚠️
src/course-team/utils.js 75.00% 2 Missing ⚠️
src/course-unit/add-component/AddComponent.jsx 94.44% 2 Missing ⚠️
src/course-updates/update-form/utils.js 75.00% 2 Missing ⚠️
... and 4 more
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1052   +/-   ##
=======================================
  Coverage   92.59%   92.60%           
=======================================
  Files         710      710           
  Lines       12683    12683           
  Branches     2764     2764           
=======================================
+ Hits        11744    11745    +1     
+ Misses        903      902    -1     
  Partials       36       36           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@yusuf-musleh yusuf-musleh left a comment

Choose a reason for hiding this comment

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

👍 @pomegranited Great work on this! Things seems to be working smoothly. Just had a small non-blocker question about some test.

  • I tested this: Ran locally and npm installed everything, enabled all new_studio_mfe flags, then navigated through all the pages to confirm nothing is broken.
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

src/files-and-videos/files-page/FilesPage.test.jsx Outdated Show resolved Hide resolved
@yusuf-musleh
Copy link
Member

@pomegranited Though I'm not sure how to go about the coverage issue in the CI. My hunch is that this is probably because many files were changed, and some code might not have had tests previously, hence the in the patch coverage it falls under the required limit.

@pomegranited
Copy link
Contributor Author

Hi @yusuf-musleh ,

I'm not sure how to go about the coverage issue in the CI. My hunch is that this is probably because many files were changed,

I think if we merge the smaller PRs and then rebase this one, the coverage will fix itself.

better than we did in the previous commit.
@pomegranited pomegranited force-pushed the jill/frontend-build-14 branch from fb86d8a to 3f53e96 Compare June 5, 2024 00:45
Copy link
Contributor

@xitij2000 xitij2000 left a comment

Choose a reason for hiding this comment

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

I see a couple of await useEvent instances. I assume they were from the other PR in which case this will eb fixed with a rebase, otherwise some of the points from the test warnign fix PR will apply here as well.

@@ -23,8 +23,7 @@
.configuration-card-header {
display: flex;
align-items: center;
align-content: center;
justify-content: space-between;
place-content: center space-between;

.configuration-card-header__button {
display: flex;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nope, I meat you can use those classes instead of using a custom class to apply the same styles.

i.e. do a search-replace with:
search className="configuration-card-header"
replace className="configuration-card-header d-flex align-items-start p-0 h-auto text-black "

Then these can be removed from the custom css

src/generic/delete-modal/DeleteModal.test.jsx Outdated Show resolved Hide resolved
@rayzhou-bit
Copy link
Contributor

@pomegranited Thank you for working on this PR! TnL is looking to get this moved in asap so please let me know if there's anything I can do to help.

@bradenmacdonald
Copy link
Contributor

@rayzhou-bit Could you help us get openedx-unsupported/frontend-component-ai-translations#16 merged? That's blocking this PR so that would definitely be a big help in getting this over the line sooner. Thanks :)

@pomegranited
Copy link
Contributor Author

@bradenmacdonald @xitij2000

I thought that the codecov/patch would fix itself when we merged those other PRs, but it hasn't. But now I'm worried that it will take too much more time to fix.

Is there any way we can ignore this test failure for this particular case, and merge anyway?

@bradenmacdonald
Copy link
Contributor

bradenmacdonald commented Jun 13, 2024

@pomegranited Yes I believe it will be fine just to ignore that and merge anyways. You're not responsible for increasing the test coverage of unrelated components that the diff happens to touch, which already weren't meeting the requirement. IMHO.

It would be a different story if you added a bunch of new code without tests.

As you can see, the overall coverage % of the project is not affected at all.

@pomegranited
Copy link
Contributor Author

Hi @rayzhou-bit , thank you for your help! Could we also get a release created for https://github.com/openedx/frontend-lib-content-components ? I need to update the dependency here now that openedx/frontend-lib-content-components#475 has been merged.

@rayzhou-bit
Copy link
Contributor

@pomegranited 2.2.0 should work for frontend-lib-content-component version! I had a change merged in with 2.2.0 set, but we reverted it because we thought it was blocking the pipeline without the upgrades in this PR.

@pomegranited pomegranited force-pushed the jill/frontend-build-14 branch from df7b0fe to 21924cb Compare June 18, 2024 03:24
@bradenmacdonald
Copy link
Contributor

@pomegranited @xitij2000 What's left before we can merge this? Merge the @edx/frontend-component-ai-translations PR ?

@pomegranited
Copy link
Contributor Author

@bradenmacdonald Yep, we need openedx-unsupported/frontend-component-ai-translations#16 merged & tagged, that's all that's blocking us now.

@pomegranited
Copy link
Contributor Author

@xitij2000 There's an issue with the codecov token:

Error: Codecov token not found. Please provide Codecov token with -t flag.

The validate workflow looks like it's configured correctly, so maybe that secret got removed? Or maybe these tokens expire? I don't know..

CC @bradenmacdonald @arbrandes in case you can help.

@xitij2000
Copy link
Contributor

@xitij2000 There's an issue with the codecov token:

Error: Codecov token not found. Please provide Codecov token with -t flag.

The validate workflow looks like it's configured correctly, so maybe that secret got removed? Or maybe these tokens expire? I don't know..

CC @bradenmacdonald @arbrandes in case you can help.

Since the tests are passing and this PR doesn't have a coverage impact, I think it's safe to merge. However, I don't see any option to merge. As you said, it's probably an expired or missing token. Rerunning didn't help and I don't have the ability or access to fix the token issue.

@yusuf-musleh
Copy link
Member

Error: Codecov token not found. Please provide Codecov token with -t flag.

@pomegranited @xitij2000 I've seen this error happen sometimes, generally repushing/rerunning the tests after some time fixes the issue and the coverage gets uploaded.

@bradenmacdonald bradenmacdonald force-pushed the jill/frontend-build-14 branch from a63bfa0 to 0197c1d Compare June 21, 2024 17:41
@bradenmacdonald
Copy link
Contributor

@pomegranited @xitij2000 I believe the token is only available for PRs that come from the openedx organization. Since this PR is hosted on an OpenCraft branch, it only uses the shared GitHub tokenless approach which is subject to rate limits. I force-pushed it now and we'll see what that does.

@xitij2000
Copy link
Contributor

@pomegranited @xitij2000 I believe the token is only available for PRs that come from the openedx organization. Since this PR is hosted on an OpenCraft branch, it only uses the shared GitHub tokenless approach which is subject to rate limits. I force-pushed it now and we'll see what that does.

I had already rerun the tests. I also pushed this branch to this repo, but didn't want to create another PR from it, I remember sometimes having the same commits in a branch on the same repo helps.

@xitij2000 xitij2000 merged commit 6b6d3aa into openedx:master Jun 21, 2024
5 of 6 checks passed
@openedx-webhooks
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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