9
9
import java .util .function .Predicate ;
10
10
import java .util .stream .Collectors ;
11
11
12
+ import com .gradle .develocity .model .BuildAttributesEnvironment ;
12
13
import jakarta .inject .Inject ;
13
14
14
15
import org .hibernate .infra .bot .config .DeploymentConfig ;
@@ -161,6 +162,7 @@ private boolean isJenkinsBuild(GHCheckRun checkRun) {
161
162
162
163
private DevelocityCIBuildScan toCIBuildScan (Build build ) {
163
164
URI buildScanURI = deploymentConfig .develocity ().uri ().resolve ( "/s/" + build .getId () );
165
+ BuildAttributesEnvironment environment ;
164
166
List <BuildAttributesValue > customValues ;
165
167
List <BuildAttributesLink > links ;
166
168
List <String > tags ;
@@ -171,6 +173,7 @@ private DevelocityCIBuildScan toCIBuildScan(Build build) {
171
173
var gradle = build .getModels ().getGradleAttributes ();
172
174
if ( maven != null && maven .getModel () != null ) {
173
175
var model = maven .getModel ();
176
+ environment = model .getEnvironment ();
174
177
tags = model .getTags ();
175
178
customValues = model .getValues ();
176
179
links = model .getLinks ();
@@ -180,6 +183,7 @@ private DevelocityCIBuildScan toCIBuildScan(Build build) {
180
183
}
181
184
else if ( gradle != null && gradle .getModel () != null ) {
182
185
var model = gradle .getModel ();
186
+ environment = model .getEnvironment ();
183
187
tags = model .getTags ();
184
188
customValues = model .getValues ();
185
189
links = model .getLinks ();
@@ -191,6 +195,7 @@ else if ( gradle != null && gradle.getModel() != null ) {
191
195
throw new IllegalStateException ( "No Maven or Gradle model in build scan " + buildScanURI );
192
196
}
193
197
String provider = "" ;
198
+ String hostname = environment .getPublicHostname ();
194
199
String jobOrWorkflow = "" ;
195
200
String stage = "" ;
196
201
for ( BuildAttributesValue customValue : customValues ) {
@@ -218,7 +223,7 @@ else if ( customValue.getName().equals( "CI stage" ) ) {
218
223
.sorted ()
219
224
.toList ();
220
225
return new DevelocityCIBuildScan (
221
- provider ,
226
+ provider , hostname ,
222
227
jobOrWorkflow ,
223
228
jobOrWorkflowUri ,
224
229
stage ,
0 commit comments