u-root icon indicating copy to clipboard operation
u-root copied to clipboard

Tracking image sizes

Open rojer opened this issue 5 years ago • 6 comments

We need to be conscious of the size of the output images. Image size impact of every change should be evaluated during review. Things like #1798 do happen and go unnoticed while it would've probably raised a red flag in review if the size impact was more apparent (#1808 specifically addresses the DCE regression but a size bump should've raised a red flag as well).

I think every PR should come with a size diff breakdown for standard templates (minimal, core, all). I am going to work on this. Rough idea is:

  1. Gather stats during CircleCI build, e.g. this part, and store as a build artifact.
  2. Some sort of automation (new GitHub action?) to automatically comment on PRs with comparison to last master build stats, e.g. "all: +12345 bytes, core: no change, minimal: no change, ...".

cc @insomniacslk

rojer avatar Aug 18 '20 17:08 rojer

@hugelgupf @rminnich after #1810 goes in, the intention is to have CircleCI post stats to pull request after successful build as a comment. for that, a GitHub token is required. do we have one already that can be used for this? or can one be created and added as a project-level variable?

rojer avatar Aug 20 '20 11:08 rojer

@hugelgupf thak you for merging #1810, we are collecting the stats now but to provide diffs and PR feedback we need DircleCI to carry a GH token with the necessary permissions. can you help setting one up and putting it into a variable?

rojer avatar Sep 14 '20 11:09 rojer

Hey, we can set one up. What exactly does the posting?

hugelgupf avatar Sep 14 '20 12:09 hugelgupf

my current plan is to add a step to the CircleCI build when building a branch other than master, after collecting stats, to fetch latest master build stats via CircleCI API, diff them and post a comment to the PR via GH API. for that to work, CircleCI build environment should have access to a GH token with enough permissions to be able to comment on PRs.

rojer avatar Sep 14 '20 12:09 rojer

@hugelgupf what do you think of this? do you have other suggestions?

rojer avatar Sep 27 '20 23:09 rojer

Are you referring to this for posting a comment? https://support.circleci.com/hc/en-us/articles/360048170573-Auto-comment-on-GitHub-Pull-Requests

Aren't these GitHub tokens secret and not safe to put in the CI?

rjoleary avatar Jun 07 '21 04:06 rjoleary