Skip to content

Commit 21bba1f

Browse files
committed
Merge branch 'master' into SDK-2005-iOS-placeholder-stop-calling-v1-profile-and-v1-logout
# Conflicts: # Branch-TestBed/Branch-SDK-Tests/BNCServerRequestQueueTests.m # Branch-TestBed/Branch-TestBed.xcodeproj/project.pbxproj # BranchSDK.xcodeproj/project.pbxproj # BranchSDK/BNCServerRequestQueue.m # BranchSDK/Branch.m Manually resolved conflicts.
2 parents f9b43d9 + bee9f1c commit 21bba1f

File tree

66 files changed

+619
-1637
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+619
-1637
lines changed
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Merge Dependabot PRs
2+
on:
3+
schedule:
4+
- cron: "0 9 * * 1" # Run this workflow every Monday at 9:00
5+
workflow_dispatch:
6+
7+
jobs:
8+
merge:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out code
12+
uses: actions/checkout@v3
13+
with:
14+
ref: master
15+
16+
- name: Authenticate GitHub CLI
17+
run: echo "${{ secrets.DEPENDABOT_MERGER_PAT }}" | gh auth login --with-token
18+
19+
- name: Set Git user identity
20+
run: |
21+
git config user.email "[email protected]"
22+
git config user.name "Dependabot Merger Bot"
23+
24+
- name: Get current date and time
25+
id: datetime
26+
run: echo "date=$(date +'%m-%d-%Y-%H-%M')" >> $GITHUB_OUTPUT
27+
28+
- name: Create new branch based on date and time
29+
run: |
30+
NEW_BRANCH="dependabot-test-${{ steps.datetime.outputs.date }}"
31+
git checkout -b $NEW_BRANCH
32+
git push origin $NEW_BRANCH
33+
34+
- name: Get list of PRs from dependabot
35+
id: pr_list
36+
run: |
37+
PR_LIST=$(gh pr list --json number,author,headRefName --jq '.[] | select( .author.is_bot == true and .author.login == "app/dependabot" ) | "\(.number) \(.headRefName)"')
38+
PR_LIST=$(echo "$PR_LIST" | tr -d '\r')
39+
if [ -z "$PR_LIST" ]; then
40+
echo "No PRs from dependabot found."
41+
exit 0
42+
fi
43+
44+
PR_COUNT=$(echo "$PR_LIST" | wc -l)
45+
echo "$PR_COUNT PR's to be merged."
46+
47+
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
48+
echo "prs<<$EOF" >> $GITHUB_OUTPUT
49+
echo "$PR_LIST" >> $GITHUB_OUTPUT
50+
echo "$EOF" >> $GITHUB_OUTPUT
51+
52+
- name: Merge PRs into new branch
53+
run: |
54+
NEW_BRANCH="dependabot-test-${{ steps.datetime.outputs.date }}"
55+
git checkout $NEW_BRANCH
56+
PR_LIST="${{ steps.pr_list.outputs.prs }}"
57+
while IFS= read -r line; do
58+
IFS=' ' read -r PR_NUMBER BRANCH_NAME <<< "$line"
59+
echo "Merging PR #$PR_NUMBER from branch $BRANCH_NAME into $NEW_BRANCH..."
60+
git fetch origin $BRANCH_NAME
61+
git merge --no-commit --allow-unrelated-histories --strategy-option=theirs origin/$BRANCH_NAME
62+
echo "Pushing changes to $NEW_BRANCH..."
63+
git commit -m "Merged PR #$PR_NUMBER into $NEW_BRANCH"
64+
git push origin $NEW_BRANCH
65+
done <<< "$PR_LIST"
66+
67+
- name: Merge process status
68+
run: |
69+
echo "Merging process completed successfully!"
70+
echo "New branch name: dependabot-test-${{ steps.datetime.outputs.date }}"
71+
72+
- name: Generate PR links
73+
id: pr_links
74+
run: |
75+
PR_LIST="${{ steps.pr_list.outputs.prs }}"
76+
PR_LINKS=""
77+
while IFS= read -r line; do
78+
IFS=' ' read -r PR_NUMBER BRANCH_NAME <<< "$line"
79+
PR_URL="https://github.com/${GITHUB_REPOSITORY}/pull/$PR_NUMBER"
80+
PR_LINKS+="\n• <$PR_URL|#${PR_NUMBER}: ${BRANCH_NAME}>"
81+
done <<< "$PR_LIST"
82+
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
83+
echo "pr_links<<$EOF" >> $GITHUB_OUTPUT
84+
echo "$PR_LINKS" >> $GITHUB_OUTPUT
85+
echo "$EOF" >> $GITHUB_OUTPUT
86+
87+
- name: Post to a Slack channel
88+
uses: slackapi/[email protected]
89+
with:
90+
channel-id: "C03RTLRKJQP"
91+
payload: |
92+
{
93+
"blocks": [
94+
{
95+
"type": "header",
96+
"text": {
97+
"type": "plain_text",
98+
"text": "⚡️ New iOS Dependabot Testing Branch",
99+
"emoji": true
100+
}
101+
},
102+
{
103+
"type": "section",
104+
"text": {
105+
"type": "mrkdwn",
106+
"text": "*Included PRs:*${{ steps.pr_links.outputs.pr_links }}"
107+
}
108+
},
109+
{
110+
"type": "actions",
111+
"elements": [
112+
{
113+
"type": "button",
114+
"text": {
115+
"type": "plain_text",
116+
"text": "Checkout Test Branch",
117+
"emoji": true
118+
},
119+
"value": "branch-button",
120+
"url": "https://github.com/${{ github.repository }}/tree/dependabot-test-${{ steps.datetime.outputs.date }}",
121+
"action_id": "link-action"
122+
}
123+
]
124+
}
125+
]
126+
}
127+
env:
128+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_SDK_BOT_TOKEN }}

