Resolve merge conflicts on GitHub protected branches

If you have the Require a pull request before merging branch protection rule enabled on the source branch of a pull request, you cannot resolve merge conflicts via the web interface. Unfortunately, no error alerts you to the failure.

The only solution I’ve found that allows you to resolve merge conflicts between branches with branch protection rules without disabling the branch protection rules is to create a temporary branch, locally resolve the conflicts, and then merge that into the target branch via a PR.

So many features so little time

One of the things that I am constantly amazed by at GitHub is just how much they release stuff. Now I know that GitHub has many engineers and different product areas to work on, but last week they announced 13 changes. And they didn’t release anything on Monday!
Looking at this with my engineer hat on, GitHub gives us a great view of what ship then iterate looks like. They tend to release public betas of new features to get feedback from actual system users and eventually promote them to GA or Generally Available. A lot of their changes are also minor changes.
I remain fascinated with their work on improving 2FA as they move to require it for anyone who contributes code. I remember working at a company with quarterly releases where we would batch together 3-4 months’ worth of changes from devs and release them all at once. This release cadence was jarring for the user and also prone to bugs. Instead, GitHub is releasing a bunch of small stand-alone features as they are ready. This approach gives them faster feedback on each feature, makes the whole rollback process a lot easier, and is easier for most users to adapt to the changes.

But enough talk about their engineering process; let’s look at those 13 changes.

Dependabot just got even easier to enable across your enterprise. Enterprises exist as an entity over multiple organizations. A pattern I’ve seen some companies do is to have an organization dedicated to their open source/public repositories and another to their closed source/private repos. This segregation offers a ton of value and peace of mind. Previously you could enable dependabot at the repo and organization level, but just doing this at the enterprise level is nice, especially if you ever roll out a new organization.

Secret Scanning is now generally available on all public repos. You can also enable this for all your public repos from your account’s code security and analysis settings. This functionality already existed for organizations, but seeing this as an easy feature for individuals is terrific.

The GitHub profile now allows you to specify your pronouns. When you hover over a user’s profile picture and sometimes their name, you see their profile details which now include their pronouns if they specified them.

As a paid team or enterprise, you can now enroll in a public beta for access to a 12-core x64 macOS runner for GitHub Actions. At the moment, the per-minute runner cost is

  • $0.32 per minute for the 12-core macOS
  • $0.08 for a 3-core macOS
  • $0.256 for a 64-core Linux
  • $0.512 for a 64-core Windows

GitHub Actions Importer is now Generally Available. The importer is an extension for the GitHub CLI. It supports importing workflows from

  • Azure DevOps
  • CircleCI
  • GitLab
  • Jenkins
  • Travis CI
    Initially, I was intrigued by the ability to create extensions for gh, but this is the first one I’ve seen that looks truly useful. I hope we start seeing more extensions like this from the community and GitHub. In fact, GitHub released another extension for gh this week, but I’ll get to that in a moment.

You can now try rich diffs for Jupyter Notebooks in PRs. You can enable this under Feature preview, one of the few places you can’t deep link to in GitHub. This feature is another excellent example of how GitHub ships than iterates. There was a private beta for this feature; if you were part of it, you might need to re-enable it. Also, it does not allow you to make comments in the rich preview for the moment. I know that in the past, many places I’ve worked would have held back a feature until it was “perfect,” but this way, GitHub is getting it out faster to those who care about it.

GitHub admins can now bypass environment protection rules in GitHub Actions. It is possible to disable this, but by default, admins can skip those rules. This bypass is for a break-glass scenario when the normal approver is unavailable. I was initially skeptical about this, but then I realized I had previously added the admin group to environments to create this very option. I haven’t looked at the audit logs, but I’m betting this will make it easier to check when an admin bypassed the standard process rather than my current strategy, which looks like a normal approval.

The Projects team seems to take a slightly different approach from the other teams and gives weekly updates on what they release. It is great to see an example of a company providing a team the autonomy to do what works for them rather than trying to force every team into the same pattern. The new GitHub Projects has more improvements. Also, continuing the theme of extensions to the GitHub CLI, projects now has an extension.

I’m sure at some point, you’ve heard someone go on a moralistic rant about the importance of accessibility in what we create. GitHub is walking the talk and has made many accessibility improvements to the contribution graph. It is now keyboard navigable and more screen reader friendly.

The 2FA improvements keep coming. You can now enable both SMS and TOTP as a second factor at the same time. This has removed SMS as a fallback method since it is now a first-class second factor.

GitHub Desktop got some love, and you can now preview PRs. I’ve been using GitKraken for years, but I’ll give GitHub Desktop another try.

And last but not least, there were some changes to GitHub Advanced Security. You can now control code scanning for all repos in an organization from the Security Coverage page. This is a public beta, and currently, it only supports JavaScript, Python, and Ruby but more languages will come. Also, notifications for secret scanning are moving to an opt-in model; you’ll need to make changes before March 16th if you wish to continue receiving notifications.

There was certainly a lot of stuff released last week by GitHub. What feature are you most excited about?

On being a cartoon character

I spent the last month wearing the same outfit every day. Someone finally asked me about it yesterday, so I explained my experiment.

Decision fatigue is a thing. I never really noticed how much of a thing it was until I had Covid and the resulting brain fog. I started to think of myself as an RPG character with a certain number of “decision points.” Each decision, no matter how big or small, took one of these points, and when I was all out, making decisions would start pulling away from my energy level.

