incubator-devlake
incubator-devlake copied to clipboard
fix(gitextractor): subtask Clone Git Repo ended unexpectedly
Summary
- According to github documentation the installation access token expire after 1 hour. This commit generates a new installation access token at the start of each gitextractor task avoiding the auth error that happens for pipelines that last more than 1 hour.
Does this close any open issues?
Closes https://github.com/apache/incubator-devlake/issues/7958
Screenshots
Before the fix:
After the fix: The pipeline lasts more than 1 hour and the gitextractor tasks keep working
Other Information
I understand that this solution is not the most efficient, since for each gitextractor task it will generate new tokens even when the current token is still valid. However, I believe it can be used as a temporary solution to enable the use of Github App without problems.
For a more efficient solution, we could generate a new token only when it has reached its expiration time. Analyzing the code, I believe that the expiration time of this token needs to be persisted in the database in order to be accessed when preparing the task. What do you think? I may be evolving this solution in another new PR.