incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

fix(gitextractor): subtask Clone Git Repo ended unexpectedly

Open caioq opened this issue 4 months ago • 1 comments

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: image

After the fix: The pipeline lasts more than 1 hour and the gitextractor tasks keep working image

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.

caioq avatar Oct 09 '24 12:10 caioq