Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(secret): add source secrets #82

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

abhinandan13jan
Copy link
Contributor

@abhinandan13jan abhinandan13jan commented Jan 15, 2025

Fixes

https://issues.redhat.com/browse/HAC-5834

Description

PR ready for review

Type of change

  • Feature
  • Bugfix
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Screen shots / Gifs for design review

Screenshot 2025-01-20 at 6 12 15 PM Screenshot 2025-01-20 at 6 10 38 PM Screenshot 2025-01-20 at 6 09 51 PM Screenshot 2025-01-20 at 6 09 42 PM

How to test or reproduce?

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@abhinandan13jan abhinandan13jan changed the title [WIP] feat(secret): add source secrets feat(secret): add source secrets Jan 20, 2025
Copy link

codecov bot commented Jan 20, 2025

Codecov Report

Attention: Patch coverage is 55.88235% with 30 lines in your changes missing coverage. Please review.

Project coverage is 80.07%. Comparing base (93f0fc3) to head (25eb65f).

Files with missing lines Patch % Lines
src/utils/validation-utils.ts 34.48% 19 Missing ⚠️
src/components/Secrets/SecretForm.tsx 10.00% 9 Missing ⚠️
src/components/Secrets/SecretModal.tsx 83.33% 1 Missing ⚠️
src/utils/create-utils.ts 90.90% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (55.88%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #82      +/-   ##
==========================================
+ Coverage   80.06%   80.07%   +0.01%     
==========================================
  Files         544      544              
  Lines       21155    21189      +34     
  Branches     5326     5072     -254     
==========================================
+ Hits        16937    16967      +30     
- Misses       4194     4198       +4     
  Partials       24       24              
Flag Coverage Δ
unittests 80.07% <55.88%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...c/components/Secrets/SecretsForm/AddSecretForm.tsx 83.33% <100.00%> (ø)
...s/Secrets/SecretsForm/MultiImageCredentialForm.tsx 88.00% <ø> (ø)
...mponents/Secrets/SecretsForm/SecretTypeSubForm.tsx 82.53% <ø> (+3.17%) ⬆️
...omponents/Secrets/SecretsForm/SourceSecretForm.tsx 100.00% <ø> (ø)
.../components/Secrets/utils/service-account-utils.ts 97.05% <100.00%> (ø)
...-value-file-input-field/KeyValueFileInputField.tsx 84.00% <ø> (+1.14%) ⬆️
src/types/secret.ts 95.83% <100.00%> (ø)
src/components/Secrets/SecretModal.tsx 92.72% <83.33%> (+0.27%) ⬆️
src/utils/create-utils.ts 76.72% <90.90%> (+1.46%) ⬆️
src/components/Secrets/SecretForm.tsx 81.11% <10.00%> (-2.03%) ⬇️
... and 1 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 93f0fc3...25eb65f. Read the comment docs.

@sahil143 sahil143 requested a review from JoaoPedroPP January 23, 2025 10:03
@JoaoPedroPP
Copy link
Contributor

JoaoPedroPP commented Jan 23, 2025

LGTM

All the modifications are working properly.
The conflicts are related to #61. Please rebase the branch and this will be following issues

  • src/components/Secrets/SecretForm.tsx
    1. I believe it's a mix of both. From my side it's important to keep options = []
    2. Also a mix of both. This time is important to keep ...getSupportedPartnerTaskKeyValuePairs(value, optionsValues)
  • src/components/Secrets/SecretModal.tsx
    1. Keep yours modification, just add the BuildTimeSecret in the import from types
  • src/components/Secrets/tests_/SecretModal.spec.tsx
    1. Keep your modification, just add SecretType in the import from types
    2. Keep both and remove the additional describe ('SecretForm', () => {

Probably there are other things to fix since there were changes on how the build time secret was model

Is it possible to cover the missing lines in Codecov/patch?

@abhinandan13jan
Copy link
Contributor Author

LGTM

All the modifications are working properly. The conflicts are related to #61. Please rebase the branch and this will be following issues

  • src/components/Secrets/SecretForm.tsx

    1. I believe it's a mix of both. From my side it's important to keep options = []
    2. Also a mix of both. This time is important to keep ...getSupportedPartnerTaskKeyValuePairs(value, optionsValues)
  • src/components/Secrets/SecretModal.tsx

    1. Keep yours modification, just add the BuildTimeSecret in the import from types
  • src/components/Secrets/tests_/SecretModal.spec.tsx

    1. Keep your modification, just add SecretType in the import from types
    2. Keep both and remove the additional describe ('SecretForm', () => {

Probably there are other things to fix since there were changes on how the build time secret was model

Is it possible to cover the missing lines in Codecov/patch?

@JoaoPedroPP thanks for the references JP, I'll look into these

@abhinandan13jan abhinandan13jan force-pushed the add-source-secret branch 4 times, most recently from 8a9c729 to 85f9b23 Compare January 29, 2025 18:19
Copy link
Contributor

@StanislavJochman StanislavJochman left a comment

Choose a reason for hiding this comment

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

LGTM

@sahil143
Copy link
Collaborator

/test

Comment on lines +132 to +142
{currentType === SecretTypeDropdownLabel.source && <SourceSecretForm />}
{currentType !== SecretTypeDropdownLabel.source && (
<KeyValueFileInputField
required
name={
currentType === SecretTypeDropdownLabel.opaque ? 'opaque.keyValues' : 'image.keyValues'
}
entries={defaultKeyValues}
disableRemoveAction={values.opaque.keyValues.length === 1}
/>
)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

you need to test this conditional rendering to make the codecov happy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added by mocking the component

@testcara
Copy link
Contributor

LGTM

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.

5 participants