@@ -68,17 +68,28 @@ ext.testArtifact = { p, String name = "test" ->
6868}
6969
7070tasks. register(" updateCIBwcVersions" 
71-   doLast {
72-     File  yml =  file(" .ci/bwcVersions" 
73-     yml. text =  " " 
74-     yml <<  " BWC_VERSION:\n " 
75-     BuildParams . bwcVersions. indexCompatible. each {
76-       yml <<  "   - \" $it  \"\n " 
71+   def  writeVersions =  { File  file , List<Version >  versions  -> 
72+     file. text =  " " 
73+     file <<  " BWC_VERSION:\n " 
74+     versions. each {
75+       file <<  "   - \" $it  \"\n " 
7776    }
7877  }
78+   doLast {
79+     writeVersions(file(" .ci/bwcVersions" BuildParams . bwcVersions. indexCompatible)
80+     writeVersions(file(" .ci/snapshotBwcVersions" BuildParams . bwcVersions. unreleasedIndexCompatible)
81+   }
7982}
8083
8184tasks. register(" verifyVersions" 
85+   def  verifyCiYaml =  { File  file , List<Version >  versions  -> 
86+     String  ciYml =  file. text
87+     versions. each {
88+       if  (ciYml. contains(" \" $it  \"\n " ==  false ) {
89+         throw  new  Exception (" ${ file} " 
90+       }
91+     }
92+   }
8293  doLast {
8394    if  (gradle. startParameter. isOffline()) {
8495      throw  new  GradleException (" Must run in online mode to verify versions" 
@@ -94,12 +105,8 @@ tasks.register("verifyVersions") {
94105          .collect { Version . fromString(it) }
95106      )
96107    }
97-     String  ciYml =  file(" .ci/bwcVersions" . text
98-     BuildParams . bwcVersions. indexCompatible. each {
99-       if  (ciYml. contains(" \" $it  \"\n " ==  false ) {
100-         throw  new  Exception (" .ci/bwcVersions is outdated, run `./gradlew updateCIBwcVersions` and check in the results" 
101-       }
102-     }
108+     verifyCiYaml(file(" .ci/bwcVersions" BuildParams . bwcVersions. indexCompatible)
109+     verifyCiYaml(file(" .ci/snapshotBwcVersions" BuildParams . bwcVersions. unreleasedIndexCompatible)
103110
104111    //  Make sure backport bot config file is up to date
105112    JsonNode  backportConfig =  new  ObjectMapper (). readTree(file(" .backportrc.json" 
0 commit comments