Skip to content

Commit

Permalink
[TO REVERT] Comment out side effects to start_code_freeze lane, kee…
Browse files Browse the repository at this point in the history
…ping only version bump
  • Loading branch information
iangmaia committed Oct 25, 2024
1 parent 77e220a commit e47032a
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 69 deletions.
4 changes: 1 addition & 3 deletions .buildkite/release-pipelines/start-code-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

agents:
queue: mac
hostname: MV-MKE-ARM64-001

env:
IMAGE_ID: $IMAGE_ID
Expand All @@ -22,9 +23,6 @@ steps:
echo '--- :snowflake: Start Code Freeze'
bundle exec fastlane start_code_freeze skip_confirm:true
echo '--- :cocoapods: Check for Outdated Pods'
.buildkite/commands/log-outdated-pods.sh
retry:
manual:
# If those jobs fail, one should always prefer re-triggering a new build from ReleaseV2 rather than retrying the individual job from Buildkite
Expand Down
133 changes: 67 additions & 66 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -175,28 +175,29 @@ platform :ios do
ensure_git_status_clean

# Check out the up-to-date default branch, the designated starting point for the code freeze
Fastlane::Helper::GitHelper.checkout_and_pull(DEFAULT_BRANCH)
# Fastlane::Helper::GitHelper.checkout_and_pull(DEFAULT_BRANCH)
Fastlane::Helper::GitHelper.checkout_and_pull('iangmaia/use-trusted-mac-agents-for-releases')

# Checks if internal dependencies are on a stable version
check_pods_references
# # Checks if internal dependencies are on a stable version
# check_pods_references

UI.important <<-MESSAGE
# UI.important <<-MESSAGE

Code Freeze:
• New release branch from #{DEFAULT_BRANCH}: release/#{release_version_next}
• Current release version and build code: #{release_version_current} (#{build_code_current}).
• New release version and build code: #{release_version_next} (#{build_code_code_freeze}).
# Code Freeze:
# • New release branch from #{DEFAULT_BRANCH}: release/#{release_version_next}
# • Current release version and build code: #{release_version_current} (#{build_code_current}).
# • New release version and build code: #{release_version_next} (#{build_code_code_freeze}).

MESSAGE
UI.user_error!("Terminating as requested. Don't forget to run the remainder of this automation manually.") unless skip_confirm || UI.confirm('Do you want to continue?')
# MESSAGE
# UI.user_error!("Terminating as requested. Don't forget to run the remainder of this automation manually.") unless skip_confirm || UI.confirm('Do you want to continue?')

# Create the release branch
new_release_branch = "release/#{release_version_next}"
ensure_branch_does_not_exist!(new_release_branch)
# # Create the release branch
# new_release_branch = "release/#{release_version_next}"
# ensure_branch_does_not_exist!(new_release_branch)

UI.message('Creating release branch...')
Fastlane::Helper::GitHelper.create_branch(new_release_branch, from: DEFAULT_BRANCH)
UI.success("Done! New release branch is: #{git_branch}")
# UI.message('Creating release branch...')
# Fastlane::Helper::GitHelper.create_branch(new_release_branch, from: DEFAULT_BRANCH)
# UI.success("Done! New release branch is: #{git_branch}")

# Bump the release version and build code and write it to the `xcconfig` file
UI.message('Bumping release version and build code...')
Expand All @@ -207,61 +208,61 @@ platform :ios do
commit_version_bump
UI.success("Done! New Release Version: #{release_version_current}. New Build Code: #{build_code_current}")

new_version = release_version_current
# new_version = release_version_current

extract_release_notes_for_version(
version: new_version,
release_notes_file_path: RELEASE_NOTES_SOURCE_PATH,
extracted_notes_file_path: RELEASE_NOTES_PATH
)
ios_update_release_notes(
new_version: new_version,
release_notes_file_path: RELEASE_NOTES_SOURCE_PATH
)
# extract_release_notes_for_version(
# version: new_version,
# release_notes_file_path: RELEASE_NOTES_SOURCE_PATH,
# extracted_notes_file_path: RELEASE_NOTES_PATH
# )
# ios_update_release_notes(
# new_version: new_version,
# release_notes_file_path: RELEASE_NOTES_SOURCE_PATH
# )

