-
Notifications
You must be signed in to change notification settings - Fork 35
New-arch/MOB-11545-update-build-configurations-for-both-ios-and-andro #645
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
base: master
Are you sure you want to change the base?
New-arch/MOB-11545-update-build-configurations-for-both-ios-and-andro #645
Conversation
…ns for new architecture support
…g in React Native SDK
…for inbox display
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup | ||
uses: ./.github/actions/setup | ||
|
||
- name: Switch to new architecture | ||
run: yarn switch-arch new | ||
|
||
- name: Build package with new architecture | ||
run: yarn build:new-arch | ||
|
||
build-android-old-arch: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 4 days ago
To fix the issue, we need to add a permissions
block to the workflow file. This block should specify the minimal permissions required for the workflow to function correctly. Based on the provided workflow, it appears that the jobs primarily involve checking out code, running setup scripts, linting, type-checking, testing, and building packages. These tasks typically require only contents: read
permissions. Therefore, we will add a permissions
block at the root level of the workflow to apply to all jobs.
-
Copy modified lines R2-R3
@@ -1,2 +1,4 @@ | ||
name: CI | ||
permissions: | ||
contents: read | ||
on: |
runs-on: ubuntu-latest | ||
env: | ||
TURBO_CACHE_DIR: .turbo/android-old | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup | ||
uses: ./.github/actions/setup | ||
|
||
- name: Switch to old architecture | ||
run: yarn switch-arch old | ||
|
||
- name: Cache turborepo for Android | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.TURBO_CACHE_DIR }} | ||
key: ${{ runner.os }}-turborepo-android-old-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-turborepo-android-old- | ||
|
||
- name: Check turborepo cache for Android | ||
run: | | ||
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status") | ||
|
||
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then | ||
echo "turbo_cache_hit=1" >> $GITHUB_ENV | ||
fi | ||
|
||
- name: Install JDK | ||
if: env.turbo_cache_hit != 1 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '17' | ||
|
||
- name: Finalize Android SDK | ||
if: env.turbo_cache_hit != 1 | ||
run: | | ||
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" | ||
|
||
- name: Cache Gradle | ||
if: env.turbo_cache_hit != 1 | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/wrapper | ||
~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-old-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle-old- | ||
|
||
- name: Build example for Android (Old Architecture) | ||
env: | ||
JAVA_OPTS: '-XX:MaxHeapSize=6g' | ||
run: | | ||
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" | ||
|
||
build-android-new-arch: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 4 days ago
To fix the issue, we need to add a permissions
block to the workflow file. This block should specify the least privileges required for the workflow to function correctly. Since the workflow primarily involves linting, testing, building, and caching, the minimal permission contents: read
is sufficient for most jobs. If specific jobs require additional permissions, they can be set individually.
The permissions
block can be added at the root level of the workflow to apply to all jobs, or it can be added to individual jobs if different permissions are required for each job.
-
Copy modified lines R2-R3
@@ -1,2 +1,4 @@ | ||
name: CI | ||
permissions: | ||
contents: read | ||
on: |
❌ 28 blocking issues (85 total)
This is from Qlty Cloud, the successor to Code Climate Quality. Learn more. |
} | ||
|
||
@Override | ||
public void initializeWithApiKey(String apiKey, ReadableMap config, String version, Promise promise) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
@Override | ||
public void initialize2WithApiKey(String apiKey, ReadableMap config, String apiEndPoint, String version, Promise promise) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
@Override | ||
public void trackPushOpen(double campaignId, Double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
@Override | ||
public void trackInAppClose(String messageId, double location, double source, String clickedUrl) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private IterableConfig getIterableConfigFromMap(ReadableMap config) { | ||
IterableConfig.Builder builder = new IterableConfig.Builder(); | ||
|
||
if (config.hasKey("pushIntegrationName")) { | ||
builder.setPushIntegrationName(config.getString("pushIntegrationName")); | ||
} | ||
|
||
if (config.hasKey("autoPushRegistration")) { | ||
builder.setAutoPushRegistration(config.getBoolean("autoPushRegistration")); | ||
} | ||
|
||
if (config.hasKey("logLevel")) { | ||
builder.setLogLevel(config.getInt("logLevel")); | ||
} | ||
|
||
if (config.hasKey("inAppDisplayInterval")) { | ||
builder.setInAppDisplayInterval(config.getDouble("inAppDisplayInterval")); | ||
} | ||
|
||
if (config.hasKey("urlHandler")) { | ||
ReadableMap urlHandler = config.getMap("urlHandler"); | ||
builder.setUrlHandler(url -> { | ||
sendEvent("urlHandler", url); | ||
return urlHandler.getBoolean("shouldOpenInNewWindow"); | ||
}); | ||
} | ||
|
||
if (config.hasKey("customActionHandler")) { | ||
ReadableMap customActionHandler = config.getMap("customActionHandler"); | ||
builder.setCustomActionHandler((action, context) -> { | ||
sendEvent("customActionHandler", action.getType()); | ||
return customActionHandler.getBoolean("shouldHandleCustomAction"); | ||
}); | ||
} | ||
|
||
if (config.hasKey("inAppHandler")) { | ||
ReadableMap inAppHandler = config.getMap("inAppHandler"); | ||
builder.setInAppHandler(new IterableConfig.InAppHandler() { | ||
@Override | ||
public boolean onInAppReceived(IterableInAppMessage message) { | ||
sendEvent("inAppReceived", message.getMessageId()); | ||
return inAppHandler.getBoolean("shouldShowInApp"); | ||
} | ||
|
||
@Override | ||
public void onInAppDisplayed(IterableInAppMessage message) { | ||
sendEvent("inAppDisplayed", message.getMessageId()); | ||
} | ||
|
||
@Override | ||
public void onInAppDismissed(IterableInAppMessage message) { | ||
sendEvent("inAppDismissed", message.getMessageId()); | ||
} | ||
|
||
@Override | ||
public void onInAppClicked(IterableInAppMessage message, String clickedUrl) { | ||
sendEvent("inAppClicked", message.getMessageId()); | ||
} | ||
}); | ||
} | ||
|
||
return builder.build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
height: 300, | ||
backgroundColor: '#FFFFFF', | ||
borderRadius: 8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
messageCard: { | ||
padding: 12, | ||
backgroundColor: '#F8F8F8', | ||
borderRadius: 6, | ||
marginBottom: 8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
padding: 12, | ||
backgroundColor: '#F8F8F8', | ||
borderRadius: 6, | ||
marginBottom: 8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
messageTitle: { | ||
fontSize: 16, | ||
fontWeight: 'bold', | ||
color: '#333333', | ||
marginBottom: 4, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fontSize: 16, | ||
fontWeight: 'bold', | ||
color: '#333333', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔹 JIRA Ticket(s) if any
✏️ Description