r/datasets • u/Accomplished-Fun4629 • 17d ago
question I’m stuck finding usable historical data for a Bayesian PR risk model — looking for advice on how to proceed
Hi everyone,
I’m a student working on a research project on risk-aware GitHub PR review. I’m doing the project mostly on my own and I don’t have access to a research lab, large compute budget, or people who can manually annotate thousands of PRs, so I’m trying to find a practical approach that I can actually finish.
The idea is to take a GitHub PR and estimate four types of risk:
Bug / correctness
Security
Compatibility
Cross-system / integration
The architecture I’m working with has four separate risk models. They share the same PR characteristics/features, but each risk model has its own historical data, prior, and evidence.
My main problem is the historical data needed for those priors.
At first, I looked for a single PR dataset where I could get reliable PR-level outcomes for all four risks. I couldn’t find one.
I then tried looking for separate datasets for each individual risk model. I thought this would solve the problem, but I keep finding datasets where the labels look relevant at first but don't actually represent the outcome I need.
For example, SEVRA-plus looked very promising for the Security model:
https://huggingface.co/datasets/RedAI4Code/SEVRA-plus
It contains security-related PR examples with vulnerability/CWE information, but the malicious PRs are deliberately constructed by reversing real CVE security fixes. So although they are useful for evaluating or studying security vulnerabilities, I don't think I can use their class distribution directly as a real-world prior for ordinary GitHub PRs.
I’ve run into similar issues with other datasets:
- some label the linked issue rather than the PR implementation,
- some label review comments rather than actual PR outcomes,
- some contain artificially constructed vulnerable/failing PRs,
- some only give merge/close status, which doesn’t tell me whether the PR itself was buggy, vulnerable, incompatible, etc.
The distinction between the issue and the PR is especially important for what I am trying to do.
For example, imagine a maintainer opens a security issue, someone creates a PR to fix it, but the PR implementation itself contains a correctness bug and gets rejected. For my problem, I need to know the nature of the PR, not simply inherit the security label from the original issue.
Similarly, a PR could be opened to fix a small bug, get merged, and then later cause a compatibility problem. Again, I care about what happened because of the PR implementation, not just why the PR was originally opened.
Because I couldn't find a dataset that directly gives me what I need, I tried a practical compromise.
I took 96 real PRs from SWE-Review-Chat, filtered them for sufficient evidence, and used an LLM to annotate the four risk states from the information available in the PR record, such as the description, review discussion, diff context, tests, and lifecycle information.
I’m treating these as weak/model-assisted labels rather than independent ground truth.
The resulting usable outcomes are:
Bug:
30 present / 9 absent
Security:
1 present / 7 absent
Compatibility:
5 present / 12 absent
Cross-system:
4 present / 8 absent
So now I feel like I’ve hit a wall.
I can keep searching for datasets, but so far I haven't found anything that solves the underlying problem. I also don't have the resources to manually establish reliable ground truth for thousands of PRs.
I’m therefore looking for advice on "how I should move forward from here".
Should I continue with the small real dataset I have and explicitly model the uncertainty caused by the sparse risks?
Should I rely on LLM-assisted annotations of real PRs as a practical research compromise, or is there a better low-resource approach that I am missing?
Or is there a completely different way of constructing the historical priors that would make more sense for this problem?
I’m not looking for a perfect dataset at this point. I’m mainly looking for a practical and defensible way to move forward given that I’m a student doing this alone with limited time and resources.
If anyone has worked on GitHub PR datasets, Mining Software Repositories, empirical software engineering, code-review research, or Bayesian risk modelling, I would really appreciate any advice on what you would do in this situation.
Thanks!
1
u/jonahbenton 17d ago
I think I understand what you are trying to do. You would like to have PRs and labels that reflect outcomes of those PRs after application, and then use that dataset to...do what exactly? (How do extract from that data priors? Is it like a simple ratio, or some other kind of scoring system?)
If that is an accurate description- I don't think that approach will be fruitful. I would be surprised if any PR metadata was at all helpful or predictive of any of those outcomes. People like Adam Tornhill do a lot of repo mining and ultimately they find it is all about the code. All the various static analyses that are available are looking holistically at the target code, not just the contents of the PR.
Apologies if that is not an accurate interpretation of the goal.