Skip to content

Commit f22249d

Browse files
committed
Merge branch 'master' into integration-validator-uri-scheme-fix
Fix for iOS integration validator. This fix will loop through each of the URI schemes while matching.
2 parents 56c92ff + 4800c88 commit f22249d

File tree

226 files changed

+6045
-7399
lines changed

Some content is hidden

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

226 files changed

+6045
-7399
lines changed

.github/workflows/automation-trigger-test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
BROWSERSTACK_USER: ${{ secrets.BROWSER_STACK_USER }}
2424
steps:
2525
- name: Check out code
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2727
- name: Install the Apple certificate and provisioning profile
2828
env:
2929
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
@@ -67,20 +67,20 @@ jobs:
6767
response=$(curl -X POST https://api-cloud.browserstack.com/app-automate/upload -u "${{ secrets.BROWSER_STACK_USER }}:${{ secrets.BROWSER_STACK_KEY }}" -F "file=@DeepLinkDemo/IPA/DeepLinkDemo.ipa")
6868
parsed=$(echo $response | jq ".app_url")
6969
echo "::add-mask::$parsed"
70-
echo "APP_URL=$parsed" >> "$GITHUB_ENV"
70+
echo "BrowserStackIOSBuildKey=$parsed" >> "$GITHUB_ENV"
7171
- name: Cheout Automation Code
72-
uses: actions/checkout@v3
72+
uses: actions/checkout@v4
7373
with:
7474
repository: BranchMetrics/qentelli-saas-sdk-testing-automation
7575
token: ${{ secrets.BRANCHLET_ACCESS_TOKEN_PUBLIC }}
7676
- name: Set up JDK 11
77-
uses: actions/setup-java@v3
77+
uses: actions/setup-java@v4
7878
with:
7979
java-version: '11'
8080
distribution: 'temurin'
8181
cache: maven
8282
- name: Setup Node.js environment
83-
uses: actions/setup-node@v3.6.0
83+
uses: actions/setup-node@v4.0.1
8484
- name: Build with Maven
8585
id: build_maven
8686
run: |

.github/workflows/dependabot-merger.yml

Lines changed: 122 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Merge Dependabot PRs
2+
23
on:
34
schedule:
45
- cron: "0 9 * * 1" # Run this workflow every Monday at 9:00
@@ -7,120 +8,151 @@ on:
78
jobs:
89
merge:
910
runs-on: ubuntu-latest
10-
steps:
11-
- name: Check out code
12-
uses: actions/checkout@v3
13-
with:
14-
ref: master
1511

16-
- name: Authenticate GitHub CLI
17-
run: echo "${{ secrets.DEPENDABOT_MERGER_PAT }}" | gh auth login --with-token
18-
19-
- name: Set Git user identity
12+
steps:
13+
- name: Get current on-call
14+
id: on-call
2015
run: |
21-
git config user.email "[email protected]"
22-
git config user.name "Dependabot Merger Bot"
16+
now=$(date -u +%Y-%m-%dT%H:%M:%SZ)
17+
end_time=$(date -u -d '+24 hour' +%Y-%m-%dT%H:%M:%SZ)
2318
24-
- name: Get current date and time
25-
id: datetime
26-
run: echo "date=$(date +'%m-%d-%Y-%H-%M')" >> $GITHUB_OUTPUT
19+
oncall=$(curl --request GET \
20+
--url "https://api.pagerduty.com/oncalls?since=$now&until=$end_time&schedule_ids[]=PQLHTOP" \
21+
--header 'Accept: application/vnd.pagerduty+json;version=2' \
22+
--header "Authorization: Token token=${{ secrets.PAGERDUTY_TOKEN }}" \
23+
--header 'Content-Type: application/json' )
2724
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
25+
engineer_name=$(echo "$oncall" | jq -r '.oncalls[0].user.summary')
4326
44-
PR_COUNT=$(echo "$PR_LIST" | wc -l)
45-
echo "$PR_COUNT PR's to be merged."
27+
declare -A engineer_to_slackid
28+
engineer_to_slackid=(
29+
["Nipun Singh"]="U02AMC70R6E"
30+
["Jagadeesh Karicherla"]="U038BDE0XUZ"
31+
["Gabe De Luna"]="U02MDA0PHK5"
32+
["Ernest Cho"]="UCV77QDSL"
33+
["Nidhi Dixit"]="U02GDFBP88N"
34+
)
4635
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
36+
slack_id=${engineer_to_slackid["$engineer_name"]}
37+
echo "oncall_slack_id=$slack_id" >> $GITHUB_OUTPUT
5138
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"
39+
- name: Create PR
40+
uses: actions/github-script@v7
41+
id: create-pr
42+
with:
43+
script: |
44+
const uniqueBranchName = 'dependabot-combined-prs-' + Date.now().toString();
45+
const pulls = await github.paginate('GET /repos/:owner/:repo/pulls', {
46+
owner: context.repo.owner,
47+
repo: context.repo.repo
48+
});
49+
let branchesAndPRStrings = [];
50+
let baseBranch = null;
51+
let baseBranchSHA = null;
52+
for (const pull of pulls) {
53+
const branch = pull['head']['ref'];
54+
if (branch.startsWith('dependabot/')) {
55+
console.log('Branch matched prefix. Adding to array: ' + branch);
56+
const prString = '#' + pull['number'] + ' ' + pull['title'];
57+
branchesAndPRStrings.push({ branch, prString });
58+
baseBranch = pull['base']['ref'];
59+
baseBranchSHA = pull['base']['sha'];
60+
}
61+
}
62+
if (branchesAndPRStrings.length == 0) {
63+
core.setFailed('There are no open dependabot PRs.');
64+
return;
65+
}
66+
try {
67+
await github.rest.git.createRef({
68+
owner: context.repo.owner,
69+
repo: context.repo.repo,
70+
ref: 'refs/heads/' + uniqueBranchName,
71+
sha: baseBranchSHA
72+
});
73+
} catch (error) {
74+
console.log(error);
75+
core.setFailed('Failed to create combined branch');
76+
return;
77+
}
6678
67-
- name: Merge process status
68-
run: |
69-
echo "Merging process completed successfully!"
70-
echo "New branch name: dependabot-test-${{ steps.datetime.outputs.date }}"
79+
let combinedPRs = [];
80+
let mergeFailedPRs = [];
81+
for(const { branch, prString } of branchesAndPRStrings) {
82+
try {
83+
await github.rest.repos.merge({
84+
owner: context.repo.owner,
85+
repo: context.repo.repo,
86+
base: uniqueBranchName,
87+
head: branch,
88+
});
89+
console.log('Merged branch ' + branch);
90+
combinedPRs.push(prString);
91+
} catch (error) {
92+
console.log('Failed to merge branch ' + branch);
93+
mergeFailedPRs.push(prString);
94+
}
95+
}
7196
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
97+
console.log('Creating combined PR');
98+
const combinedPRsString = combinedPRs.join('\n');
99+
let body = '✅ This PR was created by the Merge Dependabot PRs action by combining the following dependabot PRs:\n' + combinedPRsString;
100+
if(mergeFailedPRs.length > 0) {
101+
const mergeFailedPRsString = mergeFailedPRs.join('\n');
102+
body += '\n\n⚠️ The following dependabot PRs were left out due to merge conflicts:\n' + mergeFailedPRsString
103+
}
104+
let response = await github.rest.pulls.create({
105+
owner: context.repo.owner,
106+
repo: context.repo.repo,
107+
title: 'Combined Dependabot PR',
108+
head: uniqueBranchName,
109+
base: baseBranch,
110+
body: body
111+
});
112+
console.log('Created combined PR: ' + response.data.html_url);
113+
core.setOutput('pr_url', response.data.html_url);
114+
core.setOutput('pr_list', combinedPRsString);
86115
87116
- name: Post to a Slack channel
88117
uses: slackapi/[email protected]
118+
id: slack
89119
with:
90120
channel-id: "C03RTLRKJQP"
91121
payload: |
92122
{
93-
"blocks": [
123+
"text": "iOS: New Dependabot PR Awaiting Review",
124+
"blocks": [
94125
{
95-
"type": "header",
96-
"text": {
126+
"type": "header",
127+
"text": {
97128
"type": "plain_text",
98-
"text": "⚡️ New iOS Dependabot Testing Branch",
129+
"text":"📱🔧 iOS: New Dependabot PR Awaiting Review",
99130
"emoji": true
100-
}
131+
}
101132
},
102133
{
103-
"type": "section",
104-
"text": {
134+
"type": "section",
135+
"text": {
105136
"type": "mrkdwn",
106-
"text": "*Included PRs:*${{ steps.pr_links.outputs.pr_links }}"
107-
}
137+
"text": "*Included PRs:*\n${{ toJSON(steps.create-pr.outputs.pr_list) }}\n\n\nCurrent On-Call: *<${{ steps.on-call.outputs.oncall_slack_id }}>*"
138+
}
108139
},
109140
{
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-
]
141+
"type": "actions",
142+
"elements": [
143+
{
144+
"type": "button",
145+
"text": {
146+
"type": "plain_text",
147+
"text": ":github-pull-request-open: View Combined PR",
148+
"emoji": true
149+
},
150+
"value": "pr-button",
151+
"url": "${{ steps.create-pr.outputs.pr_url }}",
152+
"action_id": "link-action",
153+
"style": "primary"
154+
}
155+
]
124156
}
125157
]
126158
}

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: macos-latest
1010
steps:
1111
- name: Check out code
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313
- name: Set up Ruby 2.7
1414
uses: ruby/setup-ruby@v1
1515
with:

.github/workflows/post-release-qa.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: macos-latest
99
steps:
1010
- name: Check out code
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212
- name: Install pod, build project and run tests
1313
run: |
1414
./scripts/getSimulator
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: macos-latest
2121
steps:
2222
- name: Check out code
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424
- name: Run carthage command, build project and run tests
2525
run: |
2626
./scripts/getSimulator
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: macos-latest
3333
steps:
3434
- name: Check out code
35-
uses: actions/checkout@v3
35+
uses: actions/checkout@v4
3636
- name: build project and run tests
3737
run: |
3838
./scripts/getSimulator
@@ -43,7 +43,7 @@ jobs:
4343
runs-on: macos-latest
4444
steps:
4545
- name: Check out code
46-
uses: actions/checkout@v3
46+
uses: actions/checkout@v4
4747
- name: Install pod, build project and run tests
4848
run: |
4949
./scripts/getSimulator

.github/workflows/pre-release-qa.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: macos-latest
88
steps:
99
- name: Check out code
10-
uses: actions/checkout@v3
10+
uses: actions/checkout@v4
1111
- name: Install pod, build project and run tests
1212
run: |
1313
echo "branch=${{ github.ref }}" >> $GITHUB_OUTPUT
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: macos-latest
2121
steps:
2222
- name: Check out code
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424
- name: Create Cart File, run carthage command, build project and run tests
2525
env:
2626
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
@@ -36,7 +36,7 @@ jobs:
3636
runs-on: macos-latest
3737
steps:
3838
- name: Check out code
39-
uses: actions/checkout@v3
39+
uses: actions/checkout@v4
4040
- name: build project and run tests
4141
run: |
4242
./scripts/getSimulator
@@ -47,7 +47,7 @@ jobs:
4747
runs-on: macos-latest
4848
steps:
4949
- name: Check out code
50-
uses: actions/checkout@v3
50+
uses: actions/checkout@v4
5151
- name: build xcframework, then build project and run tests
5252
run: |
5353
./scripts/getSimulator
@@ -59,7 +59,7 @@ jobs:
5959
runs-on: macos-latest
6060
steps:
6161
- name: Check out code
62-
uses: actions/checkout@v3
62+
uses: actions/checkout@v4
6363
- name: build static xcframework, then build project and run tests
6464
run: |
6565
./scripts/getSimulator
@@ -71,7 +71,7 @@ jobs:
7171
runs-on: macos-latest
7272
steps:
7373
- name: Check out code
74-
uses: actions/checkout@v3
74+
uses: actions/checkout@v4
7575
- name: Install pod, build project and run tests
7676
run: |
7777
./scripts/getSimulator
@@ -83,7 +83,7 @@ jobs:
8383
runs-on: macos-latest
8484
steps:
8585
- name: Check out code
86-
uses: actions/checkout@v3
86+
uses: actions/checkout@v4
8787
- name: Verify Integration using Carthage for tvOS
8888
run: |
8989
./scripts/getSimulator
@@ -94,7 +94,7 @@ jobs:
9494
runs-on: macos-latest
9595
steps:
9696
- name: Check out code
97-
uses: actions/checkout@v3
97+
uses: actions/checkout@v4
9898
- name: build xcframework, then build project and run tests
9999
run: |
100100
./scripts/getSimulator

0 commit comments

Comments
 (0)