staabm / phpstan-todo-by

Todo comments with expiration
https://staabm.github.io/2023/12/17/phpstan-todo-by-published.html
MIT License
172 stars 4 forks source link

Add GitHub support for by ticket rule #62

Closed EmilMassey closed 8 months ago

EmilMassey commented 8 months ago

This PR (still a draft) adds GitHub support, but also tries to prepare an extension to support multiple issue trackers. I can see that there's already pending support for YouTrack #51, so I decided to publish this draft so we can discuss the direction together.

staabm commented 8 months ago

I think we need at least one real end-2-end test for github and jira

EmilMassey commented 8 months ago

I think we need at least one real end-2-end test for github and jira

Unfortunately I have no idea how to approach it. Do I understand correctly that we need to rely on real issues on GitHub / Jira?

  1. Currently I see that current E2E tests workflow asserts only if no issues are reported. I think we should also be able to test if expected issues are present. How can we do it? I think about comparing it to a text file with expected errors (see https://github.com/staabm/phpstan-todo-by/pull/62/commits/09f21fe10ce90e076caee2222e5659d4f6226f4d), but I'm not sure if it's OK.
  2. How to test if it works with open issues? Should we have an always-open dummy issue on GitHub?

GitHub API allows accessing public repositories without providing access token, but rate-limits apply (currently 60 requests per hour AFAIK). We'll probably need to use a secret in the CI with a token to avoid hitting the limits.

Do we need our own Jira board to be able to test it e2e? I know there are some public boards that we could access, but it's very risky to rely on some external board which may disappear some day.

staabm commented 8 months ago

I would be fine when the E2E test just triggers for a issue, no matter its state. I just want to see our curl client can connect, find the issue and get its state (for both trackers)

staabm commented 8 months ago

I couldn't wait. love it