Skip to content

Commit

Permalink
Add build id to workflow context (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sushisource authored Jan 12, 2024
1 parent 53a8a3d commit 7127437
Show file tree
Hide file tree
Showing 35 changed files with 6,528 additions and 2,586 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ obj/
/tests/Temporalio.Tests/TestResults
/tests/golangworker/golangworker
/.vs
/.vscode
/.vscode
/.idea
28 changes: 14 additions & 14 deletions src/Temporalio.Api.Generator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

var currFile = new StackTrace(true).GetFrame(0)?.GetFileName();
var projectDir = Path.GetFullPath(Path.Join(currFile, "../../../"));
var protoDir = Path.Join(projectDir, "src/Temporalio/Bridge/sdk-core/protos");
var protoDir = Path.Join(projectDir, "src/Temporalio/Bridge/sdk-core/sdk-core-protos/protos");
var apiProtoDir = Path.Join(protoDir, "api_upstream");
var testSrvProtoDir = Path.Join(protoDir, "testsrv_upstream");
var bridgeProtoDir = Path.Join(protoDir, "local");

// Remove/recreate entire api dir
new DirectoryInfo(Path.Join(projectDir, "src/Temporalio/Api")).Delete(true);
new DirectoryInfo(Path.Join(projectDir, "src/Temporalio/Api/Dependencies")).Create();
new DirectoryInfo(Path.Join(projectDir, "src/Temporalio/Api/Dependencies/Google")).Create();
// Do not delete the .editorconfig from Bridge/Api
foreach (var fi in new DirectoryInfo(Path.Join(projectDir, "src/Temporalio/Bridge/Api")).GetFileSystemInfos())
{
Expand All @@ -31,15 +31,15 @@
// Gen proto
foreach (var fi in new DirectoryInfo(apiProtoDir).GetFiles("*.proto", SearchOption.AllDirectories))
{
if (fi.FullName.Contains("gogo"))
if (fi.FullName.Contains($"google{Path.DirectorySeparatorChar}api"))
{
Protoc(
fi.FullName,
Path.Join(projectDir, "src/Temporalio/Api/Dependencies"),
Path.Join(projectDir, "src/Temporalio/Api/Dependencies/Google"),
string.Empty,
apiProtoDir);
}
else
else if (!fi.FullName.Contains($"google{Path.DirectorySeparatorChar}protobuf"))
{
Protoc(fi.FullName, Path.Join(projectDir, "src/Temporalio"), "Temporalio", apiProtoDir);
}
Expand Down Expand Up @@ -112,7 +112,7 @@
["UnlockTimeSkippingWithSleep"] = "SleepResponse",
}));

// Change Gogoproto namespace to Temporalio.Api.Dependencies.Gogoproto
// Change Google namespace to Temporalio.Api.Dependencies.Google
foreach (
var fi in new DirectoryInfo(Path.Join(projectDir, "src/Temporalio/Api")).GetFiles(
"*.cs",
Expand All @@ -123,18 +123,18 @@
continue;
}
string contents = File.ReadAllText(fi.FullName);
if (fi.Name == "Gogo.cs")
if (fi.FullName.Contains("Google"))
{
// Just change the namespace field;
File.WriteAllText(
fi.FullName,
contents.Replace(
"namespace Gogoproto ",
"namespace Temporalio.Api.Dependencies.Gogoproto "));
// change the namespace field
var newContents = contents.Replace(
"namespace Google.Api ",
"namespace Temporalio.Api.Dependencies.Google.Api ");
newContents = newContents.Replace("Google.Api.", "Temporalio.Api.Dependencies.Google.Api.");
File.WriteAllText(fi.FullName, newContents);
}
else
{
var newContents = contents.Replace("Gogoproto.", "Temporalio.Api.Dependencies.Gogoproto.");
var newContents = contents.Replace("Google.Api.", "Temporalio.Api.Dependencies.Google.Api.");
if (contents != newContents)
{
File.WriteAllText(fi.FullName, newContents);
Expand Down
153 changes: 101 additions & 52 deletions src/Temporalio/Api/Batch/V1/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,39 @@ static MessageReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CiN0ZW1wb3JhbC9hcGkvYmF0Y2gvdjEvbWVzc2FnZS5wcm90bxIVdGVtcG9y",
"YWwuYXBpLmJhdGNoLnYxGiFkZXBlbmRlbmNpZXMvZ29nb3Byb3RvL2dvZ28u",
"cHJvdG8aH2dvb2dsZS9wcm90b2J1Zi90aW1lc3RhbXAucHJvdG8aJHRlbXBv",
"cmFsL2FwaS9jb21tb24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4udGVtcG9yYWwuYXBpLmNvbW1v",
"bi52MS5IZWFkZXISEAoIaWRlbnRpdHkYBCABKAkiLgoaQmF0Y2hPcGVyYXRp",
"b25DYW5jZWxsYXRpb24SEAoIaWRlbnRpdHkYASABKAkiKgoWQmF0Y2hPcGVy",
"YXRpb25EZWxldGlvbhIQCghpZGVudGl0eRgBIAEoCSLZAQoTQmF0Y2hPcGVy",
"YXRpb25SZXNldBIQCghpZGVudGl0eRgDIAEoCRI1CgdvcHRpb25zGAQgASgL",
"MiQudGVtcG9yYWwuYXBpLmNvbW1vbi52MS5SZXNldE9wdGlvbnMSNAoKcmVz",
"ZXRfdHlwZRgBIAEoDjIgLnRlbXBvcmFsLmFwaS5lbnVtcy52MS5SZXNldFR5",
"cGUSQwoScmVzZXRfcmVhcHBseV90eXBlGAIgASgOMicudGVtcG9yYWwuYXBp",
"LmVudW1zLnYxLlJlc2V0UmVhcHBseVR5cGVChAEKGGlvLnRlbXBvcmFsLmFw",
"aS5iYXRjaC52MUIMTWVzc2FnZVByb3RvUAFaIWdvLnRlbXBvcmFsLmlvL2Fw",
"aS9iYXRjaC92MTtiYXRjaKoCF1RlbXBvcmFsaW8uQXBpLkJhdGNoLlYx6gIa",
"VGVtcG9yYWxpbzo6QXBpOjpCYXRjaDo6VjFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Temporalio.Api.Dependencies.Gogoproto.GogoReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Temporalio.Api.Common.V1.MessageReflection.Descriptor, global::Temporalio.Api.Enums.V1.BatchOperationReflection.Descriptor, global::Temporalio.Api.Enums.V1.ResetReflection.Descriptor, },
new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Temporalio.Api.Common.V1.MessageReflection.Descriptor, global::Temporalio.Api.Enums.V1.BatchOperationReflection.Descriptor, global::Temporalio.Api.Enums.V1.ResetReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Temporalio.Api.Batch.V1.BatchOperationInfo), global::Temporalio.Api.Batch.V1.BatchOperationInfo.Parser, new[]{ "JobId", "State", "StartTime", "CloseTime" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Temporalio.Api.Batch.V1.BatchOperationTermination), global::Temporalio.Api.Batch.V1.BatchOperationTermination.Parser, new[]{ "Details", "Identity" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Temporalio.Api.Batch.V1.BatchOperationSignal), global::Temporalio.Api.Batch.V1.BatchOperationSignal.Parser, new[]{ "Signal", "Input", "Header", "Identity" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Temporalio.Api.Batch.V1.BatchOperationCancellation), global::Temporalio.Api.Batch.V1.BatchOperationCancellation.Parser, new[]{ "Identity" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Temporalio.Api.Batch.V1.BatchOperationDeletion), global::Temporalio.Api.Batch.V1.BatchOperationDeletion.Parser, new[]{ "Identity" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Temporalio.Api.Batch.V1.BatchOperationReset), global::Temporalio.Api.Batch.V1.BatchOperationReset.Parser, new[]{ "ResetType", "ResetReapplyType", "Identity" }, null, null, null, null)
new pbr::GeneratedClrTypeInfo(typeof(global::Temporalio.Api.Batch.V1.BatchOperationReset), global::Temporalio.Api.Batch.V1.BatchOperationReset.Parser, new[]{ "Identity", "Options", "ResetType", "ResetReapplyType" }, null, null, null, null)
}));
}
#endregion
Expand Down Expand Up @@ -1406,9 +1406,10 @@ public BatchOperationReset() {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public BatchOperationReset(BatchOperationReset other) : this() {
identity_ = other.identity_;
options_ = other.options_ != null ? other.options_.Clone() : null;
resetType_ = other.resetType_;
resetReapplyType_ = other.resetReapplyType_;
identity_ = other.identity_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}

Expand All @@ -1418,11 +1419,41 @@ public BatchOperationReset Clone() {
return new BatchOperationReset(this);
}

/// <summary>Field number for the "identity" field.</summary>
public const int IdentityFieldNumber = 3;
private string identity_ = "";
/// <summary>
/// The identity of the worker/client.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Identity {
get { return identity_; }
set {
identity_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "options" field.</summary>
public const int OptionsFieldNumber = 4;
private global::Temporalio.Api.Common.V1.ResetOptions options_;
/// <summary>
/// Describes what to reset to and how. If set, `reset_type` and `reset_reapply_type` are ignored.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public global::Temporalio.Api.Common.V1.ResetOptions Options {
get { return options_; }
set {
options_ = value;
}
}

/// <summary>Field number for the "reset_type" field.</summary>
public const int ResetTypeFieldNumber = 1;
private global::Temporalio.Api.Enums.V1.ResetType resetType_ = global::Temporalio.Api.Enums.V1.ResetType.Unspecified;
/// <summary>
/// Reset type.
/// Reset type (deprecated, use `options`).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Expand All @@ -1437,7 +1468,7 @@ public BatchOperationReset Clone() {
public const int ResetReapplyTypeFieldNumber = 2;
private global::Temporalio.Api.Enums.V1.ResetReapplyType resetReapplyType_ = global::Temporalio.Api.Enums.V1.ResetReapplyType.Unspecified;
/// <summary>
/// History event reapply options.
/// History event reapply options (deprecated, use `options`).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Expand All @@ -1448,21 +1479,6 @@ public BatchOperationReset Clone() {
}
}

