Skip to content

Commit

Permalink
Merge branch 'trunk' into task/stats-insights-diffable-optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
staskus committed Feb 22, 2024
2 parents ce0d1fe + 39f08e5 commit 02c194f
Show file tree
Hide file tree
Showing 312 changed files with 14,532 additions and 9,719 deletions.
23 changes: 23 additions & 0 deletions .buildkite/commands/finalize-hotfix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash -eu

RELEASE_NUMBER=$1

if [[ -z "${RELEASE_NUMBER}" ]]; then
echo "Usage $0 <release number>"
exit 1
fi

echo '--- :git: Configure Git for release management'
.buildkite/commands/configure-git-for-release-management.sh

echo '--- :git: Checkout release branch'
.buildkite/commands/checkout-release-branch.sh "$RELEASE_NUMBER"

echo '--- :ruby: Setup Ruby tools'
install_gems

echo '--- :closed_lock_with_key: Access secrets'
bundle exec fastlane run configure_apply

echo '--- :shipit: Finalize hotfix'
bundle exec fastlane finalize_hotfix_release skip_confirm:true
24 changes: 24 additions & 0 deletions .buildkite/commands/log-outdated-pods.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -eu

RELEASE_NUMBER=$1

if [[ -z "${RELEASE_NUMBER}" ]]; then
echo "Usage $0 <release number>"
exit 1
fi

echo '--- :git: Checkout release branch'
.buildkite/commands/configure-git-for-release-management.sh
.buildkite/commands/checkout-release-branch.sh "$RELEASE_NUMBER"

echo '--- :ruby: Setup Ruby tools'
install_gems

echo '--- :cocoapods: Install Pods (required to check for outdated next)'
install_cocoapods

# Expand this group to surface the information.
#
# It's simpler than capturing the CocoaPods output, filtering, and annotating the build with it.
echo '+++ :cocoapods: Outdated Pods'
bundle exec pod outdated
24 changes: 20 additions & 4 deletions .buildkite/release-pipelines/complete-code-freeze.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.18.1
# Common environment values to use with the `env` key.
- &common_env
# Be sure to also update the `.xcode-version` file when updating the Xcode image/version here
IMAGE_ID: xcode-15.1

steps:
- label: Complete Code Freeze
plugins:
- automattic/a8c-ci-toolkit#2.18.2
key: complete_code_freeze
plugins: *common_plugins
env: *common_env
# The code freeze completion needs to run on macOS because it uses genstrings under the hood
agents:
queue: mac
env:
IMAGE_ID: xcode-15.1
command: ".buildkite/commands/complete-code-freeze.sh $RELEASE_VERSION"

- label: Log Outdated Pods
depends_on: complete_code_freeze
plugins: *common_plugins
env: *common_env
agents:
queue: mac
command: ".buildkite/commands/log-outdated-pods.sh $RELEASE_VERSION"
10 changes: 10 additions & 0 deletions .buildkite/release-pipelines/finalize-hotfix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
steps:
- label: Finalize Release
plugins:
- automattic/a8c-ci-toolkit#2.18.2
# The finalization needs to run on macOS because of localization linting
agents:
queue: mac
env:
IMAGE_ID: xcode-15.1
command: ".buildkite/commands/finalize-hotfix.sh $VERSION"
21 changes: 21 additions & 0 deletions .buildkite/release-pipelines/new-hotfix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
steps:
- label: New Hotfix Deployment
plugins:
- automattic/a8c-ci-toolkit#2.18.2
# The beta needs to run on macOS because it uses genstrings under the hood
agents:
queue: mac
env:
IMAGE_ID: xcode-15.1
command: |
echo '--- :git: Configure Git for release management'
.buildkite/commands/configure-git-for-release-management.sh
echo '--- :ruby: Setup Ruby tools'
install_gems
echo '--- :closed_lock_with_key: Access secrets'
bundle exec fastlane run configure_apply
echo '--- :shipit: Start new hotfix'
bundle exec fastlane new_hotfix_release skip_confirm:true version:"$VERSION"
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ PR submission checklist:
- [ ] I have considered adding accessibility improvements for my changes.
- [ ] I have considered if this change warrants user-facing release notes and have added them to `RELEASE-NOTES.txt` if necessary.

UI Changes testing checklist:
Testing checklist:
- [ ] WordPress.com sites and self-hosted Jetpack sites.
- [ ] Portrait and landscape orientations.
- [ ] Light and dark modes.
- [ ] Fonts: Larger, smaller and bold text.
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/run-danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ name: ☢️ Danger

on:
pull_request:
types: [opened, synchronize, edited, review_requested, review_request_removed, labeled, unlabeled, milestoned, demilestoned]
types: [opened, reopened, ready_for_review, synchronize, edited, labeled, unlabeled, milestoned, demilestoned]

jobs:
dangermattic:
uses: Automattic/dangermattic/.github/workflows/reusable-run-danger.yml@trunk
# runs on draft PRs only for opened / synchronize events
if: ${{ (github.event.pull_request.draft == false) || (github.event.pull_request.draft == true && contains(fromJSON('["opened", "synchronize"]'), github.event.action)) }}
uses: Automattic/dangermattic/.github/workflows/reusable-run-danger.yml@v1.0.0
secrets:
github-token: ${{ secrets.DANGERMATTIC_GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/validate-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 📝 Validate Issues

on:
issues:
types: [opened, labeled, unlabeled]

jobs:
check-labels-on-issues:
uses: Automattic/dangermattic/.github/workflows/reusable-check-labels-on-issues.yml@v1.0.0
with:
label-format-list: '[
"^\[.+\]",
"^[[:alnum:]]"
]'
label-error-message: '🚫 Please add a type label (e.g. **[Type] Enhancement**) and a feature label (e.g. **Stats**) to this issue.'
label-success-message: 'Thanks for reporting! 👍'
secrets:
github-token: ${{ secrets.DANGERMATTIC_GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"state" : "Started",
"possibleStates" : [ "Started", "initial_likes_list", "post_liked", "new_likes_list" ]
},
{
"id" : "reader_subscriptions_flow",
"name" : "reader_subscriptions_flow",
"state" : "Started",
"possibleStates" : [ "Started", "initial_subscriptions_list", "empty_subscriptions_list" ]
},
{
"id" : "new_page_flow",
"name" : "new_page_flow",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"scenarioName": "reader_subscriptions_flow",
"requiredScenarioState": "Started",
"newScenarioState": "initial_subscriptions_list",
"request": {
"method": "GET",
"urlPath": "/rest/v1.2/read/following"
Expand Down Expand Up @@ -1478,4 +1481,4 @@
"Cache-Control": "no-cache, must-revalidate, max-age=0"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"scenarioName": "reader_subscriptions_flow",
"requiredScenarioState": "initial_subscriptions_list",
"newScenarioState": "empty_subscriptions_list",
"request": {
"method": "GET",
"urlPath": "/rest/v1.2/read/following"
},
"response": {
"status": 200,
"jsonBody": {
"date_range": {
"before": "2019-05-23T13:00:09+00:00",
"after": "2021-05-17T16:34:44+00:00"
},
"number": 0,
"posts": [
]
},
"headers": {
"Content-Type": "application/json",
"Connection": "keep-alive",
"Cache-Control": "no-cache, must-revalidate, max-age=0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,31 @@
"page": 1,
"refresh": 1,
"cards": [
{
"type": "interests_you_may_like",
"data": [
{
"slug": "blogging",
"title": "Blogging",
"score": 278
},
{
"slug": "travel",
"title": "Travel",
"score": 251
},
{
"slug": "photos",
"title": "Photos",
"score": 173
},
{
"slug": "technology",
"title": "Technology",
"score": 139
}
]
},
{
"type": "interests_you_may_like",
"data": [
Expand Down Expand Up @@ -3934,13 +3959,12 @@
"use_excerpt": false
}
}
],
"next_page_handle": "ZnJvbT04JnJlZnJlc2g9MQ=="
]
},
"headers": {
"Content-Type": "application/json",
"Connection": "keep-alive",
"Cache-Control": "no-cache, must-revalidate, max-age=0"
}
}
}
}
47 changes: 26 additions & 21 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
# frozen_string_literal: true

def release_branch?
danger.github.branch_for_base.start_with?('release/') || danger.github.branch_for_base.start_with?('hotfix/')
end
github.dismiss_out_of_range_messages

def main_branch?
danger.github.branch_for_base == 'trunk'
end
# `files: []` forces rubocop to scan all files, not just the ones modified in the PR
rubocop.lint(files: [], force_exclusion: true, inline_comment: true, fail_on_inline_comment: true, include_cop_names: true)

def wip_feature?
has_wip_label = github.pr_labels.any? { |label| label.include?('WIP') }
has_wip_title = github.pr_title.include?('WIP')
manifest_pr_checker.check_all_manifest_lock_updated

has_wip_label || has_wip_title
podfile_checker.check_podfile_does_not_have_branch_references

ios_release_checker.check_core_data_model_changed
ios_release_checker.check_release_notes_and_app_store_strings

# skip remaining checks if we're in a release-process PR
if github.pr_labels.include?('Releases')
message('This PR has the `Releases` label: some checks will be skipped.')
return
end

return if github.pr_labels.include?('Releases')
common_release_checker.check_internal_release_notes_changed(report_type: :message)

github.dismiss_out_of_range_messages
ios_release_checker.check_modified_translations_on_release_branch

manifest_pr_checker.check_all_manifest_lock_updated
view_changes_checker.check

pr_size_checker.check_diff_size(max_size: 500)

# skip remaining checks if the PR is still a Draft
if github.pr_draft?
message('This PR is still a Draft: some checks will be skipped.')
return
end

labels_checker.check(
do_not_merge_labels: ['[Status] DO NOT MERGE'],
required_labels: [//],
required_labels_error: 'PR requires at least one label.'
)

view_changes_need_screenshots.view_changes_need_screenshots

pr_size_checker.check_diff_size

# skip check for draft PRs and for WIP features unless the PR is against the main branch or release branch
milestone_checker.check_milestone_due_date(days_before_due: 4) unless github.pr_draft? || (wip_feature? && !(release_branch? || main_branch?))

rubocop.lint(inline_comment: true, fail_on_inline_comment: true, include_cop_names: true)
# runs the milestone check if this is not a WIP feature and the PR is against the main branch or the release branch
milestone_checker.check_milestone_due_date(days_before_due: 4) if (github_utils.main_branch? || github_utils.release_branch?) && !github_utils.wip_feature?
9 changes: 5 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ source 'https://rubygems.org'

gem 'cocoapods', '~> 1.14'
gem 'commonmarker'
gem 'danger-dangermattic', git: 'https://github.com/Automattic/dangermattic'
gem 'danger-dangermattic', '~> 1.0'
gem 'dotenv'
# 2.217.0 includes a fix for Xcode 15 test results parsing in CI
gem 'fastlane', '~> 2.217'
# 2.219.0 includes a fix for a bug introduced in 2.218.0
# See https://github.com/fastlane/fastlane/issues/21762#issuecomment-1875208663
gem 'fastlane', '~> 2.219'
gem 'fastlane-plugin-appcenter', '~> 2.1'
gem 'fastlane-plugin-sentry'
# This comment avoids typing to switch to a development version for testing.
Expand All @@ -17,7 +18,7 @@ gem 'fastlane-plugin-sentry'
# gem 'fastlane-plugin-wpmreleasetoolkit', git: 'https://github.com/wordpress-mobile/release-toolkit', ref: '2cb009edaee3d058a61cfeb503e533eb0647f108'
gem 'fastlane-plugin-wpmreleasetoolkit', '~> 9.3'
gem 'rake'
gem 'rubocop', '~> 1.30'
gem 'rubocop', '~> 1.60'
gem 'rubocop-rake', '~> 0.6'
gem 'xcpretty-travis-formatter'

Expand Down

0 comments on commit 02c194f

Please sign in to comment.