Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CodeQL #1885

Open
wants to merge 248 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
248 commits
Select commit Hold shift + click to select a range
9ae7158
Merge from main
brismithers Oct 17, 2022
1266cbd
Merge pull request #1670 from OneSignal/user-model/merge-from-main
brismithers Oct 17, 2022
66d0311
[User Model] notification_types and model event rework
brismithers Oct 19, 2022
86af18f
Merge pull request #1673 from OneSignal/user-model/notification-types…
brismithers Oct 20, 2022
4bdaa8b
[User Model] Visual logging and other TODOs
brismithers Oct 20, 2022
96fb6c4
[User Model] Session Manager
brismithers Oct 20, 2022
60dbb5a
* Align preferences with config model store, removing preferences now…
brismithers Oct 21, 2022
a12b55c
Merge pull request #1674 from OneSignal/user-model/visual-logging-and…
brismithers Oct 24, 2022
a0b4a74
Merge pull request #1675 from OneSignal/user-model/session-manager
brismithers Oct 24, 2022
5e9019e
[User Model] Modularize IAM/Notification/Location
brismithers Oct 24, 2022
698b14f
Merge pull request #1678 from OneSignal/user-model/gradle-modularization
brismithers Oct 31, 2022
77793e8
[User Model] New login process and operation repo updates
brismithers Oct 31, 2022
f2ec786
Merge pull request #1681 from OneSignal/user-model/login-identity
brismithers Nov 7, 2022
9fd560e
[User Model] Core Unit Tests
brismithers Nov 7, 2022
460a7d6
Merge pull request #1684 from OneSignal/user-model/core-unit-tests
brismithers Nov 8, 2022
edb2c18
[User Model] Move and rename
brismithers Nov 8, 2022
95fd7c1
Merge pull request #1685 from OneSignal/user-model/renames-and-moves
brismithers Nov 9, 2022
86b872e
[User Model] Track Session Start
brismithers Nov 9, 2022
6816df4
Merge pull request #1687 from OneSignal/user-model/track-session-start
brismithers Nov 14, 2022
6ded6a2
[User Model] Push notification/subscription alignment
brismithers Nov 15, 2022
4fa327f
Merge pull request #1688 from OneSignal/user-model/notification-subsc…
brismithers Nov 17, 2022
7fe6aca
[User Model] Minor cleanup
brismithers Nov 17, 2022
78383da
Merge pull request #1689 from OneSignal/user-model/minor-cleanup
brismithers Nov 21, 2022
8bf8651
[User Model] Notifications Unit Tests
brismithers Nov 22, 2022
67f40a9
Merge pull request #1692 from OneSignal/user-model/notification-unit-…
brismithers Nov 28, 2022
7c6d8be
[User Model] Notification Clicked Handler
brismithers Nov 29, 2022
3d2b5b0
Merge pull request #1695 from OneSignal/user-model/notification-clicked
brismithers Dec 5, 2022
7fa1ff4
[User Model] Backend Integration
brismithers Dec 7, 2022
2f5926a
[User Model] Location Unit Tests
brismithers Dec 9, 2022
222cb85
Simplify gradle testImplementation addition
brismithers Dec 9, 2022
576cceb
Merge pull request #1700 from OneSignal/user-model/location-unit-tests
brismithers Dec 12, 2022
e588c4a
[User Model] IAM Unit Tests (partial)
brismithers Dec 13, 2022
da60c85
[User Model] Backend Integration
brismithers Dec 15, 2022
a32b98c
revert tempory test code
brismithers Dec 15, 2022
fb8cac9
Merge pull request #1701 from OneSignal/user-model/iam-unit-tests
brismithers Dec 15, 2022
c67b8e1
Merge from user-model/main
brismithers Dec 15, 2022
9911f8e
code review comments and unit testing
brismithers Dec 19, 2022
45516c6
Merge pull request #1705 from OneSignal/user-model/backend-integration
brismithers Dec 19, 2022
6cde347
Pre-alpha polish and fixes
brismithers Dec 19, 2022
d32966b
Merge pull request #1707 from OneSignal/user-model/prealpha-fixes
brismithers Dec 20, 2022
bf29f7e
[User Model] Core Module
brismithers Dec 20, 2022
06683dc
Remove unused POM_DESCRIPTION variable in maven-push.gradle
brismithers Dec 20, 2022
01b3cdc
Fix gradle build-related issues
brismithers Dec 20, 2022
ccd8c46
Fix timing condition in OutcomeEventsControllerTests unit test
brismithers Dec 20, 2022
69f43ca
Merge pull request #1708 from OneSignal/user-model/core-module
brismithers Dec 20, 2022
e5e8196
[User Model] Add name to each module for maven publish pom
brismithers Dec 21, 2022
b7d2022
Merge pull request #1709 from OneSignal/user-model/module-name
brismithers Dec 21, 2022
64cdfad
[User Model] alpha bug fixes
brismithers Jan 4, 2023
16ac66b
Merge pull request #1712 from OneSignal/user-model/alpha-bug-fixes
brismithers Jan 4, 2023
cbd9fd9
[User Model] Subscription Already Exists
brismithers Jan 5, 2023
2038f7a
Merge pull request #1714 from OneSignal/user-model/subscription-alrea…
brismithers Jan 5, 2023
a3d839f
[User Model] Final touches
brismithers Jan 6, 2023
026f748
Merge pull request #1716 from OneSignal/user-model/alpha-final-touches
brismithers Jan 6, 2023
dac3e47
Release 5.0.0-alpha1
brismithers Jan 6, 2023
b2b95ad
Merge pull request #1717 from OneSignal/rel/5.0.0-alpha1
brismithers Jan 6, 2023
74e0d86
[User Model] Application Focus and Threading
brismithers Jan 18, 2023
46bee80
[User Model] Provide serialization mechanism for external classes
brismithers Jan 18, 2023
5b434fd
Merge pull request #1722 from OneSignal/user-model/focus-and-threading
brismithers Jan 19, 2023
3453d43
Merge pull request #1723 from OneSignal/user-model/tojsonobject
brismithers Jan 19, 2023
24201b4
[User Model] Successfully recover from failing operations
brismithers Jan 19, 2023
8c56a63
[User Model] Add "OneSignal-Subscription-Id" header to requests
brismithers Jan 20, 2023
7996fe3
Merge pull request #1724 from OneSignal/user-model/operation-recover
brismithers Jan 20, 2023
7f06356
Merge pull request #1725 from OneSignal/user-model/subscription-id-he…
brismithers Jan 20, 2023
2412676
[User Model] Transfer Subscription on user create
brismithers Jan 24, 2023
7a31edd
[User Model] Support migrating user from SDK 4.x to SDK 5.x
brismithers Jan 25, 2023
674fd4a
Merge pull request #1726 from OneSignal/user-model/xfer-subscription-…
brismithers Jan 25, 2023
0478d56
merge from user-model/main
brismithers Jan 25, 2023
2e841d7
Merge pull request #1727 from OneSignal/user-model/sdk-migration
brismithers Jan 27, 2023
117b682
[User Model] Fix broken unit test compilation
brismithers Jan 30, 2023
3e3011c
Merge pull request #1728 from OneSignal/user-model/unit-test-fixup
brismithers Jan 30, 2023
454bf34
[User Model] Add validation logic to add/remove email & sms subscript…
brismithers Jan 30, 2023
db5c56a
Merge pull request #1729 from OneSignal/user-model/email-sms-validation
brismithers Jan 30, 2023
8e4337f
[User Model] Pre-Beta Fixes
brismithers Feb 2, 2023
952de92
Merge pull request #1730 from OneSignal/user-model/pre-beta-fixes
brismithers Feb 2, 2023
8e64caa
[User Model] Properly set `isUnattributedEnabled` to config when spec…
brismithers Feb 2, 2023
f97cfdd
Merge pull request #1731 from OneSignal/user-model/enable-unattribute…
brismithers Feb 2, 2023
6b5b1fe
[User Model] Beta Release Prep
brismithers Feb 2, 2023
9fc1c61
Merge pull request #1732 from OneSignal/user-model/beta-prep
brismithers Feb 3, 2023
e346164
[User Model] Make `sdkVersion` in OneSignalWrapper settable.
brismithers Feb 3, 2023
8499e90
Merge pull request #1733 from OneSignal/user-model/wrapper-sdkversion…
brismithers Feb 16, 2023
3f2060f
[User Model] Expose `INotification.rawPayload`
brismithers Feb 16, 2023
937ac66
Release 5.0.0-beta2
brismithers Feb 16, 2023
964ab9f
Merge pull request #1736 from OneSignal/user-model/raw-payload
brismithers Feb 16, 2023
fde36dc
Merge pull request #1737 from OneSignal/user-model/beta-2-release-prep
brismithers Feb 16, 2023
018a330
Update logic for detecting when to show fallback settings for request…
brismithers Feb 28, 2023
72d663d
Remove `retain_previous_owner` parameter from "Create User" and "Crea…
brismithers Mar 1, 2023
f8c0d29
Use correct reflection method retrieval of isHuaweiMobileServicesAvai…
brismithers Mar 1, 2023
d4f42e4
* Update example app to use `com.onesignal.sdk.test` application id a…
brismithers Mar 6, 2023
9f7171e
Merge pull request #1740 from OneSignal/user-model/remove-retain-prev…
brismithers Mar 7, 2023
3ad1b97
Merge pull request #1739 from OneSignal/user-model/permission-fallbac…
brismithers Mar 7, 2023
0e1ca74
[User Model] ADM Fixes
brismithers Mar 8, 2023
d9f4023
[User Model] Safeguard against activities/services/receivers being ca…
brismithers Mar 9, 2023
ff3081e
Merge pull request #1742 from OneSignal/user-model/huawei-fixes
brismithers Mar 14, 2023
f314151
Merge pull request #1744 from OneSignal/user-model/adm-support
brismithers Mar 14, 2023
f9b0f75
Merge pull request #1746 from OneSignal/user-model/upgrade-receiver-c…
brismithers Mar 14, 2023
5124ed0
[User Model] ensure 100% unit test pass
brismithers Mar 20, 2023
fe5f854
[User Model] Don't show "Missing Google Project number!" error messag…
brismithers Mar 20, 2023
ad10873
[User Model] Change `addTrigger` to accept a `String` instead of `Any`
brismithers Mar 27, 2023
b13819e
[User Model] Make ktlint fixes
brismithers Mar 29, 2023
cbbb7fa
Update ktlint plugin to `11.3.1`, fix ktlint version to `0.48.2`
brismithers Mar 30, 2023
82f0774
Merge pull request #1754 from OneSignal/user-model/trigger-as-string
brismithers Mar 30, 2023
0b3a432
Merge pull request #1750 from OneSignal/user-model/incorrect-error-me…
brismithers Mar 30, 2023
7461ecf
Merge branch 'user-model/main' into user-model/ktlint-fixes
brismithers Mar 30, 2023
fdee4a7
Fix lint errors from merge
brismithers Mar 30, 2023
f1f7bcb
Merge pull request #1758 from OneSignal/user-model/ktlint-fixes
brismithers Mar 30, 2023
b62b895
Merge from user-model/main
brismithers Mar 30, 2023
4172f8b
Merge pull request #1749 from OneSignal/user-model/broken-unit-tests
brismithers Apr 17, 2023
822eb71
Update high level components to be accessed via pascal casing.
brismithers Apr 17, 2023
e7c9594
Merge pull request #1764 from OneSignal/user-model/pascal-case-areas
brismithers Apr 18, 2023
ee63a38
[User Model] Rename notification event listeners
brismithers Apr 19, 2023
8a9e6e6
Update OneSignalSDK/onesignal/core/src/main/java/com/onesignal/notifi…
brismithers Apr 20, 2023
8d0cd40
Update OneSignalSDK/onesignal/core/src/main/java/com/onesignal/notifi…
brismithers Apr 20, 2023
1da3636
Update OneSignalSDK/onesignal/core/src/main/java/com/onesignal/notifi…
brismithers Apr 20, 2023
bbed11d
Update OneSignalSDK/onesignal/core/src/main/java/com/onesignal/notifi…
brismithers Apr 20, 2023
9ad8e09
Update OneSignalSDK/onesignal/core/src/main/java/com/onesignal/notifi…
brismithers Apr 20, 2023
28dac77
Code review comment updates
brismithers Apr 20, 2023
bbeb09d
Updates for lintcheck
brismithers Apr 24, 2023
88559d5
Update migration guide with new notification events naming
brismithers Apr 24, 2023
ede53a0
Merge pull request #1765 from OneSignal/user-model/notification-events
brismithers Apr 25, 2023
1f15b7a
[User Model] Update IAM with events terminologies
brismithers Apr 25, 2023
ab6fe90
Update InAppMessageClickEvent/Result
jennantilla Apr 28, 2023
ef2b432
Updating the notification click result to have actionId and URL
emawby Apr 28, 2023
ac3a2ab
[User Model] User Push Subscription Event update
brismithers Apr 27, 2023
e5a748c
Fire onSubscriptionChanged event for all subscription types
emawby Apr 28, 2023
c77c903
Merge pull request #1767 from OneSignal/user-model/click_event_result
emawby May 1, 2023
ce67625
Merge pull request #1766 from OneSignal/user-model/iam-events
emawby May 1, 2023
49480f0
Add PushSubscriptionObserver methods to the migration guide
emawby May 1, 2023
23433b6
Merge pull request #1768 from OneSignal/user-model/user-events
emawby May 1, 2023
4665148
Bumping versions for beta 3
emawby May 1, 2023
7f56342
Merge pull request #1769 from OneSignal/user-model/beta3_release
emawby May 1, 2023
46efcf9
Add the override modifier to InAppMessageActionUrlType toString
emawby May 1, 2023
3611eaa
change the huawei package name to com.onesignal.sdktest
emawby May 1, 2023
3706902
adding toJSONObject for push subscription changed event parameters
emawby May 3, 2023
491fb92
Updating the privacy consent property names
emawby May 3, 2023
b743588
Fix outcomes unit tests so tests pass
emawby May 3, 2023
5064005
Merge pull request #1771 from OneSignal/user-model/update_privacy_con…
emawby May 4, 2023
3e39c0a
Merge pull request #1770 from OneSignal/user-model/add_to_json_object
emawby May 4, 2023
6e58fa0
bumping version numbers for beta 4 release
emawby May 4, 2023
f5e9056
Update MIGRATION_GUIDE.md for new privacy consent names
emawby May 4, 2023
81fc303
Merge pull request #1772 from OneSignal/user-model/beta4_release
emawby May 8, 2023
5d04aeb
Add device type to the outcome event request
nan-li Jul 31, 2023
19afb08
Add session_time to OutcomeEvent
nan-li Aug 6, 2023
43fa3cc
Send influenced session outcome
nan-li Aug 6, 2023
49ed920
update outcomes table to include `session_time` column
nan-li Aug 6, 2023
97a2bce
Fixing unit tests after outcomes changes
nan-li Aug 6, 2023
f1d204e
Modify create user operation to send less associated info
nan-li Aug 7, 2023
da91c6a
Fix tests after create user operation changes
nan-li Aug 7, 2023
b1b4d99
[nit] add note about `OutcomeEventParams.timestamp`
nan-li Aug 7, 2023
5a33afe
Make subscribers in EventProducer synchronized
emawby Aug 7, 2023
aed2897
Merge pull request #1796 from OneSignal/fix/event_producer_crash
emawby Aug 8, 2023
8b58c6e
Update PreferenceStores bool upon granting permission
jennantilla Aug 9, 2023
b8441cc
Merge pull request #1798 from OneSignal/fix/canRequestPermission_retu…
emawby Aug 10, 2023
b3eb9b9
Bump firebase-messaging dependency version to 23.0.0
jennantilla Aug 10, 2023
a3b2f17
Bump demo app minSdk from 16 to 19
jennantilla Aug 10, 2023
5fd6dfb
Adding zapier, release-drafter, and response time actions
emawby Aug 10, 2023
fda8ee2
Merge pull request #1800 from OneSignal/user_model/copy_actions_from_…
emawby Aug 10, 2023
977130c
Merge pull request #1793 from OneSignal/user_model/fix_outcome_requests
emawby Aug 10, 2023
9cbbf70
Merge pull request #1801 from OneSignal/user-model/ga_updates
emawby Aug 10, 2023
67c2c52
Merge pull request #1794 from OneSignal/user_model/improve_create_use…
emawby Aug 10, 2023
8ab25ce
set inAppMessageIdShowing back to null after display
jennantilla Aug 9, 2023
ed80fcc
Merge pull request #1799 from OneSignal/fix/iam
emawby Aug 10, 2023
7cf7038
Don't crash if login fails
emawby Aug 10, 2023
67912a4
Don't throw for bad alias actions
emawby Aug 10, 2023
54fb095
Don't throw for bad email and sms tokens
emawby Aug 10, 2023
2a8fc52
Don't throw for empty tag keys
emawby Aug 10, 2023
950b275
Merge pull request #1802 from OneSignal/user_model/remove_throws
emawby Aug 10, 2023
f10913f
Update version for v5.0.0 release
nan-li Aug 10, 2023
fb30348
Update migration guide
nan-li Aug 10, 2023
82fc8e8
Merge pull request #1803 from OneSignal/rel/5.0.0
nan-li Aug 10, 2023
c97fdb3
Update proguard rules with new classes
jennantilla Aug 30, 2023
bce0f2f
protecting all classmembers via consumer-rules.pro
emawby Sep 1, 2023
bb3041e
Merge pull request #1828 from OneSignal/fix/proguard_updates
emawby Sep 7, 2023
a54f90c
bump to version 5.0.1
emawby Sep 7, 2023
fea6fa1
Merge pull request #1831 from OneSignal/release-5.0.1
emawby Sep 7, 2023
669fa51
Fix bug for generating notification's android notification ID
nan-li Sep 15, 2023
b4de371
Differentiate login failure cases
nan-li Sep 15, 2023
7fe6a47
Send timezone_id on createuser
emawby Sep 15, 2023
9a1bee3
Update unit tests to account for properties in createUser
emawby Sep 18, 2023
2e4b382
Rename kotlin modules to be named after namespace
shepherd-l Sep 20, 2023
545e5cd
Change notification time out log level to info
shepherd-l Sep 20, 2023
9f7f9a0
Merge pull request #1844 from OneSignal/rename-kotlin-modules
shepherd-l Sep 20, 2023
b65c008
Fix crash from missing operationExecutor in OperationModelStore create
emawby Sep 21, 2023
cbfaeb9
Merge pull request #1845 from OneSignal/fix/crash_on_login_from_user_sub
emawby Sep 21, 2023
ea70883
Replace messageView non-null assertion with safe call operator
jennantilla Sep 21, 2023
6fab6bb
Send language on createuser
jennantilla Sep 21, 2023
2f3cc69
Update unit tests to account for language properties in createUser
jennantilla Sep 21, 2023
cfca9ce
Access ILanguageContext for setting language on createUser
jennantilla Sep 22, 2023
2e04cd1
Merge pull request #1840 from OneSignal/user_model/fix_notifications_…
emawby Sep 22, 2023
9a5c959
Merge pull request #1841 from OneSignal/user_model/add_login_409_logs
emawby Sep 22, 2023
cdc09c1
Clarify comment for showView execution
jennantilla Sep 22, 2023
d49858c
Update LoginUserOperationExecutor tests to take in parameter MockHelp…
jennantilla Sep 22, 2023
7bd784f
make getTimeZoneId non-optional
emawby Sep 22, 2023
3402c6d
Fix concurrent modification exception in Model.kt
emawby Sep 22, 2023
2de5c46
Merge pull request #1846 from OneSignal/fix/in_app_npe_crash
emawby Sep 25, 2023
6839f4c
Merge pull request #1842 from OneSignal/fix/timezone_id_not_set
emawby Sep 25, 2023
1c184ff
Merge branch 'user-model/main' into fix/language_not_set
jennantilla Sep 25, 2023
bb041ad
Merge pull request #1847 from OneSignal/fix/language_not_set
jennantilla Sep 25, 2023
a5c88de
Merge pull request #1849 from OneSignal/fix/concurrent_modification_e…
emawby Sep 25, 2023
079139c
Version bump for release
jennantilla Sep 25, 2023
3488c90
Merge pull request #1852 from OneSignal/rel/5.0.2
jennantilla Sep 25, 2023
1541487
Fix Amazon purchase tracking setup
nan-li Oct 4, 2023
9794d5e
Differentiate appstore v3.0.4
nan-li Oct 5, 2023
b253e40
Read in dismissed IAMs on IAM Manager start
nan-li Oct 6, 2023
c864d7d
Merge pull request #1860 from OneSignal/fix/amazon_purchase_tracking_…
nan-li Oct 6, 2023
52e27ea
Merge pull request #1863 from OneSignal/fix/iam_showing_on_app_launch
nan-li Oct 6, 2023
3bf087e
release commit 5.0.3
nan-li Oct 6, 2023
1721ec7
Merge pull request #1865 from OneSignal/rel/android_5.0.3
nan-li Oct 6, 2023
243cb0a
WIP add synchronization blocks to prevent ConcurrentModificationExcep…
jennantilla Oct 18, 2023
7b8444d
Update ktlint version
shepherd-l Oct 25, 2023
3899146
Run ktlint format
shepherd-l Oct 25, 2023
aed50e6
Fix wildcard import linting error
shepherd-l Oct 25, 2023
92ae453
Increase linting max line length
shepherd-l Oct 25, 2023
cf9aef5
Fix comment linting errors
jennantilla Oct 25, 2023
b24c3a6
Fix import linting errors
jennantilla Oct 25, 2023
f837e97
update location module property naming
jennantilla Oct 25, 2023
af506e7
Update InAppMessages property naming
jennantilla Oct 25, 2023
56948ba
Update core module property naming
jennantilla Oct 25, 2023
151a7f9
Update notifications module property naming
jennantilla Oct 26, 2023
e8801c2
Bump minimum SDK version to 19
shepherd-l Oct 26, 2023
c0c6e9d
Remove detekt
shepherd-l Oct 26, 2023
43f36f4
Merge pull request #1881 from OneSignal/remove-detekt
shepherd-l Oct 26, 2023
0fb3003
Merge branch 'user-model/main' into fix/linting
jennantilla Oct 26, 2023
0ee4ef3
Update PropertiesModel's deserialization of tags to not use `Model.in…
brismithers Oct 27, 2023
2a8ce6a
General protection against exceptions that occur on a thread.
brismithers Oct 30, 2023
390f1f0
Retrieve current ADM PurchasingListener assuming it returns a nullable.
brismithers Oct 31, 2023
1ec2723
Merge pull request #1884 from OneSignal/issues/1874-deserialize-tag-w…
brismithers Nov 1, 2023
ec3d03d
Merge pull request #1888 from OneSignal/issues/1812-adm-purchase-list…
brismithers Nov 1, 2023
9447835
Add synchronized block to get method
jennantilla Nov 1, 2023
e8bf0e8
Update initializeFromModel to never clear the model id
jennantilla Nov 1, 2023
68d2b5a
Update initializeFromModel to build a local map to replace data
jennantilla Nov 1, 2023
ca26745
Merge pull request #1882 from OneSignal/fix/linting
jennantilla Nov 1, 2023
c742bbf
Merge branch 'user-model/main' into fix/concurrent_modification_excep…
jennantilla Nov 2, 2023
81cb885
Update work-runtime dependency version
jennantilla Nov 2, 2023
f5fe01e
Update comment linting errors
jennantilla Nov 2, 2023
df534d5
Add additional synchronized blocks to get methods
jennantilla Nov 2, 2023
1847cb4
Revert "Add additional synchronized blocks to get methods"
jennantilla Nov 3, 2023
ae758cf
Add synchronized blocks to model get and set methods
jennantilla Nov 3, 2023
d8abaee
Merge pull request #1876 from OneSignal/fix/concurrent_modification_e…
jennantilla Nov 3, 2023
5df036a
Merge pull request #1883 from OneSignal/fix/unitTests
jennantilla Nov 3, 2023
7d994a9
Merge pull request #1890 from OneSignal/fix/work-runtime_dependency_bump
jennantilla Nov 3, 2023
a86c887
Merge pull request #1891 from OneSignal/fix/PropertiesModelTests_linting
jennantilla Nov 3, 2023
9d66a3d
Merge pull request #1887 from OneSignal/issues/1871-protect-thread-ex…
jennantilla Nov 3, 2023
f8162dc
Update version for v5.0.4 release
jennantilla Nov 3, 2023
3f00ac1
Update formatting to pass lint test
jennantilla Nov 3, 2023
ff841f9
Merge pull request #1899 from OneSignal/rel/5.0.4
jennantilla Nov 3, 2023
9a32cf7
add codeql action for security scanning
jennantilla Oct 27, 2023
ae8991b
Fix branches for scanning
jennantilla Nov 2, 2023
48eb818
Add intent verification to BroadcastReceiver classes
jennantilla Nov 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
58 changes: 58 additions & 0 deletions .github/os_probot_metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* Based on probot-metadata - https://github.com/probot/metadata
*/
const regex = /\n\n<!-- probot = (.*) -->/

