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

Add stats comment to Pull Requests #4039

Merged
merged 6 commits into from
Aug 23, 2023
Merged

Add stats comment to Pull Requests #4039

merged 6 commits into from
Aug 23, 2023

Conversation

domoscargin
Copy link
Contributor

@domoscargin domoscargin commented Aug 3, 2023

Closes #3282

Adds file sizes for key files, and a module breakdown summary in a comment on all PRs.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 3, 2023 08:28 Inactive
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

📋 Stats

File sizes

File Size
dist/govuk-frontend-4.6.0.min.css 118.07 KiB
dist/govuk-frontend-4.6.0.min.js 47.1 KiB
dist/govuk-frontend-ie8-4.6.0.min.css 79.27 KiB
packages/govuk-frontend/dist/govuk/all.bundle.js 72.35 KiB
packages/govuk-frontend/dist/govuk/all.bundle.mjs 67.96 KiB
packages/govuk-frontend/dist/govuk/all.mjs 3.91 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend-component.mjs 359 B
packages/govuk-frontend/dist/govuk/govuk-frontend.min.js 34.31 KiB
packages/govuk-frontend/dist/govuk/i18n.mjs 5.83 KiB

Modules

File Size
all.mjs 64.5 KiB
components/accordion/accordion.mjs 20.86 KiB
components/button/button.mjs 3.67 KiB
components/character-count/character-count.mjs 20.46 KiB
components/checkboxes/checkboxes.mjs 4.37 KiB
components/error-summary/error-summary.mjs 4.96 KiB
components/exit-this-page/exit-this-page.mjs 15.42 KiB
components/header/header.mjs 2.3 KiB
components/notification-banner/notification-banner.mjs 3.5 KiB
components/radios/radios.mjs 3.37 KiB
components/skip-link/skip-link.mjs 2.12 KiB
components/tabs/tabs.mjs 8.04 KiB

View stats and visualisations on the review app


Action run for 7ee4596

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 3, 2023 08:34 Inactive
shared/lib/package.json Outdated Show resolved Hide resolved
@domoscargin domoscargin marked this pull request as ready for review August 3, 2023 08:40
@domoscargin domoscargin requested a review from a team as a code owner August 3, 2023 08:40
@domoscargin domoscargin added github_actions Pull requests that update GitHub Actions code performance analytics tooling labels Aug 3, 2023
@domoscargin domoscargin modified the milestone: v5.0 Aug 3, 2023
@colinrotherham
Copy link
Contributor

@domoscargin Love seeing these stats appearing 😍

@domoscargin
Copy link
Contributor Author

domoscargin commented Aug 3, 2023

Hmm, application error on the deployment...

Looks like filesize needs to be a dependency because govuk-frontend-stats tries to import it.

I'll have a look at rejigging things a bit.

edit: Done. I've moved filesize out of govuk-frontend-stats, which now just returns the raw stats.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 3, 2023 11:39 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 3, 2023 11:59 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 3, 2023 12:04 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 3, 2023 12:23 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 3, 2023 12:26 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 3, 2023 12:32 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 3, 2023 12:37 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 3, 2023 12:40 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 16, 2023 15:04 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 16, 2023 15:13 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 16, 2023 15:23 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 16, 2023 16:06 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 17, 2023 10:14 Inactive
@domoscargin domoscargin marked this pull request as ready for review August 17, 2023 10:20
@domoscargin domoscargin force-pushed the bk-stats-comment branch 3 times, most recently from 081f58b to 0032a78 Compare August 17, 2023 13:00
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 23, 2023 14:01 Inactive
@domoscargin
Copy link
Contributor Author

@colinrotherham, I've implemented your changes and all looks good.

I've also cleaned up the commit list, because it was getting messy.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 23, 2023 14:17 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 23, 2023 14:25 Inactive
Copy link
Contributor

@colinrotherham colinrotherham left a comment

Choose a reason for hiding this comment

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

Looks ace, good to have this merged

Can you double check package versions? Think some had updated

Comment on lines 267 to 271
/**
* @typedef {object} StatComment
* @property {string} titleText - The title of the comment
* @property {string} markerText - The marker to identify the comment
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a blocker, but we could share (or rename) the DiffComment type to avoid a new one

The workspace path could satisfy path to stop any warnings

await commentStats({ github, context, commit }, issueNumber, {
  path: '${{ github.workspace }}',
  titleText: ':clipboard: Stats',
  markerText: 'stats'
})

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-4039 August 23, 2023 15:51 Inactive
@domoscargin domoscargin merged commit 85d49ed into main Aug 23, 2023
44 checks passed
@domoscargin domoscargin deleted the bk-stats-comment branch August 23, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analytics github_actions Pull requests that update GitHub Actions code performance tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display file sizes and module breakdown on pull requests
3 participants