fastify / workflows

Reusable workflows for use in the Fastify organization
MIT License
9 stars 6 forks source link

Seeking feedback: improved PR benchmark workflow #121

Open mweberxyz opened 6 months ago

mweberxyz commented 6 months ago

After having spent time looking at the implementation of the PR benchmark workflow and in-tree benchmarks in fastify/point-of-view, fastify/fastify, and fastify/workflows, I've managed to pull it all together. Hopefully the result is more usable with less code duplication, and provides better actionable information to PR reviewers.

I feel like things are in a stable place now, so I'm seeking feedback on if this is going to be valuable to reviewers, my approach, and the changes to each of the three repos needed. Open to any and all feedback before I spent any more time on it.

Demo

fastify

CleanShot 2024-02-25 at 15 38 45@2x

point-of-view

CleanShot 2024-02-25 at 14 32 26@2x

Required changes

fastify/workflows: https://github.com/mweberxyz/fastify-workflows/commit/9cee01191ba450c4550eaa9c2eec4fa93f2d2c21 fastify/fastify: https://github.com/mweberxyz/fastify/commit/053330ec0c52b4f063e78b13e0488bd92e551e86 fastify/point-of-view: https://github.com/mweberxyz/point-of-view/commit/07b17c8e0e5bb7f41ae326abba360d9ed0e9fa01

Sample PRs

fastify/fastify: PR from fork

https://github.com/mweberxyz/fastify/pull/3

Merges code from a fork into my fork, to demonstrate that the "base" benchmark are run against the target of the PR. Additionally, it shows warnings in the comment because the "head" aka PR branch does not run the parser.js correctly and all requests return 404s.

fastify/point-of-view: PR from same repo with performance degredation

https://github.com/mweberxyz/point-of-view/pull/5

Merges code from a branch into the default branch of the same fork. It reverts a performance improvement, to demonstrate what it looks like when a PR really tanks performance.

Approach

Lessons

Future work

mcollina commented 6 months ago

Maybe let's give it a try in one of the repos!

mweberxyz commented 6 months ago

Maybe let's give it a try in one of the repos!

👍 I'll keep pushing forward with a goal of getting a PR up in fastify/fastify, and keep the implementation confined to that repo. If people like the approach, making it generic and re-usable will be work for a later date.

The only remaining annoyance is that the "run workflow when tag is added" trigger within GitHub actions only fires once the workflow has been committed to the default branch, so I'll have to continue testing in and referring to my personal fork.

Uzlopak commented 6 months ago

Just because we are not giving feedback, doesnt mean that we are uninterested.

Its actually more an issue of reproducability. When you think your workflow is perfect give us feedback. We can then check how your code is and that you are not doing malicious stuff :imp: and if it makes sense we will merge it.

mweberxyz commented 6 months ago

Thanks for the encouragement! I am still working at various sampling strategies and to try to minimize the run-to-run variance.