Giter VIP home page Giter VIP logo

buildsize's Introduction

⚠⚠⚠
Due to a lack of free time, I'm no longer working on this project. Please email me if you'd like to take over its maintenance.
⚠⚠⚠


BuildSize is a simple web app allowing you to automatically track the size of your build artifacts. For each pull request you receive, BuildSize will automatically calculate the size of the build artifacts, and leave a comment (and a build status message) comparing them to the latest master version.

This is currently a work-in-progress. More documentation (including documentation on how to self-host it) will be coming in the future.

If you want to hack on BuildSize, see the development documentation.

Features

  • Simple to use. BuildSize uses the artifacts from your existing CI system, so there's practically no configuration required, and it's available as a GitHub App so you don't need to install any software. Just install the GitHub App to your repository and that's it!
  • Supports CircleCI, with more build systems coming soon.
  • Open-source. Use the hosted version at https://buildsize.org/, or host it yourself.

Similar Projects

There are a few similar projects to BuildSize, such as bundlesize. See how BuildSize differs.

Licence

(The MIT licence)

Copyright (C) 2017 Daniel Lo Nigro (Daniel15)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

buildsize's People

Contributors

daniel15 avatar serima avatar tusbar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

buildsize's Issues

Editing the existing comment makes it harder to find

When I publish a new commit to a PR, buildsize updates the comment it made earlier.

This is nice to reduce spaminess on the thread, but on the other hand it means the comment gets lost higher up the thread, eg. angular/angular#22040 has some later robot comments added for each commit.

Not sure if there's a way to have both low-spam and also keep the message near the bottom. Maybe it's a moot point if we solve #31 since that way the PR status will indicate the current state of the PR.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organiszation’s settings page, under Installed GitHub Apps.

Collect build size changes for an entire workflow?

Thanks for making this! It's quite nice.

I've got a feature request that I took a stab at working on, but I'm not familiar enough with Circle's API to do what I'm trying to do.

Here's an example issue from one of my projects: StoDevX/AAO-React-Native#2271 (comment)

I have a number of jobs in a CircleCI "workflow", four of which store artifacts. BuildSize currently updates the comment after each "build" completes, but it only only checks the artifacts for that build event, so when the workflow has completed only a single job's worth of sizes are reported.

Would it be possible to only report the build sizes when the entire workflow has completed? Or to progressively update the comment as the jobs complete, perhaps, instead of marking the other files [deleted]? (I'm not sure how you'd manage to actually handle deleted files; perhaps tagging each file by the job that inserts it?)

Configuration option to mark SHA status as non-success

I'm trying this out for angular/angular which has a clunky brittle size-limit test.

I see from angular/angular-bazel-example#74 that I get a nice comment from the bot. But I also want the green merge button to go away, and force whoever merges the commit to think about it.
I'd like to do this by marking that commit SHA with a "pending" status.
Thoughts about whether such a feature belongs?

Feature request: Set branch to compare against

Right now, it appears that the comparison is always with the master branch. It would be nice if you could compare with a given branch.

For example, in my repo I've changed my default/base branch to be dev. I would like the artifact measurement to compare against the dev branch instead of master.

Thanks for your awesome work!

Add Circle config

This repo does not have .circle/config.yml
I tried it using circleci/php:7.1-node-browsers docker image, but it did not have php-soap, and the following error occurred when running phpunit. We need to configure php with --enable-soap if we use this.

Fatal error: Uncaught BadMethodCallException: For soap support you need to install the soap extension. in /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/LibraryHooks/SoapHook.php on line 47

BadMethodCallException: For soap support you need to install the soap extension. in /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/LibraryHooks/SoapHook.php on line 47