const { Octokit } = require("@octokit/action")

const octokit = new Octokit()

module.exports = (context, issue = null) => {
console.log(context)
const prefix = "onesignal-probot"

if (!issue) issue = context.payload.issue

return {
async get (key = null) {
let body = issue.body

if (!body) {
body = (await octokit.issues.get(issue)).data.body || ''
}

const match = body.match(regex)

if (match) {
const data = JSON.parse(match[1])[prefix]
return key ? data && data[key] : data
}
},

async set (key, value) {
let body = issue.body
let data = {}

if (!body) body = (await octokit.issues.get(issue)).data.body || ''

body = body.replace(regex, (_, json) => {
data = JSON.parse(json)
return ''
})

if (!data[prefix]) data[prefix] = {}

if (typeof key === 'object') {
Object.assign(data[prefix], key)
} else {
data[prefix][key] = value
}

body = `${body}\n\n<!-- probot = ${JSON.stringify(data)} -->`

const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/")
const issue_number = context.payload.issue.number
return octokit.issues.update({ owner, repo, issue_number, body })
}
}
}
25 changes: 25 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name-template: $RESOLVED_VERSION
tag-template: $RESOLVED_VERSION
categories:
- title: 🚀 Features
label: Enhancement / Feature
- title: 🐛 Bug Fixes
label: Bug
- title: 🧰 Improvements
label: Improvement
change-template: '- $TITLE (#$NUMBER)'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Other Changes

