Skip to content

ci(android): Add a links-only mode to the verify-pr test workflow - #7185

Merged
antonis merged 1 commit into
mainfrom
ci/verify-pr-links-only
Dec 4, 2026
Merged

antonis merged 1 commit into
mainfrom
ci/verify-pr-links-only

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Adds a links_only mode to verify-pr-spike.yml (#7127) for PRs whose evidence is a metric. The fetch job's token can't read metrics, because it lacks org:read, and that stays as it is. The run builds and exercises both sides, reads nothing back from Sentry, and leaves a person what they need to check the metrics by hand.

Sample (samples/react-native/src/verifyRun.ts): metrics ignore tags, so verify.run_id, verify.pr and verify.commit are now also set with Sentry.setAttributes(...). The tags stay, now set in one Sentry.setTags(...) call. setAttributes is re-exported from @sentry/core 10.78.0, the version on main, and it writes to the isolation scope, the same scope as setTag. Metric capture merges the isolation and current scope attributes into every metric. setAttributes sets all three in one call with a plain Record<string, string>, which setAttribute can't do.

Workflow, links_only: true:

  • The build job needs no error or transaction id on either side. A failed Maestro flow still fails it.
  • The fetch job is skipped.
  • results.json gets flow_start_utc and flow_end_utc under runs.<side>, next to the existing run_id. Both are runner time, taken right before and after maestro test.
  • The build job summary has a table with each side's verify.run_id and flow window. It has no Sentry links.
  • links_only together with transactions, any fetch_* input, or probe_metric is refused in the build job's first step, before checkout. Only input names are printed. In this mode the build job runs even when a fetch-only or probe input is set, so the refusal can happen.

With links_only: false, nothing changes: same job conditions, same results.json keys, same summary. The workflow is still dispatch-only. The build job still has no secrets, and there is no new token or permission.

How to tell a side's metrics really reached Sentry. Nothing in the run confirms it. For each side, separately:

  1. In sentry-sdks / sentry-react-native, open the metrics explorer for the metric (for feat(core): Add the task context to the long task metric #7119, react_native.long_task.duration). Filter on verify.run_id:<that side's run id from the summary>, over that side's flow window. Widen the window by a few minutes on both ends, because metric timestamps come from the emulator's clock and the window comes from the runner's clock.
  2. At least one data point with that exact verify.run_id means the side's metrics arrived. Run ids are unique to a run and side, so nothing else can match.
  3. If nothing matches, check the side's device log in the verify-pr-spike artifact (<run_id>/<run_id>.logcat). A 'Metric beforeSend:', '<name>' line means the SDK produced the metric. Envelope sent successfully means it was sent. If both are there and Sentry has nothing, the metric got lost in ingestion or the query is wrong. If neither is there, the flow never triggered the metric.

For #7119, the expected difference is on the metric's attributes: the "with" side should carry the new route, foreground and start-phase attributes, and the "without" side shouldn't.

💡 Motivation and Context

Metric-only PRs such as #7119 can't be verified with the current modes: the build fails without an error event id, and the fetch job can't read metrics. Part of #7127. #skip-changelog

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes (packages/core/etc/sentry-react-native.api.md) reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

Needs a decision:

  • The verify/* branch must contain this sample change. The build uses the sample from ref, and feat(core): Add the task context to the long task metric #7119's head is older than this PR. So its verify/* branch has to merge main after this lands. Otherwise its metrics carry no verify.run_id and step 1 finds nothing. Should the skill do that merge for links-only runs, or should it check for it?
  • probe_metric is refused as well. The ask was to refuse transactions and the fetch-only inputs. probe_metric is refused too because it is also a fetch-job mode. Keep it or drop it?
  • Metric link format. The summary prints no Sentry link until the metrics URL format is confirmed.
  • Main-only is a convention. Nothing in the workflow checks that a run was started on main. This PR doesn't change that. Should the workflow enforce it?

via Antonis Lilis.

--

View Session [Sentry]

Co-Authored-By: Antonis Lilis <antonis.lilis@sentry.io>
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

⚪ None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request

Generated by 🚫 dangerJS against 6fa6687

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 6fa6687.

Main concerns: public contract, data sent to Sentry, host performance.

Rules that block low also fired:

  • R6: build or release configuration changed: .github/verify-pr-spike/spike.py, .github/workflows/verify-pr-spike.yml

This label is a hint for reviewers, not an approval.

@antonis
antonis marked this pull request as ready for review December 4, 2026 14:33
@antonis
antonis merged commit 6de848e into main Dec 4, 2026
63 of 75 checks passed
@antonis
antonis deleted the ci/verify-pr-links-only branch December 4, 2026 14:34
@github-actions github-actions Bot removed the risk: medium PR risk score: medium label Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant