Drilling the detent for magazine cap isn’t really that difficult, just takes some special tools. This isn’t really something you would want to tackle with a hand drill or even a drill press. I’m not saying that a home shop smith can’t do it,
I have seen some home guys do some pretty amazing things, but a good vertical milling machine with an accurate locating system is a BIG plus here.
Tools needed
Bridgeport milling machine.
6 inch spot drill. A 6 inch long #2 center drill works great for this.
4-5 inch long 1/8 drill ** Standard length drills will not work due to the drill chuck hitting the muzzle of the barrel. ** (The shop I work in buys some drills in 12 inch lengths and we cut the shank off to the length we need)
Remington detent and spring
Detent staking tool
Small ball peen hammer
I made this barrel holding jig a few years ago to help hold and locate the barrel for drilling, tapping and installing a sight bead on the 870. The jig holds it by the support ring so you can hold the barrel in a mill vice without doing any damage to it.
The first thing is to mount a vice on the Bridgeport mill table with the jaws hanging over the side of the table so the barrel will hang vertical. Use an indicator mounted in the spindle to locate the center (zero) of the barrel support ring.
I made this drawing from an old Wingmaster barrel ring that I have.
After you find the center of the ring move the spindle to the locations on the drawing.
Use the spot drill and lightly drill a spot for the 1/8 drill.
Change out the spot drill with the 1/8 drill, drill into the ring .030-.040 deep, raise drill, and blow out the chips. Repeat this until the hole is
a little deeper than the length of the spring. A little oil helps with the drilling.I drilled mine about .350 deep
Clean out the hole, insert the spring and detent. Place the detent punch over the detent and push it down until the lips of the punch touches the ring,
Lightly tap the punch with a small ball peen hammer a couple of times or until the detent is secured in the hole.
I'll post a picture of the finished part when I get the replacement staking tool. If it doesn't end up with the other one.
update
staking tool
staked detent

The devil danced as he went down, in the hail of arrows comin' Out on the wild Montana ground, Custer died a-runnin'.