Skip to content

Commit bd41900

Browse files
committed
Added possibility of a manual trigger that is disregarding the release date
1 parent 58a45c2 commit bd41900

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

Tools/scripts/ReleaseAutomation/release_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ def __init__(self):
3939
self.yamato_project_id = '1201'
4040
self.command_to_run_on_release_branch = make_package_release_ready
4141

42-
self.release_weekday = 5 # Saturday
42+
self.release_weekday = 6 # Sunday
4343
self.release_week_cycle = 4 # Release every 4 weeks
44-
self.anchor_date = datetime.date(2025, 7, 19) # Anchor date for the release cycle (previous release Saturday)
44+
self.anchor_date = datetime.date(2025, 7, 20) # Anchor date for the release cycle (previous release Sunday)
4545

4646
self.package_version = get_package_version_from_manifest(self.manifest_path)
4747
self.release_branch_name = f"release/{self.package_version}" # Branch from which we want to release

Tools/scripts/ReleaseAutomation/run_release_preparation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ def PrepareNetcodePackageForRelease():
2121
except Exception as e:
2222
print("\n--- Release conditions were not met ---", file=sys.stderr)
2323
print(f"Reason: {e}", file=sys.stderr)
24-
sys.exit(0) # In this case we want the job not to fail because this will be an intended behavior
24+
sys.exit(0) # In this case we want the job not to fail because this will be an intended blocking behavior
25+
26+
2527

2628
try:
2729
print("\nStep 2: Creating release branch...")

Tools/scripts/Utils/verifyReleaseConditions.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
The script will check the following conditions:
55
1. **Is today a release day?**
66
- The script checks if today is a specified in ReleaseConfig weekday that falls on the release cycle of the team.
7+
- Note that if the job is triggered manually, this condition will be bypassed.
78
2. **Is the [Unreleased] section of the CHANGELOG.md not empty?**
89
- The script checks if the [Unreleased] section in the CHANGELOG.md contains meaningful entries.
910
3. **Does the release branch already exist?**
@@ -21,6 +22,15 @@
2122
import re
2223
from release_config import ReleaseConfig
2324

25+
def get_yamato_trigger_type():
26+
"""
27+
Retrieves the trigger type for the current Yamato job from environment variables.
28+
In other words, we can check if the job was triggered manually, by a schedule, or by a PR, etc.
29+
"""
30+
trigger_type = os.environ.get('YAMATO_TRIGGER_TYPE', 'unknown')
31+
return trigger_type
32+
33+
2434
def is_release_date(weekday, release_week_cycle, anchor_date):
2535
"""
2636
Checks if today is a weekday that falls on the release_week_cycle starting from anchor_date .
@@ -74,7 +84,7 @@ def verifyReleaseConditions(config: ReleaseConfig):
7484
error_messages = []
7585

7686
try:
77-
if not is_release_date(config.release_weekday, config.release_week_cycle, config.anchor_date):
87+
if get_yamato_trigger_type() != "Manual" and not is_release_date(config.release_weekday, config.release_week_cycle, config.anchor_date):
7888
error_messages.append(f"Condition not met: Today is not the scheduled release day. It should be weekday: {config.release_weekday}, every {config.release_week_cycle} weeks starting from {config.anchor_date}.")
7989

8090
if is_changelog_empty(config.changelog_path):

0 commit comments

Comments
 (0)