Skip to content

Commit

Permalink
tosquash
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Nov 27, 2024
1 parent 73146a0 commit 3802730
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/datadog/ci/git/local_repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,13 @@ def self.git_commits_rev_list(included_commits:, excluded_commits:)
end

def self.git_generate_packfiles(included_commits:, excluded_commits:, path:)
p "git_generate_packfiles"
p path
return nil unless File.exist?(path)

commit_tree = git_commits_rev_list(included_commits: included_commits, excluded_commits: excluded_commits)
p "commit_tree"
p commit_tree
return nil if commit_tree.nil?

basename = SecureRandom.hex(4)
Expand All @@ -241,6 +245,7 @@ def self.git_generate_packfiles(included_commits:, excluded_commits:, path:)

basename
rescue => e
p e
log_failure(e, "git generate packfiles")
telemetry_track_error(e, Ext::Telemetry::Command::PACK_OBJECTS)
nil
Expand Down
8 changes: 8 additions & 0 deletions lib/datadog/ci/git/packfiles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def self.generate(included_commits:, excluded_commits:)
path: tmpdir
)

p "PREFIX!!!!!!!!!!!!"
p prefix

if prefix.nil?
# git pack-files command fails if tmpdir is mounted on
# a different device from the current process directory
Expand All @@ -34,7 +37,11 @@ def self.generate(included_commits:, excluded_commits:)
path: current_process_tmp_folder
)

p "PREFIX"
p prefix

if prefix.nil?
p "failed twice, exit"
Datadog.logger.debug("Packfiles generation failed twice, aborting")
break
end
Expand All @@ -44,6 +51,7 @@ def self.generate(included_commits:, excluded_commits:)

packfiles = Dir.entries(tmpdir) - %w[. ..]
if packfiles.empty?
p "empty packfiles"
Datadog.logger.debug("Empty packfiles list, aborting process")
break
end
Expand Down

0 comments on commit 3802730

Please sign in to comment.