fix(tracing): use agentId as span reference_id#1634
Closed
ionmincu wants to merge 1 commit into
Closed
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
There was a problem hiding this comment.
Pull request overview
Updates tracing span conversion so coded-agent spans carry a meaningful ReferenceId, and adjusts the integration test workflow so Dependabot PRs can run integration tests with tightly-scoped secret exposure.
Changes:
- Map
UiPathSpan.reference_idfrom theagentIdspan attribute (populated fromPROJECT_KEY) instead ofreferenceId. - Add a
pull_request_targetworkflow path gated for Dependabot, check out PR head SHA, restrict Dependabot runs toalpha, and omit App Insights secrets. - Add a “Check secrets availability” step to emit clearer warnings when required integration-test secrets are missing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
packages/uipath-platform/src/uipath/platform/common/_span_utils.py |
Adjusts span conversion to set reference_id from agentId. |
.github/workflows/integration_tests.yml |
Adds a Dependabot-only pull_request_target path and safety checks to enable integration tests with constrained secrets. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+22
to
25
| if: | | ||
| (github.event_name == 'pull_request' && github.actor != 'dependabot[bot]') || | ||
| (github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') | ||
| runs-on: ubuntu-latest |
Comment on lines
+165
to
+166
| (github.event_name == 'pull_request' && github.actor != 'dependabot[bot]') || | ||
| (github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') |
Comment on lines
+121
to
+124
| CLIENT_SECRET: ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_SECRET || matrix.environment == 'staging' && secrets.STAGING_TEST_CLIENT_SECRET || matrix.environment == 'cloud' && secrets.CLOUD_TEST_CLIENT_SECRET }} | ||
| BASE_URL: ${{ matrix.environment == 'alpha' && secrets.ALPHA_BASE_URL || matrix.environment == 'staging' && secrets.STAGING_BASE_URL || matrix.environment == 'cloud' && secrets.CLOUD_BASE_URL }} | ||
| PR_ACTOR: ${{ github.event.pull_request.user.login }} | ||
| run: | |
| [ -z "$BASE_URL" ] && missing+=("BASE_URL") | ||
|
|
||
| if [ ${#missing[@]} -gt 0 ]; then | ||
| echo "::warning::Missing or empty secrets for ${{ matrix.environment }}: ${missing[*]}. PRs from forks or Dependabot do not receive repository secrets — workflows triggered by '$PR_ACTOR' must have the corresponding values configured in Settings → Secrets and variables → Dependabot (or be re-run by a maintainer from a branch in this repo). The testcase will fail with a misleading auth error downstream." |
Comment on lines
283
to
287
| # Top-level fields for internal tracing schema | ||
| execution_type = attributes_dict.get("executionType") | ||
| agent_version = attributes_dict.get("agentVersion") | ||
| reference_id = attributes_dict.get("referenceId") | ||
| reference_id = attributes_dict.get("agentId") | ||
|
|
This was referenced May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Summary
Tracing
UiPathSpan.reference_idfrom theagentIdattribute (sourced from thePROJECT_KEYenv var) instead of the unsetreferenceIdattribute, so coded-agent spans carry a meaningful reference back to their agent.Integration tests workflow
Make Dependabot PRs actually able to run integration tests, without exposing the full secret blast radius to arbitrary fork PRs:
pull_request_targettrigger alongside the existingpull_request, gated by actor so it fires only fordependabot[bot]. Regular PRs continue to usepull_requestexactly as before. No double-runs.actions/checkouttoref: ${{ github.event.pull_request.head.sha }}so the PR's code is tested in both event contexts (default forpull_request_targetis base).alphaenvironment only (skipcloudandstaging) to minimize credential exposure for dependency-bump PRs.Check secrets availabilitystep that emits a::warning::annotation when any ofCLIENT_ID/CLIENT_SECRET/BASE_URLis empty, so the previously-misleading downstreamUIPATH_ACCESS_TOKEN is not setfailure now has clear context (useful for non-Dependabot fork PRs).Supersedes #1628 — rebased onto current main (the original branch could not be force-pushed past the latest main due to the repo ruleset blocking direct pushes).
Test plan
ReferenceIdmatching the project/agent id