Create a GraphQL query to find the last N commits along with their statuses and some metadata (paginated after 'cursor')
(user: str, repo: str, cursor: str | None = None)
| 59 | |
| 60 | |
| 61 | def commits_query(user: str, repo: str, cursor: str | None = None): |
| 62 | """ |
| 63 | Create a GraphQL query to find the last N commits along with their statuses |
| 64 | and some metadata (paginated after 'cursor') |
| 65 | """ |
| 66 | after = "" |
| 67 | if cursor is not None: |
| 68 | after = f', after:"{cursor}"' |
| 69 | |
| 70 | return f""" |
| 71 | {{ |
| 72 | repository(name: "{repo}", owner: "{user}") {{ |
| 73 | defaultBranchRef {{ |
| 74 | target {{ |
| 75 | ... on Commit {{ |
| 76 | history(first: 15{after}) {{ |
| 77 | edges {{ cursor }} |
| 78 | nodes {{ |
| 79 | {_commit_query_fields} |
| 80 | }} |
| 81 | }} |
| 82 | }} |
| 83 | }} |
| 84 | }} |
| 85 | }} |
| 86 | }} |
| 87 | """ |
| 88 | |
| 89 | |
| 90 | EXPECTED_CI_JOBS = [ |
no outgoing calls
no test coverage detected
searching dependent graphs…