Skip to content

Commit

Permalink
Move all RC int values to long, to mirror RC backend (#6219 => v2) (#…
Browse files Browse the repository at this point in the history
…6228)

## Summary of changes

RC backend use long for there integer fields.

Backport of 
- #6219

Co-authored-by: Robert Pickering <robert.pickering@datadoghq.com>
  • Loading branch information
andrewlock and robertpi authored Nov 4, 2024
1 parent 9bc2ebe commit 9f27913
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public ApplyDetails(string filename)

public string Filename { get; }

public uint ApplyState { get; set; }
public ulong ApplyState { get; set; }

public string? Error { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Datadog.Trace.RemoteConfigurationManagement.Protocol
{
internal class RcmCachedTargetFile
{
public RcmCachedTargetFile(string path, int length, List<RcmCachedTargetFileHash> hashes)
public RcmCachedTargetFile(string path, long length, List<RcmCachedTargetFileHash> hashes)
{
Path = path;
Length = length;
Expand All @@ -21,7 +21,7 @@ public RcmCachedTargetFile(string path, int length, List<RcmCachedTargetFileHash
public string Path { get; }

[JsonProperty("length")]
public int Length { get; }
public long Length { get; }

[JsonProperty("hashes")]
public List<RcmCachedTargetFileHash> Hashes { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Datadog.Trace.RemoteConfigurationManagement.Protocol
{
internal class RcmClientState
{
public RcmClientState(int rootVersion, int targetsVersion, List<RcmConfigState> configStates, bool hasError, string error, string backendClientState)
public RcmClientState(long rootVersion, long targetsVersion, List<RcmConfigState> configStates, bool hasError, string error, string backendClientState)
{
RootVersion = rootVersion;
TargetsVersion = targetsVersion;
Expand All @@ -21,7 +21,7 @@ public RcmClientState(int rootVersion, int targetsVersion, List<RcmConfigState>
}

[JsonProperty("root_version")]
public int RootVersion { get; }
public long RootVersion { get; }

[JsonProperty("targets_version")]
public long TargetsVersion { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Datadog.Trace.RemoteConfigurationManagement.Protocol
{
internal class RcmConfigState
{
public RcmConfigState(string id, int version, string product, uint applyState, string applyError = null)
public RcmConfigState(string id, long version, string product, ulong applyState, string applyError = null)
{
Id = id;
Version = version;
Expand All @@ -22,13 +22,13 @@ public RcmConfigState(string id, int version, string product, uint applyState, s
public string Id { get; }

[JsonProperty("version")]
public int Version { get; }
public long Version { get; }

[JsonProperty("product")]
public string Product { get; }

[JsonProperty("apply_state")]
public uint ApplyState { get; }
public ulong ApplyState { get; }

[JsonProperty("apply_error")]
public string ApplyError { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal class Signed
public Dictionary<string, Target> Targets { get; set; } = new();

[JsonProperty("version")]
public int Version { get; set; }
public long Version { get; set; }

[JsonProperty("custom")]
public TargetsCustom Custom { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ internal class Target
public Dictionary<string, string> Hashes { get; set; } = new();

[JsonProperty("length")]
public int Length { get; set; }
public long Length { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ namespace Datadog.Trace.RemoteConfigurationManagement.Protocol.Tuf
internal class TargetCustom
{
[JsonProperty("v")]
public int V { get; set; }
public long V { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ internal class RcmSubscriptionManager : IRcmSubscriptionManager
private IReadOnlyList<ISubscription> _subscriptions = [];

private string? _backendClientState;
private int _targetsVersion;
private long _targetsVersion;
private BigInteger _capabilities;
private string? _lastPollError;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ internal class RemoteConfiguration : IEquatable<RemoteConfiguration>
public RemoteConfiguration(
RemoteConfigurationPath path,
byte[] contents,
int length,
long length,
Dictionary<string, string> hashes,
int version)
long version)
{
Path = path;
Contents = contents;
Expand All @@ -29,11 +29,11 @@ public RemoteConfiguration(

public byte[] Contents { get; }

public int Length { get; }
public long Length { get; }

public Dictionary<string, string> Hashes { get; }

public int Version { get; }
public long Version { get; }

public override bool Equals(object o)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Datadog.Trace.RemoteConfigurationManagement
{
internal class RemoteConfigurationCache
{
public RemoteConfigurationCache(RemoteConfigurationPath path, int length, Dictionary<string, string> hashes, int version)
public RemoteConfigurationCache(RemoteConfigurationPath path, long length, Dictionary<string, string> hashes, long version)
{
Path = path;
Length = length;
Expand All @@ -20,13 +20,13 @@ public RemoteConfigurationCache(RemoteConfigurationPath path, int length, Dictio

public RemoteConfigurationPath Path { get; }

public int Length { get; }
public long Length { get; }

public Dictionary<string, string> Hashes { get; }

public int Version { get; }
public long Version { get; }

public uint ApplyState { get; private set; } = ApplyStates.UNACKNOWLEDGED;
public ulong ApplyState { get; private set; } = ApplyStates.UNACKNOWLEDGED;

public string Error { get; private set; }

Expand Down

0 comments on commit 9f27913

Please sign in to comment.