Call Stack:
    0.0001     366512   1. {main}() /home/circleci/laravel/vendor/phpunit/phpunit/phpunit:0
    0.0152    2750832   2. PHPUnit\TextUI\Command::main() /home/circleci/laravel/vendor/phpunit/phpunit/phpunit:53
    0.0152    2750944   3. PHPUnit\TextUI\Command->run() /home/circleci/laravel/vendor/phpunit/phpunit/src/TextUI/Command.php:141
    0.0152    2750944   4. PHPUnit\TextUI\Command->handleArguments() /home/circleci/laravel/vendor/phpunit/phpunit/src/TextUI/Command.php:152
    0.0183    3059008   5. PHPUnit\TextUI\Command->handleBootstrap() /home/circleci/laravel/vendor/phpunit/phpunit/src/TextUI/Command.php:735
    0.0184    3064760   6. PHPUnit\Util\Fileloader::checkAndLoad() /home/circleci/laravel/vendor/phpunit/phpunit/src/TextUI/Command.php:913
    0.0184    3064968   7. PHPUnit\Util\Fileloader::load() /home/circleci/laravel/vendor/phpunit/phpunit/src/Util/Fileloader.php:45
    0.0185    3067312   8. include_once('/home/circleci/laravel/tests/bootstrap.php') /home/circleci/laravel/vendor/phpunit/phpunit/src/Util/Fileloader.php:61
    0.0187    3073080   9. VCR\VCR::turnOn() /home/circleci/laravel/tests/bootstrap.php:4
    0.0187    3073136  10. VCR\VCR::__callStatic() /home/circleci/laravel/tests/bootstrap.php:4
    0.0196    3169112  11. call_user_func_array:{/home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCR.php:35}() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCR.php:35
    0.0196    3169176  12. VCR\Videorecorder->turnOn() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCR.php:35
    0.0196    3169176  13. VCR\Videorecorder->enableLibraryHooks() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/Videorecorder.php:122
    0.0231    3704344  14. VCR\VCRFactory::get() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/Videorecorder.php:288
    0.0231    3704344  15. VCR\VCRFactory->getOrCreate() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCRFactory.php:98
    0.0231    3704776  16. call_user_func_array:{/home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCRFactory.php:119}() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCRFactory.php:119
    0.0231    3704840  17. VCR\VCRFactory->createVCRLibraryHooksSoapHook() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCRFactory.php:119
    0.0241    3724472  18. VCR\LibraryHooks\SoapHook->__construct() /home/circleci/laravel/vendor/php-vcr/php-vcr/src/VCR/VCRFactory.php:60

Private repos not supported

Apologies if this is the wrong forum to ask support questions like this.

I'm wondering if my configuration is set up correctly — BuildSize isn't commenting on my PRs nor setting a build status. Not sure what I'm doing wrong.

  • I've installed BuildSize as a GitHub app and have given it the proper permissions
  • CircleCI is monitoring my repo and running whenever a PR is open
  • Build artifacts are being uploaded to CircleCI

screen shot 2017-10-21 at 10 55 40 am

Is there a specific path I need to put the build artifacts?
My repo is private, can BuildSize only work with public repos?

Thank you!

Document whether BuildSize works on forks

One of the downsides to bundlesize is that since it requires that the GitHub token be passed via an environment variable, it doesn't work for PRs opened from forks of a repository (since CI systems like TravisCI strip secure variables for forks).

Since BuildSize uses a GitHub App, I'm presuming this limitation doesn't apply?

If so, perhaps it would be good to document this in the README and the comparison page?

Handle when pull request is sent after build completes

