You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: update.rb
    path of file: ./repos/kontena/server/app/mutations/grid_services
    
    the code of the file until where you have to start completion: require_relative 'common'
require_relative 'helpers'

module GridServices
  class Update
    
    def build_grid_service_envs(env)
      new_env = GridService.new(env: env).env_hash
      current_env = self.grid_service.env_hash
      new_env.each do |k, v|
        if (v.nil? || v.empty?) && current_env[k]
          new_env[k] = current_env[k]
        end
      end