I never figured out the exact number of decision points I have, and I also suspect that it fluctuates daily. However, I realized they are a finite resource that I needed to conserve.

That is how I came to try wearing a daily uniform. Steve Jobs might be the most famous person to apply this idea with his black turtleneck, jeans, and sneakers. There are a lot of other examples, from Albert Einstein to Mark Zuckerberg, along with a growing number of folks like me trying to make their lives a little simpler. As I was talking about this idea, my friend suggested it was like being a cartoon character, and I might like that idea even more.

What was it like wearing the same outfit for a whole month?
Surprisingly easy. At first, I was self-conscious about wearing identical outfits every day. I thought people would say something about it, but only one person brought it up during the entire month, which was on the 31st day.

By the second week, I had realized that people either didn’t notice me wearing the same thing every time they saw me or didn’t care enough to mention it.

That’s not to say that I didn’t receive a decent number of compliments on the outfit choice, as it is a casual outfit that was a step or two up from my traditional t-shirt and shorts.

The other thing I realized in that second week was that picking from a selection of identical outfits in my closet was still a choice. This is where the most critical tweak during this entire process came in. I started laying out my clothes for the next day.

Getting dressed now has no thought process to it at this point. The clothes are laid out and ready for me in the morning. It sounds inconsequentially simple, but this was when I started to feel the freedom of being a cartoon character.

Another factor that led me to try this is I no longer need to worry about fashion. My outfit works when I go to the store, hang out with friends, or attend a networking event. As long as jeans are acceptable, I don’t need to worry. It is also surprisingly easy to find a casual shirt that goes with jeans and can transition from casual to business casual based on whether you roll the sleeves up.

On top of not worrying about fashion, I also don’t get distracted by clothing at stores anymore. I may see something I like as I walk through a store, but there is no more internal debate on whether I want to buy it. In many ways, this whole part of my life runs on autopilot.

If you want to try this experiment, I suggest getting enough copies of the clothes so that you don’t need to wear them every week. Wearing a uniform daily will show you how tough you are on your clothes.

Aside from my clothing choices, I am taking this idea of removing decisions and applying it in other areas of my life. The first two places that got this attention were how I stock my refrigerator and how I do my status updates at work.

I use a meal prep service, and every week I get a bunch of re-heatable meals delivered. Before I put them into the refrigerator according to which meal it is, I would then look through what I have as an option and pick something. Now I make my weekly menu in advance, deciding what lunch and dinner will be. Just as getting dressed in the morning is a matter of putting on the clothes I laid out the night before, picking out a meal is simply taking the top item off the stack.

Daily status updates are always a fun part of being a software engineer. I’ve done them for years, and still, I forget what I did the day before. I now write my status updates at the end of the day rather than trying to remember them in the morning. This practice has turned into a way to close down my day and leave myself with breadcrumbs for what I want to do the next day.

While none of these changes are particularly earth-shattering, they are helping me focus on other things that I find far more exciting.

Do you have any hacks to reduce decision fatigue?

Also, do you have any suggestions for a catchphrase?

Grep or else

Grep is a ubiquitous tool for searching plain text in *nix systems. It is so ubiquitous that the documentation for select-string in PowerShell mentions grep and the Oxford English Dictionary added grep as a noun and a verb in 2003.

While grep is incredibly well known, that doesn’t prevent it from having odd quirks that left me stuck debugging a script for hours.

If grep does not find the specified pattern, it exits with an exit code of 1 and kills the running script.

> echo "foo" | grep --count "bar"
0
> echo $?
1
> echo "foobar" | grep --count "bar"
1
> echo $?
0

It took me ages to recognize that my script was failing because of grep. I included the count flag because I needed the count for future logic, and I saw the correct count coming out but couldn’t understand why the script stopped executing there.

In hindsight, it was obvious, but it took me a while to get there.

The trick to using grep in a script that might return no results is adding an or true.

> echo "foo" | grep --count "bar" || true
0
> echo $?
0
> echo "foobar" | grep --count "bar" || true
1
> echo $?
0

Smoothie in a bag

Sometimes when someone gives me the answer to a problem, I’m left thinking, “well, duh, why didn’t I think of that?”

For a few months, my doctor has been working with me on improving my diet. One of the consistent things she has tried to get me to do is move from a morning protein shake to a morning protein smoothie. I was very resistant to the idea.

I have experimented a lot with morning and evening routines over the years, and a recurring theme I have found with myself is that I need a simple brain-dead process.

Easy: Put a scoop or two of powder into a cup with water and shake
Hard: Pull out a half dozen things and add them to a blender, plus clean up

Yesterday, she brought up the smoothie idea again, but this time, she asked me if I had considered batch-prepping the smoothies in bags and just sticking them in the freezer until I was ready to make them.

💡

With this change, I think I’m now a morning smoothie person. I have a lot of tweaks to make to the ingredients, but I’m thrilled with the initial result.

Frozen avocado will likely be a staple, and I highly recommend it as it gives the smoothie a milkshake-like texture.

Also, I was initially worried about the almond butter I put in not coming out of the bag easily, but it froze while in the freezer, so it was alright.

Hello, World!

There is a convention amongst programmers to start learning a new language by printing to the screen Hello, World!

I find it beautiful in its simplicity, ambitious in its scope, and it leaves me wondering what next?