Skip to content

Conversation

Sushisource
Copy link
Member

What was changed

Added fairness keys/weights to priority

Why?

New feature

Checklist

  1. Closes

  2. How was this tested:
    Added test

  3. Any docs updates needed?

@Sushisource Sushisource marked this pull request as ready for review August 20, 2025 18:49
@Sushisource Sushisource requested a review from a team as a code owner August 20, 2025 18:49
ClangSharpPInvokeGenerator @src/Temporalio/Bridge/GenerateInterop.rsp
dotnet run --project src/Temporalio.Api.Generator
npx doctoc README.md
git add src/Temporalio/Api
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this leftover code from using CI to generate some aspect?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not leftover, it's genuinely useful for getting protos from CI that are net-new files

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget the git diff details, but do we also need to change git diff --exit-code to be git diff --cached --exit-code? The goal is to detect anything that doesn't match a re-run of the generator, including new files. Also, what about the other generated proto place, src/Temporalio/Bridge/Api?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added those 👍

public Priority(int? priorityKey = null) => PriorityKey = priorityKey;
/// <param name="fairnessKey">The fairness key.</param>
/// <param name="fairnessWeight">The fairness weight.</param>
public Priority(int? priorityKey = null, string? fairnessKey = null, float? fairnessWeight = null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are inconsistent across languages on whether we require a priority key in the constructor or not

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's actually Ruby that was the odd one out here. Everywhere else is optional. Adding a fix here: temporalio/sdk-ruby#323

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python also requires priority key be set when constructing, note how https://github.com/temporalio/sdk-python/blob/3c6fae6606428bb895c4a0df0c0a9c20c6e4bf82/temporalio/common.py#L985 doesn't have a default of None

@Sushisource
Copy link
Member Author

Hmm, looks like there are some additional changes to the span expectations that are causing issues

foreach (var item in items)
{
var found = false;
var exceptions = new List<Exception>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically no need for this collection anymore, but no big deal

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, derp

@Sushisource Sushisource merged commit deb2756 into main Aug 22, 2025
16 of 17 checks passed
@Sushisource Sushisource deleted the fairness branch August 22, 2025 17:15
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.

2 participants