Skip to content

Conversation

@ryu-man
Copy link
Contributor

@ryu-man ryu-man commented Jan 1, 2026

Addresses #4997

  • implement server-side logic
  • show a yellow update icon to indicate update in k8s settings
  • fix issue where server is re-deployed when navigating to /admin/mcp-servers/c/[x]/instance/[y]/details route
Screenshot 2025-12-31 181940

@ryu-man ryu-man marked this pull request as ready for review January 1, 2026 00:43
@ryu-man
Copy link
Contributor Author

ryu-man commented Jan 1, 2026

@ivyjeong13 I am not sure if it is better to add an "Update k8s setting" item to the dots menu; however, I lean toward that. What do you think?

Copy link
Contributor

@thedadams thedadams left a comment

Choose a reason for hiding this comment

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

You would also need to run go generate to fix the Go listing.

Comment on lines 3054 to 3056
if err := req.Storage.Status().Update(req.Context(), &server); err != nil {
return fmt.Errorf("failed to update server status: %w", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Typically, we wouldn't want to do this in the API. Instead, let the controller update the field.

I think it's fine if you want to ensure the value is true when returning from the API, but better to let the controller update the database.

Copy link
Contributor

Choose a reason for hiding this comment

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

This file should be deleted.

The way our controller framework works, the two controllers you wrote (one for servers and one for catalog entries) will do the correct thing when the k8s settings change.

}

// DetectK8sSettingsDrift detects when servers created from this catalog entry need redeployment with new K8s settings
func DetectK8sSettingsDrift(req router.Request, _ router.Response) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be deleted.

The way our controller framework works, the controller you added for MCP servers will do the right thing.

Comment on lines 14 to 19
func isServerNotRunningError(err error) bool {
if err == nil {
return false
}
return strings.Contains(err.Error(), "is not running")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to create a type for this and use errors.As or errors.Is then match on the string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please let me know if the change I made is what you mean

// NeedsUpdate indicates whether this composite catalog entry's component snapshots have drifted from their sources.
NeedsUpdate bool `json:"needsUpdate,omitempty"`
// NeedsK8sUpdate indicates whether servers created from this catalog entry need redeployment with new K8s settings
NeedsK8sUpdate bool `json:"needsK8sUpdate,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on what I saw in the implementation, this can be removed. It seems like it was used to track when all servers deployed from this entry should be upgraded, but that is already handled by the MCP server controllers.

PowerUserWorkspaceID string `json:"powerUserWorkspaceID,omitempty"`
PowerUserID string `json:"powerUserID,omitempty"`
NeedsUpdate bool `json:"needsUpdate,omitempty"`
NeedsK8sUpdate bool `json:"needsK8sUpdate,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this can also be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I delete this I do get the following error in mcp.go line 159

unknown field NeedsK8sUpdate in struct literal of type "github.com/obot-platform/obot/apiclient/types".MCPServerCatalogEntry

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to track this for catalog entries. There are no deployments for catalog entries, so this field and all of its references should be removed.

@cjellick
Copy link
Contributor

cjellick commented Jan 6, 2026

can I get a quick loom of this working end to end, including updating the k8s settings for the server and seeing it successfully redeploy

@ryu-man
Copy link
Contributor Author

ryu-man commented Jan 6, 2026

Yep, working on that

@ryu-man ryu-man requested a review from thedadams January 6, 2026 17:54
@ryu-man
Copy link
Contributor Author

ryu-man commented Jan 6, 2026

@cjellick
Copy link
Contributor

cjellick commented Jan 6, 2026

@ryu-man - looking good. a couple things:

  1. in the Status dropdown filter, can we add entries for the two different types of updates available? id like to be able to filter to servers that JUST need a k8s update or JUST need a catalog update
  2. Somewhat related, I want to make sure we can bulk update by checking more that one row and clicking a button.

Then end goal here is if i have a ton of seves and change the default k8s resources, i can easily update them all.

@ryu-man
Copy link
Contributor Author

ryu-man commented Jan 6, 2026

@cjellick Working on that

@ryu-man
Copy link
Contributor Author

ryu-man commented Jan 6, 2026

@ryu-man - looking good. a couple things:

  1. in the Status dropdown filter, can we add entries for the two different types of updates available? id like to be able to filter to servers that JUST need a k8s update or JUST need a catalog update
  2. Somewhat related, I want to make sure we can bulk update by checking more that one row and clicking a button.

Then end goal here is if i have a ton of seves and change the default k8s resources, i can easily update them all.

@cjellick loom for request changes.

https://www.loom.com/share/c5d286dd82fc4f8693fd2530fa45e941

@ryu-man
Copy link
Contributor Author

ryu-man commented Jan 6, 2026

@cjellick Currently, if a user selects only "Kubernetes Upgrade Available," those servers with both server and Kubernetes will not be included, because currently the table filters allow matches only against a single value. if this PR can wait a little bit longer, I can work on a solution; otherwise, this can tracked in a separate PR if necessary

@cjellick
Copy link
Contributor

cjellick commented Jan 6, 2026

@ryu-man this pr can wait for you to find a solution.

Regarding your loom, here's some feedback:

  • Instead of saying "Kubernetes Upgrade Available", let's say "Scheduling Update Available"
  • Instead of saying "Upgrade Available", let's New Server Config Available"
    And then make the action buttons match that, so like "Update Scheduling Configuration" and "Update Server"

Let me see a loom for that bc I'm not 100% sure itll look good.

Also, since we now have explicit text for the status, i think we can just drop the upgrade icons...they were there so that that column could do "double duty" of health status and upgrade status. so now I think we need two separate columns:

  • Health
  • Update Status

@ryu-man
Copy link
Contributor Author

ryu-man commented Jan 7, 2026

@cjellick loom for the above requested changes + new status filteration approach

https://www.loom.com/share/884386f2ec324728a249792de4b1ed12

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