Skip to content

feat(extend-app-start): [1/4] Add IAppStartExtender bridge#5605

Open
buenaflor wants to merge 1 commit into
feat/extend-app-startfrom
feat/app-start-extension-core
Open

feat(extend-app-start): [1/4] Add IAppStartExtender bridge#5605
buenaflor wants to merge 1 commit into
feat/extend-app-startfrom
feat/app-start-extension-core

Conversation

@buenaflor

@buenaflor buenaflor commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

PR Stack (Extend App Start)


📜 Description

Adds the @ApiStatus.Internal IAppStartExtender contract and a NoOpAppStartExtender default, wired into SentryOptions with a getter/setter mirroring fullyDisplayedReporter.

This is the naming-stable core bridge for the app start extension API. It is inert (returns NoOpSpan / no-ops) until the Android implementation and the public Sentry facade land later in the stack. Keeping the public-facing surface out of this PR isolates the API naming from the machinery.

💡 Motivation and Context

First PR of the stack implementing the app start extension API (part of #5553), which lets apps extend the app start measurement to cover extra launch-time work (mirrors sentry-cocoa's extendAppLaunch()). Splitting into stacked PRs keeps each change small and reviewable.

💚 How did you test it?

Unit tests (TDD):

  • SentryOptionsTest — default appStartExtender is NoOpAppStartExtender; setter works.
  • NoOpAppStartExtenderTest — singleton; getExtendedAppStartSpan() returns NoOpSpan; extendAppStart() / finishAppStart() no-op.

./gradlew :sentry:apiCheck :sentry:spotlessJavaCheck :sentry:spotlessKotlinCheck pass.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the 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.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

[2/4] — deferred extended span + AppStartMetrics extension state.

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

#skip-changelog

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 7a7d63f

@sentry

sentry Bot commented Jun 23, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.44.1 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 315.46 ms 366.56 ms 51.10 ms
Size 0 B 0 B 0 B

Previous results on branch: feat/app-start-extension-core

Startup times

Revision Plain With Sentry Diff
3d04aae 324.42 ms 359.30 ms 34.88 ms

App size

Revision Plain With Sentry Diff
3d04aae 0 B 0 B 0 B

…s wiring

Introduces the @ApiStatus.Internal IAppStartExtender contract (extendAppStart /
finishAppStart / getExtendedAppStartSpan) and a NoOp default, wired into
SentryOptions. This is the naming-stable core bridge for the app start
extension API; it is inert (returns NoOpSpan / no-ops) until the Android
implementation and public Sentry facade land later in the stack.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@buenaflor buenaflor force-pushed the feat/app-start-extension-core branch from 064d3f1 to 7a7d63f Compare June 23, 2026 12:13
@buenaflor buenaflor marked this pull request as ready for review June 23, 2026 12:21
Copilot AI review requested due to automatic review settings June 23, 2026 12:21
Comment on lines +6 to +17
class NoOpAppStartExtenderTest {
private val extender = NoOpAppStartExtender.getInstance()

@Test fun `extendAppStart does not throw`() = extender.extendAppStart()

@Test fun `finishAppStart does not throw`() = extender.finishAppStart()

@Test
fun `getExtendedAppStartSpan returns NoOpSpan`() {
assertSame(NoOpSpan.getInstance(), extender.extendedAppStartSpan)
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

following conventions of existing no-op class tests, lmk if we dont need this

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds the core (internal) bridge for the upcoming “extend app start” feature by introducing an IAppStartExtender contract with a default no-op implementation and wiring it into SentryOptions. This establishes stable naming in the core SDK while keeping the feature inert until Android/public facade PRs land later in the stack.

Changes:

  • Add IAppStartExtender (@ApiStatus.Internal) and NoOpAppStartExtender default implementation.
  • Wire appStartExtender into SentryOptions with an internal getter/setter and default to the no-op.
  • Add unit tests for the new option default/setter behavior and for the no-op extender behavior; update sentry.api.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sentry/src/main/java/io/sentry/SentryOptions.java Adds appStartExtender field + @ApiStatus.Internal getter/setter with default no-op implementation.
sentry/src/main/java/io/sentry/IAppStartExtender.java Introduces the internal contract bridging future Sentry.extendAppStart()-style APIs to platform implementation.
sentry/src/main/java/io/sentry/NoOpAppStartExtender.java Adds default no-op implementation returning NoOpSpan and no-op lifecycle methods.
sentry/src/test/java/io/sentry/SentryOptionsTest.kt Verifies SentryOptions defaults to NoOpAppStartExtender and returns a custom extender when set.
sentry/src/test/java/io/sentry/NoOpAppStartExtenderTest.kt Tests singleton/no-throw behavior and that the extended span is NoOpSpan.
sentry/api/sentry.api Updates API dump to include the new types and SentryOptions accessor methods.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3 to +5
import org.jetbrains.annotations.NotNull;

public final class NoOpAppStartExtender implements IAppStartExtender {
}

@Test
fun `when appStartExtender is set, its returned as well`() {
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.

2 participants