fix(site): CredentialField: mask api key after submit (#25848) - #27210
Closed
jakehwll wants to merge 1 commit into
Closed
fix(site): CredentialField: mask api key after submit (#25848)#27210jakehwll wants to merge 1 commit into
jakehwll wants to merge 1 commit into
Conversation
Fixes CODAGT-525 * Re-masks the field after submit * Sets font to monospaced for legibility * Extracts `createDeferred` to `testHelpers` (cherry picked from commit 7195be8)
Contributor
Author
|
Closed to favour a smaller test change, this seems like too big of a refactor to bring back without testing. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Manual backport of #25848 to
release/2.34.Original PR: #25848 — fix(site): CredentialField: mask api key after submit (fixes CODAGT-525)
Cherry-picked commit:
7195be87b1fcf4946bad2ad308a029503a32b1a0Why this backport
release/2.34still has the pre-refactorProviderFormstories, includingAddBedrockWithoutStaticCredentials, whose interaction test asserts:Formik invokes
onSubmit(values, formikHelpers)with two arguments, sotoHaveBeenCalledWithnever matches and the Chromatic/storybook interaction test fails deterministically. This breaks storybook CI for any PR targetingrelease/2.34(e.g. the #27083 backport #27144).#25848 already fixed this on
mainandrelease/2.35by wrappingonSubmitso the spy receives onlyvalues. This backport brings that fix (and the underlying credential-masking change) torelease/2.34.Cherry-pick conflict resolution
The provider files (
ProviderForm.tsx,ProviderForm.stories.tsx,CredentialField.tsx,deferred.ts, etc.) applied cleanly. The only conflict was insite/src/pages/AgentsPage/AgentChatPage.test.ts:createDeferredto#/testHelpers/deferredand importing it instead of defining it inline.main-only drift (agetWorkspaceOptionsWithLinkedWorkspacetest andMockUserOwner/MockWorkspaceimports) that does not exist onrelease/2.34.Resolution: added the
createDeferredimport, removed the inlinecreateDeferred/Deferreddefinition, and dropped the unrelated drift.Verified on 2.34:
ProviderFormstorybook stories (15) andAgentChatPage/useChatDraftAttachmentsunit tests (66) pass; changed files type-check and lint cleanly.