Support co-authors in GitHub flows with Copilot AI as main author and actual contributor as co-author#4746
Support co-authors in GitHub flows with Copilot AI as main author and actual contributor as co-author#4746lukaszgryglicki merged 18 commits intomainfrom
Conversation
… actual contributor as co-author Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
…me, email and caching Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
… email and caching Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
…me, email and caching Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
…or-github-case Support co-authors in GitHub flows with Copilot AI as main author and actual contributor as co-author
…-wide on github-org level Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
…support-conditional Make co-authors support configurable per repo, or repo pattern or org-wide on github-org level
There was a problem hiding this comment.
Pull Request Overview
This PR implements co-authors support in GitHub flows, allowing CLA systems to handle commits where Copilot AI is the main author and actual contributors are listed as co-authors. The system parses co-authored-by: commit trailers and attempts to resolve GitHub users through multiple lookup strategies.
Key changes:
- Added database schema and configuration support for enabling co-authors per repository
- Implemented comprehensive GitHub user lookup logic with caching for co-authors
- Enhanced commit processing to include co-author analysis when enabled
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/skip_cla_entry.sh | Updated example patterns for Copilot-related entries |
| utils/enable_co_authors_entry.sh | New utility script for managing co-authors configuration |
| utils/copy_prod_case_4.sh | New script for copying production data for testing |
| cla-backend/cla/utils.py | Enhanced co-authors extraction with case-insensitive regex |
| cla-backend/cla/tests/unit/test_github_models.py | Added cache clearing and mock updates for co-authors tests |
| cla-backend/cla/models/github_models.py | Core implementation of co-authors support with caching and GitHub user lookup |
| cla-backend/cla/models/dynamo_models.py | Added enable_co_authors field to GitHub organization model |
| cla-backend-go/v2/sign/helpers.go | Updated Go backend to support co-authors in change requests |
| cla-backend-go/swagger/common/github-organization.yaml | Added API documentation for enableCoAuthors field |
| cla-backend-go/signatures/service.go | Updated signature service to use co-authors support |
| cla-backend-go/github_organizations/models.go | Added EnableCoAuthors field to Go organization model |
| cla-backend-go/github/github_repository.go | Implemented comprehensive co-authors processing in Go |
| cla-backend-go/github/bots.go | Added repository pattern matching for co-authors enablement |
| README.md | Added reference to co-authors documentation |
| CO_AUTHORS.md | Comprehensive documentation for co-authors feature |
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>
mlehotskylf
left a comment
There was a problem hiding this comment.
This looks good, my only concerns is that with this approach some co-authors can be identified and some may not, introducing inconsistency. To fix this I suggest:
- If maintainers will ask us to enable "co-author feature" for the repo/org then ALL co-authors need to be identified AND be authorized, otherwise entire PR will not pass EasyCLA check. This means co-author trailer always need to have expected format with identifiable co-authors.
- If maintainers don't enable co-author feature (default), then EasyCLA will keep current behavior (ignore co-authors)
|
@mlehotskylf : |
|
Great, thank you for confirmation. Please add this to the documentation. |
We handle co-authors by searching (case insensitive) for
co-authored-by: name <email>git commit trailers.When handling
(name, email)pairs we resolve potential GitHub users as follows:ID + Login:id+login@users.noreply.github.com, extract the numericGitHub IDand look up the user byID.Login:login@users.noreply.github.com, extract theloginand look up the user byGitHub username.Email:GitHub API.NameasLogin:If all else fails, attempt to look up the user treating the provided name as a possible GitHub login (from
Co-authored-by: name <email>- we assume thatnameislogin- this is true for AI bots checked so far).This sequence ensures the most reliable identification of GitHub
co-authorsfrom commit metadata.Internally we cache GitHub users found (or not found which is the most time consuming operation) with
TTL = 24 hoursand using(name, email)fromco-authored-bytrailer as a key.This is implemented in both
pythonandgolangbackends.cc @mlehotskylf @jarias-lfx @ahmedomosanya