Skip to content

New-arch/MOB-11545-update-build-configurations-for-both-ios-and-andro#645

Closed
lposen wants to merge 14 commits into
masterfrom
new-arch/MOB-11545-update-build-configurations-for-both-ios-and-andro
Closed

New-arch/MOB-11545-update-build-configurations-for-both-ios-and-andro#645
lposen wants to merge 14 commits into
masterfrom
new-arch/MOB-11545-update-build-configurations-for-both-ios-and-andro

Conversation

@lposen
Copy link
Copy Markdown
Contributor

@lposen lposen commented Jun 4, 2025

🔹 JIRA Ticket(s) if any

✏️ Description

Please provide a brief description of what this pull request does.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2025

Lines Statements Branches Functions
Coverage: 38%
38.11% (178/467) 11.29% (20/177) 32.46% (50/154)

Comment thread .github/workflows/ci.yml
Comment on lines +57 to +71
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

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment thread .github/workflows/ci.yml
Comment on lines +72 to +130
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

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
@qlty-cloud-legacy
Copy link
Copy Markdown

❌ 28 blocking issues (85 total)

Tool Category Rule Count
eslint Lint Replace useEffect,·useState with ·useEffect,·useState· 7
eslint Lint Expected style properties to be in ascending order. 'backgroundColor' should be before 'flex'. 6
eslint Lint Error loading TSDoc config file:
Error encountered for /home/runner/work/react-native-sdk/tsdoc.json:
Unable to resolve "extends" reference to "typedoc/tsdoc.json": Cannot find module 'typedoc/tsdoc.json' from '/home/runner/work/react-native-sdk'
3
eslint Lint Unexpected any. Specify a different type. 2
eslint Lint Color literal: { backgroundColor: '#F5F5F5' } 10
qlty Duplication Found 19 lines of similar code in 2 locations (mass = 71) 8
qlty Structure Function with many parameters (count = 4): initializeWithApiKey 24
qlty Structure Function with high complexity (count = 7): getIterableConfigFromMap 22
qlty Structure Function with many returns (count = 4): getIterableConfigFromMap 2
qlty Structure High total complexity (count = 103) 1

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) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 4): initializeWithApiKey [qlty:function-parameters]

}

@Override
public void initialize2WithApiKey(String apiKey, ReadableMap config, String apiEndPoint, String version, Promise promise) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 5): initialize2WithApiKey [qlty:function-parameters]

}

@Override
public void trackPushOpen(double campaignId, Double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 5): trackPushOpen [qlty:function-parameters]

}

@Override
public void trackInAppClose(String messageId, double location, double source, String clickedUrl) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 4): trackInAppClose [qlty:function-parameters]

Comment on lines +262 to +323
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();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 2 issues:

1. Function with high complexity (count = 7): getIterableConfigFromMap [qlty:function-complexity]


2. Function with many returns (count = 4): getIterableConfigFromMap [qlty:return-statements]

Comment thread example/src/App.tsx
Comment on lines +162 to +164
height: 300,
backgroundColor: '#FFFFFF',
borderRadius: 8,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected style properties to be in ascending order. 'backgroundColor' should be before 'height'. [eslint:react-native/sort-styles]

Suggested change
height: 300,
backgroundColor: '#FFFFFF',
borderRadius: 8,
backgroundColor: '#FFFFFF',
borderRadius: 8,
height: 300,

Comment thread example/src/App.tsx
Comment on lines +166 to +170
messageCard: {
padding: 12,
backgroundColor: '#F8F8F8',
borderRadius: 6,
marginBottom: 8,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color literal: { backgroundColor: '#F8F8F8' } [eslint:react-native/no-color-literals]

Comment thread example/src/App.tsx
Comment on lines +167 to +170
padding: 12,
backgroundColor: '#F8F8F8',
borderRadius: 6,
marginBottom: 8,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected style properties to be in ascending order. 'backgroundColor' should be before 'padding'. [eslint:react-native/sort-styles]

Suggested change
padding: 12,
backgroundColor: '#F8F8F8',
borderRadius: 6,
marginBottom: 8,
backgroundColor: '#F8F8F8',
borderRadius: 6,
marginBottom: 8,
padding: 12,

Comment thread example/src/App.tsx
Comment on lines +172 to +176
messageTitle: {
fontSize: 16,
fontWeight: 'bold',
color: '#333333',
marginBottom: 4,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color literal: { color: '#333333' } [eslint:react-native/no-color-literals]

Comment thread example/src/App.tsx
Comment on lines +173 to +175
fontSize: 16,
fontWeight: 'bold',
color: '#333333',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected style properties to be in ascending order. 'color' should be before 'fontWeight'. [eslint:react-native/sort-styles]

Suggested change
fontSize: 16,
fontWeight: 'bold',
color: '#333333',
color: '#333333',
fontSize: 16,
fontWeight: 'bold',

@lposen lposen closed this Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants