Skip to content

Commit b729b63

Browse files
runningcodeclaude
andauthored
feat(sentry-cli): Set SENTRY_PIPELINE environment variable (#365)
* feat(sentry-cli): Set SENTRY_PIPELINE environment variable Set SENTRY_PIPELINE environment variable for all sentry-cli invocations to identify the plugin and version being used. The value is set to "sentry-fastlane-plugin/<version>" where version is dynamically read from the Fastlane::Sentry::VERSION constant. This allows Sentry to track which integration is being used to upload data and helps with debugging and analytics. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * docs(changelog): Add entry for SENTRY_PIPELINE feature 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 272cb41 commit b729b63

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Features
6+
7+
- Set `SENTRY_PIPELINE` environment variable for all sentry-cli invocations to identify the plugin and version ([#365](https://github.com/getsentry/sentry-fastlane-plugin/pull/365))
8+
59
### Dependencies
610

711
- Bump CLI from v2.58.2 to v2.58.3 ([#366](https://github.com/getsentry/sentry-fastlane-plugin/pull/366))

lib/fastlane/plugin/sentry/helper/sentry_helper.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def self.call_sentry_cli(params, sub_command)
3131
UI.command(final_command)
3232
end
3333

34-
Open3.popen3(final_command) do |stdin, stdout, stderr, status_thread|
34+
env = { 'SENTRY_PIPELINE' => "sentry-fastlane-plugin/#{Fastlane::Sentry::VERSION}" }
35+
Open3.popen3(env, final_command) do |stdin, stdout, stderr, status_thread|
3536
out_reader = Thread.new do
3637
output = []
3738

spec/sentry_helper_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
sentry_cli_path = 'path'
55
options = {}
66
expect(Fastlane::Helper::SentryHelper).to receive(:find_and_check_sentry_cli_path!).with(options).and_return(sentry_cli_path)
7-
expect(Open3).to receive(:popen3).with("#{sentry_cli_path} subcommand")
7+
expect(Open3).to receive(:popen3).with({ 'SENTRY_PIPELINE' => "sentry-fastlane-plugin/#{Fastlane::Sentry::VERSION}" }, "#{sentry_cli_path} subcommand")
88

99
Fastlane::Helper::SentryHelper.call_sentry_cli(options, ["subcommand"])
1010
end

0 commit comments

Comments
 (0)