@@ -295,8 +295,19 @@ fn parse_published_artifact_tag(line: &str) -> Option<String> {
295295 if let Some ( date) = date {
296296 if let Some ( name) = name {
297297 // Create beta artifact in the form of beta-YYYY-MM-DD
298- if name. starts_with ( "channel-rust-" ) && name . ends_with ( "- beta.toml") {
298+ if name == "channel-rust-beta.toml" {
299299 return Some ( format ! ( "beta-{date}" ) ) ;
300+ } else if name. contains ( "beta" ) {
301+ // No other beta releases are recognized as toolchains.
302+ //
303+ // We also have names like this:
304+ //
305+ // * channel-rust-1.75-beta.toml
306+ // * channel-rust-1.75.0-beta.toml
307+ // * channel-rust-1.75.0-beta.1.toml
308+ //
309+ // Which should get ignored for now, they're not consumable via rustup yet.
310+ return None ;
300311 } else if let Some ( capture) = VERSION_REGEX . captures ( name) {
301312 if let Some ( version) = capture. get ( 1 ) . map ( |c| c. as_str ( ) ) {
302313 return Some ( version. to_string ( ) ) ;
@@ -759,4 +770,34 @@ mod tests {
759770 Some ( "1.63.0" . to_string( ) )
760771 ) ;
761772 }
773+
774+ #[ test]
775+ fn parse_published_beta_non_rustup_1 ( ) {
776+ assert_eq ! (
777+ parse_published_artifact_tag(
778+ "static.rust-lang.org/dist/2023-11-13/channel-rust-1.75-beta.toml"
779+ ) ,
780+ None
781+ ) ;
782+ }
783+
784+ #[ test]
785+ fn parse_published_beta_non_rustup_2 ( ) {
786+ assert_eq ! (
787+ parse_published_artifact_tag(
788+ "static.rust-lang.org/dist/2023-11-13/channel-rust-1.75.0-beta.toml"
789+ ) ,
790+ None
791+ ) ;
792+ }
793+
794+ #[ test]
795+ fn parse_published_beta_non_rustup_3 ( ) {
796+ assert_eq ! (
797+ parse_published_artifact_tag(
798+ "static.rust-lang.org/dist/2023-11-13/channel-rust-1.75.0-beta.1.toml"
799+ ) ,
800+ None
801+ ) ;
802+ }
762803}
0 commit comments