Previous Lecture Lecture 26 Next Lecture

Lecture 26, Mon 03/07

Tue Discussion: Continue work on team04, more notes on PRs

The PR boards (staff and students alike, review these)

It’s important to keep the PR pipeline flowing.

So staff, please spend some time reviewing the status of PRs here.

Students, do likewise.

PR List
https://github.com/ucsb-cs156-w22/team04-w22-5pm-courses/pulls
https://github.com/ucsb-cs156-w22/team04-w22-5pm-HappyCows/pulls
https://github.com/ucsb-cs156-w22/team04-w22-6pm-courses/pulls
https://github.com/ucsb-cs156-w22/team04-w22-6pm-HappyCows/pulls
https://github.com/ucsb-cs156-w22/team04-w22-7pm-courses/pulls
https://github.com/ucsb-cs156-w22/team04-w22-7pm-HappyCows/pulls

PR Titles:

Make sure that anyone on the project can glance at your title and know immediately what the PR is about.

Commented out code is generally a no-no…

If you have commented out code in your PR, you can expect some push back from staff.

(Even Conrad gets push back from the TAs and LAs when he tries to put commented out code in a PR.)

There are some exceptions, but in general, ask yourself: do I really need this commented out code?

Or would it be better to remove it?

One reason you might think you want commented out code is, for example:

Remember: sand vs. boulders

“It’s easier to move sand through a pipe than boulders.”

This saying is a metaphor for the fact that is is easier to code review, test, and merge small pull requests.

There may be a temptation to gather lots of features into one giant PR. This is typically not a good idea. There are exceptions, but even in those cases, there is a price to be paid:

But the biggest reason not to do this is that the whole idea of CI/CD is “Continuous Integration/Continuous Delivery”.

One of the main reasons is that it helps you catch architectural conflicts early:

An important note about “updating from main”

Occasionally, you may see this on a PR.

Staff or fellow team members especially may see this when doing a code review. If you see this, it means that the main branch has moved on while your PR was waiting, so you need to incorporate those changes.

Staff may click the indicated button when needed (and so can you):

image

That means you may need to git pull origin branch-name early and often

If you try to push to your branch and git complains, you might need to do:

git pull origin my-branch-name

That’s always something you should do when starting work on a branch, even if you think you are the only one working on that branch.

If there’s an open pull request, at any time, someone might update that branch from main.

Even if there isn’t an open pull request, other folks on your team might have made some patch (e.g. because they saw a failing test) so it’s important to be sure your branch is up-to-date before pushing new code.