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

Bundle analyzer on plugins #9320

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ruchidh
Copy link

@ruchidh ruchidh commented Feb 1, 2025

Description

This PR will create bundle variation percentage report in pr comment for a newly added performance testing from existing limit size of bundle for every Open PR against main. If the variation is more than 20%, you will see the list of plugins name which are breaking the thereshold of bundle size limit variation in comments.

Limit is updated with package size to current date.

For any plugin from now on, if have bundle size variation more than 20% will get report.

Screenshot

No required

Testing the changes

Changelog

  • feature: Webapck bundle analyser limit check

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Signed-off-by: Ruchi Sharma <[email protected]>
Copy link
Contributor

github-actions bot commented Feb 1, 2025

ℹ️ Manual Changeset Creation Reminder

Please ensure manual commit for changeset file 9320.yml under folder changelogs/fragments to complete this PR.

If you want to use the available OpenSearch Changeset Bot App to avoid manual creation of changeset file you can install it in your forked repository following this link.

For more information about formatting of changeset files, please visit OpenSearch Auto Changeset and Release Notes Tool.

@ruchidh ruchidh changed the title Bundle analyzer Bundle analyzer on plugins Feb 1, 2025
Copy link
Contributor

github-actions bot commented Feb 1, 2025

❌ Changeset File Not Added Yet

Please ensure manual commit for changeset file 9320.yml under folder changelogs/fragments to complete this PR. File still missing.

Copy link
Contributor

github-actions bot commented Feb 1, 2025

❌ Changelog Entry Missing Hyphen

Changelog entries must begin with a hyphen (-).

Copy link
Contributor

Choose a reason for hiding this comment

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

Are these bundle size limits? Can you share how these number comes up? Why are we deleting some?

Copy link
Author

Choose a reason for hiding this comment

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

Actually, these are not deleted manually. The file was updated 4 years back with old plugins, which are not supported now. This is all auto updated with new plugins and relevant package size only.

Copy link
Author

@ruchidh ruchidh Feb 3, 2025

Choose a reason for hiding this comment

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

ruchidh#3 - forked pr with results

@github-actions github-actions bot added Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry and removed failed changeset labels Feb 3, 2025
Copy link
Contributor

github-actions bot commented Feb 3, 2025

❌ Invalid Prefix For Manual Changeset Creation

Invalid description prefix. Found "feature". Only "skip" entry option is permitted for manual commit of changeset files.

If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description.

@github-actions github-actions bot added failed changeset and removed Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry labels Feb 3, 2025
Copy link
Contributor

github-actions bot commented Feb 3, 2025

❌ Invalid Prefix For Manual Changeset Creation

Invalid description prefix. Found "feature". Only "skip" entry option is permitted for manual commit of changeset files.

If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description.

1 similar comment
Copy link
Contributor

github-actions bot commented Feb 3, 2025

❌ Invalid Prefix For Manual Changeset Creation

Invalid description prefix. Found "feature". Only "skip" entry option is permitted for manual commit of changeset files.

If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description.

const delta = metric.value - metric.limit;
const deltaPercentage = Math.round((delta / metric.limit) * 100 * 100) / 100;

if (deltaPercentage > 20) {
Copy link
Member

Choose a reason for hiding this comment

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

This percentage seems quite high. For reference, if we had 5 PRs that increased the bundle size by 15% we'd get no notification and would have more than doubled the bundle size.

: metric.value + DEFAULT_BUDGET;
existingLimit != null && existingLimit >= metric.value ? existingLimit : metric.value;

// Update the bundle size variation file for bundles that exceed the limit by more than 20%.
Copy link
Member

Choose a reason for hiding this comment

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

Is this to update the baseline or for reporting to the CI for it to decide whether or not to fail?

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

Successfully merging this pull request may close these issues.

3 participants