What way do you set up New Code definition for a project using Github Flow?

Want to gather the community’s thoughts on the way people set up New Code definition for a project using Github Flow (merging everything to main branch).

Our default branch is main. We version that branch with tags and all PRs target it.

I’m trying to understand what the difference is between setting Previous Version as the New Code definition versus setting it to a Reference Branch.
Would it be better to use Reference Branch (choosing main branch as reference for the New Code)?

If I choose Reference Branch, I’m then asked to choose a New Code Period for main branch, which is where I would pick Previous Version I’m assuming.

Is there any difference between this and just setting Previous Version as the New Code definition straight away?
Any clarity on this would be appreciated as I don’t think the documentation dives deep into these settings.

1 Like

Hi,

Most probably you want to use Previous Version for your main branch. That assumes you release to production at a moderate pace - not once a year and not with every commit. That means that New Code is all the changes (code added or edited) since the previous release.

Then for other branches, since they all target the main branch, using main as a reference branch makes a lot of sense.

The order you set these in doesn’t matter.

However, since you’re using GitHub flow, and each branch is small and targeted and integrated via a PR, it may be easier to skip branch analysis and just use PR analysis.

Does that help?

 
Ann