UI.important('Pushing changes to remote and configuring the release on GitHub')
UI.user_error!("Terminating as requested. Don't forget to run the remainder of this automation manually.") unless skip_confirm || UI.confirm('Do you want to continue?')
# UI.important('Pushing changes to remote and configuring the release on GitHub')
# UI.user_error!("Terminating as requested. Don't forget to run the remainder of this automation manually.") unless skip_confirm || UI.confirm('Do you want to continue?')

push_to_git_remote(tags: false)

# Protect release/* branch
copy_branch_protection(
repository: GITHUB_REPO,
from_branch: DEFAULT_BRANCH,
to_branch: "release/#{new_version}"
)

begin
# Move PRs to next milestone
moved_prs = update_assigned_milestone(
repository: GITHUB_REPO,
from_milestone: new_version,
to_milestone: release_version_next,
comment: "Version `#{new_version}` has now entered code-freeze, so the milestone of this PR has been updated to `#{release_version_next}`."
)

# Add ❄️ marker to milestone title to indicate we entered code-freeze
set_milestone_frozen_marker(
repository: GITHUB_REPO,
milestone: new_version
)
rescue StandardError => e
moved_prs = []

report_milestone_error(error_title: "Error freezing milestone `#{new_version}`: #{e.message}")
end

UI.message("Moved the following PRs to milestone #{release_version_next}: #{moved_prs.join(', ')}")

# Annotate the build with the moved PRs
moved_prs_info = if moved_prs.empty?
"👍 No open PR were targeting `#{new_version}` at the time of code-freeze"
else
"#{moved_prs.count} PRs targeting `#{new_version}` were still open and thus moved to `#{release_version_next}`:\n" \
+ moved_prs.map { |pr_num| "[##{pr_num}](https://github.com/#{GITHUB_REPO}/pull/#{pr_num})" }.join(', ')
end

buildkite_annotate(style: moved_prs.empty? ? 'success' : 'warning', context: 'start-code-freeze', message: moved_prs_info) if is_ci
# # Protect release/* branch
# copy_branch_protection(
# repository: GITHUB_REPO,
# from_branch: DEFAULT_BRANCH,
# to_branch: "release/#{new_version}"
# )

# begin
# # Move PRs to next milestone
# moved_prs = update_assigned_milestone(
# repository: GITHUB_REPO,
# from_milestone: new_version,
# to_milestone: release_version_next,
# comment: "Version `#{new_version}` has now entered code-freeze, so the milestone of this PR has been updated to `#{release_version_next}`."
# )

# # Add ❄️ marker to milestone title to indicate we entered code-freeze
# set_milestone_frozen_marker(
# repository: GITHUB_REPO,
# milestone: new_version
# )
# rescue StandardError => e
# moved_prs = []

# report_milestone_error(error_title: "Error freezing milestone `#{new_version}`: #{e.message}")
# end

# UI.message("Moved the following PRs to milestone #{release_version_next}: #{moved_prs.join(', ')}")

# # Annotate the build with the moved PRs
# moved_prs_info = if moved_prs.empty?
# "👍 No open PR were targeting `#{new_version}` at the time of code-freeze"
# else
# "#{moved_prs.count} PRs targeting `#{new_version}` were still open and thus moved to `#{release_version_next}`:\n" \
# + moved_prs.map { |pr_num| "[##{pr_num}](https://github.com/#{GITHUB_REPO}/pull/#{pr_num})" }.join(', ')
# end

# buildkite_annotate(style: moved_prs.empty? ? 'success' : 'warning', context: 'start-code-freeze', message: moved_prs_info) if is_ci
end

#####################################################################################
Expand Down

0 comments on commit e47032a

Please sign in to comment.