-
Notifications
You must be signed in to change notification settings - Fork 29
feat: add git history analysis to go flaky tests #1029
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
feat: add git history analysis to go flaky tests #1029
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes look good - the linter fails because the github app doesn't have the necessary permissions it looks like?
(the other linter has actual lint issues that need to be fixed)
Add Git client implementation to track test authors: - Find test files using grep search through repository - Extract commit history using git log -L for specific test functions - Filter commits to last 6 months to focus on recent contributors - Add FilePath and RecentCommits to FlakyTest struct - Update action to include repository-directory input - Enhance test reporting with author information Builds on PR1's Loki analysis with Git history tracking. GitHub username resolution will be added in PR3. # Conflicts: # actions/go-flaky-tests/cmd/go-flaky-tests/analyzer.go
This reverts commit 9a29cc3.
This reverts commit 085c861.
755b363
to
c096b12
Compare
i'm not sure what happened there, i rebased on |
a short update - this has been working pretty well for us. The only change I've had to make in addition is to add the option to ignore some tests (tests which often fail on PRs, but catch actual bugs). I'll upstream that in a 4th PR (this is the 2nd PR, github issues integration is the 3rd, 4th is tiny) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great 🚀
do we need to do anything else to merge this? (I can't click merge) |
oh sorry! I'll merge it for you :) |
Summary
Extends the basic flaky test detection in #1013 with Git history analysis to identify recent authors of flaky tests. This enables better ownership tracking and more targeted notifications when tests become flaky.
What's Added
GitClient
interface and implementation for repository operationsgit log -L
to find recent commits that modified specific test functionsKey Components
git.go
: Git operations implementation with proper error handlinganalyzer.go
: Now calls Git functions to gather author informationrepository-directory
input parameter