Branch-TestBed/Branch-SDK-Tests/BNCDeviceInfoTests.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,6 @@ - (void)testScreenScale {
153153
XCTAssert(self.deviceInfo.screenScale.intValue >= 1);
154154
}
155155

156-
- (void)testCarrierName_Simulator {
157-
XCTAssertNil(self.deviceInfo.carrierName);
158-
}
159-
160156
- (void)testLocale {
161157
NSString *locale = [NSLocale currentLocale].localeIdentifier;
162158
XCTAssertNotNil(locale);

Branch-TestBed/Branch-SDK-Tests/BNCLocaleTests.m

Lines changed: 0 additions & 73 deletions
This file was deleted.

Branch-TestBed/Branch-SDK-Tests/BNCPasteboardTests.m

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,53 +31,41 @@ - (void)tearDown {
3131

3232
- (void)addStringToPasteboard {
3333
#if !TARGET_OS_TV
34-
if (@available(iOS 10.0, *)) {
35-
[UIPasteboard.generalPasteboard setString:self.testString];
36-
}
34+
[UIPasteboard.generalPasteboard setString:self.testString];
3735
#endif
3836
}
3937

4038
- (void)addBranchURLToPasteboard {
4139
#if !TARGET_OS_TV
42-
if (@available(iOS 10.0, *)) {
43-
[UIPasteboard.generalPasteboard setURL:self.testBranchURL];
44-
}
40+
[UIPasteboard.generalPasteboard setURL:self.testBranchURL];
4541
#endif
4642
}
4743

4844
- (void)addNonBranchURLToPasteboard {
4945
#if !TARGET_OS_TV
50-
if (@available(iOS 10.0, *)) {
51-
[UIPasteboard.generalPasteboard setURL:[NSURL URLWithString:@"https://www.apple.com"]];
52-
}
46+
[UIPasteboard.generalPasteboard setURL:[NSURL URLWithString:@"https://www.apple.com"]];
5347
#endif
5448
}
5549

5650
- (void)clearPasteboard {
5751
#if !TARGET_OS_TV
58-
if (@available(iOS 10.0, *)) {
59-
// cannot delete items from the pasteboard, but we can put something else on there
60-
[[UIPasteboard generalPasteboard] setString:@""];
61-
}
52+
// cannot delete items from the pasteboard, but we can put something else on there
53+
[[UIPasteboard generalPasteboard] setString:@""];
6254
#endif
6355
}
6456

6557
- (NSString *)getStringFromClipboard {
6658
NSString *string = nil;
6759
#if !TARGET_OS_TV
68-
if (@available(iOS 10.0, *)) {
69-
string = [UIPasteboard.generalPasteboard string];
70-
}
60+
string = [UIPasteboard.generalPasteboard string];
7161
#endif
7262
return string;
7363
}
7464

7565
- (NSURL *)getURLFromPasteboard {
7666
NSURL *url = nil;
7767
#if !TARGET_OS_TV
78-
if (@available(iOS 10.0, *)) {
79-
url = [UIPasteboard.generalPasteboard URL];
80-
}
68+
url = [UIPasteboard.generalPasteboard URL];
8169
#endif
8270
return url;
8371
}
@@ -157,7 +145,7 @@ - (void)testCheckForBranchLink_noLink {
157145
// This test fails intermittently when executed with other tests - depending upon the order in which its executed
158146
- (void) testPassPasteControl {
159147
#if !TARGET_OS_TV
160-
if (@available(iOS 16.0, *)) {
148+
if (@available(iOS 16.0, macCatalyst 16.0, *)) {
161149

162150
long long timeStamp = ([[NSDate date] timeIntervalSince1970] - 5*60)*1000; // 5 minute earlier timestamp
163151
NSString *urlString = [NSString stringWithFormat:@"https://bnctestbed-alternate.app.link/9R7MbTmnRtb?__branch_flow_type=viewapp&__branch_flow_id=1105940563590163783&__branch_mobile_deepview_type=1&nl_opt_in=1&_cpts=%lld", timeStamp];

0 commit comments

Comments
 (0)