Daniel15 / BuildSize

Automatically track the size of your build artifacts
MIT License
54 stars 7 forks source link

Never getting a comment #25

Open tusbar opened 6 years ago

tusbar commented 6 years ago

Hey,

When are comments created? I just added BuildSize to a repo, and pushed some artifacts on CircleCI on this PR: https://github.com/etalab/geo.data.gouv.fr/pull/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.

tusbar commented 6 years ago

And on this PR https://github.com/etalab/geo.data.gouv.fr/pull/563, I opened the PR before the build finished, didn’t get a comment.

Updated something and forced push, and now I have one.

tusbar commented 6 years ago

Did the exact same thing on this PR: https://github.com/etalab/geo.data.gouv.fr/pull/566 never got a comment at all.

Daniel15 commented 6 years ago

Thanks for the bug report, I'll try to look into this soon :)

Daniel15 commented 6 years ago

I just added BuildSize to a repo, and pushed some artifacts on CircleCI on this PR: https://github.com/etalab/geo.data.gouv.fr/pull/553 but I’m not getting a comment.

For this particular one, the base commit (https://github.com/etalab/geo.data.gouv.fr/commit/c7f7fea48fbfc39a1defeb2caf2756482047fe54) was not processed by BuildSize, and thus it had nothing to compare to. Comments are only posted if a comparison is available (that is, if the base commit was processed using BuildSize). Was the base commit from before BuildSize was enabled?

And on this PR etalab/geo.data.gouv.fr#563, I opened the PR before the build finished, didn’t get a comment. Updated something and forced push, and now I have one.

Oh yeah, this one sounds like a race condition. I'll need to rethink how some of the data is processed. The CircleCI build won't have any pull request data (so BuildSize doesn't know it's a pull request), and then when the PR is submitted, CircleCI doesn't rebuild it.

tusbar commented 6 years ago

Ah yeah, you’re right about the first one. Sorry for the ultra large PR, I should have picked a smaller one to enable this on 😄.

Unfortunately I’m not really familiar with CircleCI/GitHub APIs, but I like how codecov does it. Their comment is posted after the PR is created (if they already have build data), or when the first build finishes (the PR already exists); then updated whenever another build completes.

Daniel15 commented 6 years ago

t. Their comment is posted after the PR is created (if they already have build data), or when the first build finishes (the PR already exists); then updated whenever another build completes.

BuildSize almost works like this. It does update the comment when another build completes. The only thing it doesn't handle at the moment is posting a comment when a PR is created if the build was completed before the PR was opened. That's something I'd like to implement, but my free time is pretty limited these days.

Daniel15 commented 6 years ago

I opened a new issue to track that particular issue (submitting PR after the build has completed): https://github.com/Daniel15/BuildSize/issues/27