@@ -7,7 +7,7 @@ use crate::run::config::Config;
77use crate :: run:: runner:: ExecutorName ;
88use crate :: run:: uploader:: { Runner , UploadMetadata } ;
99
10- use super :: interfaces:: { CIProviderMetadata , RepositoryProvider } ;
10+ use super :: interfaces:: { CIProviderMetadata , Platform , RepositoryProvider } ;
1111
1212pub trait CIProviderDetector {
1313 /// Detects if the current environment is running inside the CI provider.
@@ -30,6 +30,8 @@ fn get_commit_hash(repository_root_path: &str) -> Result<String> {
3030}
3131
3232/// `CIProvider` is a trait that defines the necessary methods for a continuous integration provider.
33+ ///
34+ /// In other parts of the application, this may also be referred as `Platform`.
3335pub trait CIProvider {
3436 /// Returns the logger for the CI provider.
3537 fn get_logger ( & self ) -> Box < dyn SharedLogger > ;
@@ -47,15 +49,8 @@ pub trait CIProvider {
4749 /// ```
4850 fn get_provider_name ( & self ) -> & ' static str ;
4951
50- /// Returns the slug of the CI provider.
51- ///
52- /// # Example
53- ///
54- /// ```
55- /// let provider = MyCIProvider::new();
56- /// assert_eq!(provider.get_provider_slug(), "my-ci-provider");
57- /// ```
58- fn get_provider_slug ( & self ) -> & ' static str ;
52+ /// Returns the platform of the CI Provider
53+ fn get_platform ( & self ) -> Platform ;
5954
6055 /// Returns the metadata related to the CI provider.
6156 fn get_ci_provider_metadata ( & self ) -> Result < CIProviderMetadata > ;
@@ -101,7 +96,7 @@ pub trait CIProvider {
10196 executor : executor_name,
10297 system_info : system_info. clone ( ) ,
10398 } ,
104- platform : self . get_provider_slug ( ) . into ( ) ,
99+ platform : self . get_platform ( ) ,
105100 } )
106101 }
107102}
0 commit comments