jenkinsci / jenkinsci/git-forensics-plugin
Git Forensics miner always performs full repository mining on the first build of a branch
- Dominant language
- Java
- Stars
- 43
- Forks
- 29
- Avg merge
- 5d 12h
- Merged PRs (30d)
- 5
Description
### Jenkins and plugins versions report
Environment
```text
Jenkins: 2.542
OS: Linux - 5.15.0-1087-kvm
Java: 17.0.17 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
analysis-model-api:13.18.0-933.v90e9a_fdff4e2
ansible:588.v2a_a_a_f345e34f
ansicolor:1.0.6
antisamy-markup-formatter:173.v680e3a_b_69ff3
apache-httpcomponents-client-4-api:4.5.14-269.vfa_2321039a_83
apache-httpcomponents-client-5-api:5.5-170.v023de017ccd7
asm-api:9.9-185.va_6c6b_3348b_c3
authentication-tokens:1.144.v5ff4a_5ec5c33
authorize-project:2.0.0
aws-credentials:254.v978a_5e206a_d7
aws-java-sdk:1.12.671-439.veec746c91fcb_
aws-java-sdk-api-gateway:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-cloudformation:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-cloudfront:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-codebuild:1.12.671-439.veec746c91fcb_
aws-java-sdk-codedeploy:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-ec2:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-ecr:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-ecs:1.12.671-439.veec746c91fcb_
aws-java-sdk-efs:1.12.671-439.veec746c91fcb_
aws-java-sdk-elasticbeanstalk:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-elasticloadbalancingv2:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-iam:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-kinesis:1.12.671-439.veec746c91fcb_
aws-java-sdk-lambda:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-logs:1.12.671-439.veec746c91fcb_
aws-java-sdk-minimal:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-organizations:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-secretsmanager:1.12.671-439.veec746c91fcb_
aws-java-sdk-sns:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-sqs:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-ssm:1.12.671-439.veec746c91fcb_
aws-java-sdk2-core:2.33.4-62.vc1a_8df64b_4c9
aws-java-sdk2-ec2:2.33.4-62.vc1a_8df64b_4c9
blueocean:1.27.25
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.27.25
blueocean-commons:1.27.25
blueocean-config:1.27.25
blueocean-core-js:1.27.25
blueocean-dashboard:1.27.25
blueocean-display-url:2.4.4
blueocean-events:1.27.25
blueocean-git-pipeline:1.27.25
blueocean-github-pipeline:1.27.25
blueocean-i18n:1.27.25
blueocean-jira:1.27.25
blueocean-jwt:1.27.25
blueocean-personalization:1.27.25
blueocean-pipeline-api-impl:1.27.25
blueocean-pipeline-editor:1.27.25
blueocean-pipeline-scm-api:1.27.25
blueocean-rest:1.27.25
blueocean-rest-impl:1.27.25
blueocean-web:1.27.25
bootstrap5-api:5.3.8-895.v4d0d8e47fea_d
bouncycastle-api:2.30.1.82-277.v70ca_0b_877184
branch-api:2.1268.v044a_87612da_8
build-monitor-plugin:1.14-985.v7b_f37b_3d0b_f5
caffeine-api:3.2.3-194.v31a_b_f7a_b_5a_81
checks-api:373.vfe7645102093
cloud-stats:377.vd8a_6c953e98e
cloudbees-bitbucket-branch-source:937.2.2
cloudbees-folder:6.1073.va_7888eb_dd514
command-launcher:123.v37cfdc92ef67
commons-collections4-api:4.5.0-8.va_d5448ef9011
commons-compress-api:1.28.0-2
commons-httpclient3-api:3.1-3
commons-lang3-api:3.20.0-109.ve43756e2d2b_4
commons-text-api:1.15.0-210.v7480a_da_70b_9e
configuration-as-code:2006.v001a_2ca_6b_574
coverage:2.3060.v035a_5557cdb_c
credentials:1453.v9b_a_29777a_b_fd
credentials-binding:702.vfe613e537e88
dark-theme:574.va_19f05d54df5
data-tables-api:2.3.5-1482.vb_47a_3c19f78c
dependency-track:6.0.2
display-url-api:2.217.va_6b_de84cc74b_
docker-commons:457.v0f62a_94f11a_3
docker-java-api:3.7.0-133.v93b_8fb_c17a_77
docker-plugin:1308.vff6e33248305
docker-workflow:1.26
durable-task:639.vefb_3d8372f6d
echarts-api:6.0.0-1165.vd1283a_3e37d4
eddsa-api:0.3.0.1-19.vc432d923e5ee
explain-error:95.v9fc3e141e57a_
extra-columns:1.28
favorite:2.253.v9b_413168133b_
font-awesome-api:7.1.0-882.v1dfb_771e3278
forensics-api:3.1772.v99ca_3d83b_9fa_
git:5.8.1
git-client:6.4.2
git-forensics:3.2138.vf25ea_d549e33
git-server:137.ve0060b_432302
github:1.45.0
github-api:1.330-492.v3941a_032db_2a_
github-branch-source:1925.v62fb_7ffb_08ce
github-checks:634.v371dc6d978a_3
github-oauth:651.v135e939e8b_60
gson-api:2.13.2-173.va_a_092315913c
handlebars:3.0.8
handy-uri-templates-2-api:2.1.8-38.vcea_5d521d5f3
htmlpublisher:427
instance-identity:203.v15e81a_1b_7a_38
ionicons-api:94.vcc3065403257
jackson2-api:2.20.1-423.v13951f6b_6532
jakarta-activation-api:2.1.4-1
jakarta-mail-api:2.1.5-1
jakarta-xml-bind-api:4.0.6-10.v9b_7e1d1fc40b_
javax-activation-api:1.2.0-8
javax-mail-api:1.6.2-11
jaxb:2.3.9-133.vb_ec76a_73f706
jdk-tool:83.v417146707a_3d
jenkins-design-language:1.27.25
jersey2-api:2.47-165.ve7809a_3e87e0
jira:3.20
jjwt-api:0.11.5-120.v0268cf544b_89
job-dsl:1.93
jobcacher:764.v098c635e4315
joda-time-api:2.14.0-149.v1c3ce991d1b_9
jquery3-api:3.7.1-619.vdb_10e002501a_
jsch:0.1.55.61.va_e9ee26616e7
json-api:20250517-173.v596efb_962a_31
json-path-api:2.10.0-202.va_9cc16c1e476
jsoup:1.21.2-66.v6ea_38164b_8a_2
junit:1380.v491ff054cd35
kubernetes:4398.vb_b_33d9e7fe23
kubernetes-cli:1.364.vadef8cb8b823
kubernetes-client-api:7.3.1-256.v788a_0b_787114
kubernetes-credentials:206.vde31a_b_0f71a_c
lockable-resources:2.14
mailer:525.v2458b_d8a_1a_71
matrix-auth:3.2.9
matrix-project:870.v9db_fcfc2f45b_
metrics:4.2.37-489.vb_6db_69b_ce753
mina-sshd-api-common:2.16.0-167.va_269f38cc024
mina-sshd-api-core:2.16.0-167.va_269f38cc024
momentjs:1.1.1
nexus-artifact-uploader:2.15
nexus-jenkins-plugin:3.16.510.v4d23e22cf563
nvm-wrapper:0.1.7
okhttp-api:4.12.0-195.vc02552c04ffd
pipeline-aws:1.45
pipeline-build-step:571.v08a_fffd4b_0ce
pipeline-github:2.8-162.382498405fdc
pipeline-graph-analysis:245.v88f03631a_b_21
pipeline-graph-view:730.v433816a_b_7a_73
pipeline-groovy-lib:787.ve2fef0efdca_6
pipeline-input-step:540.v14b_100d754dd
pipeline-milestone-step:138.v78ca_76831a_43
pipeline-model-api:2.2277.v00573e73ddf1
pipeline-model-definition:2.2277.v00573e73ddf1
pipeline-model-extensions:2.2277.v00573e73ddf1
pipeline-rest-api:2.38
pipeline-stage-step:322.vecffa_99f371c
pipeline-stage-tags-metadata:2.2277.v00573e73ddf1
pipeline-stage-view:2.38
pipeline-utility-steps:2.20.0
plain-credentials:199.v9f8e1f741799
plot:2.4.0
plugin-usage-plugin:4.10
plugin-util-api:6.1192.v30fe6e2837ff
prism-api:1.30.0-630.va_e19d17f83b_0
prometheus:819.v50953a_c560dd
pubsub-light:1.19
s3-jobcacher-storage:62.v260cb_8db_5b_fa_
scm-api:724.v7d839074eb_5c
script-security:1385.v7d2d9ec4d909
slack:795.v4b_9705b_e6d47
snakeyaml-api:2.5-143.v93b_c004f89de
sse-gateway:1.28
ssh-agent:386.v36cc0c7582f0
ssh-credentials:361.vb_f6760818e8c
ssh-slaves:3.1085.vc64d040efa_85
sshd:3.374.v19b_d59ce6610
structs:362.va_b_695ef4fdf9
theme-manager:327.v780d7096ec29
throttle-concurrents:2.18
timestamper:1.30
token-macro:477.vd4f0dc3cb_cf1
trilead-api:2.284.v1974ea_324382
variant:70.va_d9f17f859e0
warnings-ng:12.9923.v0a_d61546e93d
workflow-aggregator:608.v67378e9d3db_1
workflow-api:1398.v67030756d3fb_
workflow-basic-steps:1098.v808b_fd7f8cf4
workflow-cps:4238.va_6fb_65c1f699
workflow-durable-task-step:1464.v2d3f5c68f84c
workflow-job:1559.va_a_533730b_ea_d
workflow-multibranch:821.vc3b_4ea_780798
workflow-scm-step:466.va_d69e602552b_
workflow-step-api:710.v3e456cc85233
workflow-support:1010.vb_b_39488a_9841
```
### What Operating System are you using (both controller, and any agents involved in the problem)?
Linux in a docker container: FROM jenkins/jenkins:2.536-jdk17
### Reproduction steps
On repositories with a large history, the mineRepository() step from Git Forensics takes a very long time on the first build of a new branch job (e.g. release branches).
Even when:
discoverGitReferenceBuild is configured with a valid targetBranch
a reference build exists on the base branch
the miner still scans the entire repository history instead of computing a delta from the reference build.
### Expected Results
When a reference build is available, the miner should be able to limit mining to commits introduced since the reference branch
### Actual Results
The scm miner is computing all the repository commit.
### Anything else?
We could manually hint the miner with the base branch we want to calculate delta from.
### Are you interested in contributing a fix?
perhaps if the fix makes sense for the community.
Contributor guide
Assessment
This issue has not been assessed yet.