99class BuildScenario (str , Enum ):
1010 """Represents the context in which the build is running."""
1111
12- RELEASE = "release" # Official release build from a git tag
12+ RELEASE = "release" # Official release triggered by a git tag
1313 PATCH = "patch" # CI build for a patch/pull request
14- MASTER = "master " # CI build from a merge to the master
14+ STAGING = "staging " # CI build from a merge to the master
1515 DEVELOPMENT = "development" # Local build on a developer machine
1616
1717 @classmethod
@@ -23,15 +23,14 @@ def infer_scenario_from_environment(cls) -> "BuildScenario":
2323 patch_id = os .getenv ("version_id" )
2424
2525 if git_tag :
26- scenario = BuildScenario .RELEASE # TODO: git tag won't trigger the pipeline, only the promotion process
26+ # Release scenario and the git tag will be used for promotion process only
27+ scenario = BuildScenario .RELEASE
2728 logger .info (f"Build scenario: { scenario } (git_tag: { git_tag } )" )
2829 elif is_patch :
2930 scenario = BuildScenario .PATCH
3031 logger .info (f"Build scenario: { scenario } (patch_id: { patch_id } )" )
3132 elif is_evg :
32- scenario = (
33- BuildScenario .MASTER
34- ) # TODO: MASTER -> Staging
33+ scenario = BuildScenario .STAGING
3534 logger .info (f"Build scenario: { scenario } (patch_id: { patch_id } )" )
3635 else :
3736 scenario = BuildScenario .DEVELOPMENT
@@ -63,7 +62,7 @@ def from_scenario(cls, scenario: BuildScenario) -> "BuildContext":
6362 git_tag = git_tag ,
6463 patch_id = patch_id ,
6564 signing_enabled = signing_enabled ,
66- version = git_tag or patch_id , # TODO: update this
65+ version = git_tag or patch_id ,
6766 )
6867
6968 def get_version (self ) -> str :
@@ -76,7 +75,8 @@ def get_version(self) -> str:
7675
7776 def get_base_registry (self ) -> str :
7877 """Get the base registry URL for the current scenario."""
79- if self .scenario == BuildScenario .RELEASE :
78+ # TODO CLOUDP-335471: when working on the promotion process, use the prod registry variable in RELEASE scenario
79+ if self .scenario == BuildScenario .STAGING :
8080 return os .environ .get ("STAGING_REPO_URL" )
8181 else :
8282 return os .environ .get ("BASE_REPO_URL" )
0 commit comments