# EasyCLA and Co-Author Compliance Guide

This guide outlines the steps to ensure contributions using the "co-author" feature comply with EasyCLA.

**Ensuring Contributor Compliance**

1. **Verify CLA Signature:**
   * Every contributor, individual or organizational representative, must have a signed EasyCLA.
   * Use EasyCLA's dashboard or attempt a contribution to check the signature status. EasyCLA will provide instructions if a signature is missing.
2. **Co-authors check:**
   * Co-author checks are **disabled by default**. They can be enabled at the GitHub organization level.
   * Co-author checks can be enabled or disabled for:
     * A specific repository,
     * Repositories matching a pattern (regular expression),
     * All repositories in a GitHub organization.
   * **Priority/order matters:** Exact repository match takes precedence, followed by pattern match, and finally the organization-wide setting (wildcard).
   * For example, you can enable co-author checks for the entire organization, but disable them for a specific repository, or enable them only for repositories matching a certain pattern.
   * Enabling or disabling co-author checks can be configured by submitting a support ticket.
   * If co-author checks are enabled, EasyCLA will verify that all co-authors have signed the CLA.
3. **Adding Co-Authors Correctly:**
   * When using the "co-author" trailer in commit messages, include the following syntax for each co-author:

     ```
     Co-authored-by: [Full Name] <[email@example.com]>
     ```
   * Example:

     ```
     Implement new feature for API

     -Refactored data models
     -Created unit tests for edge cases

     Co-authored-by: Alice Johnson <alice@example.com>
     Co-Authored-by: Bob Williams <bob@example.com>
     Co-Authored-By: Lukasz Gryglicki <2469783+lukaszgryglicki@users.noreply.github.com>
     co-authored-by: Justyna Gryglicka <justynagryglicka@users.noreply.github.com>
     co-Authored-By: lukaszgryglicki2 <non-existing@domain.com>
     ```

<figure><img src="https://3411187760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M2DCN9UgoRgMEkgnLyP-887967055%2Fuploads%2Fgit-blob-bc0f04f12aca90cc6808469d86b8dcfe7a293471%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3411187760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M2DCN9UgoRgMEkgnLyP-887967055%2Fuploads%2Fgit-blob-449d66ce7958baeaaede046e167ddd8ab5937f54%2Fco-author-agreement-missing.png?alt=media" alt=""><figcaption><p>Example of a co-author failure showing SIGNED AGREEMENT MISSING</p></figcaption></figure>

<figure><img src="https://3411187760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M2DCN9UgoRgMEkgnLyP-887967055%2Fuploads%2Fgit-blob-410107bcc5e5b52f8e6fe3efa7377a0fd98e1e8d%2Fco-author-unknown-commit-author.png?alt=media" alt=""><figcaption><p>Example of a co-author failure showing UNKNOWN COMMIT AUTHOR</p></figcaption></figure>

**EasyCLA Integration with Co-Authors**

* If co-author checks are enabled, EasyCLA validates each co-author against a signed CLA using the identifier that can be resolved from the co-author trailer.
* Ensure all co-authors are registered and have a signed CLA.
* If a co-author is resolved but is not authorized under a signed CLA, EasyCLA can show **SIGNED AGREEMENT MISSING**.
* If a co-author cannot be resolved to a GitHub user, EasyCLA can show **UNKNOWN COMMIT AUTHOR**.
* Depending on the pull request, both badges can appear in the same EasyCLA comment.

{% hint style="info" %}
Use one of the supported `Co-authored-by:` formats below. A non-public email can only be matched if that email was previously used for another CLA as a main commit author. Otherwise EasyCLA may not be able to find the co-author.
{% endhint %}

**Supported `Co-authored-by:` formats include:**

1. `Anything <id+login@users.noreply.github.com>` - it will locate your GitHub user by `id` part.
2. `Anything <login@users.noreply.github.com>` - it will locate your GitHub user by `login` part.
3. `Anything <public-email>` - it will locate your GitHub user by `public-email` part. Note that this email must be made public on GitHub.
4. `Anything <other-email>` - it will locate your GitHub user by `other-email` part but only if that email was used before for any other CLA as a main commit author.
5. `login <any-valid-email>` - it will locate your GitHub user by `login` part. Note that `login` part must be at least 3 characters long.

If any co-author cannot be found, EasyCLA will add a comment on the pull request explaining how to correctly specify commit co-authors.

EasyCLA currently instructs contributors as follows: Alternatively, if the co-author should not be included, remove the `Co-authored-by:` line from the commit message.

After updating your commit message(s) by doing `git commit --amend` and then `git push [--force]`, request re-running the CLA check by commenting on the pull request:

```
/easycla
```

**Tips for Successful Integration**

1. **Consistency:** Ensure email addresses in co-author tags match those used for signing the CLA.
2. **Training:** Educate contributors on signing the CLA and including accurate information in co-author trailers.

For automation users that should bypass CLA checks altogether, see [Allowlisting Bots to Skip CLA](https://docs.linuxfoundation.org/lfx/easycla/v2-current/allowing_bots_to_skip_cla).

**Additional Resources**

* [GitHub Documentation](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors)
* You can set the email address used to author commits on GitHub.com and your computer. For more information see, [Setting your commits email addresses](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.linuxfoundation.org/lfx/easycla/v2-current/easycla-and-co-author-compliance-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
