Skip to content

Fix DCO plugin trusted_apps not working without skip flags#681

Open
vigneshakaviki wants to merge 1 commit intokubernetes-sigs:mainfrom
vigneshakaviki:fix/dco-trusted-apps
Open

Fix DCO plugin trusted_apps not working without skip flags#681
vigneshakaviki wants to merge 1 commit intokubernetes-sigs:mainfrom
vigneshakaviki:fix/dco-trusted-apps

Conversation

@vigneshakaviki
Copy link
Copy Markdown

@vigneshakaviki vigneshakaviki commented Apr 14, 2026

Summary

  • Fix trusted_apps config having no effect when both SkipDCOCheckForMembers and SkipDCOCheckForCollaborators are false
  • The filterTrustedUsers() call was gated behind config.SkipDCOCheckForMembers || config.SkipDCOCheckForCollaborators, but trusted_apps should work independently of those flags
  • Add len(config.TrustedApps) > 0 to the condition so trusted apps (e.g. dependabot) are filtered even without the skip flags

Fixes #606

Root Cause

In handle() (pkg/plugins/dco/dco.go), filterTrustedUsers — which processes trusted_apps via trigger.TrustedUser() — was only invoked when skip flags were enabled:

// Before (broken):
if config.SkipDCOCheckForMembers || config.SkipDCOCheckForCollaborators {
    commitsMissingDCO, err = filterTrustedUsers(...)
}

// After (fixed):
if config.SkipDCOCheckForMembers || config.SkipDCOCheckForCollaborators || len(config.TrustedApps) > 0 {
    commitsMissingDCO, err = filterTrustedUsers(...)
}

Test plan

  • Added test case: should skip dco check for trusted app even without skip flags — configures only TrustedApps: ["dependabot"] (no skip flags) and verifies a dependabot[bot] commit passes DCO
  • All existing DCO tests pass (go test ./pkg/plugins/dco/...)
=== RUN   TestHandlePullRequest
--- PASS: TestHandlePullRequest (0.00s)
    --- PASS: .../should_skip_dco_check_for_trusted_app_even_without_skip_flags (0.00s)
    ... (17 other subtests all PASS)
PASS
ok  	sigs.k8s.io/prow/pkg/plugins/dco	0.019s

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 14, 2026

Deploy Preview for k8s-prow ready!

Name Link
🔨 Latest commit eabb696
🔍 Latest deploy log https://app.netlify.com/projects/k8s-prow/deploys/69ddb160ef375900080551cb
😎 Deploy Preview https://deploy-preview-681--k8s-prow.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the area/plugins Issues or PRs related to prow's plugins for the hook component label Apr 14, 2026
@k8s-ci-robot k8s-ci-robot requested a review from cjwagner April 14, 2026 03:11
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Apr 14, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: vigneshakaviki / name: vigneshakaviki (eabb696)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Apr 14, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @vigneshakaviki!

It looks like this is your first PR to kubernetes-sigs/prow 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/prow has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

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

Details

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 14, 2026
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>
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 14, 2026
Copy link
Copy Markdown
Member

@Prucek Prucek left a comment

Choose a reason for hiding this comment

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

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 23, 2026
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 23, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Prucek, vigneshakaviki
Once this PR has been reviewed and has the lgtm label, please assign cjwagner for approval. For more information see the Code Review Process.

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

Details 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

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@vigneshakaviki: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-prow-integration eabb696 link true /test pull-prow-integration

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.

Details

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/plugins Issues or PRs related to prow's plugins for the hook component cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DCO plugin trusted_apps config not working

3 participants