-
Notifications
You must be signed in to change notification settings - Fork 294
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
Extract Bundlesize to its own job/check #2539
Comments
Based on usage in other repos, it looks like all we need to do here is outlined in this comment: #2366 (comment) |
Note: from what I can tell, there isn't actually a way to stop us running the build process and |
@tofumatt – correct, we will still need to run the build ourselves. Whether or not we split out the check to its own job may not be necessary or more efficient, but I think the added information is worth adding as a distinct check in the list even if that means it remains as part the current JS tests job. |
@tofumatt I just added the |
Aha, I see. I missed this section in the docs: https://github.com/siddharthkp/bundlesize#using-a-different-ci So we need to add a few more environment variables when we run IB updated, should be straightforward according to the docs. 👍🏻 I think it's best to leave actually running the check inside the JS tests to be quicker/more efficient, but this will separate the info out into its own check. 🙂 |
IB ✅ |
@aaemnnosttv @tofumatt I see the bundlesize check already showing up among our actions. Is there actually anything else needed here? |
@felixarntz – if we have a branch where the new check has been triggered, I would expect it to appear in the list of all/known checks if that's what you mean. I don't see it on the list of checks for current PRs however, so I think the only thing left is to add the missing env vars to the command. See "Work to be done" above and Default environment variables for GHA. |
@aaemnnosttv @benbowler Is there no way to make this a PR check that shows along the other checks (CLA, tests, etc.)? |
Ping @aaemnnosttv |
@felixarntz it looks like it already is I think this was mainly not working before due to instability on the backend of the service needed for this to work. The bigger problem with bundlesize right now is that it doesn't really support bundles with a hash in the filename, so the diff will always be wrong for us since file names will never match for changed bundles. This is one of the problems that I agree it would be nice to be more visible on the check itself rather than only on the PR. It should be possible, but looks like it might require us to roll our own action to do it at the moment. |
Pulling back for a follow-up to apply the hash stripping as mentioned here. |
@aaemnnosttv is it possible to get a few more steps on how to test this? I've looked at the ticket, but not sure what I am looking for :) |
Feature Description
In #2366 we migrated our JS tests to GitHub Actions, which created a new workflow for running our Jest tests as well as our Bundlesize tests.
These currently run in the same job, making both slower to run, but also Bundlesize has some integration with GitHub checks which makes the results of the run more visible, rather than simply pass or fail.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
Because this process needs to be done by someone with admin access to the repo and the ability to authorise Bundlesize to access the repo, it's best done by @felixarntz.
Work completed by @felixarntz, required to allow the check to appear
bundlesize
on.google/site-kit-wp
repo as a GitHub secret namedBUNDLESIZE_GITHUB_TOKEN
.Work to be done
npm run test:bundlesize
command in the "JS Tests" GitHub Action workflow:CI_REPO_OWNER='google'
CI_REPO_NAME='site-kit-wp'
CI_COMMIT_MESSAGE={The git commit message for this commit, should be available as a GitHub Actions ENV var}
CI_COMMIT_SHA={The git commit SHA for this commit, should be available as a GitHub Actions ENV var}
CI=true
(if not already set by GitHub Actions)Doing the above will mean future PRs running
bundlesize
will send their data to the Bundlesize app and report as a check, as #2366 already added the necessary info in the GitHub Action for this to work if the secret is available.Test Coverage
Visual Regression Changes
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: