For magnesium you will want to use a zinc-chromate primer. Unfortunately, zinc-chromate has been identified as some sort of health risk, so I don't believe it is sold here anymore. I ordered my primer from Aircraft Spruce; they recommended zinc-phosphate as a substitute, which I used.
I painted my rim set a couple years ago and have not had any problems with paint adhesion or the rims holding air.
Be sure to follow the painting temperature and humidity recommendations for the paint, though. I sprayed the front and rear rims using Eastwood paint from the same batch, the only thing being different between the front and rear rims was the temperature, humidity, etc. The front rim paint is noticeably softer than the rear paint. I think it was due to painting the fronts at too low a temperature.
Finally, when using the kitchen oven to anneal the rims, you may want to do it while your wife is out of town. A smell that I thought was quite mild and harmless, my wife equated to ricen poisening. What made her go especially wild was that we have a cute parakeet residing in our living room, who she believed was in mortal danger. I ended up making a makeshift plastic drape to direct the out-gases to the outside vent hood. Problem solved.