$CHANGES
47 changes: 47 additions & 0 deletions .github/set_response_times.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
function calcResponseTimeForIssueCreatedAt(createdAt) {
const issueOpenedDate = new Date(createdAt);
const issueTriagedDate = new Date();
const businessDaysResponseTime = calcBusinessDaysBetweenDates(issueOpenedDate, issueTriagedDate);
return businessDaysResponseTime;
}

function calcBusinessDaysBetweenDates(openedDate, triagedDate) {
let differenceInWeeks, responseTime;
if (triagedDate < openedDate)
return -1; // error code if dates transposed
let openedDay = openedDate.getDay(); // day of week
let triagedDay = triagedDate.getDay();
openedDay = (openedDay == 0) ? 7 : openedDay; // change Sunday from 0 to 7
triagedDay = (triagedDay == 0) ? 7 : triagedDay;
openedDay = (openedDay > 5) ? 5 : openedDay; // only count weekdays
triagedDay = (triagedDay > 5) ? 5 : triagedDay;
// calculate differnece in weeks (1000mS * 60sec * 60min * 24hrs * 7 days = 604800000)
differenceInWeeks = Math.floor((triagedDate.getTime() - openedDate.getTime()) / 604800000);
if (openedDay < triagedDay) { //Equal to makes it reduce 5 days
responseTime = (differenceInWeeks * 5) + (triagedDay - openedDay);
}
else if (openedDay == triagedDay) {
responseTime = differenceInWeeks * 5;
}
else {
responseTime = ((differenceInWeeks + 1) * 5) - (openedDay - triagedDay);
}
return (responseTime);
}

