nhsx / open-source-policy

Open Source Policy development for the NHS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Coding in the open versus requirement for code review - paradox?

wbryant opened this issue · comments

Thanks - for clarity if I make a feature on a branch when coding in the open, it would be visible as soon as I push it? So even if there is a code review prior to merging, it will be visible prior to that? Or is there a step I am missing?

Different teams have different approaches. For us, we would push the branch to remote - so others in the team can see it, pull it to their local machine, and run the code. At this phase, we try to encourage the bulk of code review - treating it as a collaborative design process where everyone is still happy to make substantial changes to the code.

Then when we are happy the code is ready to be merged into the main branch we do a merge request. This might prompt automatic running of tests, linters, etc that will reject the request if they fail. The request to merge to master also prompts someone senior to review before approving.

We try to keep short lived feature branches which makes this whole process quite lightweight. There is never that much change in each merge so we keep the cadence high and everyone on the same page. Also fewer merge conflicts

To more directly answer your question - visibility will depend on how you have set up your repo. I understand that github steers you towards being fully open or fully closed. So any work-in-progress in a branch would be visible. I know some teams who get around this by doing development in a private repo. Then whenever they merge to main they transfer that to the open repo

That makes good sense - I may not have appreciated it while I was reading through but is this spelled out in the policy - or is it more appropriate to reference the NHSD RAP community where more practical guidance on how you organise this sort of thing could be held?

Hi both, I'll double check there are no other conflicts (there shouldn't be) and then I'm very happy to link out to the guidance above!

Checked and linked!