Skip to content

Add [disabled] Bots list view#36845

Merged
michellescripts merged 1 commit intomasterfrom
michelle/bots
Feb 1, 2024
Merged

Add [disabled] Bots list view#36845
michellescripts merged 1 commit intomasterfrom
michelle/bots

Conversation

@michellescripts
Copy link
Copy Markdown
Contributor

@michellescripts michellescripts commented Jan 18, 2024

This PR adds a new access management menu item: Bots and the ability to delete a bot from the list. Currently, it is disabled (false in Features) until we integrate the create workflows. Until then, "enroll" will also be disabled.

This PR uses the old DataTable styles rather than the new Resources look/feel. This expedites the integrations across the team; a follow-up PR will start to tackle the new style. We are also only showing the name, roles and options button at this time.

Pagination for bots is MVP - we will fetch all the bots in the API and return them to the UI for pagination. This is due to a limitation of our Bot Service, which needs to fetch ListUsers to get bots. The team is aware of the pitfalls of this approach and will be revisiting this in the future. I left a comment on the Bot service list method.

Screenshot 2024-01-19 at 11 17 09 AM

Supports #34260

e-sibling: https://github.com/gravitational/teleport.e/pull/3294

@michellescripts michellescripts force-pushed the michelle/bots branch 2 times, most recently from 46837fb to 3618f23 Compare January 18, 2024 21:16
@michellescripts michellescripts marked this pull request as ready for review January 18, 2024 21:18
@github-actions
Copy link
Copy Markdown
Contributor

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

@github-actions github-actions Bot requested review from klizhentas and r0mant January 18, 2024 21:19
@michellescripts michellescripts requested review from kimlisa and ryanclark and removed request for klizhentas and r0mant January 19, 2024 00:57
@michellescripts michellescripts changed the title add bots UI, disabled Add [disabled] Bots list view Jan 19, 2024
@github-actions
Copy link
Copy Markdown
Contributor

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

@github-actions
Copy link
Copy Markdown
Contributor

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

Comment thread web/packages/teleport/src/Bots/List/ActionCell.tsx Outdated
Comment thread web/packages/teleport/src/Bots/List/ActionCell.tsx Outdated
Comment thread web/packages/teleport/src/Bots/List/BotList.tsx Outdated
Comment thread web/packages/teleport/src/Bots/List/Bots.tsx Outdated
Comment thread web/packages/teleport/src/Bots/List/Bots.tsx Outdated
Comment thread web/packages/teleport/src/services/bot/types.ts Outdated
Comment thread web/packages/teleport/src/teleportContext.tsx Outdated
kimlisa
kimlisa previously approved these changes Jan 19, 2024
Copy link
Copy Markdown
Contributor

@kimlisa kimlisa left a comment

Choose a reason for hiding this comment

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

just some nits

Comment thread lib/web/machineid_test.go Outdated
Comment thread web/packages/teleport/src/Bots/List/ActionCell.tsx Outdated
Comment thread web/packages/teleport/src/Bots/List/BotList.tsx Outdated
Comment thread web/packages/teleport/src/services/bot/bot.ts Outdated
Comment thread web/packages/teleport/src/services/bot/bot.ts Outdated
Comment thread web/packages/teleport/src/Bots/types.ts Outdated
Comment thread web/packages/teleport/src/Bots/List/BotList.tsx Outdated
Comment thread web/packages/teleport/src/config.ts
Comment thread web/packages/teleport/src/features.tsx Outdated
Comment thread web/packages/teleport/src/services/bot/types.ts Outdated
Comment thread web/packages/teleport/src/services/bot/consts.ts Outdated
@michellescripts
Copy link
Copy Markdown
Contributor Author

@kimlisa @ryanclark temporarily converting back to draft status. This design wasn't intended to see the light of day (rather just used to speed up the integration), but we're pivoting and using DataTable as the MVP. Let me clean this up, and I'll reopen/re-request!

@michellescripts michellescripts marked this pull request as draft January 22, 2024 20:50
@michellescripts michellescripts dismissed kimlisa’s stale review January 22, 2024 20:51

will re-request when ready

@michellescripts michellescripts force-pushed the michelle/bots branch 4 times, most recently from 46f7b2e to eef9c7a Compare January 29, 2024 22:48
Comment thread web/packages/teleport/src/services/bot/consts.ts Outdated
Comment thread web/packages/teleport/src/services/bot/bot.ts Outdated
Comment thread web/packages/teleport/src/config.ts
@michellescripts michellescripts force-pushed the michelle/bots branch 5 times, most recently from 9d15376 to 5b1ed7d Compare January 30, 2024 16:44
@zmb3
Copy link
Copy Markdown
Collaborator

zmb3 commented Jan 30, 2024

/excludeflake *

