Skip to content

Conversation

atrauzzi
Copy link

Description

Added initial support for jobs.

Issue reference

Closes: #667

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@atrauzzi atrauzzi changed the title feat: feat: add jobs Mar 15, 2025
@WhitWaldo WhitWaldo added this to the v3.6.0 milestone Mar 16, 2025
@WhitWaldo
Copy link
Contributor

@atrauzzi This runs a linter (for now) as part of the build pipeline and failures will stop the build. Would you mind fixing the lint errors locally and pushing a commit with those changes as well so we can run the checks?

Copy link
Contributor

@WhitWaldo WhitWaldo left a comment

Choose a reason for hiding this comment

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

Excellent start - still a bit to go, but it's a good foundation.

Copy link
Contributor

@WhitWaldo WhitWaldo left a comment

Choose a reason for hiding this comment

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

Coming along - note about the regexps though

Copy link
Contributor

@WhitWaldo WhitWaldo left a comment

Choose a reason for hiding this comment

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

More thoughts

atrauzzi added a commit to atrauzzi/dapr-js-sdk that referenced this pull request Mar 22, 2025
 - Addresses
   - dapr#688 (comment)
   - dapr#688 (comment)

Signed-off-by: Alexander Trauzzi <[email protected]>
@joebowbeer
Copy link
Contributor

joebowbeer commented Apr 19, 2025

== APP ==     Error: 14 UNAVAILABLE: connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:50001: connect: connection refused"
== APP ==         at callErrorFromStatus (/home/runner/work/js-sdk/js-sdk/node_modules/@grpc/grpc-js/src/call.ts:82:17)
== APP ==         at Object.onReceiveStatus (/home/runner/work/js-sdk/js-sdk/node_modules/@grpc/grpc-js/src/client.ts:360:55)
== APP ==         at Object.onReceiveStatus (/home/runner/work/js-sdk/js-sdk/node_modules/@grpc/grpc-js/src/client-interceptors.ts:458:34)
== APP ==         at Object.onReceiveStatus (/home/runner/work/js-sdk/js-sdk/node_modules/@grpc/grpc-js/src/client-interceptors.ts:419:48)
== APP ==         at /home/runner/work/js-sdk/js-sdk/node_modules/@grpc/grpc-js/src/resolving-call.ts:163:24
== APP ==         at processTicksAndRejections (node:internal/process/task_queues:78:11)
== APP ==     for call at
== APP ==         at ServiceClientImpl.makeUnaryRequest (/home/runner/work/js-sdk/js-sdk/node_modules/@grpc/grpc-js/src/client.ts:325:42)
== APP ==         at ServiceClientImpl.invokeService (/home/runner/work/js-sdk/js-sdk/node_modules/@grpc/grpc-js/src/make-client.ts:189:15)
== APP ==         at /home/runner/work/js-sdk/js-sdk/src/implementation/Client/GRPCClient/invoker.ts:64:14
== APP ==         at new Promise (<anonymous>)
== APP ==         at GRPCClientInvoker.invoke (/home/runner/work/js-sdk/js-sdk/src/implementation/Client/GRPCClient/invoker.ts:63:12)
== APP ==         at Object.<anonymous> (/home/runner/work/js-sdk/js-sdk/test/e2e/grpc/server.test.ts:78:21) {
== APP ==       code: 14,
== APP ==       details: 'connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:50001: connect: connection refused"',
== APP ==       metadata: Metadata {
== APP ==         internalRepr: Map(2) { 'traceparent' => [Array], 'grpc-trace-bin' => [Array] },
== APP ==         options: {}
== APP ==       }
== APP ==     }
== APP == 
== APP ==       at Object.<anonymous> (test/e2e/grpc/server.test.ts:81:17)

@WhitWaldo
Copy link
Contributor

== APP ==     Error: 14 UNAVAILABLE: connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:50001: connect: connection refused"
== APP ==         at callErrorFromStatus (/home/runner/work/js-sdk/js-sdk/node_modules/@grpc/grpc-js/src/call.ts:82:17)
== APP ==         at Object.onReceiveStatus (/home/runner/work/js-sdk/js-sdk/node_modules/@grpc/grpc-js/src/client.ts:360:55)
== APP ==         at Object.onReceiveStatus (/home/runner/work/js-sdk/js-sdk/node_modules/@grpc/grpc-js/src/client-interceptors.ts:458:34)
== APP ==         at Object.onReceiveStatus (/home/runner/work/js-sdk/js-sdk/node_modules/@grpc/grpc-js/src/client-interceptors.ts:419:48)
== APP ==         at /home/runner/work/js-sdk/js-sdk/node_modules/@grpc/grpc-js/src/resolving-call.ts:163:24
== APP ==         at processTicksAndRejections (node:internal/process/task_queues:78:11)
== APP ==     for call at
== APP ==         at ServiceClientImpl.makeUnaryRequest (/home/runner/work/js-sdk/js-sdk/node_modules/@grpc/grpc-js/src/client.ts:325:42)
== APP ==         at ServiceClientImpl.invokeService (/home/runner/work/js-sdk/js-sdk/node_modules/@grpc/grpc-js/src/make-client.ts:189:15)
== APP ==         at /home/runner/work/js-sdk/js-sdk/src/implementation/Client/GRPCClient/invoker.ts:64:14
== APP ==         at new Promise (<anonymous>)
== APP ==         at GRPCClientInvoker.invoke (/home/runner/work/js-sdk/js-sdk/src/implementation/Client/GRPCClient/invoker.ts:63:12)
== APP ==         at Object.<anonymous> (/home/runner/work/js-sdk/js-sdk/test/e2e/grpc/server.test.ts:78:21) {
== APP ==       code: 14,
== APP ==       details: 'connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:50001: connect: connection refused"',
== APP ==       metadata: Metadata {
== APP ==         internalRepr: Map(2) { 'traceparent' => [Array], 'grpc-trace-bin' => [Array] },
== APP ==         options: {}
== APP ==       }
== APP ==     }
== APP == 
== APP ==       at Object.<anonymous> (test/e2e/grpc/server.test.ts:81:17)

What's this in reference to?

@joebowbeer
Copy link
Contributor

joebowbeer commented Apr 19, 2025

What's this in reference to?

@WhitWaldo This is the failure from the test run of the previous commit.

However, I don't think it sheds much light. I think the interesting failure is in the scheduler's (Testcontainer) log:

"failed to invoke schedule app job:
  error returned from app channel while sending triggered job to app:
    Post \"http://127.0.0.1:8070/job/test\": EOF"

I suspect this 127.0.0.1 is wrong.

@atrauzzi
Copy link
Author

Alright, so a small bit of progress on connectivity between the dapr daemon and the scheduler, but sadly not quite there with things yet.

I'm now running into a timeout scenario where it seems like any attempt to use the client.

dapr-js-sdk testcontainers jest timeout.txt

The code seems to hang when I try to create the job. @WhitWaldo, maybe you can spot something?

Copy link

codecov bot commented Jul 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d1bf38a) to head (17852f6).
⚠️ Report is 32 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #688   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines            6         6           
  Branches         1         1           
=========================================
  Hits             6         6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

atrauzzi added 6 commits July 12, 2025 15:49
Signed-off-by: Alexander Trauzzi <[email protected]>
Signed-off-by: Alexander Trauzzi <[email protected]>
Signed-off-by: Alexander Trauzzi <[email protected]>
Signed-off-by: Alexander Trauzzi <[email protected]>
WhitWaldo and others added 10 commits July 12, 2025 15:49
Removes stale bot + adds me to repo owners for bot actions

Signed-off-by: Whit Waldo <[email protected]>
Signed-off-by: Alexander Trauzzi <[email protected]>
Signed-off-by: Alexander Trauzzi <[email protected]>
Signed-off-by: Alexander Trauzzi <[email protected]>
Signed-off-by: Alexander Trauzzi <[email protected]>
Signed-off-by: Joe Bowbeer <[email protected]>
Signed-off-by: Alexander Trauzzi <[email protected]>
Signed-off-by: Alexander Trauzzi <[email protected]>
Signed-off-by: Alexander Trauzzi <[email protected]>
Signed-off-by: Alexander Trauzzi <[email protected]>
atrauzzi added 2 commits July 12, 2025 15:53
Signed-off-by: Alexander Trauzzi <[email protected]>

# Conflicts:
#	package-lock.json
Signed-off-by: Alexander Trauzzi <[email protected]>
@atrauzzi atrauzzi requested a review from WhitWaldo July 13, 2025 00:27
Copy link
Contributor

@WhitWaldo WhitWaldo left a comment

Choose a reason for hiding this comment

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

Just want to make sure we've got strong test coverage - reviewed on GitHub, so I can't run a check myself, but if it looks good to you, I'm satisifed.

Also, please remove the gRPC implementations of the Jobs bits. The way I see it, the SDK need only implement one or the other and it's up to the runtime to ensure that there's parity in the APIs. We have no need to expose both and have the developer pick one as that would just be confusing. Rather, you've already got HTTP in place, so let's delete the gRPC side.

I flipped these. I'd prefer to keep gRPC and drop HTTP.

Copy link
Contributor

Choose a reason for hiding this comment

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

Frankly, I think the SDK should just pick one or the other - if we've got this implemented via HTTP, I don't know we need to have a stub for gRPC (that itself doesn't work) just because as that can lead to developer confusion.

Copy link
Contributor

Choose a reason for hiding this comment

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

As before - if this is implemented using HTTP, no need to add a gRPC implementation just because.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the shape of this has changed in the latest protos - I believe there's an override property now.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd just generally like to see much better test coverage to prove there are no typos in each of the helper extension implementations.

Copy link
Contributor

Choose a reason for hiding this comment

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

When putting together each of the regex variations, just do a quick pass to make sure any seemingly edge cases are covered.

@mikeee mikeee modified the milestones: v3.6.0, v3.7.0 Aug 11, 2025
@WhitWaldo
Copy link
Contributor

@atrauzzi Do you have any interest in getting this over the finish line?

@atrauzzi
Copy link
Author

@WhitWaldo - Yepyep. Sorry, been tight on time in the evenings.

@atrauzzi
Copy link
Author

Alright, further to our discussion this evening, let me know what's happening with the protos and which direction you think we should go with the http and grpc stuff.

I've fixed up the one thing for producing the sorted list of days of the week based on enum or ints and of course added two tests for it 🙂

If you have some specifics for the other details, let me know, but I think once the grpc stuff is resolved, we're in pretty good shape!

@WhitWaldo
Copy link
Contributor

I'm good with just implementing the HTTP bits (already done) and just leaving gRPC unimplemented. We can call this out in the documentation that this API is currently only supported when using it in an HTTP context and throw an exception that reflects the same.

Protos should be updated per the recently merged conversation API, so if you can merge with that, I think this should generally be good to go, right?

@atrauzzi atrauzzi marked this pull request as ready for review August 26, 2025 17:18
@atrauzzi atrauzzi requested review from a team as code owners August 26, 2025 17:18
@atrauzzi atrauzzi requested a review from WhitWaldo August 26, 2025 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Jobs] Add support for Jobs building block
5 participants