lib/datadog/ci/ext/environment.rb in ddtrace-1.0.0 vs lib/datadog/ci/ext/environment.rb in ddtrace-1.1.0
- old
+ new
@@ -377,52 +377,66 @@
# Because we can't get a reliable UTC time from all recent versions of git
# We have to rely on converting the date to UTC ourselves.
committer_date: Time.at(fields[5].to_i).utc.to_datetime.iso8601
}
rescue => e
- Datadog.logger.debug("Unable to read git commit users: #{e.message} at #{Array(e.backtrace).first}")
+ Datadog.logger.debug(
+ "Unable to read git commit users: #{e.class.name} #{e.message} at #{Array(e.backtrace).first}"
+ )
nil
end
def git_repository_url
exec_git_command('git ls-remote --get-url')
rescue => e
- Datadog.logger.debug("Unable to read git repository url: #{e.message} at #{Array(e.backtrace).first}")
+ Datadog.logger.debug(
+ "Unable to read git repository url: #{e.class.name} #{e.message} at #{Array(e.backtrace).first}"
+ )
nil
end
def git_commit_message
exec_git_command('git show -s --format=%s')
rescue => e
- Datadog.logger.debug("Unable to read git commit message: #{e.message} at #{Array(e.backtrace).first}")
+ Datadog.logger.debug(
+ "Unable to read git commit message: #{e.class.name} #{e.message} at #{Array(e.backtrace).first}"
+ )
nil
end
def git_branch
exec_git_command('git rev-parse --abbrev-ref HEAD')
rescue => e
- Datadog.logger.debug("Unable to read git branch: #{e.message} at #{Array(e.backtrace).first}")
+ Datadog.logger.debug(
+ "Unable to read git branch: #{e.class.name} #{e.message} at #{Array(e.backtrace).first}"
+ )
nil
end
def git_commit_sha
exec_git_command('git rev-parse HEAD')
rescue => e
- Datadog.logger.debug("Unable to read git commit SHA: #{e.message} at #{Array(e.backtrace).first}")
+ Datadog.logger.debug(
+ "Unable to read git commit SHA: #{e.class.name} #{e.message} at #{Array(e.backtrace).first}"
+ )
nil
end
def git_tag
exec_git_command('git tag --points-at HEAD')
rescue => e
- Datadog.logger.debug("Unable to read git tag: #{e.message} at #{Array(e.backtrace).first}")
+ Datadog.logger.debug(
+ "Unable to read git tag: #{e.class.name} #{e.message} at #{Array(e.backtrace).first}"
+ )
nil
end
def git_base_directory
exec_git_command('git rev-parse --show-toplevel')
rescue => e
- Datadog.logger.debug("Unable to read git base directory: #{e.message} at #{Array(e.backtrace).first}")
+ Datadog.logger.debug(
+ "Unable to read git base directory: #{e.class.name} #{e.message} at #{Array(e.backtrace).first}"
+ )
nil
end
def exec_git_command(cmd)
out, status = Open3.capture2e(cmd)