|
9 | 9 | import java.util.function.Predicate;
|
10 | 10 | import java.util.stream.Collectors;
|
11 | 11 |
|
12 |
| -import com.gradle.develocity.model.BuildAttributesEnvironment; |
13 | 12 | import jakarta.inject.Inject;
|
14 | 13 |
|
15 | 14 | import org.hibernate.infra.bot.config.DeploymentConfig;
|
|
21 | 20 |
|
22 | 21 | import com.gradle.develocity.api.BuildsApi;
|
23 | 22 | import com.gradle.develocity.model.Build;
|
| 23 | +import com.gradle.develocity.model.BuildAttributesEnvironment; |
24 | 24 | import com.gradle.develocity.model.BuildAttributesLink;
|
25 | 25 | import com.gradle.develocity.model.BuildAttributesValue;
|
26 | 26 | import com.gradle.develocity.model.BuildModelName;
|
@@ -133,6 +133,17 @@ private void extractCIBuildScans(GHRepository repository, RepositoryConfig.Devel
|
133 | 133 | private String createBuildScansQuery(List<GHCheckRun> checkRuns) throws IOException {
|
134 | 134 | Set<String> queries = new HashSet<>();
|
135 | 135 | for ( GHCheckRun checkRun : checkRuns ) {
|
| 136 | + // This may not catch build scans based on merge commits created within CI runs, |
| 137 | + // but will catch build scans that have no corresponding GH check run, |
| 138 | + // and will allow the query link we put in reports to catch (some) *future* GH check runs. |
| 139 | + var sha = checkRun.getHeadSha(); |
| 140 | + if ( sha != null && !sha.isBlank() ) { |
| 141 | + queries.add( "tag:CI and value:\"Git commit id=%s\"".formatted( sha ) ); |
| 142 | + } |
| 143 | + |
| 144 | + // This will catch build scans based on merge commits created within CI runs, |
| 145 | + // but will not catch build scans that have no corresponding GH check run, |
| 146 | + // and will not allow the query link we put in reports to catch *future* GH check runs. |
136 | 147 | if ( isJenkinsBuild( checkRun ) ) {
|
137 | 148 | var runId = JenkinsRunId.parse( checkRun.getExternalId() );
|
138 | 149 | queries.add( "value:\"CI job=%s\" and value:\"CI build number=%s\""
|
|
0 commit comments