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

[Bug][github] Branches do not get removed

Open cypher7682 opened this issue 11 months ago • 4 comments

Search before asking

  • [x] I had searched in the issues and found no similar issues.

What happened

When branches are deleted in github, the lake.refs table is not updated to either A: mark the branch as deleted, or B: the branch is deleted from the table.

This causes problems when trying to detect stale branches, because it includes branches that have already been deleted/tidied up in github.

What do you expect to happen

Either:

  • Mark the branch as deleted in the lake.refs table
  • Remove the branch from the lake.refs table

How to reproduce

  • Create a repository
  • Push an additional branch to the repository
  • Scrap the repository
  • Check the lake.refs table for the repo + branches
  • Delete the branch in the github UI
  • Scrape the repository
  • Check the lake.refs table for the branch - it should still exist.

Anything else

No response

Version

devlake-1.0.2-beta1

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

cypher7682 avatar Feb 27 '25 11:02 cypher7682

Hey @cypher7682! 👋 I'm here to help you with any bugs, questions, or contributions you have for the project. I'll assist you while we wait for a human maintainer.

The issue you're encountering is related to the lake.refs table not being updated to reflect branch deletions from GitHub. Currently, there is no field in the lake.refs table specifically designed to mark a branch as deleted [1]. This means that when a branch is deleted in GitHub, it is not automatically marked or removed in the lake.refs table during a repository scrape.

To address this, you might consider implementing a mechanism to either mark branches as deleted or remove them from the table when they are deleted in GitHub. This would help in accurately detecting stale branches by excluding those that have been deleted.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

dosubot[bot] avatar Feb 27 '25 11:02 dosubot[bot]

This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Apr 29 '25 00:04 github-actions[bot]

Branch information is currently useless since there is not certainty at all about the existence of the branches.

juanluisanton-vonage avatar Apr 29 '25 06:04 juanluisanton-vonage

Why do you need to detect stable branches using DevLake?

klesh avatar May 12 '25 03:05 klesh

This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Jul 12 '25 00:07 github-actions[bot]

This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future.

github-actions[bot] avatar Jul 19 '25 00:07 github-actions[bot]