SAN FRANCISCO -- Madison Bumgarner and the San Francisco Giants have agreed to a new five-year contract through the 2017 season, locking up the lefty through his arbitration years.