Skip to content

fix(sentry): не падать на null-версии сервера при инициализации Sentry#4141

Merged
nixel2007 merged 1 commit into
developfrom
fix/sentry-environment-null-version
Jun 17, 2026
Merged

fix(sentry): не падать на null-версии сервера при инициализации Sentry#4141
nixel2007 merged 1 commit into
developfrom
fix/sentry-environment-null-version

Conversation

@nixel2007

Copy link
Copy Markdown
Member

Проблема

SentryScopeConfigurer.resolveEnvironment(version) бросает NullPointerException на version.matches(...), когда serverInfo.getVersion() возвращает null. Версия равна null при запуске без манифеста (из IDE/исходников — в META-INF/MANIFEST.MF нет Implementation-Version). Если при этом задан sentry.dsn, лямбда sentryOptionsConfiguration вызывается при инициализации Sentry SDK на старте контекста → падение.

Решение

getEnvironment() трактует null-версию как окружение feature (как и любую неизвестную строку версии). resolveEnvironment(String) сохраняет не-null контракт — null обрабатывается в вызывающем методе.

Тест

SentryScopeConfigurerOptionsTest (Mockito-юнит): sentryOptionsConfiguration().configure(options) при getVersion()==null не падает и выставляет environment feature. Сначала написан красный (воспроизводит NPE), затем фикс.

🤖 Generated with Claude Code

resolveEnvironment(version) бросал NullPointerException, когда
serverInfo.getVersion() возвращает null — а это происходит при запуске
без манифеста (из IDE/исходников). Если при этом задан sentry.dsn,
инициализация Sentry падала на старте.

getEnvironment теперь трактует null-версию как окружение feature;
resolveEnvironment сохраняет не-null контракт.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@nixel2007, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 22 minutes and 41 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fa8ec35f-4e45-4f80-b110-e306baecad3e

📥 Commits

Reviewing files that changed from the base of the PR and between 6c985d8 and 012f15d.

📒 Files selected for processing (2)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/aop/sentry/SentryScopeConfigurer.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/aop/sentry/SentryScopeConfigurerOptionsTest.java
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sentry-environment-null-version

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
75.0% Coverage on New Code (required ≥ 80%)
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

 3 474 files  +6   3 474 suites  +6   1h 34m 39s ⏱️ -57s
 3 483 tests +1   3 465 ✅ +1   18 💤 ±0  0 ❌ ±0 
20 898 runs  +6  20 786 ✅ +6  112 💤 ±0  0 ❌ ±0 

Results for commit 012f15d. ± Comparison against base commit 6c985d8.

@nixel2007
nixel2007 merged commit 7394b55 into develop Jun 17, 2026
36 of 37 checks passed
@nixel2007
nixel2007 deleted the fix/sentry-environment-null-version branch June 17, 2026 06:51
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