Skip to content

Commit

Permalink
Merge pull request #541 from DataRecce/feature/pla-213-telemetry-add-…
Browse files Browse the repository at this point in the history
…command-options-to-command-events

Add command options to command events
  • Loading branch information
even-wei authored Dec 17, 2024
2 parents cea1e6f + e36309f commit cce9b49
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion recce/event/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,21 @@ def invoke(self, ctx: Context) -> t.Any:
sys.exit(1)
finally:
end_time = time.time()
duration = end_time - start_time
runner = get_runner()
repo = hosting_repo()
branch = current_branch()
command = ctx.command.name
duration = end_time - start_time
target_path = ctx.params.get('target_path', None)
target_base_path = ctx.params.get('target_base_path', None)
props = dict(
command=command,
status=status,
reason=reason,
duration=duration,
cloud=ctx.params.get('cloud', False),
review=ctx.params.get('review', False),
debug=ctx.params.get('debug', False),
)

if runner is not None:
Expand All @@ -109,6 +114,12 @@ def invoke(self, ctx: Context) -> t.Any:
if branch is not None:
props['branch'] = sha256(branch.encode()).hexdigest()

if target_path is not None:
props['target_path'] = sha256(target_path.encode()).hexdigest()

if target_base_path is not None:
props['target_base_path'] = sha256(target_base_path.encode()).hexdigest()

try:
recce_context = load_context()
except Exception:
Expand Down

0 comments on commit cce9b49

Please sign in to comment.