/// <summary>Field number for the "identity" field.</summary>
public const int IdentityFieldNumber = 3;
private string identity_ = "";
/// <summary>
/// The identity of the worker/client.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string Identity {
get { return identity_; }
set {
identity_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
Expand All @@ -1478,19 +1494,21 @@ public bool Equals(BatchOperationReset other) {
if (ReferenceEquals(other, this)) {
return true;
}
if (Identity != other.Identity) return false;
if (!object.Equals(Options, other.Options)) return false;
if (ResetType != other.ResetType) return false;
if (ResetReapplyType != other.ResetReapplyType) return false;
if (Identity != other.Identity) return false;
return Equals(_unknownFields, other._unknownFields);
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
if (Identity.Length != 0) hash ^= Identity.GetHashCode();
if (options_ != null) hash ^= Options.GetHashCode();
if (ResetType != global::Temporalio.Api.Enums.V1.ResetType.Unspecified) hash ^= ResetType.GetHashCode();
if (ResetReapplyType != global::Temporalio.Api.Enums.V1.ResetReapplyType.Unspecified) hash ^= ResetReapplyType.GetHashCode();
if (Identity.Length != 0) hash ^= Identity.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
Expand Down Expand Up @@ -1521,6 +1539,10 @@ public void WriteTo(pb::CodedOutputStream output) {
output.WriteRawTag(26);
output.WriteString(Identity);
}
if (options_ != null) {
output.WriteRawTag(34);
output.WriteMessage(Options);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
Expand All @@ -1543,6 +1565,10 @@ public void WriteTo(pb::CodedOutputStream output) {
output.WriteRawTag(26);
output.WriteString(Identity);
}
if (options_ != null) {
output.WriteRawTag(34);
output.WriteMessage(Options);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
Expand All @@ -1553,15 +1579,18 @@ public void WriteTo(pb::CodedOutputStream output) {
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
if (Identity.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Identity);
}
if (options_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Options);
}
if (ResetType != global::Temporalio.Api.Enums.V1.ResetType.Unspecified) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResetType);
}
if (ResetReapplyType != global::Temporalio.Api.Enums.V1.ResetReapplyType.Unspecified) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResetReapplyType);
}
if (Identity.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Identity);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
Expand All @@ -1574,15 +1603,21 @@ public void MergeFrom(BatchOperationReset other) {
if (other == null) {
return;
}
if (other.Identity.Length != 0) {
Identity = other.Identity;
}
if (other.options_ != null) {
if (options_ == null) {
Options = new global::Temporalio.Api.Common.V1.ResetOptions();
}
Options.MergeFrom(other.Options);
}
if (other.ResetType != global::Temporalio.Api.Enums.V1.ResetType.Unspecified) {
ResetType = other.ResetType;
}
if (other.ResetReapplyType != global::Temporalio.Api.Enums.V1.ResetReapplyType.Unspecified) {
ResetReapplyType = other.ResetReapplyType;
}
if (other.Identity.Length != 0) {
Identity = other.Identity;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}

Expand Down Expand Up @@ -1610,6 +1645,13 @@ public void MergeFrom(pb::CodedInputStream input) {
Identity = input.ReadString();
break;
}
case 34: {
if (options_ == null) {
Options = new global::Temporalio.Api.Common.V1.ResetOptions();
}
input.ReadMessage(Options);
break;
}
}
}
#endif
Expand Down Expand Up @@ -1637,6 +1679,13 @@ public void MergeFrom(pb::CodedInputStream input) {
Identity = input.ReadString();
break;
}
case 34: {
if (options_ == null) {
Options = new global::Temporalio.Api.Common.V1.ResetOptions();
}
input.ReadMessage(Options);
break;
}
}
}
}
Expand Down
Loading

0 comments on commit 7127437

Please sign in to comment.