@@ -464,7 +464,7 @@ func testResultByName(results []TestResults, testName string) *TestResults {
464
464
}
465
465
466
466
func listTestResultFor (featureGate string , clusterProfiles sets.Set [string ]) (map [JobVariant ]* TestingResults , error ) {
467
- fmt .Printf ("Query component readiness for all test run results for feature gate %q on clusterProfile %q\n " , featureGate , sets .List (clusterProfiles ))
467
+ fmt .Printf ("Query sippy for all test run results for feature gate %q on clusterProfile %q\n " , featureGate , sets .List (clusterProfiles ))
468
468
469
469
results := map [JobVariant ]* TestingResults {}
470
470
@@ -533,6 +533,10 @@ func getLatestRelease() (string, error) {
533
533
534
534
var result struct {
535
535
Releases []string `json:"releases"`
536
+ Dates map [string ]struct {
537
+ GA * time.Time `json:"ga,omitempty"`
538
+ DevelopmentStart * time.Time `json:"development_start,omitempty"`
539
+ } `json:"dates"`
536
540
}
537
541
err = json .Unmarshal (body , & result )
538
542
if err != nil {
@@ -543,7 +547,15 @@ func getLatestRelease() (string, error) {
543
547
return "" , fmt .Errorf ("no releases found" )
544
548
}
545
549
546
- return result .Releases [0 ], nil
550
+ for _ , release := range result .Releases {
551
+ if dates , ok := result .Dates [release ]; ok {
552
+ if dates .DevelopmentStart != nil && ! dates .DevelopmentStart .IsZero () && time .Now ().After (* dates .DevelopmentStart ) {
553
+ return release , nil
554
+ }
555
+ }
556
+ }
557
+
558
+ return "" , fmt .Errorf ("no valid development releases found" )
547
559
}
548
560
549
561
func listTestResultForVariant (featureGate string , jobVariant JobVariant ) (* TestingResults , error ) {
@@ -555,7 +567,7 @@ func listTestResultForVariant(featureGate string, jobVariant JobVariant) (*Testi
555
567
testPattern = fmt .Sprintf ("install should succeed" )
556
568
}
557
569
558
- fmt .Printf ("Query component readiness for all test run results for pattern %q on variant %#v\n " , testPattern , jobVariant )
570
+ fmt .Printf ("Query sippy for all test run results for pattern %q on variant %#v\n " , testPattern , jobVariant )
559
571
560
572
defaultTransport := & http.Transport {
561
573
Proxy : http .ProxyFromEnvironment ,
@@ -576,29 +588,28 @@ func listTestResultForVariant(featureGate string, jobVariant JobVariant) (*Testi
576
588
577
589
testNameToResults := map [string ]* TestResults {}
578
590
queries := sippy .QueriesFor (jobVariant .Cloud , jobVariant .Architecture , jobVariant .Topology , jobVariant .NetworkStack , testPattern )
591
+ var release string
592
+ // if its not main branch, then use the ENV var to determine the release version
593
+ currentRelease := os .Getenv ("PULL_BASE_REF" )
594
+ if strings .Contains (currentRelease , "release-" ) {
595
+ // example: release-4.18, release-4.17
596
+ release = strings .TrimPrefix (currentRelease , "release-" )
597
+ } else {
598
+ // means its main branch
599
+ var err error
600
+ release , err = getLatestRelease ()
601
+ if err != nil {
602
+ return nil , fmt .Errorf ("couldn't fetch latest release version: %w" , err )
603
+ }
604
+ }
605
+ fmt .Printf ("Querying sippy release %s for test run results\n " , release )
606
+
579
607
for _ , currQuery := range queries {
580
608
currURL := & url.URL {
581
609
Scheme : "https" ,
582
610
Host : "sippy.dptools.openshift.org" ,
583
611
Path : "api/tests" ,
584
612
}
585
- var release string
586
- // if its not main branch, then use the ENV var to determine the release version
587
- currentRelease := os .Getenv ("PULL_BASE_REF" )
588
- if strings .Contains (currentRelease , "release-" ) {
589
- // example: release-4.18, release-4.17
590
- release = strings .TrimPrefix (currentRelease , "release-" )
591
- } else {
592
- // Temporary until branching on 2025-04-18, or we find a way to fix sippy to return the dev branch sooner.
593
- release = "4.19"
594
-
595
- // means its main branch
596
- // var err error
597
- // release, err = getLatestRelease()
598
- // if err != nil {
599
- // return nil, fmt.Errorf("couldn't fetch latest release version: %w", err)
600
- // }
601
- }
602
613
queryParams := currURL .Query ()
603
614
queryParams .Add ("release" , release )
604
615
queryParams .Add ("period" , "default" )
0 commit comments