[TT-1078] allow to pass run id to remove function #918
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.
Why
The changes improve the run ID generation and removal logic by making it more robust and context-aware. Specifically, enhancing the run ID to include a "local_" prefix for locally generated IDs and adjusting the removal logic to check if the run ID indicates local execution.
What
utils/runid/run_id.go
fmt
andstrings
packages to support new logic.GetOrGenerateRunId
function to prefix the generated UUID with "local_" indicating it was generated in a local context.RemoveLocalRunId
function to accept arunId
parameter and updated logic to only remove the.run.id
file if therunId
contains the substring "local", making the removal conditional on the run ID indicating it's from a local context. This change ensures that cleanup happens only when appropriate, avoiding unintended deletions in non-local environments.