From @sfist, the gunman actor was performing a mock stickup while the film crew was filming at a different location. The crew did have permission from the shop owners. The Japanese crew did have the proper permits to film in Cole Valley and did not need to inform the cops that they were filming on private property. Supposedly, the film crew (Duo Creative) were filming, "a comedy bit about a stupid crime, 'a little segment people can laugh about."
So don't worry folks! Just a little joking fun!