module.exports = async(context, osmetadata) => {
const foundResponseTime = await osmetadata(context).get('response_time_in_business_days');
if (foundResponseTime) {
const foundString = "already found response time in business days: " + foundResponseTime
console.log(foundString);
return foundString;
}
if (context.payload.comment && context.payload.comment.author_association != "MEMBER" && context.payload.comment.author_association != "OWNER" && context.payload.comment.author_association != "CONTRIBUTOR") {
return;
}
const businessDaysResponseTime = calcResponseTimeForIssueCreatedAt(context.payload.issue.created_at);
console.log("response time in business days: " + businessDaysResponseTime);
const result = osmetadata(context, context.payload.issue).set('response_time_in_business_days', businessDaysResponseTime)
console.log("osmetadata update result: " + result);
return "set response time in business days: " + businessDaysResponseTime;
}
34 changes: 34 additions & 0 deletions .github/workflows/Zapier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This is an action to close asana tasks that were generated by Github issues

name: Zapier web hook

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
issues:
types: [closed]

permissions:
issues: read

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a set of commands using the runners shell
- name: Call Zapier web hook to close Asana task
if: ${{ !github.event.issue.pull_request }}
env:
ISSUE_TITLE: ${{ github.event.issue.title }}
run: |
curl --location --request POST 'https://hooks.zapier.com/hooks/catch/12728683/b7009qc/' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
"task_name" : "$ISSUE_TITLE"
}'
7 changes: 1 addition & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,10 @@ jobs:
working-directory: OneSignalSDK
run: |
./gradlew ktlintCheck --console=plain
- name: "[Test] Analyzing"
working-directory: OneSignalSDK
continue-on-error: true
run: |
./gradlew detekt --console=plain
- name: "[Test] SDK Unit Tests"
working-directory: OneSignalSDK
run: |
./gradlew unittest:testReleaseUnitTest --console=plain
./gradlew test --console=plain
- name: Unit tests results
if: failure()
uses: actions/upload-artifact@v3
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main", "user-model/main", "add_codeql" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main", "user-model/main", "add_codeql" ]
schedule:
- cron: '37 19 * * 4'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java-kotlin' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
41 changes: 41 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]
# pull_request_target event is required for autolabeler to support PRs from forks
# pull_request_target:
# types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV

# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/set_response_time.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Set Response Time
on:
issue_comment:
types:
- created
issues:
types:
- closed
jobs:
calculate:
name: set reponse time for the issue
if: github.event.issue.pull_request == null
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- run: npm install @octokit/action
- uses: actions/github-script@v6
id: set-time
with:
result-encoding: string
script: |
const os_probot_metadata = require('./.github/os_probot_metadata.js')
const set_response_time = require('./.github/set_response_times.js')
return await set_response_time(context, os_probot_metadata)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get result
run: echo "${{steps.set-time.outputs.result}}" >> $GITHUB_STEP_SUMMARY
Loading
Loading