The City of Mountain View owns the mains under the street and the meter at the curb. From the meter to your house, the pipe is yours, and so is any leak on it. The City's Water Service Line Replacement Permit covers exactly that stretch for a single-family home or duplex. It sets the approved materials and burial depth, requires grounding and bonding of the electrical service, and calls for a rough and a final inspection. We pull the permit and meet the inspector.
One of these jobs started with a call at midnight: a water leak on the service line, and the city had already turned the water off. Our plumbing service professionals made a small temporary repair that night to restore water, then came back to replace the entire water line from the house to the main. We recommended replacing the whole line rather than leaving the patch in place, because of the age of the property and because high water pressure made more pinhole leaks likely. We also recommended a pressure reducing valve, to help keep that pressure from damaging the new pipes, the fixtures, and the water heater.
Pressure decides how long the new line lasts. California's plumbing code calls for a regulator where static pressure runs above 80 psi, so we gauge it before we start and quote a pressure reducing valve with the replacement if the reading is high. If pinholes are showing inside the house too, pipe replacement for the interior runs is the next conversation.