Skip to content

Commit

Permalink
Merge branch 'develop' into sam/additional-autofill-pixels
Browse files Browse the repository at this point in the history
# By Dominik Kapusta (4) and others
# Via GitHub
* develop:
  Blockable JS Alerts inside tabs (#904)
  Fix add bookmark / folder modal in fullscreen (#930)
  Add Mac App Store target (#927)
  Pull request review checklist added to the pull request template (#935)
  Version Bump to 0.31.7
  Update embedded files
  Update BSK with autofill 6.1.2 (#942)
  Migrate to targeted Swift Concurrency checking (#937)
  Add bundler configuration to limit Gemfile.lock noise (#939)
  update openssl depedency (#918)
  Remove tab content when showing TabContent.none (such as for new tabs opened from navigation links) (#938)
  Update GRDB to 2.0.0 (upstream 6.6.0, SQLCipher 4.5.3) (#933)
  Sparkle 2 (#934)
  Bump Submodules/privacy-reference-tests from `de75d51` to `4fdbbb6` (#932)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
  • Loading branch information
samsymons committed Jan 26, 2023
2 parents 6f3595c + c7f54ed commit 8dc6d54
Show file tree
Hide file tree
Showing 119 changed files with 18,874 additions and 14,897 deletions.
3 changes: 3 additions & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: "ruby"
18 changes: 4 additions & 14 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<!--
Note: This checklist is a reminder of our shared engineering expectations. Feel free to change it, although assigning a GitHub reviewer and the items in bold are required.
-->

Task/Issue URL:
Tech Design URL:
CC:

**Description**:

**Steps to test this PR**:
1.

<!--
Tagging instructions
If this PR isn't ready to be merged for whatever reason it should be marked with the `DO NOT MERGE` label (particularly if it's a draft)
Expand All @@ -16,18 +15,9 @@ If it's pending Product Review/PFR, please add the `Pending Product Review` labe
If at any point it isn't actively being worked on/ready for review/otherwise moving forward (besides the above PR/PFR exception) strongly consider closing it (or not opening it in the first place). If you decide not to close it, make sure it's labelled to make it clear the PRs state and comment with more information.
-->

**Steps to test this PR**:
1.

**Testing checklist**:

* [ ] Test with Release configuration
* [ ] Test proper deallocation of tabs
* [ ] Make sure committed submodule changes are desired
* [ ] Make sure configuration is changed only in xcconfig files, not in the Xcode project file directly

---
###### Internal references:
[Pull Request Review Checklist](https://app.asana.com/0/1202500774821704/1203764234894239/f)
[Software Engineering Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design Template](https://app.asana.com/0/59792373528535/184709971311943)
**When ready for review, remember to post the PR in MM**
77 changes: 77 additions & 0 deletions .github/workflows/appstore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Make App Store Connect Release

on:
workflow_dispatch:
inputs:
destination:
description: "Upload destination (TestFlight or App Store)"
required: true
default: appstore
type: choice
options:
- testflight
- appstore

jobs:
make-release:

name: Make App Store Connect Release

runs-on: macos-12

steps:

- name: Assert release branch
if: github.event.inputs.destination == 'appstore'
run: |
case "${{ github.ref }}" in
refs/heads/release/*) ;;
refs/heads/hotfix/*) ;;
*) echo "👎 Not a release or hotfix branch"; exit 1 ;;
esac
- name: Register SSH keys for submodules access
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: |
${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }}
${{ secrets.SSH_PRIVATE_KEY_FIND_IN_PAGE }}
${{ secrets.SSH_PRIVATE_KEY_PRIVACY_DASHBOARD }}
- name: Check out the code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_14.1.app/Contents/Developer

- name: Prepare fastlane
run: bundle install

- name: Install xcbeautify
run: brew install xcbeautify

- name: Archive and Upload the App
env:
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
run: bundle exec fastlane release_${{ github.event.inputs.destination }}

- name: Send Mattermost message
env:
WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
DESTINATION: ${{ github.event.inputs.destination }}
run: |
export MM_USER_HANDLE=$(base64 -d <<< ${{ secrets.MM_HANDLES_BASE64 }} | jq ".${{ github.actor }}" | tr -d '"')
if [[ -z "${MM_USER_HANDLE}" ]]; then
echo "Mattermost user handle not known for ${{ github.actor }}, skipping sending message"
else
curl -s -H 'Content-type: application/json' \
-d "$(envsubst < ./scripts/assets/appstore-release-mm-template.json)" \
${{ secrets.MM_WEBHOOK_URL }}
fi
19 changes: 16 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ jobs:

name: Unit Tests

strategy:
matrix:
flavor: [ "Sandbox", "Non-Sandbox" ]
include:
- scheme: DuckDuckGo Privacy Browser
flavor: Non-Sandbox
- scheme: DuckDuckGo Privacy Browser App Store
flavor: Sandbox

runs-on: macos-12
timeout-minutes: 30

Expand All @@ -67,19 +76,23 @@ jobs:
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_14.1.app/Contents/Developer

- name: Install xcbeautify
run: brew install xcbeautify

- name: Build and test
run: |
set -o pipefail && xcodebuild test \
-scheme "DuckDuckGo Privacy Browser" \
-scheme "${{ matrix.scheme }}" \
-configuration "CI" \
ENABLE_TESTABILITY=true \
| xcpretty -r junit -o unittests.xml
| xcbeautify --report junit --report-path . --junit-report-filename unittests-${{ matrix.flavor }}.xml
- name: Publish unit tests report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: unittests.xml
check_name: "Test Report: ${{ matrix.flavor }}"
report_paths: unittests-${{ matrix.flavor }}.xml

verify-autoconsent-bundle:
name: 'Verify autoconsent bundle'
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
options:
- review
- release
- review-appstore
- release-appstore
create-dmg:
description: "Create DMG image"
required: true
Expand Down Expand Up @@ -74,6 +76,9 @@ jobs:
with:
submodules: recursive

- name: Install xcbeautify
run: brew install xcbeautify

- name: Install create-dmg
if: ${{ github.event.inputs.create-dmg == true || github.event.inputs.asana-task-url }}
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# ruby
vendor

.DS_Store
node_modules/

Expand Down
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ excluded:
- Unit Tests
- Integration Tests
- UI Tests
- vendor
6 changes: 4 additions & 2 deletions Configuration/App/AppTargetsBase.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = GlobalAccentColor
CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES

CODE_SIGN_STYLE[sdk=*] = Manual
CODE_SIGN_STYLE[config=Debug][sdk=*] = Automatic

CURRENT_PROJECT_VERSION = $(MARKETING_VERSION)

ENABLE_HARDENED_RUNTIME = YES
Expand All @@ -38,8 +41,7 @@ INFOPLIST_FILE = DuckDuckGo/Info.plist

LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks

PRODUCT_MODULE_NAME = $(TARGET_NAME:c99extidentifier)
PRODUCT_NAME = $(PRODUCT_NAME_PREFIX)
PRODUCT_NAME[config=Review] = $(PRODUCT_NAME_PREFIX) Review
PRODUCT_NAME[config=Review][arch=*][sdk=*] = $(PRODUCT_NAME_PREFIX) Review

SWIFT_OBJC_BRIDGING_HEADER = $(SRCROOT)/DuckDuckGo/Bridging.h
5 changes: 1 addition & 4 deletions Configuration/App/DuckDuckGo.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
BUNDLE_IDENTIFIER_PREFIX = com.duckduckgo.macos.browser

CODE_SIGN_ENTITLEMENTS = DuckDuckGo/DuckDuckGo.entitlements
CODE_SIGN_ENTITLEMENTS[config=CI] = DuckDuckGo/DuckDuckGoCI.entitlements

CODE_SIGN_STYLE[sdk=*] = Manual
CODE_SIGN_STYLE[config=Debug][sdk=*] = Automatic
CODE_SIGN_ENTITLEMENTS[config=CI][arch=*][sdk=*] = DuckDuckGo/DuckDuckGoCI.entitlements

CODE_SIGN_IDENTITY[sdk=macosx*] = Developer ID Application
CODE_SIGN_IDENTITY[config=Debug][sdk=macosx*] = Apple Development
Expand Down
43 changes: 43 additions & 0 deletions Configuration/App/DuckDuckGoAppStore.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright © 2022 DuckDuckGo. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#include "AppTargetsBase.xcconfig"
#include "../AppStore.xcconfig"
#include "ManualAppStoreRelease.xcconfig"

BUNDLE_IDENTIFIER_PREFIX = com.duckduckgo.mobile.ios

CODE_SIGN_ENTITLEMENTS = DuckDuckGo/DuckDuckGoAppStore.entitlements
CODE_SIGN_ENTITLEMENTS[config=CI][arch=*][sdk=*] = DuckDuckGo/DuckDuckGoAppStoreCI.entitlements

CODE_SIGN_IDENTITY[sdk=macosx*] = 3rd Party Mac Developer Application
CODE_SIGN_IDENTITY[config=Review][sdk=macosx*] = Developer ID Application
CODE_SIGN_IDENTITY[config=Debug][sdk=macosx*] = Apple Development
CODE_SIGN_IDENTITY[config=CI][sdk=macosx*] =

ENABLE_APP_SANDBOX = YES

MACOSX_DEPLOYMENT_TARGET = 12.3

PRODUCT_MODULE_NAME = DuckDuckGo_Privacy_Browser
PRODUCT_NAME_PREFIX = DuckDuckGo App Store
PRODUCT_NAME[config=Release][arch=*][sdk=*] = $(RELEASE_PRODUCT_NAME_OVERRIDE:default=$(PRODUCT_NAME_PREFIX))

PROVISIONING_PROFILE_SPECIFIER[config=Debug][sdk=macosx*] =
PROVISIONING_PROFILE_SPECIFIER[config=CI][sdk=macosx*] =
PROVISIONING_PROFILE_SPECIFIER[config=Release][sdk=macosx*] = match AppStore com.duckduckgo.mobile.ios macos
PROVISIONING_PROFILE_SPECIFIER[config=Review][sdk=macosx*] = Sandbox MacOS Browser Product Review

#include? "../../LocalOverridesAppStore.xcconfig"
33 changes: 33 additions & 0 deletions Configuration/App/ManualAppStoreRelease.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// ManualAppStoreRelease.xcconfig
//
// Copyright © 2023 DuckDuckGo. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

// App Store app target's PRODUCT_NAME is "DuckDuckGo App Store"
// ("DuckDuckGo App Store Review" for Product Review build).
// It's required to keep it different from non-App Store target
// because otherwise Xcode gets confused: it would make unit tests
// targets depend on both app targets and require both to be built
// before unit tests are compiled, and would immediately fail due
// to the same output files being generated by 2 targets.
//
// For Release build we still need to keep "DuckDuckGo" name. This
// is handled automatically by archive.sh, fastlane and GitHub Actions,
// but in rare cases when the release has to be done manually from
// Xcode, this additional setting is required.
//
// Uncomment the line below when making App Store Release manually from Xcode:
//RELEASE_PRODUCT_NAME_OVERRIDE = DuckDuckGo
28 changes: 28 additions & 0 deletions Configuration/AppStore.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

// Copyright © 2022 DuckDuckGo. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#include "AppStoreBuildNumber.xcconfig"

GCC_PREPROCESSOR_DEFINITIONS[arch=*][sdk=*] = APPSTORE=1
GCC_PREPROCESSOR_DEFINITIONS[config=CI][arch=*][sdk=*] = APPSTORE=1 DEBUG=1 CI=1 $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[config=Debug][arch=*][sdk=*] = APPSTORE=1 DEBUG=1 $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[config=Review][arch=*][sdk=*] = APPSTORE=1 REVIEW=1 $(inherited)

MACOSX_DEPLOYMENT_TARGET = 12.3

SWIFT_ACTIVE_COMPILATION_CONDITIONS[arch=*][sdk=*] = APPSTORE $(FEATURE_FLAGS)
SWIFT_ACTIVE_COMPILATION_CONDITIONS[config=CI][arch=*][sdk=*] = APPSTORE DEBUG CI $(FEATURE_FLAGS)
SWIFT_ACTIVE_COMPILATION_CONDITIONS[config=Debug][arch=*][sdk=*] = APPSTORE DEBUG $(FEATURE_FLAGS)
1 change: 1 addition & 0 deletions Configuration/AppStoreBuildNumber.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CURRENT_PROJECT_VERSION = 4
2 changes: 2 additions & 0 deletions Configuration/Common.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ GCC_PREPROCESSOR_DEFINITIONS[config=Review][arch=*][sdk=*] = REVIEW=1 $(inherite

MACOSX_DEPLOYMENT_TARGET = 10.15

PRODUCT_MODULE_NAME = $(TARGET_NAME:c99extidentifier)

SWIFT_ACTIVE_COMPILATION_CONDITIONS[arch=*][sdk=*] = $(FEATURE_FLAGS)
SWIFT_ACTIVE_COMPILATION_CONDITIONS[config=CI][arch=*][sdk=*] = DEBUG CI $(FEATURE_FLAGS)
SWIFT_ACTIVE_COMPILATION_CONDITIONS[config=Debug][arch=*][sdk=*] = DEBUG $(FEATURE_FLAGS)
Expand Down
2 changes: 2 additions & 0 deletions Configuration/Global.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,5 @@ SWIFT_OPTIMIZATION_LEVEL[config=Debug][arch=*][sdk=*] = -Onone
SWIFT_COMPILATION_MODE = wholemodule
SWIFT_COMPILATION_MODE[config=CI][arch=*][sdk=*] =
SWIFT_COMPILATION_MODE[config=Debug][arch=*][sdk=*] =

SWIFT_STRICT_CONCURRENCY = targeted;
1 change: 1 addition & 0 deletions Configuration/Tests/IntegrationTests.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ MACOSX_DEPLOYMENT_TARGET = 11.1
INFOPLIST_FILE = Integration Tests/Info.plist
PRODUCT_BUNDLE_IDENTIFIER = com.duckduckgo.Integration-Tests

TEST_HOST=$(BUILT_PRODUCTS_DIR)/DuckDuckGo.app/Contents/MacOS/DuckDuckGo
21 changes: 21 additions & 0 deletions Configuration/Tests/IntegrationTestsAppStore.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright © 2022 DuckDuckGo. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#include "IntegrationTests.xcconfig"
#include "../AppStore.xcconfig"

PRODUCT_BUNDLE_IDENTIFIER = com.duckduckgo.mobile.ios.Integration-Tests

TEST_HOST=$(BUILT_PRODUCTS_DIR)/DuckDuckGo App Store.app/Contents/MacOS/DuckDuckGo App Store
2 changes: 0 additions & 2 deletions Configuration/Tests/TestsTargetsBase.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ INFOPLIST_FILE = DuckDuckGo/Info.plist

LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @loader_path/../Frameworks

PRODUCT_MODULE_NAME = $(TARGET_NAME:c99extidentifier)
PRODUCT_NAME = $(TARGET_NAME)

TEST_HOST=$(BUILT_PRODUCTS_DIR)/DuckDuckGo.app/Contents/MacOS/DuckDuckGo
2 changes: 2 additions & 0 deletions Configuration/Tests/UnitTests.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ INFOPLIST_FILE = Unit Tests/Info.plist
PRODUCT_BUNDLE_IDENTIFIER = com.duckduckgo.macos.browser.DuckDuckGoTests

SWIFT_OBJC_BRIDGING_HEADER = $(SRCROOT)/Unit Tests/Common/TestsBridging.h

TEST_HOST=$(BUILT_PRODUCTS_DIR)/DuckDuckGo.app/Contents/MacOS/DuckDuckGo
Loading

0 comments on commit 8dc6d54

Please sign in to comment.