Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include coauthors in GitHub repos #63

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

j3soon
Copy link
Contributor

@j3soon j3soon commented Jul 11, 2024

Completely implements #44 (along with #61).

Solution Description:

  • If no commit message includes co-authors, then the plugin behavior stays exactly the same.
  • If one of the commit message includes co-authors, then the plugin will check if a GitHub token exists.
    • If no GitHub token exists, the plugin outputs a warning, and keep the original behavior.
    • If a GitHub token exists, the plugin sends a GraphQL query to reliably retrieve all co-authors info and include them to the author list.

Design Choices:

I considered a few implementations and decided to use REST API by default, switching to GraphQL only when necessary.

Some considerations:

  • Always using GraphQL is not preferred since it requires users to provide a GitHub token. Therefore, we still want to use the REST API by default, allow using this plugin even when no GitHub tokens are provided.
  • Not using GraphQL entirely will require manually determining the co-authors info, which is very error-prone.

References & Further Details:

@ojacques
Copy link
Owner

Yes, I moved back from graphql to indeed make it really simple for anyone who does not need advanced use cases. I would consider coauthors to be one of those advanced use case, hence graphql usage seems perfectly fine to me.

Could you please

Thanks!

@j3soon
Copy link
Contributor Author

j3soon commented Jul 12, 2024

Thanks for the quick reply! Just resolved the conflicts and updated the docs.

It's also worth noting that these two PRs only fixes #44 for GitHub repos, not for GitLab repos yet.

@lancehaig
Copy link

Just adding my +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants