Skip to content

Allow Bots to be Whitelisted and Affiliated Automatically #284

Closed

Description

@jpalmerLinuxFoundation

Summary
When a corporate entity whitelists a bot for their project, then EasyCLA needs to

  1. Add a user record associated with that bot associated
  • cla-*-users.user_company_id equals company_id that whitelisted the bot
  • cla-*-users.user_github_id equals GitHub API response {"id": #######}
  • cla-*-users.user_github_username equals GitHub API response {"login": whitelisted_bot_name}
  • cla-*-users.note equals "[date] Added as part of [cla-*-projects.project_name], whitelisted by [cla-*-companies.company_name]
  1. Add a signature record for the new bot's user
  • cla-*-signatures.signature_user_ccla_company_id equals [cla-*-companies.company_id] that whitelisted the bot
  • cla-*-signatures.signature_signed equals true
  • cla-*-signatures.signature_approved equals true
  • cla-*-signatures.signature_type equals cla
  • cla-*-signatures.signature_reference_type equals user
  • cla-*-signatures.signature_reference_id equals [cla-*-users.user_id]
  • cla-*-signatures.signature_project_id equals [cla-*-projects.project_id] that the CCLA is valid for
  • cla-*-signatures.verison equals v1
  • cla-*-signatures.note equals "[date] Added as part of [cla-*-projects.project_name], whitelisted by [cla-*-companies.company_name]"

Background
When an entity whitelists a bot under a signed CCLA for a project and the bot attempts a PR on a CLA enforced repo then EasyCLA checks to see if the GitHub user is a bot. If the user is a bot, then EasyCLA automatically adds an affiliation confirmation signature record to the signature table

Sample:
https://api.github.com/users/dependabot-preview[bot]
{...
"type": "Bot",
...}

If GitHub Username is whitelisted and users API response is type: Bot then automatically confirm the association. In contrast, type: User will continue to require affiliation confirmation

User Story

As a project on GitHub, I need to be able to whitelist bots so that I can continue using the bots I need to manage contributions.

Acceptance Criteria

The "done" criteria when this feature or problem is resolved. Such as:

  1. Unit Tests added and running in CI
  2. Functional Tests updated to cover feature, if applicable
  3. Demonstrate the set of capabilities to the product team while the code is
    running in the STAGING environment.

Activity

  1. added
    03 - Med
    Console - Corp
    on Oct 17, 2019
  2. modified the milestones: Sprint 03, Sprint 04 on Oct 17, 2019
  3. added a commit that references this issue on Oct 18, 2019
    c0cfd32
  4. WillsonHG commented on Jul 6, 2020

    @WillsonHG

    Reopening this issue for discussion because there are duplicate entries of the bot being created and the when the CLA check runs, it pulls the first user it finds, regardless of whether it's the right one. The message in the logs states :

    2020-07-06T20:57:13 WARNING cla: more than 1 user found in our user database - user: [<cla.models.dynamo_models.User object at 0x7efdbe729ad0>, <cla.models.dynamo_models.User object at 0x7efdbe729a50>] - will ONLY evaluate the first one

    If the bot user selected does not have a signature entry for the current project, the bot will not pass the CLA check.

    Options:
    One bot - multiple ccla entries
    a) Add more logic when looking for the bot in the user table to prevent duplicate bots being created for each company who adds it to their approved list. This will require removing the user_company_id from the bot entry in the users table. When the bot is added to a company's approved list, if the app finds an entry in the user table for the bot, it will not create another. It will then create a signature for the bot's user_id, the company's company_id, and the project's project_id.

    Multiple bots - each bot has a ccla signature entry for the required project/company.
    b) Instead of only checking the first user found, check every single bot user found for a signature for the project/company.

    c) Bypass this behavior completely in favor of creating one user entry per bot. A project admin will request through the service desk that the bot be added to the approved list for the project. A signature entry is made for the bot user and project (icla).

  5. WillsonHG commented on Jul 7, 2020

    @WillsonHG
  6. removed this from the Sprint 04 milestone on Nov 30, 2020
  7. added
    tier-3
    on Nov 30, 2020
  8. mlehotskylf commented on Aug 19, 2025

    @mlehotskylf
    Collaborator

    We recently rolled out feature where bots can be whitelisted.
    @lukaszgryglicki @jarias-lfx I believe we can close this ticket.

  9. lukaszgryglicki commented on Sep 17, 2025

    @lukaszgryglicki
    Member

    Yes, closing.

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

Metadata

Metadata

Assignees

Labels

03 - MedConsole - Corptier-3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions