Skip to content

Web: Require S3 fields when creating/editing AWS OIDC Integration#39285

Merged
kimlisa merged 7 commits intomasterfrom
lisa/web-update-aws-oidc
Mar 18, 2024
Merged

Web: Require S3 fields when creating/editing AWS OIDC Integration#39285
kimlisa merged 7 commits intomasterfrom
lisa/web-update-aws-oidc

Conversation

@kimlisa
Copy link
Copy Markdown
Contributor

@kimlisa kimlisa commented Mar 13, 2024

part of #38782 (a bug fix)

recommend reviewing by commit

Before merge:

  • requires backend PRs listed ^ issue
  • test e2e

Require filling out S3 fields when creating:
http://192.168.0.103:9002/?path=/story/teleport-integrations-enroll-awsoidc--flow&globals=theme:Light%20Theme
image

Render warning with tooltip if integration is missing s3 fields:
image

Require missing s3 fields if editing integration:
image

Give user ability to edit s3 fields if editing:
image

Stories under Teleport/Integrations

changelog: Require AWS S3 bucket fields when creating/editing AWS OIDC integration in the web UI

@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.

2 similar comments
@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.

@kimlisa kimlisa added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v14 labels Mar 13, 2024
@kimlisa kimlisa force-pushed the lisa/web-update-aws-oidc branch from 5882a8d to 027fe43 Compare March 13, 2024 19:04
@kimlisa
Copy link
Copy Markdown
Contributor Author

kimlisa commented Mar 14, 2024

friendly ping 🙏 @ryanclark @ibeckermayer

Comment on lines +141 to +161
<Box
requiresS3={requiresS3}
px={3}
pt={2}
css={`
border-radius: ${p => p.theme.space[1]}px;
border: 2px solid
${p => {
if (p.requiresS3) {
return p.theme.colors.warning.main;
}
return p.theme.colors.spotBackground[1];
}};
background-color: ${p => {
if (p.requiresS3) {
return p.theme.colors.interactive.tonal.alert[0];
}
return p.theme.colors.spotBackground[0];
}};
`}
>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

At this point, why not use const Whatever = styled(Box)``;


import { requiredBucketName, requiredPrefixName } from './Shared/utils';

export function S3Bucket({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

S3Bucket is a bit ambiguous. Maybe S3BucketConfiguration or S3BucketForm?

Comment on lines +52 to +53
expect(screen.queryByText(script)).not.toBeInTheDocument();
expect(screen.queryByText(checkbox)).not.toBeInTheDocument();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a better way to match these elements vs text? Even resorting to data-testid will ensure these tests don't break if any copy changes

if (inputVal.length < 3 || inputVal.length > 63) {
return {
valid: false,
message: 'only 3-63 characters long',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How does this read in the UI? Should it be Field should be 3-63 characters?

if (!bucketNameRegex.test(inputVal)) {
return {
valid: false,
message: 'only - (in between words), a-z, and 0-9',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This could do with rewording also

Copy link
Copy Markdown
Contributor Author

@kimlisa kimlisa Mar 15, 2024

Choose a reason for hiding this comment

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

i opted to add a tooltip for the error message because it's kinda long. i have too much tooltips now but this is temporary. in another PR i'll have the FieldXXX.tsx to conditionally render tooltip for errors only

image image

@kimlisa kimlisa requested a review from ryanclark March 15, 2024 14:58
@kimlisa kimlisa force-pushed the lisa/web-update-aws-oidc branch from 9bad88b to 3b49cb2 Compare March 15, 2024 15:16
Comment on lines 99 to 101
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it really arbitrary or some cap for something? hurts my heart seeing 63 instead of 64

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, I was wondering about all these random checks and it's all real

https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh AWS, you rascal 🤣

@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from ibeckermayer March 15, 2024 15:33
@kimlisa kimlisa removed the no-changelog Indicates that a PR does not require a changelog entry label Mar 18, 2024
@kimlisa kimlisa enabled auto-merge March 18, 2024 15:47
@kimlisa kimlisa disabled auto-merge March 18, 2024 15:53
@kimlisa kimlisa force-pushed the lisa/web-update-aws-oidc branch from bdefe93 to af8e4f5 Compare March 18, 2024 15:55
@kimlisa kimlisa enabled auto-merge March 18, 2024 15:55
@kimlisa kimlisa added this pull request to the merge queue Mar 18, 2024
Merged via the queue into master with commit 49ac0c5 Mar 18, 2024
@kimlisa kimlisa deleted the lisa/web-update-aws-oidc branch March 18, 2024 16:40
@public-teleport-github-review-bot
Copy link
Copy Markdown

@kimlisa See the table below for backport results.

Branch Result
branch/v14 Failed
branch/v15 Create PR

kimlisa added a commit that referenced this pull request Mar 18, 2024
…9285)

* Add s3 fields to URL param

* Add s3 fields to integration awsoidc type

* Create S3Bucket component, utils, fixtures

* Allow s3 fields to be editable

* Give warning status if s3 fields are not defined

* Require s3 fields when creating

* Update types, story, language, address CRs
github-merge-queue Bot pushed a commit that referenced this pull request Mar 18, 2024
…on (#39513)

* Web: Require S3 fields when creating/editing AWS OIDC Integration (#39285)

* Add s3 fields to URL param

* Add s3 fields to integration awsoidc type

* Create S3Bucket component, utils, fixtures

* Allow s3 fields to be editable

* Give warning status if s3 fields are not defined

* Require s3 fields when creating

* Update types, story, language, address CRs

* Fix import
@fheinecke fheinecke mentioned this pull request Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants