Skip to content

fix: [Core] Deployment resolution selects running targets#892

Open
rpanackal wants to merge 6 commits into
mainfrom
fix/resolve-to-running-deploy
Open

fix: [Core] Deployment resolution selects running targets#892
rpanackal wants to merge 6 commits into
mainfrom
fix/resolve-to-running-deploy

Conversation

@rpanackal

Copy link
Copy Markdown
Member

Context

Deployment resolution at the moment picks the first deployment under given predicate. A predicate being a scenario, or model. This do not check for the status of the deployment. Therefore, if there are stopped deployments, it might be selected to construct the deployment url.

Feature scope:

  • Insert a filter to only pick out deployments with target status running.

Note: Regular "status" points to the current status, but not the target state. "targetStatus" points to the expected state of the deployment avoiding the situation where a deployment get picked that will soon be obselete.

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Aligned changes with the JavaScript SDK
  • Documentation updated
  • Release notes updated

@rpanackal rpanackal self-assigned this Jun 9, 2026
.extracting(AiDeployment::getId, AiDeployment::getTargetStatus)
.contains(
tuple("d2a491b5010620b0", AiDeployment.TargetStatusEnum.STOPPED),
tuple("d4b1396b84c1944d", AiDeployment.TargetStatusEnum.RUNNING));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why yould the cache contain the STOPPED deployment?

@rpanackal rpanackal Jun 9, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Because the cache loads all deployments as returned by Deployments API. Currently, the cache is for all deployments under a resource group.

But you are right. We can load the cache selectively instead.

Essentially, instead of caching all deployments, we could only cache RUNNING deployments

@rpanackal rpanackal Jun 9, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is that preferrable to you? Do you see any logic that relies on the cache being an exhaustive list of deployments that might break?

I am a bit skeptical about touching a global cache,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No reason to cache deployments that can't be used

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.

3 participants