Skip to content

temporal: always set temporal-namespace header on requests (#7079)#7080

Merged
zroubalik merged 4 commits intokedacore:mainfrom
robcao:gh-7079
Sep 30, 2025
Merged

temporal: always set temporal-namespace header on requests (#7079)#7080
zroubalik merged 4 commits intokedacore:mainfrom
robcao:gh-7079

Conversation

@robcao
Copy link
Contributor

@robcao robcao commented Sep 15, 2025

The temporal scaler now always attaches the temporal-namespace header on requests to the temporal server. Previously, this header was only set (at the keda scaler) level on requests when the scaler metadata contained an api key.

Note that namespace specific gRPC requests already contained the temporal-namespace header on every request, but the initial GetSystemInfo request does not, because it is not a namespace specific request: temporalio/sdk-go#1458

Checklist

Fixes #7079

I don't believe that any documentation needs to be updated, since there is no mention of the temporal-namespace header on the current scaler documentation, but please correct me if I should add to the documentation.

For potential tests, I could do two things:

  • Create a new method getTemporalClientDialOptions that returns all of the dialOptions, update getTemporalClient to call that method, and then assert that the interceptor is always added
  • Add an in-memory gRPC temporal server, and validate that requests from the scaler to the in memory server always contain the expected header in unit tests

@robcao robcao requested a review from a team as a code owner September 15, 2025 15:44
@github-actions
Copy link

Thank you for your contribution! 🙏

Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected.

While you are waiting, make sure to:

  • Add an entry in our changelog in alphabetical order and link related issue
  • Update the documentation, if needed
  • Add unit & e2e tests for your changes
  • GitHub checks are passing
  • Is the DCO check failing? Here is how you can fix DCO issues

Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient.

Learn more about our contribution guide.

@keda-automation keda-automation requested a review from a team September 15, 2025 15:44
…7079)

Signed-off-by: Robert Cao <robert.cao@relativity.com>
Signed-off-by: Robert Cao <robert.cao@relativity.com>
Signed-off-by: Robert Cao <robert.cao@relativity.com>
@rickbrouwer
Copy link
Member

rickbrouwer commented Sep 15, 2025

/run-e2e temporal
Update: You can check the progress here

@zroubalik zroubalik requested a review from Copilot September 18, 2025 10:40
@zroubalik
Copy link
Member

zroubalik commented Sep 18, 2025

/run-e2e temporal
Update: You can check the progress here

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the Temporal scaler to always include the temporal-namespace header on requests to the Temporal server, regardless of whether an API key is present. Previously, this header was only set when the scaler metadata contained an API key, which caused issues with the initial GetSystemInfo request.

  • Moved the gRPC unary interceptor outside of the API key conditional block
  • Ensures namespace header is set on all requests, not just authenticated ones

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/scalers/temporal_scaler.go Relocated the gRPC interceptor code to always execute, ensuring temporal-namespace header is set on all requests
CHANGELOG.md Added entry documenting the fix for the temporal-namespace header issue

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

@robholland @Prajithp @jhecking I would love to hear your thoughts here

@robcao
Copy link
Contributor Author

robcao commented Sep 18, 2025

As far as I can tell, the end to end Temporal test failures are also present in the nightly tests on the main branch (https://github.com/kedacore/keda/actions/runs/17814119370). I can certainly look into them here if needed. It does look like potentially based on the failure logs, that the worker deployment may not actually be picking up the workflows, as the deployment does not scale down back to 0.

I'm going to try to find some time to debug them to see if anything obvious stands out.

@robholland
Copy link
Contributor

Makes sense to me 👍

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
@keda-automation keda-automation requested a review from a team September 30, 2025 14:24
@zroubalik zroubalik merged commit a34f1c1 into kedacore:main Sep 30, 2025
19 of 22 checks passed
@robcao robcao mentioned this pull request Oct 3, 2025
7 tasks
alt-dima pushed a commit to alt-dima/keda that referenced this pull request Dec 13, 2025
…7079) (kedacore#7080)

* temporal: always set temporal-namespace header on requests (kedacore#7079)

Signed-off-by: Robert Cao <robert.cao@relativity.com>

* changelog

Signed-off-by: Robert Cao <robert.cao@relativity.com>

* fix: reorder changelog

Signed-off-by: Robert Cao <robert.cao@relativity.com>

---------

Signed-off-by: Robert Cao <robert.cao@relativity.com>
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
Co-authored-by: Zbynek Roubalik <zroubalik@gmail.com>
Signed-off-by: Dmitriy Altuhov <altuhovd@gmail.com>
tangobango5 pushed a commit to tangobango5/keda that referenced this pull request Dec 22, 2025
…7079) (kedacore#7080)

* temporal: always set temporal-namespace header on requests (kedacore#7079)

Signed-off-by: Robert Cao <robert.cao@relativity.com>

* changelog

Signed-off-by: Robert Cao <robert.cao@relativity.com>

* fix: reorder changelog

Signed-off-by: Robert Cao <robert.cao@relativity.com>

---------

Signed-off-by: Robert Cao <robert.cao@relativity.com>
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
Co-authored-by: Zbynek Roubalik <zroubalik@gmail.com>
tangobango5 pushed a commit to tangobango5/keda that referenced this pull request Feb 13, 2026
…7079) (kedacore#7080)

* temporal: always set temporal-namespace header on requests (kedacore#7079)

Signed-off-by: Robert Cao <robert.cao@relativity.com>

* changelog

Signed-off-by: Robert Cao <robert.cao@relativity.com>

* fix: reorder changelog

Signed-off-by: Robert Cao <robert.cao@relativity.com>

---------

Signed-off-by: Robert Cao <robert.cao@relativity.com>
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
Co-authored-by: Zbynek Roubalik <zroubalik@gmail.com>
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.

Feature Request(temporal): Allow temporal-namespace header to be set without apiKey

6 participants