Fix DCO plugin trusted_apps not working without skip flags#681
Fix DCO plugin trusted_apps not working without skip flags#681vigneshakaviki wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
✅ Deploy Preview for k8s-prow ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
|
|
Welcome @vigneshakaviki! |
|
Hi @vigneshakaviki. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
The trusted_apps configuration was not being applied when both SkipDCOCheckForMembers and SkipDCOCheckForCollaborators were false. The filterTrustedUsers function (which checks trusted_apps via trigger.TrustedUser) was only called when one of these skip flags was enabled, making trusted_apps ineffective on its own. Add len(config.TrustedApps) > 0 to the condition so filterTrustedUsers runs whenever trusted apps are configured, regardless of skip flags. Fixes kubernetes-sigs#606 Signed-off-by: vigneshakaviki <kumarvignesh295@gmail.com>
1ac92b8 to
eabb696
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Prucek, vigneshakaviki The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@vigneshakaviki: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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. I understand the commands that are listed here. |
Summary
trusted_appsconfig having no effect when bothSkipDCOCheckForMembersandSkipDCOCheckForCollaboratorsarefalsefilterTrustedUsers()call was gated behindconfig.SkipDCOCheckForMembers || config.SkipDCOCheckForCollaborators, buttrusted_appsshould work independently of those flagslen(config.TrustedApps) > 0to the condition so trusted apps (e.g.dependabot) are filtered even without the skip flagsFixes #606
Root Cause
In
handle()(pkg/plugins/dco/dco.go),filterTrustedUsers— which processestrusted_appsviatrigger.TrustedUser()— was only invoked when skip flags were enabled:Test plan
should skip dco check for trusted app even without skip flags— configures onlyTrustedApps: ["dependabot"](no skip flags) and verifies adependabot[bot]commit passes DCOgo test ./pkg/plugins/dco/...)