Previous Lecture lect05 Next Lecture

lect05, Mon 01/29

Production pipeline. Feature-branch/pull request workflow

Announcements

Scrum Concepts

Sprint Review

The public end of the sprint; invite any and all stakeholders to this meeting. It’s the team’s chance to show off its accomplishments, the stories that have met the team’s definition of done. This is also the mentors’ opportunity to see how the product has been incrementally improved over the course of the sprint.

You just did a Retrospective, which probably followed the end of a Sprint. We will not mandate a Retro every week (but maybe 3 times this quarter). The rest of the times you should have a Sprint review meeting.

Sprint Planning

Continuous Integration / Continuous Delivery (CI/CD)

Feature Branch / Pull Request Workflow

When making a change to your team’s repo, you should typically NOT be making changes on the main branch

Reasonable exceptions: small changes to documentation only (not touching code).

So what do you do instead?

Whoa, whoa getting ahead of ourselves: issue first.

WAIT.

Before you start working on a branch:

Once your team is in steady state, you should always be assigned to at least one in-progress issue on the Kanban board.

Ok, got an issue. How do you make a feature branch?

Like this. Always start with a fresh copy of main:

git checkout main
git pull origin main
git checkout -b thAddMenuItem

The th are your initials (the person making the branch). The rest is camel-cased and summarizes the purpose of the branch.

You could also come up with a different branch name convention, one that works better for your team.

The important thing is to have one.

Working on a feature branch

You may need, periodically, to push your changes to GitHub. Use the branch name in place of main:

Rebasing on main

You may need, from time to time, to rebase your branch on main.

This is to say, replay all of the changes on your branch on top of a fresh copy of main.

To do this, type:

git pull --rebase origin main

You may have merge conflicts. If so, you may find that you have to resolve these merge conflicts one commit at a time.

If all else fails, you can always type git rebase --abort to abort the mission and start over.

But if you stay focused, you can get through it:

Eventually, you’ll have a new version of your branch, at which point you’ll want to:

git push --force origin thAddMenuItem

Creating a Pull Request

When you create a pull request, which you can easily do through the github web interface, you have to select a base branch and a compare branch.

You are requesting that the admins of the repo pull commits from the compare branch into the base branch.

Once you create a Pull Request, you should:

Reviewing a PR

If you are asked to review a PR, please do so promptly.

Diplomacy is good… it’s better to ask questions than make statements.

I wonder if this code would be clearer if we factored out both the long if
part and the long else part into separate functions?   Choosing
some good names for those and some good parameter values might make this
code easier to understand.  What do you think?

vs.

This code is a convoluted mess---so complicated that no-one could
possibly make sense of it.  You need to totally rewrite this!

Both of these might be honest and understandable reactions to the same code. But one is much more likely to result in good team relations and team productivity. :-)

Today: