Skip to content

Commit

Permalink
Merge branch 'develop' into sam/codeql-support
Browse files Browse the repository at this point in the history
* develop: (84 commits)
  Improve Sync-related database cleaning logic (#1933)
  Fix PacketTunnelProvider embedding for Alpha builds (#1932)
  Add alpha specific app groups (#1934)
  Replaces useSystemKeychain with keychain type (#1928)
  Add Commit hook install script (#1845)
  Run checks on all PRs (#1929)
  extend valid urls to include IPv6 (#1919)
  Status view error UI (#1915)
  NetP Design Review minus errors (#1923)
  Add a GHA job to build the app in release configuration (#1848)
  Release 7.85.0 (#1926)
  Update WireGuard version (#1918)
  BSK Hotfix 74.0.1-1 (#1924)
  Post merge PR check (#1920)
  Autofill letter icons for macOS (#1911)
  Alpha build readiness (#1913)
  bump C-S-S to 4.32.0 (#1914)
  Update NetP endpoint (#1905)
  Network Protection debug menu (#1910)
  Add support for syncing Credentials (#1844)
  ...
  • Loading branch information
samsymons committed Aug 24, 2023
2 parents f43ee42 + 4074976 commit e59c6ec
Show file tree
Hide file tree
Showing 226 changed files with 11,206 additions and 12,476 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/adhoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,7 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set cache key hash
run: |
has_only_tags=$(jq '[ .object.pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
if [[ "$has_only_tags" == "true" ]]; then
echo "cache_key_hash=${{ hashFiles('DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}" >> $GITHUB_ENV
else
echo "Package.resolved contains dependencies specified by branch or commit, skipping cache."
fi

- name: Cache SPM
if: env.cache_key_hash
uses: actions/cache@v3
with:
path: DerivedData/SourcePackages
key: ${{ runner.os }}-spm-${{ env.cache_key_hash }}
restore-keys: |
${{ runner.os }}-spm-
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer

Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ jobs:
run: |
set -o pipefail && xcodebuild \
-scheme "DuckDuckGo" \
-destination "platform=iOS Simulator,name=iPhone 14" \
-derivedDataPath "DerivedData"
-destination "platform=iOS Simulator,name=iPhone 14,OS=16.4" \
-derivedDataPath "DerivedData" \
| tee xcodebuild.log
- name: Setup tests
run: bundle install && bundle exec fastlane setup_e2e_tests
Expand Down Expand Up @@ -83,4 +84,13 @@ jobs:
"notes" : "The end to end workflow has failed. See https://github.com/duckduckgo/iOS/actions/runs/${{ github.run_id }}", \
" \
}'
- name: Upload logs when workflow failed
uses: actions/upload-artifact@v3
if: failure()
with:
name: BuildLogs
path: |
xcodebuild.log
DerivedData/Logs/Test/*.xcresult
retention-days: 7
15 changes: 13 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,21 @@ jobs:
run: |
set -o pipefail && xcodebuild test \
-scheme "AtbUITests" \
-destination "platform=iOS Simulator,name=iPhone 14" \
-destination "platform=iOS Simulator,name=iPhone 14,OS=16.4" \
-derivedDataPath "DerivedData" \
| tee xcodebuild.log \
| xcbeautify --report junit --report-path . --junit-report-filename unittests.xml
- name: Upload logs if workflow failed
uses: actions/upload-artifact@v3
if: failure()
with:
name: BuildLogs
path: |
xcodebuild.log
DerivedData/Logs/Test/*.xcresult
retention-days: 7

- name: Publish unit tests report
uses: mikepenz/action-junit-report@v3
with:
Expand All @@ -74,7 +85,7 @@ jobs:
run: |
set -o pipefail && xcodebuild test \
-scheme "FingerprintingUITests" \
-destination "platform=iOS Simulator,name=iPhone 14" \
-destination "platform=iOS Simulator,name=iPhone 14,OS=16.4" \
-derivedDataPath "DerivedData" \
| xcbeautify --report junit --report-path . --junit-report-filename unittests.xml
Expand Down
98 changes: 95 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on:
push:
branches: [ develop, "release/**" ]
pull_request:
branches: [ develop, "release/**" ]


jobs:
swiftlint:
Expand Down Expand Up @@ -80,13 +78,107 @@ jobs:
run: |
set -o pipefail && xcodebuild test \
-scheme "DuckDuckGo" \
-destination "platform=iOS Simulator,name=iPhone 14" \
-destination "platform=iOS Simulator,name=iPhone 14,OS=16.4" \
-derivedDataPath "DerivedData" \
DDG_SLOW_COMPILE_CHECK_THRESHOLD=250 \
| tee xcodebuild.log \
| xcbeautify --report junit --report-path . --junit-report-filename unittests.xml
- name: Upload logs if workflow failed
uses: actions/upload-artifact@v3
if: failure()
with:
name: BuildLogs
path: |
xcodebuild.log
DerivedData/Logs/Test/*.xcresult
retention-days: 7

- name: Publish unit tests report
uses: mikepenz/action-junit-report@v3
with:
report_paths: unittests.xml

release-build:

name: Make Release Build

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

steps:

- name: Register SSH keys for access to certificates
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }}

- name: Check out the code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set cache key hash
run: |
has_only_tags=$(jq '[ .object.pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
if [[ "$has_only_tags" == "true" ]]; then
echo "cache_key_hash=${{ hashFiles('DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}" >> $GITHUB_ENV
else
echo "Package.resolved contains dependencies specified by branch or commit, skipping cache."
fi
- name: Cache SPM
if: env.cache_key_hash
uses: actions/cache@v3
with:
path: DerivedData/SourcePackages
key: ${{ runner.os }}-spm-release-${{ env.cache_key_hash }}
restore-keys: |
${{ runner.os }}-spm-release-
- name: Install xcbeautify
run: brew install xcbeautify

- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer

- name: Prepare fastlane
run: bundle install

- name: Build 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 sync_signing
set -o pipefail && xcodebuild \
-scheme "DuckDuckGo" \
-destination "platform=iOS Simulator,name=iPhone 14" \
-derivedDataPath "DerivedData" \
-configuration "Release" \
| xcbeautify
asana:
name: Create Asana Task
needs: [swiftlint, unit-tests, shellcheck, release-build]

if: failure() && github.ref_name == 'develop'

env:
WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

runs-on: ubuntu-latest

steps:
- name: Create Asana Task
uses: malmstein/github-asana-action@master
with:
asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
asana-project: ${{ vars.APPLE_CI_FAILING_TESTS_PROJECT_ID }}
asana-section: ${{ vars.APPLE_CI_FAILING_TESTS_IOS_POST_MERGE_SECTION_ID }}
asana-task-name: 'PR Check is failing on develop'
action: create-asana-task
asana-task-description: PR Checks conducted after merging have failed. See ${{ env.WORKFLOW_URL }}
18 changes: 0 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,6 @@ jobs:
with:
submodules: recursive

- name: Set cache key hash
run: |
has_only_tags=$(jq '[ .object.pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
if [[ "$has_only_tags" == "true" ]]; then
echo "cache_key_hash=${{ hashFiles('DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}" >> $GITHUB_ENV
else
echo "Package.resolved contains dependencies specified by branch or commit, skipping cache."
fi
- name: Cache SPM
if: env.cache_key_hash
uses: actions/cache@v3
with:
path: DerivedData/SourcePackages
key: ${{ runner.os }}-spm-${{ env.cache_key_hash }}
restore-keys: |
${{ runner.os }}-spm-
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer

Expand Down
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ disabled_rules:
- orphaned_doc_comment
- todo
- unused_capture_list
- trailing_comma

opt_in_rules:
- closure_end_indentation
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 7.79.0
MARKETING_VERSION = 7.85.0
54 changes: 54 additions & 0 deletions Core/AppDeepLinkSchemes.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//
// AppDeepLinkSchemes.swift
// DuckDuckGo
//
// Copyright © 2017 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.
//

import Foundation

public enum AppDeepLinkSchemes: String, CaseIterable {

case newSearch = "ddgNewSearch"
case voiceSearch = "ddgVoiceSearch"
case fireButton = "ddgFireButton"
case favorites = "ddgFavorites"
case newEmail = "ddgNewEmail"

case quickLink = "ddgQuickLink"

case addFavorite = "ddgAddFavorite"

public var url: URL {
URL(string: rawValue + "://")!
}

public func appending(_ string: String) -> String {
"\(rawValue)://\(string)"
}

public static func fromURL(_ url: URL) -> AppDeepLinkSchemes? {
guard let scheme = url.scheme else { return nil }
return allCases.first(where: { $0.rawValue.lowercased() == scheme.lowercased() })
}

public static func query(fromQuickLink url: URL) -> String {
return url.absoluteString
.replacingOccurrences(of: AppDeepLinkSchemes.quickLink.url.absoluteString,
with: "",
options: .caseInsensitive)
}

}
74 changes: 0 additions & 74 deletions Core/AppDeepLinks.swift

This file was deleted.

4 changes: 2 additions & 2 deletions Core/AppPrivacyConfigurationDataProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import BrowserServicesKit
final public class AppPrivacyConfigurationDataProvider: EmbeddedDataProvider {

public struct Constants {
public static let embeddedDataETag = "\"b294e67b2262ad947e9e487b6ac9b975\""
public static let embeddedDataSHA = "1f614c4a8d5d2ddb4c6218ab3fb8718c2a6cfa2ec81a6f7c6bd7dc0a6114b353"
public static let embeddedDataETag = "\"99c821c6657eb5bb4b6e93ac29e803ae\""
public static let embeddedDataSHA = "b7cfbb562a67448b9a9c7a518ab0a4ef2b818270dc10b92ea358545d06b02782"
}

public var embeddedDataEtag: String {
Expand Down
4 changes: 2 additions & 2 deletions Core/AppTrackerDataSetProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import BrowserServicesKit
final public class AppTrackerDataSetProvider: EmbeddedDataProvider {

public struct Constants {
public static let embeddedDataETag = "\"7e00e68f8d00cbe0b092d66208300b80\""
public static let embeddedDataSHA = "3be3db8211245b3da3858231894ac823f251e9e8360d6127394ecc0f947fad9d"
public static let embeddedDataETag = "\"fe1c5d43a3f99c0733a19d87415953fc\""
public static let embeddedDataSHA = "edc1c2496d5010ba7916bd5773fdb8ca5f06faaba4454494e97954427cc04bb4"
}

public var embeddedDataEtag: String {
Expand Down
Loading

0 comments on commit e59c6ec

Please sign in to comment.