Live data from Hacker News

Ask HN: Do you pull and run code as part of code review?

news.ycombinator.com

31–40 of 146 posts

Re: Ask HN: Do you pull and run code as part of code review?

#31
Usually I don't, because the CI bot does it. I do read the code thoroughly though.

Only if something really draws my attention do I pull and run a particular PR (CR, CL, whatever yo call it). Once I did that to illustrate that the change introduces a security issue, so I had to write an exploit against it, and demonstrate how it works. (It helped.)

Re: Ask HN: Do you pull and run code as part of code review?

#32
No.

  1. PRs should target development, which is an *unstable* branch, so no biggie if something breaks
  2. CI should catch things like syntax errors, failing tests, or poor test coverage
  3. I trust my colleagues to do their work properly and fix things if they've made a mistake

Re: Ask HN: Do you pull and run code as part of code review?

#33
it varies. I work on mobile applications, the last place I worked did not afford us much/any time to really do quality unit testing.

If it's code that is really changing behavior significantly then I'll run it on my device and just see if I notice anything. I've found some surprisingly gnarly bugs this way.

Re: Ask HN: Do you pull and run code as part of code review?

#34

No. 1. PRs should target development, which is an *unstable* branch, so no biggie if something breaks 2. CI should catch things like syntax errors, failing tests, or poor test coverage 3. I trust my colleagues to do their work properly and fix things if they've made a mistake

I don’t get your first point. If the pull request doesn’t run:

- how can we even say it works?

- who’s responsibility is it to fix it?

- and when does it get fixed?

Re: Ask HN: Do you pull and run code as part of code review?

#35

This should be something agreed within a team, so that review standards are consistent across team members. In my previous team, the reviewer was the main responsible for the code they were approving. They were expected to test locally and should actively hunt for potential issues, such as checking in the logs that the ORM was building correct SQL. In my current team, the developer is the main responsible for the cod…

>This should be something agreed within a team, so that review standards are consistent across team members.

Why? it feels like individual preference

>such as checking in the logs that the ORM was building correct SQL.

Couldnt the person who creates PR copy/paste sample generated SQLs into PR?

Re: Ask HN: Do you pull and run code as part of code review?

#36
It depends.

Your CI should be robust enough to catch "does it run" type issues. That's not always possible for one reason or another. If there are things that your CI can not currently check, you should be verifying local. You should also be striving to close those gaps in your CI.

Re: Ask HN: Do you pull and run code as part of code review?

#37
post #31

Usually I don't, because the CI bot does it. I do read the code thoroughly though. Only if something really draws my attention do I pull and run a particular PR (CR, CL, whatever yo call it). Once I did that to illustrate that the change introduces a security issue, so I had to write an exploit against it, and demonstrate how it works. (It helped.)

I agree with this take. Generally it’s the tests job to run it, but test coverage is not 100%, so “sometimes” is a really good answer here.

Re: Ask HN: Do you pull and run code as part of code review?

#38
In my experience the idea that you will catch all bugs by just reading the code is just wishful thinking - I saw plenty of bugs merged into the development branch on codebase I worked on at Google despite somewhat strict PR review process.

Now that I’m in startup land, we use Heroku’s Review App feature, which is by far my favorite Heroku feature, and helps us catch bugs all the time

Re: Ask HN: Do you pull and run code as part of code review?

#40

No. 1. PRs should target development, which is an *unstable* branch, so no biggie if something breaks 2. CI should catch things like syntax errors, failing tests, or poor test coverage 3. I trust my colleagues to do their work properly and fix things if they've made a mistake

I don’t get your first point. If the pull request doesn’t run: - how can we even say it works? - who’s responsibility is it to fix it? - and when does it get fixed?

What do you mean "doesn't run"? Tests should catch the most obvious/common bugs. If you mean it doesn't compile, then something is wrong because why would any engineer check in code that doesn't compile unless they're distracted or under pressure? And again, this would be caught by CI.
Post reply on HN