Skip to content

Commit

Permalink
CM-38440 - Disable Sentry for on-premise installations (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX authored Jul 25, 2024
1 parent be7e887 commit a9577ae
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 6 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## [Unreleased]

## [1.1.4] - 2024-07-25

- Disable Sentry for on-premise installations

## [1.1.3] - 2024-07-18

- Fix deserialization errors
Expand Down Expand Up @@ -32,6 +36,8 @@

The first public release of the extension.

[1.1.4]: https://github.com/cycodehq/visual-studio-extension/releases/tag/v1.1.4

[1.1.3]: https://github.com/cycodehq/visual-studio-extension/releases/tag/v1.1.3

[1.1.2]: https://github.com/cycodehq/visual-studio-extension/releases/tag/v1.1.2
Expand All @@ -44,4 +50,4 @@ The first public release of the extension.

[1.0.0]: https://github.com/cycodehq/visual-studio-extension/releases/tag/v1.0.0

[Unreleased]: https://github.com/cycodehq/visual-studio-extension/compare/v1.1.3...HEAD
[Unreleased]: https://github.com/cycodehq/visual-studio-extension/compare/v1.1.4...HEAD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="Cycode.7e1a0714-9b3b-4e0e-9c0a-d23fb20ab86e" Version="1.1.3" Language="en-US" Publisher="cycodehq" />
<Identity Id="Cycode.7e1a0714-9b3b-4e0e-9c0a-d23fb20ab86e" Version="1.1.4" Language="en-US" Publisher="cycodehq" />
<DisplayName>Cycode</DisplayName>
<Description xml:space="preserve">Cycode for Visual Studio IDE</Description>
<MoreInfo>https://github.com/cycodehq/visual-studio-extension</MoreInfo>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="Cycode.f2c5020e-67a2-46f8-a888-609412fd59db" Version="1.1.3" Language="en-US" Publisher="cycodehq" />
<Identity Id="Cycode.f2c5020e-67a2-46f8-a888-609412fd59db" Version="1.1.4" Language="en-US" Publisher="cycodehq" />
<DisplayName>Cycode</DisplayName>
<Description xml:space="preserve">Cycode for Visual Studio IDE</Description>
<MoreInfo>https://github.com/cycodehq/visual-studio-extension</MoreInfo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ public static class Constants {

public static readonly string PluginPath = GetPluginsPath();
public static readonly string DefaultCliPath = GetDefaultCliPath();
public const string RequiredCliVersion = "1.10.4";
public const string RequiredCliVersion = "1.10.7";

public const string CycodeDomain = "cycode.com";

public const string CliGithubOrg = "cycodehq";
public const string CliGithubRepo = "cycode-cli";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Cycode.VisualStudio.Extension.Shared.Services;
using Cycode.VisualStudio.Extension.Shared.Services.ErrorList;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.VisualStudio.Shell.Interop;

namespace Cycode.VisualStudio.Extension.Shared;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,8 @@ public class General : BaseOptionModel<General> {
[DisplayName("Enable Scan on Save")]
[DefaultValue(true)]
public bool ScanOnSave { get; set; } = true;

public bool IsOnPremiseInstallation() {
return !CliApiUrl.EndsWith(Constants.CycodeDomain);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ private static string GetSentryRelease() {
return $"{Constants.AppName}@{Vsix.Version}";
}

private static bool IsSentryDisabled() {
return General.Instance.IsOnPremiseInstallation();
}

public static void Init() {
SentrySdk.Init(options => {
options.Dsn = Constants.SentryDsn;
Expand All @@ -18,6 +22,8 @@ public static void Init() {
options.SendDefaultPii = Constants.SentrySendDefaultPii;
options.ServerName = "";

options.SetBeforeSend((sentryEvent, _) => IsSentryDisabled() ? null : sentryEvent);

options.DisableUnobservedTaskExceptionCapture();
options.DisableAppDomainUnhandledExceptionCapture();
options.DisableNetFxInstallationsIntegration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ namespace Cycode.VisualStudio.Extension.Shared;
internal sealed class Vsix {
public const string Name = "Cycode";
public const string Description = "Cycode for Visual Studio IDE";
public const string Version = "1.1.3";
public const string Version = "1.1.4";
}

0 comments on commit a9577ae

Please sign in to comment.