Skip to content

Commit 73d7035

Browse files
authored
chore: kickoff release
2 parents 2855a92 + cc71e62 commit 73d7035

File tree

9 files changed

+115
-7
lines changed

9 files changed

+115
-7
lines changed

.github/codeql/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: "CodeQL config"
2+
3+
queries:
4+
# - uses: security-and-quality
5+
- uses: github/codeql/javascript/ql/src/Security/CWE-094/ExpressionInjection.ql@8cd261af0ed7edb7cd6b8ea6a0ffd99033b79783
6+
# The following line will need to be changed if/when GitHub move UntrustedCheckout out of experimental
7+
- uses: github/codeql/javascript/ql/src/experimental/Security/CWE-094/UntrustedCheckout.ql@8cd261af0ed7edb7cd6b8ea6a0ffd99033b79783
8+
9+
paths:
10+
- .github
11+
- fastlane

.github/codeql/enable_codeql.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/*
2+
GitHub CodeQL scanning is used to scan for errors in GitHub Actions workflows (.yml),
3+
but currently requires a non-empty JavaScript file to work.
4+
*/
5+
const why = 'This is needed to run CodeQL on GitHub Actions files.';

.github/workflows/cleanup_labels_issue_close.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
cleanup:
1414
name: Remove labels
1515
runs-on: ubuntu-latest
16-
if: ${{ !github.event.issue.pull_request && (contains(github.event.issue.labels.*.name, 'pending-response') || contains(github.event.issue.labels.*.name, 'closing soon')) || contains(github.event.issue.labels.*.name, 'pending-release')) }}
16+
if: ${{ !github.event.issue.pull_request && (contains(github.event.issue.labels.*.name, 'pending-response') || contains(github.event.issue.labels.*.name, 'closing soon') || contains(github.event.issue.labels.*.name, 'pending-release')) }}
1717

1818
steps:
1919
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b

.github/workflows/codeql.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev-preview
8+
pull_request:
9+
# The branches below must be a subset of the branches above
10+
branches:
11+
- main
12+
- dev-preview
13+
schedule:
14+
# ┌───────────── minute (0 - 59)
15+
# │ ┌───────────── hour (0 - 23)
16+
# │ │ ┌───────────── day of the month (1 - 31)
17+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
18+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
19+
# │ │ │ │ │
20+
# │ │ │ │ │
21+
# │ │ │ │ │
22+
# * * * * *
23+
- cron: '30 1 * * 0'
24+
jobs:
25+
analyze:
26+
name: Analyze
27+
runs-on: ubuntu-latest
28+
permissions:
29+
actions: read
30+
contents: read
31+
security-events: write
32+
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
language: ['javascript']
37+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
38+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
39+
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
43+
44+
# Initializes the CodeQL tools for scanning.
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@822fe5ef9a15bd752ef127e9ff6eac38ec37dd9c
47+
with:
48+
languages: ${{ matrix.language }}
49+
config-file: ./.github/codeql/config.yml
50+
debug: true
51+
52+
- name: Perform CodeQL Analysis
53+
uses: github/codeql-action/analyze@822fe5ef9a15bd752ef127e9ff6eac38ec37dd9c
54+
File renamed without changes.
File renamed without changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Validates and merges release PRs after they have been approved.
2+
name: Merge Release PR
3+
4+
on:
5+
pull_request_review:
6+
types:
7+
- submitted
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
check:
14+
name: Validate and Merge PR
15+
runs-on: ubuntu-latest
16+
if: "${{ github.event.pull_request.base.ref == 'release' && github.event.pull_request.head.ref == 'main' && github.event.pull_request.title == 'chore: kickoff release' && github.event.review.state == 'approved' }}"
17+
18+
steps:
19+
- name: Merge PR
20+
shell: bash
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
PR: ${{ github.event.pull_request.number }}
24+
run: "gh pr merge $PR --repo aws-amplify/amplify-ios --merge --subject 'chore: kickoff release' --body ''"

Amplify/Categories/DataStore/Model/Temporal/Temporal+Cache.swift

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ extension Temporal {
2525
return calendar
2626
}()
2727

28-
/// Lock to ensure exclusive access
29-
private static var lock = os_unfair_lock_s()
30-
28+
/// Pointer to lock to ensure exclusive access.
29+
private static let lock: UnsafeMutablePointer<os_unfair_lock> = {
30+
let pointer = UnsafeMutablePointer<os_unfair_lock>.allocate(capacity: 1)
31+
pointer.initialize(to: os_unfair_lock())
32+
return pointer
33+
}()
34+
3135
/// Internal helper function to retrieve and/or create `DateFormatter`s
3236
/// - Parameters:
3337
/// - format: The `DateFormatter().dateFormat`
@@ -37,10 +41,11 @@ extension Temporal {
3741
for format: String,
3842
in timeZone: TimeZone
3943
) -> DateFormatter {
40-
defer { os_unfair_lock_unlock(&lock) }
41-
4244
// lock before read from cache
43-
os_unfair_lock_lock(&lock)
45+
os_unfair_lock_lock(lock)
46+
47+
// unlock at return
48+
defer { os_unfair_lock_unlock(lock) }
4449

4550
// If the formatter is already in the cache and
4651
// the time zones match, we return it rather than

AmplifyPlugins/DataStore/DataStoreCategoryPlugin.xcodeproj/xcshareddata/xcschemes/AWSDataStoreCategoryPlugin.xcscheme

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@
8686
<Test
8787
Identifier = "DataStoreHubTests/testDataStoreDispatchesUpdateToHub()">
8888
</Test>
89+
<Test
90+
Identifier = "MutationEventExtensionsTest/testSentModelVersionNewerThanResponseVersion_PendingEventNotReconciled()">
91+
</Test>
92+
<Test
93+
Identifier = "MutationEventExtensionsTest/testSentModelWithNilVersion_Reconciled()">
94+
</Test>
95+
<Test
96+
Identifier = "MutationEventExtensionsTest/testSentModelWithNilVersion_SecondPendingEventNotReconciled()">
97+
</Test>
8998
<Test
9099
Identifier = "OutgoingMutationQueueTests/testLocalMutationUnsubcsribesFromCloud()">
91100
</Test>

0 commit comments

Comments
 (0)