feat(machine-id): Add bot instance details page (web)#55055
Merged
nicholasmarais1158 merged 38 commits intomasterfrom May 27, 2025
Merged
feat(machine-id): Add bot instance details page (web)#55055nicholasmarais1158 merged 38 commits intomasterfrom
nicholasmarais1158 merged 38 commits intomasterfrom
Conversation
strideynet
reviewed
May 23, 2025
strideynet
reviewed
May 23, 2025
zmb3
approved these changes
May 23, 2025
| "strconv" | ||
| "time" | ||
|
|
||
| yaml "github.com/ghodss/yaml" |
Collaborator
There was a problem hiding this comment.
I can't keep track of which YAML package to use anymore, and I see this package is already a dependency of lib/web so I think you got it right. Worth noting that ghodss/yaml seems less common in our codebase though.
teleport on master [$!] ➜ ag --go -Q --count 'gopkg.in/yaml' | wc -l
58
teleport on master [$!] ➜ ag --go -Q --count 'ghodss/yaml' | wc -l
21
| clusterName := env.server.ClusterName() | ||
|
|
||
| botName := "test-bot" | ||
| instanceId := uuid.New().String() |
Collaborator
There was a problem hiding this comment.
Suggested change
| instanceId := uuid.New().String() | |
| instanceID := uuid.New().String() |
| }, | ||
| Status: &machineidv1.BotInstanceStatus{}, | ||
| }, protocmp.Transform(), protocmp.IgnoreFields(&machineidv1.BotInstance{}, "metadata"))) | ||
| assert.Equal(t, resp.Yaml, fmt.Sprintf("kind: bot_instance\nmetadata:\n name: %[1]s\n revision: %[2]s\nspec:\n bot_name: test-bot\n instance_id: %[1]s\nstatus: {}\nversion: v1\n", instanceId, resp.BotInstance.Metadata.Revision)) |
Collaborator
There was a problem hiding this comment.
Suggested change
| assert.Equal(t, resp.Yaml, fmt.Sprintf("kind: bot_instance\nmetadata:\n name: %[1]s\n revision: %[2]s\nspec:\n bot_name: test-bot\n instance_id: %[1]s\nstatus: {}\nversion: v1\n", instanceId, resp.BotInstance.Metadata.Revision)) | |
| assert.YAMLEq(t, resp.Yaml, fmt.Sprintf("kind: bot_instance\nmetadata:\n name: %[1]s\n revision: %[2]s\nspec:\n bot_name: test-bot\n instance_id: %[1]s\nstatus: {}\nversion: v1\n", instanceId, resp.BotInstance.Metadata.Revision)) |
This will be slightly more robust.
|
|
||
| import { useGetBotInstance } from '../hooks'; | ||
|
|
||
| const docsURL = |
Collaborator
There was a problem hiding this comment.
Suggested change
| const docsURL = | |
| const docsUrl = |
I know it's confusing, but our convention is for acronyms to be all caps in Go, and first-letter caps in Typescript.
Base automatically changed from
nickmarais/feat/53584-bot-instances-list
to
master
May 27, 2025 08:22
…-details # Conflicts: # lib/web/apiserver.go # lib/web/machineid.go # lib/web/machineid_test.go # web/packages/teleport/src/BotInstances/BotInstances.tsx # web/packages/teleport/src/BotInstances/List/BotInstancesList.tsx # web/packages/teleport/src/config.ts # web/packages/teleport/src/features.tsx # web/packages/teleport/src/services/bot/bot.ts # web/packages/teleport/src/services/bot/consts.ts # web/packages/teleport/src/services/bot/types.ts # web/packages/teleport/src/test/helpers/botInstances.ts
strideynet
approved these changes
May 27, 2025
Contributor
|
@nicholasmarais1158 See the table below for backport results.
|
nicholasmarais1158
added a commit
that referenced
this pull request
Jun 2, 2025
* Add navigation item * Add bot instances page * Populate page info * Add missing license header * Update bot instance nav icon * Reword hint text * Add active at timestamp tooltip * Rename active at header * Remove copy and sort * Lint and test fixes * Support backend search term filtering * Simplify code * Add search term filter auth tests * Allow disabling `<Table />` loading indicator * Rework frontend to use backend paging and filter (remove sort) * Fix lint (ts) * Remove unused BotInstances icon * Add URL state (page and search) * Use nil-safe getters on protos * Fix crash on items w/o heartbeat data * Add bot instance details page * Fix lint (ts) * Fix formatting (prettier) * Fix yaml time serialisation * Rename ButtonIcon from jsx to tsx * Convert ButtonIcon to tsx * Fix copy button on row * Correct casing * Use `assert.YAMLEq` * Revert changes to ButtonIcon - too big for this PR
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Jun 3, 2025
* feat(machine-id): Bot instances list (web) (#54925) * Add navigation item * Add bot instances page * Populate page info * Add missing license header * Update bot instance nav icon * Reword hint text * Add active at timestamp tooltip * Rename active at header * Remove copy and sort * Lint and test fixes * Support backend search term filtering * Simplify code * Add search term filter auth tests * Allow disabling `<Table />` loading indicator * Rework frontend to use backend paging and filter (remove sort) * Fix lint (ts) * Remove unused BotInstances icon * Add URL state (page and search) * Use nil-safe getters on protos * Fix crash on items w/o heartbeat data # Conflicts: # api/gen/proto/go/teleport/machineid/v1/bot_instance_service.pb.go * Update protos grpc * feat(machine-id): Add bot instance details page (web) (#55055) * Add navigation item * Add bot instances page * Populate page info * Add missing license header * Update bot instance nav icon * Reword hint text * Add active at timestamp tooltip * Rename active at header * Remove copy and sort * Lint and test fixes * Support backend search term filtering * Simplify code * Add search term filter auth tests * Allow disabling `<Table />` loading indicator * Rework frontend to use backend paging and filter (remove sort) * Fix lint (ts) * Remove unused BotInstances icon * Add URL state (page and search) * Use nil-safe getters on protos * Fix crash on items w/o heartbeat data * Add bot instance details page * Fix lint (ts) * Fix formatting (prettier) * Fix yaml time serialisation * Rename ButtonIcon from jsx to tsx * Convert ButtonIcon to tsx * Fix copy button on row * Correct casing * Use `assert.YAMLEq` * Revert changes to ButtonIcon - too big for this PR * chore: Export feature for enterprise (bot instance details) (#55177)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The change adds a details page for bot instances. Clicking a row on the bot instance list opens the details page. This page can be deep linked from other parts of the app (if necessary) with a bot name and instance id.
Updates #53584
Changelog: View details for a bot instance
Changes
GET /webapi/sites/:site/machine-id/bot/:name/bot-instance/:id- also returns the yaml representationDemo (network throttled)
Screen.Recording.2025-05-22.at.16.41.37.mov