Skip to content

Conversation

@intojhanurag
Copy link
Contributor

@intojhanurag intojhanurag commented Oct 29, 2025

This PR improves the NewPromptForCredentials function by adding validation to handle empty username or password inputs. It ensures users cannot proceed with blank credentials.

Additionally, a new unit test has been added to verify that the function correctly returns an error when either field is left empty.

Screenshot 2025-10-30 000714

@knative-prow knative-prow bot requested review from dsimansk and nainaz October 29, 2025 18:46
@knative-prow knative-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 29, 2025
@knative-prow
Copy link

knative-prow bot commented Oct 29, 2025

Hi @intojhanurag. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@intojhanurag intojhanurag changed the title Add validation and unit test for empty credentials in NewPromptForCredentials Add validation and unit test for empty credentials Oct 29, 2025
@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.64%. Comparing base (0bc91f3) to head (aec3364).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3159      +/-   ##
==========================================
- Coverage   59.39%   55.64%   -3.75%     
==========================================
  Files         134      134              
  Lines       13514    13521       +7     
==========================================
- Hits         8026     7524     -502     
- Misses       4547     5062     +515     
+ Partials      941      935       -6     
Flag Coverage Δ
e2e-tests ?
integration-tests 54.66% <100.00%> (+1.63%) ⬆️
unit-tests 46.71% <100.00%> (-0.03%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@intojhanurag
Copy link
Contributor Author

Hey @gauron99
I’m just curious, I only added one extra test case and a small validation check for empty credentials, but it seems a lot of E2E and integration tests started failing.
My local make test passed successfully.
Would love to understand this behavior better.

@gauron99
Copy link
Contributor

gauron99 commented Oct 29, 2025

helm installation is failing, unrelated; its failing everywhere

@intojhanurag
Copy link
Contributor Author

Haha, thank God, I thought I did something blunder 😅

@gauron99
Copy link
Contributor

gauron99 commented Oct 29, 2025

no worries, thats why we have tests to catch any possible "blunders" anyways... this case is not that though. its azure front door. We will rerun tests when the service seems up and running again

@gauron99
Copy link
Contributor

/retest

1 similar comment
@gauron99
Copy link
Contributor

gauron99 commented Nov 2, 2025

/retest

@intojhanurag intojhanurag force-pushed the fix/empty-creds-validation branch from fd05c8c to 92776d6 Compare November 2, 2025 20:16
@intojhanurag
Copy link
Contributor Author

Hey @gauron99 , Is it good to go now ?

@gauron99
Copy link
Contributor

gauron99 commented Nov 4, 2025

you have some third party changes

}
})
}
t.Run("empty username or password returns error", func(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not put this as part of the for loop above?

@intojhanurag intojhanurag force-pushed the fix/empty-creds-validation branch from aec3364 to 5332270 Compare November 4, 2025 12:59
@intojhanurag
Copy link
Contributor Author

you have some third party changes

Yeah , Due to "code styles" failure I ran the goimport -w . command in the repo .

@intojhanurag intojhanurag force-pushed the fix/empty-creds-validation branch from 5332270 to 0bc91f3 Compare November 5, 2025 08:26
@knative-prow
Copy link

knative-prow bot commented Nov 5, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: intojhanurag

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants