It is recommended to disconnect the battery whenever welding on a vehicle, though most I know don't. To protect the ecu, it should be disconnected from the harness.
If you can remove the section needing welding, it would be a lot easier to weld it on a bench than under the vehicle.