Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset invocation_id Between Commands #7317

Merged
merged 8 commits into from
Apr 12, 2023
Merged

Conversation

peterallenwebb
Copy link
Contributor

resolves #7197

Description

Reset invocation_id between command invocations.

Checklist

@peterallenwebb peterallenwebb requested a review from a team as a code owner April 11, 2023 03:35
@cla-bot cla-bot bot added the cla:yes label Apr 11, 2023
@github-actions
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@peterallenwebb peterallenwebb requested a review from a team as a code owner April 11, 2023 20:59
@peterallenwebb peterallenwebb requested a review from gshank April 11, 2023 20:59
initialize_from_flags(flags.SEND_ANONYMOUS_USAGE_STATS, flags.PROFILES_DIR)
ctx.with_resource(track_run(run_command=flags.WHICH))

# Logging
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to move logging initialization above tracking because tracking fires events. Those events won't be sent to the right callbacks unless logging is already initialized.

@@ -41,14 +41,15 @@ def wrapper(*args, **kwargs):
ctx.obj["flags"] = flags
set_flags(flags)

# Tracking
initialize_from_flags(flags.SEND_ANONYMOUS_USAGE_STATS, flags.PROFILES_DIR)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this (sets up active_user) need to happen logger initialization, or just before tracking? If it's only necessary for tracking, let's move it down where tracking is initialized for readability

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

@peterallenwebb peterallenwebb requested a review from a team as a code owner April 12, 2023 13:18
@peterallenwebb peterallenwebb merged commit a500e60 into main Apr 12, 2023
@peterallenwebb peterallenwebb deleted the paw/ct-2317-invocation-id branch April 12, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-2317] invocation_id is cached between invocations in same Python process
3 participants