If a pull request is sent after a build completes, BuildSize will not leave a comment :(

When the PR is opened, pull_request webhook payload contains info on the commit:

    "head": {
      "label": "BuildSizeTest:Daniel15-patch-11",
      "ref": "Daniel15-patch-11",
      "sha": "a950afbff9f7654b1e73f7adec2ce1cebbec3d84",
Full payload
{
  "action": "opened",
  "number": 15,
  "pull_request": {
    "url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/pulls/15",
    "id": 159988968,
    "html_url": "https://github.com/BuildSizeTest/CircleCI1Test/pull/15",
    "diff_url": "https://github.com/BuildSizeTest/CircleCI1Test/pull/15.diff",
    "patch_url": "https://github.com/BuildSizeTest/CircleCI1Test/pull/15.patch",
    "issue_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/issues/15",
    "number": 15,
    "state": "open",
    "locked": false,
    "title": "test11 a",
    "user": {
      "login": "Daniel15",
      "id": 91933,
      "avatar_url": "https://avatars2.githubusercontent.com/u/91933?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/Daniel15",
      "html_url": "https://github.com/Daniel15",
      "followers_url": "https://api.github.com/users/Daniel15/followers",
      "following_url": "https://api.github.com/users/Daniel15/following{/other_user}",
      "gists_url": "https://api.github.com/users/Daniel15/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/Daniel15/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/Daniel15/subscriptions",
      "organizations_url": "https://api.github.com/users/Daniel15/orgs",
      "repos_url": "https://api.github.com/users/Daniel15/repos",
      "events_url": "https://api.github.com/users/Daniel15/events{/privacy}",
      "received_events_url": "https://api.github.com/users/Daniel15/received_events",
      "type": "User",
      "site_admin": false
    },
    "body": "",
    "created_at": "2017-12-24T05:24:14Z",
    "updated_at": "2017-12-24T05:24:14Z",
    "closed_at": null,
    "merged_at": null,
    "merge_commit_sha": null,
    "assignee": null,
    "assignees": [

    ],
    "requested_reviewers": [

    ],
    "milestone": null,
    "commits_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/pulls/15/commits",
    "review_comments_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/pulls/15/comments",
    "review_comment_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/pulls/comments{/number}",
    "comments_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/issues/15/comments",
    "statuses_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/statuses/a950afbff9f7654b1e73f7adec2ce1cebbec3d84",
    "head": {
      "label": "BuildSizeTest:Daniel15-patch-11",
      "ref": "Daniel15-patch-11",
      "sha": "a950afbff9f7654b1e73f7adec2ce1cebbec3d84",
      "user": {
        "login": "BuildSizeTest",
        "id": 31597874,
        "avatar_url": "https://avatars1.githubusercontent.com/u/31597874?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/BuildSizeTest",
        "html_url": "https://github.com/BuildSizeTest",
        "followers_url": "https://api.github.com/users/BuildSizeTest/followers",
        "following_url": "https://api.github.com/users/BuildSizeTest/following{/other_user}",
        "gists_url": "https://api.github.com/users/BuildSizeTest/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/BuildSizeTest/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/BuildSizeTest/subscriptions",
        "organizations_url": "https://api.github.com/users/BuildSizeTest/orgs",
        "repos_url": "https://api.github.com/users/BuildSizeTest/repos",
        "events_url": "https://api.github.com/users/BuildSizeTest/events{/privacy}",
        "received_events_url": "https://api.github.com/users/BuildSizeTest/received_events",
        "type": "Organization",
        "site_admin": false
      },
      "repo": {
        "id": 102289952,
        "name": "CircleCI1Test",
        "full_name": "BuildSizeTest/CircleCI1Test",
        "owner": {
          "login": "BuildSizeTest",
          "id": 31597874,
          "avatar_url": "https://avatars1.githubusercontent.com/u/31597874?v=4",
          "gravatar_id": "",
          "url": "https://api.github.com/users/BuildSizeTest",
          "html_url": "https://github.com/BuildSizeTest",
          "followers_url": "https://api.github.com/users/BuildSizeTest/followers",
          "following_url": "https://api.github.com/users/BuildSizeTest/following{/other_user}",
          "gists_url": "https://api.github.com/users/BuildSizeTest/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/BuildSizeTest/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/BuildSizeTest/subscriptions",
          "organizations_url": "https://api.github.com/users/BuildSizeTest/orgs",
          "repos_url": "https://api.github.com/users/BuildSizeTest/repos",
          "events_url": "https://api.github.com/users/BuildSizeTest/events{/privacy}",
          "received_events_url": "https://api.github.com/users/BuildSizeTest/received_events",
          "type": "Organization",
          "site_admin": false
        },
        "private": false,
        "html_url": "https://github.com/BuildSizeTest/CircleCI1Test",
        "description": null,
        "fork": false,
        "url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test",
        "forks_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/forks",
        "keys_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/keys{/key_id}",
        "collaborators_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/collaborators{/collaborator}",
        "teams_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/teams",
        "hooks_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/hooks",
        "issue_events_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/issues/events{/number}",
        "events_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/events",
        "assignees_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/assignees{/user}",
        "branches_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/branches{/branch}",
        "tags_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/tags",
        "blobs_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/blobs{/sha}",
        "git_tags_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/tags{/sha}",
        "git_refs_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/refs{/sha}",
        "trees_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/trees{/sha}",
        "statuses_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/statuses/{sha}",
        "languages_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/languages",
        "stargazers_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/stargazers",
        "contributors_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/contributors",
        "subscribers_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/subscribers",
        "subscription_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/subscription",
        "commits_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/commits{/sha}",
        "git_commits_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/commits{/sha}",
        "comments_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/comments{/number}",
        "issue_comment_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/issues/comments{/number}",
        "contents_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/contents/{+path}",
        "compare_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/compare/{base}...{head}",
        "merges_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/merges",
        "archive_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/{archive_format}{/ref}",
        "downloads_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/downloads",
        "issues_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/issues{/number}",
        "pulls_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/pulls{/number}",
        "milestones_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/notifications{?since,all,participating}",
        "labels_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/labels{/name}",
        "releases_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/releases{/id}",
        "deployments_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/deployments",
        "created_at": "2017-09-03T19:47:14Z",
        "updated_at": "2017-09-03T19:47:14Z",
        "pushed_at": "2017-12-24T05:19:19Z",
        "git_url": "git://github.com/BuildSizeTest/CircleCI1Test.git",
        "ssh_url": "[email protected]:BuildSizeTest/CircleCI1Test.git",
        "clone_url": "https://github.com/BuildSizeTest/CircleCI1Test.git",
        "svn_url": "https://github.com/BuildSizeTest/CircleCI1Test",
        "homepage": null,
        "size": 17,
        "stargazers_count": 0,
        "watchers_count": 0,
        "language": null,
        "has_issues": true,
        "has_projects": true,
        "has_downloads": true,
        "has_wiki": true,
        "has_pages": false,
        "forks_count": 0,
        "mirror_url": null,
        "archived": false,
        "open_issues_count": 10,
        "license": null,
        "forks": 0,
        "open_issues": 10,
        "watchers": 0,
        "default_branch": "master"
      }
    },
    "base": {
      "label": "BuildSizeTest:master",
      "ref": "master",
      "sha": "60ea9583fe54d13cdfe7c8fec689d19af876578a",
      "user": {
        "login": "BuildSizeTest",
        "id": 31597874,
        "avatar_url": "https://avatars1.githubusercontent.com/u/31597874?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/BuildSizeTest",
        "html_url": "https://github.com/BuildSizeTest",
        "followers_url": "https://api.github.com/users/BuildSizeTest/followers",
        "following_url": "https://api.github.com/users/BuildSizeTest/following{/other_user}",
        "gists_url": "https://api.github.com/users/BuildSizeTest/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/BuildSizeTest/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/BuildSizeTest/subscriptions",
        "organizations_url": "https://api.github.com/users/BuildSizeTest/orgs",
        "repos_url": "https://api.github.com/users/BuildSizeTest/repos",
        "events_url": "https://api.github.com/users/BuildSizeTest/events{/privacy}",
        "received_events_url": "https://api.github.com/users/BuildSizeTest/received_events",
        "type": "Organization",
        "site_admin": false
      },
      "repo": {
        "id": 102289952,
        "name": "CircleCI1Test",
        "full_name": "BuildSizeTest/CircleCI1Test",
        "owner": {
          "login": "BuildSizeTest",
          "id": 31597874,
          "avatar_url": "https://avatars1.githubusercontent.com/u/31597874?v=4",
          "gravatar_id": "",
          "url": "https://api.github.com/users/BuildSizeTest",
          "html_url": "https://github.com/BuildSizeTest",
          "followers_url": "https://api.github.com/users/BuildSizeTest/followers",
          "following_url": "https://api.github.com/users/BuildSizeTest/following{/other_user}",
          "gists_url": "https://api.github.com/users/BuildSizeTest/gists{/gist_id}",
          "starred_url": "https://api.github.com/users/BuildSizeTest/starred{/owner}{/repo}",
          "subscriptions_url": "https://api.github.com/users/BuildSizeTest/subscriptions",
          "organizations_url": "https://api.github.com/users/BuildSizeTest/orgs",
          "repos_url": "https://api.github.com/users/BuildSizeTest/repos",
          "events_url": "https://api.github.com/users/BuildSizeTest/events{/privacy}",
          "received_events_url": "https://api.github.com/users/BuildSizeTest/received_events",
          "type": "Organization",
          "site_admin": false
        },
        "private": false,
        "html_url": "https://github.com/BuildSizeTest/CircleCI1Test",
        "description": null,
        "fork": false,
        "url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test",
        "forks_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/forks",
        "keys_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/keys{/key_id}",
        "collaborators_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/collaborators{/collaborator}",
        "teams_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/teams",
        "hooks_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/hooks",
        "issue_events_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/issues/events{/number}",
        "events_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/events",
        "assignees_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/assignees{/user}",
        "branches_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/branches{/branch}",
        "tags_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/tags",
        "blobs_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/blobs{/sha}",
        "git_tags_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/tags{/sha}",
        "git_refs_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/refs{/sha}",
        "trees_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/trees{/sha}",
        "statuses_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/statuses/{sha}",
        "languages_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/languages",
        "stargazers_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/stargazers",
        "contributors_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/contributors",
        "subscribers_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/subscribers",
        "subscription_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/subscription",
        "commits_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/commits{/sha}",
        "git_commits_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/commits{/sha}",
        "comments_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/comments{/number}",
        "issue_comment_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/issues/comments{/number}",
        "contents_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/contents/{+path}",
        "compare_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/compare/{base}...{head}",
        "merges_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/merges",
        "archive_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/{archive_format}{/ref}",
        "downloads_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/downloads",
        "issues_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/issues{/number}",
        "pulls_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/pulls{/number}",
        "milestones_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/milestones{/number}",
        "notifications_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/notifications{?since,all,participating}",
        "labels_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/labels{/name}",
        "releases_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/releases{/id}",
        "deployments_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/deployments",
        "created_at": "2017-09-03T19:47:14Z",
        "updated_at": "2017-09-03T19:47:14Z",
        "pushed_at": "2017-12-24T05:19:19Z",
        "git_url": "git://github.com/BuildSizeTest/CircleCI1Test.git",
        "ssh_url": "[email protected]:BuildSizeTest/CircleCI1Test.git",
        "clone_url": "https://github.com/BuildSizeTest/CircleCI1Test.git",
        "svn_url": "https://github.com/BuildSizeTest/CircleCI1Test",
        "homepage": null,
        "size": 17,
        "stargazers_count": 0,
        "watchers_count": 0,
        "language": null,
        "has_issues": true,
        "has_projects": true,
        "has_downloads": true,
        "has_wiki": true,
        "has_pages": false,
        "forks_count": 0,
        "mirror_url": null,
        "archived": false,
        "open_issues_count": 10,
        "license": null,
        "forks": 0,
        "open_issues": 10,
        "watchers": 0,
        "default_branch": "master"
      }
    },
    "_links": {
      "self": {
        "href": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/pulls/15"
      },
      "html": {
        "href": "https://github.com/BuildSizeTest/CircleCI1Test/pull/15"
      },
      "issue": {
        "href": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/issues/15"
      },
      "comments": {
        "href": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/issues/15/comments"
      },
      "review_comments": {
        "href": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/pulls/15/comments"
      },
      "review_comment": {
        "href": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/pulls/comments{/number}"
      },
      "commits": {
        "href": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/pulls/15/commits"
      },
      "statuses": {
        "href": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/statuses/a950afbff9f7654b1e73f7adec2ce1cebbec3d84"
      }
    },
    "author_association": "OWNER",
    "merged": false,
    "mergeable": null,
    "rebaseable": null,
    "mergeable_state": "unknown",
    "merged_by": null,
    "comments": 0,
    "review_comments": 0,
    "maintainer_can_modify": false,
    "commits": 1,
    "additions": 1,
    "deletions": 1,
    "changed_files": 1
  },
  "repository": {
    "id": 102289952,
    "name": "CircleCI1Test",
    "full_name": "BuildSizeTest/CircleCI1Test",
    "owner": {
      "login": "BuildSizeTest",
      "id": 31597874,
      "avatar_url": "https://avatars1.githubusercontent.com/u/31597874?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/BuildSizeTest",
      "html_url": "https://github.com/BuildSizeTest",
      "followers_url": "https://api.github.com/users/BuildSizeTest/followers",
      "following_url": "https://api.github.com/users/BuildSizeTest/following{/other_user}",
      "gists_url": "https://api.github.com/users/BuildSizeTest/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/BuildSizeTest/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/BuildSizeTest/subscriptions",
      "organizations_url": "https://api.github.com/users/BuildSizeTest/orgs",
      "repos_url": "https://api.github.com/users/BuildSizeTest/repos",
      "events_url": "https://api.github.com/users/BuildSizeTest/events{/privacy}",
      "received_events_url": "https://api.github.com/users/BuildSizeTest/received_events",
      "type": "Organization",
      "site_admin": false
    },
    "private": false,
    "html_url": "https://github.com/BuildSizeTest/CircleCI1Test",
    "description": null,
    "fork": false,
    "url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test",
    "forks_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/forks",
    "keys_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/teams",
    "hooks_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/hooks",
    "issue_events_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/issues/events{/number}",
    "events_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/events",
    "assignees_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/assignees{/user}",
    "branches_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/branches{/branch}",
    "tags_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/tags",
    "blobs_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/languages",
    "stargazers_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/stargazers",
    "contributors_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/contributors",
    "subscribers_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/subscribers",
    "subscription_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/subscription",
    "commits_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/contents/{+path}",
    "compare_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/merges",
    "archive_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/downloads",
    "issues_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/issues{/number}",
    "pulls_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/labels{/name}",
    "releases_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/releases{/id}",
    "deployments_url": "https://api.github.com/repos/BuildSizeTest/CircleCI1Test/deployments",
    "created_at": "2017-09-03T19:47:14Z",
    "updated_at": "2017-09-03T19:47:14Z",
    "pushed_at": "2017-12-24T05:19:19Z",
    "git_url": "git://github.com/BuildSizeTest/CircleCI1Test.git",
    "ssh_url": "[email protected]:BuildSizeTest/CircleCI1Test.git",
    "clone_url": "https://github.com/BuildSizeTest/CircleCI1Test.git",
    "svn_url": "https://github.com/BuildSizeTest/CircleCI1Test",
    "homepage": null,
    "size": 17,
    "stargazers_count": 0,
    "watchers_count": 0,
    "language": null,
    "has_issues": true,
    "has_projects": true,
    "has_downloads": true,
    "has_wiki": true,
    "has_pages": false,
    "forks_count": 0,
    "mirror_url": null,
    "archived": false,
    "open_issues_count": 10,
    "license": null,
    "forks": 0,
    "open_issues": 10,
    "watchers": 0,
    "default_branch": "master"
  },
  "organization": {
    "login": "BuildSizeTest",
    "id": 31597874,
    "url": "https://api.github.com/orgs/BuildSizeTest",
    "repos_url": "https://api.github.com/orgs/BuildSizeTest/repos",
    "events_url": "https://api.github.com/orgs/BuildSizeTest/events",
    "hooks_url": "https://api.github.com/orgs/BuildSizeTest/hooks",
    "issues_url": "https://api.github.com/orgs/BuildSizeTest/issues",
    "members_url": "https://api.github.com/orgs/BuildSizeTest/members{/member}",
    "public_members_url": "https://api.github.com/orgs/BuildSizeTest/public_members{/member}",
    "avatar_url": "https://avatars1.githubusercontent.com/u/31597874?v=4",
    "description": null
  },
  "sender": {
    "login": "Daniel15",
    "id": 91933,
    "avatar_url": "https://avatars2.githubusercontent.com/u/91933?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/Daniel15",
    "html_url": "https://github.com/Daniel15",
    "followers_url": "https://api.github.com/users/Daniel15/followers",
    "following_url": "https://api.github.com/users/Daniel15/following{/other_user}",
    "gists_url": "https://api.github.com/users/Daniel15/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/Daniel15/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/Daniel15/subscriptions",
    "organizations_url": "https://api.github.com/users/Daniel15/orgs",
    "repos_url": "https://api.github.com/users/Daniel15/repos",
    "events_url": "https://api.github.com/users/Daniel15/events{/privacy}",
    "received_events_url": "https://api.github.com/users/Daniel15/received_events",
    "type": "User",
    "site_admin": false
  },
  "installation": {
    "id": 50571
  }
}

The BuildSize DB does already have this build:

MariaDB [buildsize]> SELECT * FROM builds WHERE commit = 'a950afbff9f7654b1e73f7adec2ce1cebbec3d84'\G
*************************** 1. row ***************************
          id: 877
  created_at: 2017-12-24 05:15:53
  updated_at: 2017-12-24 05:15:53
  project_id: 1
  identifier: Daniel15-patch-11/a950afbff9f7654b1e73f7adec2ce1cebbec3d84
      commit: a950afbff9f7654b1e73f7adec2ce1cebbec3d84
   committer: Daniel15
pull_request: NULL
 base_branch: NULL
 base_commit: NULL
      branch: Daniel15-patch-11
1 row in set (0.00 sec)

MariaDB [buildsize]> SELECT * FROM build_artifacts WHERE build_id = 877\G
*************************** 1. row ***************************
                 id: 5976
         created_at: 2017-12-24 05:15:54
         updated_at: 2017-12-24 05:15:54
           filename: example.txt
               size: 486015
           build_id: 877
project_artifact_id: 1
                url: https://23-102289952-gh.circle-artifacts.com/0/tmp/circle-artifacts.oplnNE3/example.txt
1 row in set (0.00 sec)

Since this build data is already cached, we should be able to recompute the BuildSize info based on the parent branch, and post a comment like normal.

Add comment customisation options

  • Only post comment if change is greater than some threshold (eg. more than 10 KB, or more than 5%, or something like that)
  • Mark status as "failure" if change is large

Never getting a comment

Hey,

When are comments created? I just added BuildSize to a repo, and pushed some artifacts on CircleCI on this PR: etalab/geo.data.gouv.fr#553 but I’m not getting a comment.

Also another issue I’ve seen on other repos: if the build finishes before the PR is opened, a comment is never created either.

Files with the same names get overriden

If i have something like this

extension
├── _locales
│   ├── en
│   │   └── messages.json
│   └── fr
│       └── messages.json
├── manifest.json

I only get one messages.json in the BuildSize output:

File name Previous Size New Size Change
manifest.json 745 bytes 828 bytes 83 bytes (11%)
messages.json 1.12 KB 1.12 KB 0 bytes (0%)

We should probably do something with partial paths for files with equal names, something like this would be nice:

File name Previous Size New Size Change
manifest.json 745 bytes 828 bytes 83 bytes (11%)
en/messages.json 1.12 KB 1.12 KB 0 bytes (0%)
fr/messages.json 1.12 KB 1.12 KB 0 bytes (0%)

BuildSize down?

Hey @Daniel15, is BuildSize still up and running? I noticed the check was missing in a recent PR and when I attempted to login with GitHub (link on buildsize.org), it just says "Whoops, looks like something went wrong." (The network tab of the browser developer tools indicated it was a 500 response from https://d.sb/ if that helps.)

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.