@@ -114,6 +114,9 @@ def __init__(self, version: str) -> None:
114114
115115 def __normalize_version (self , version : str ) -> str :
116116 if "-" in version :
117+ if version .split ("-" )[1 ] == "0" :
118+ return version .split ("-" )[0 ]
119+
117120 return version
118121
119122 click .secho (
@@ -123,14 +126,29 @@ def __normalize_version(self, version: str) -> str:
123126
124127 if version in self .__build_no_cache [self .product ]:
125128 build_no = self .__build_no_cache [self .product ][version ]
129+ if build_no == "0" :
130+ click .secho (
131+ f"Version { version } is a release version [CACHED]" , fg = "blue"
132+ )
133+ return version
134+
126135 click .secho (f"Found latest good build: { build_no } [CACHED]" , fg = "blue" )
127136 return f"{ version } -{ build_no } "
128137
129138 resp = requests .get (
130139 f"http://proget.build.couchbase.com:8080/api/get_version?product={ self .product } &version={ version } "
131140 )
132141 resp .raise_for_status ()
133- build_no = resp .json ()["BuildNumber" ]
142+ resp_body = resp .json ()
143+ if resp_body ["IsRelease" ] is True :
144+ click .secho (
145+ f"Version { version } is a release version, no build number needed" ,
146+ fg = "green" ,
147+ )
148+ self .__build_no_cache [self .product ][version ] = "0"
149+ return version
150+
151+ build_no = resp_body ["BuildNumber" ]
134152 click .secho (f"Found latest good build: { build_no } " , fg = "green" )
135153 self .__build_no_cache [self .product ][version ] = build_no
136154 return f"{ version } -{ build_no } "
@@ -191,7 +209,9 @@ def create(cls, name: str, version: str) -> TestServer:
191209 cls .initialize ()
192210
193211 if name not in cls .__registry :
194- raise ValueError (f"Unknown test server type: { name } " )
212+ raise ValueError (
213+ f"Unknown test server type: { name } . Valid names { cls .__registry .keys ()} "
214+ )
195215
196216 return cls .__registry [name ](version )
197217
0 commit comments