- in original data table view
@michellescripts michellescripts added this pull request to the merge queue Feb 1, 2024
Merged via the queue into master with commit 0ba920a Feb 1, 2024
@michellescripts michellescripts deleted the michelle/bots branch February 1, 2024 17:27
michellescripts added a commit that referenced this pull request Feb 12, 2024
- in original data table view
michellescripts added a commit that referenced this pull request Feb 13, 2024
- in original data table view
michellescripts added a commit that referenced this pull request Feb 16, 2024
- in original data table view
github-merge-queue Bot pushed a commit that referenced this pull request Feb 16, 2024
* Add endpoint to get bots by name (#37412)

* Add endpoint to get bots by name

* Lint

* Fix test method's name

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

---------

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

* Backend supporting changes for Bot creation flow (#37348)

* Add bot ui labels and github join token

* Use strings.HasPrefix instead of includes

* Add `ssh` to label

* Add bot join token endpoint

* Lint

* Fix comment typo

Co-authored-by: Bartosz Leper <bartosz.leper@goteleport.com>

* Fix comment typo

Co-authored-by: Bartosz Leper <bartosz.leper@goteleport.com>

* Improve webUIFlowLabelKey comment

---------

Co-authored-by: Bartosz Leper <bartosz.leper@goteleport.com>

* add bots UI, disabled (#36845)

- in original data table view

* Add Bot + GitHub Actions SSH UI Flow (#37443)

* add bots UI, disabled

- in original data table view

* Add bot creation UI

* Remove duplicated types

* add bots UI, disabled

- in original data table view

* Fix types and tests

* Use bot join token api endpoint

* Fix tests

* Linting and small fixes

* Fix tests

* Add missing licenses

* Improve styles, error messages, etc

* Remove clusterId from bot routes

* Undo enabling feature

* Remove unused join role bot

* Rename var

* Reuse makeListBot

* Add missing type

* Revert MachineIDIntegrationSection for now

* Lint

* Apply suggestions from code review - fix typos

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

* Remove kubernetes section fromm example yaml

* Remove border color from reftype selector

* Small changes to address code review

* Use setAttempt

* add try/catch block when parsing repo addresses

* Improve tests;remove unecessary fragment

* Use gap in flex. Fix typo

* Lint fix

* Drop "ex" from input placeholders

* Add stories for no perm and bot picker

* Add copy to explain wrkflow name limits

* fix setCurentStep

* Fix invalid host error rendering

* Use PascalCase for error components

* Improve field name validation

* Remove unecessary comments

* Update copy and minor style change

---------

Co-authored-by: Michelle Bergquist <michelle.bergquist@goteleport.com>
Co-authored-by: Noah Stride <noah.stride@goteleport.com>

* add bot edit-role flow (#37828)

* add bot edit-role flow

* only send masked/updated fields

* Add GitHub Actions bot view (#37852)

* add bots UI, disabled

- in original data table view

* Add bot creation UI

* Remove duplicated types

* add bots UI, disabled

- in original data table view

* Fix types and tests

* Use bot join token api endpoint

* Fix tests

* Linting and small fixes

* Fix tests

* Add missing licenses

* Improve styles, error messages, etc

* Remove clusterId from bot routes

* Undo enabling feature

* Remove unused join role bot

* Rename var

* Reuse makeListBot

* Add missing type

* Revert MachineIDIntegrationSection for now

* Lint

* Apply suggestions from code review - fix typos

Co-authored-by: Noah Stride <noah.stride@goteleport.com>

* Remove kubernetes section fromm example yaml

* Remove border color from reftype selector

* Small changes to address code review

* Use setAttempt

* add try/catch block when parsing repo addresses

* Improve tests;remove unecessary fragment

* Use gap in flex. Fix typo

* Lint fix

* Drop "ex" from input placeholders

* Add stories for no perm and bot picker

* Add copy to explain wrkflow name limits

* fix setCurentStep

* Fix invalid host error rendering

* Use PascalCase for error components

* Improve field name validation

* Remove unecessary comments

* Add bot type by label

* Add bot view...

* Show view gh actions yaml only for gh bots

* Use existing pattern for operations

* Add story and missing license

* Fix typos

Co-authored-by: Michelle Bergquist <11967646+michellescripts@users.noreply.github.com>

---------

Co-authored-by: Michelle Bergquist <michelle.bergquist@goteleport.com>
Co-authored-by: Noah Stride <noah.stride@goteleport.com>
Co-authored-by: Michelle Bergquist <11967646+michellescripts@users.noreply.github.com>

* Add buttons to download and copy to clipboard content to `TextEditor` (#37333)

* Add editor buttons

* Set icon size

* Move downloadObject to OSS

* remove unused test-id

* Use values from theme

* Fix buttons positioning

* Convert jsx files to tsx

* Use const instead of var

* Add z-index to buttons

* Add license

* Improvements to Bot resource (additional validation and label propagation) (#38013)

* PRevent creating bots with an empty string role

* Propagate labels to Bot user and vice versa

* Extract slice declaration for nonPropagatedLabels

* Fixed web tests relying on empty string roles

* Use "set" instead of slice for nonPropagatedLabels

* Make testing of empty string handling more thorough

* add role assertions to create

* Appease linter as to want/got order

---------

Co-authored-by: Michelle Bergquist <michelle.bergquist@goteleport.com>

* Add bot permissions and turn on feature (#37943)

* Fix makeBot labels (#38176)

---------

Co-authored-by: matheus <matheus.battirola@goteleport.com>
Co-authored-by: Noah Stride <noah.stride@goteleport.com>
Co-authored-by: Bartosz Leper <bartosz.leper@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/lg ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants