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

feat: Enterprise releases post check #1300

Draft
wants to merge 75 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
f9f48b7
Initial empty commit
AyaMahmoud148 Oct 24, 2024
2ac8429
feat: add hybrid android example app
AyaMahmoud148 Oct 23, 2024
bb4b769
feat: configure react native app
AyaMahmoud148 Oct 23, 2024
5c6b088
feat: add ios app
AyaMahmoud148 Oct 23, 2024
19db839
fix android app
AyaMahmoud148 Oct 23, 2024
ce0de4e
fix: linting errors
AyaMahmoud148 Oct 24, 2024
52e42db
Revert "feat(example): add features and buttons implementation (#1280)"
AyaMahmoud148 Oct 24, 2024
68efa4d
revert: pod changes
AyaMahmoud148 Oct 24, 2024
36bb946
fix: prettier errors
AyaMahmoud148 Oct 24, 2024
fafe2a7
fix: delete unnecessary files
AyaMahmoud148 Oct 24, 2024
f161d07
Revert "Revert "feat(example): add features and buttons implementatio…
AyaMahmoud148 Oct 24, 2024
3f6bcf8
fix: use RNInstabug instead of native SDK
AyaMahmoud148 Oct 27, 2024
c22288a
fix: use only ActivityMainBinding instead of the whole library
AyaMahmoud148 Oct 27, 2024
df2e8e5
fix: use the local keystore
AyaMahmoud148 Oct 27, 2024
c92d340
fix: use RNInstabug instead of native sdk
AyaMahmoud148 Oct 27, 2024
57c9f43
fix: remove .gitignore files
AyaMahmoud148 Oct 27, 2024
cc3fd30
fix: ios app
AyaMahmoud148 Oct 27, 2024
434e04c
fix: revert ios cocoapods version
AyaMahmoud148 Oct 27, 2024
c400298
fix: android app name
AyaMahmoud148 Oct 27, 2024
d8034c0
fix: Rename hybrid app directory
AyaMahmoud148 Oct 27, 2024
1e0e923
fix: adnroid crash
AyaMahmoud148 Oct 27, 2024
300780c
Merge pull request #1301 from Instabug/feat/add-new-hybrid-app
AyaMahmoud148 Oct 29, 2024
7a1d505
chore: Validate release post check job
AyaMahmoud148 Oct 31, 2024
1003681
fix: remove instabug-reactnative from package.json
AyaMahmoud148 Oct 31, 2024
0fdffe5
fix: enhance formatter
AyaMahmoud148 Oct 31, 2024
45c0a3c
fix: ios failure
AyaMahmoud148 Oct 31, 2024
6e0de65
fix: add ios version
AyaMahmoud148 Oct 31, 2024
f544897
fix: fix config.yml formatting
AyaMahmoud148 Oct 31, 2024
05a8e71
fix: e2e test failure
AyaMahmoud148 Oct 31, 2024
efb893a
fix: project.pbxproj
AyaMahmoud148 Oct 31, 2024
4353768
chore: restrict on master branch
AyaMahmoud148 Oct 31, 2024
eb168ed
fix: symlink instabug-reactnative
AyaMahmoud148 Oct 31, 2024
4fa1ad5
fix: rename jobs
AyaMahmoud148 Oct 31, 2024
c54e888
fix: lint
AyaMahmoud148 Oct 31, 2024
d526791
fix: generalize release jobs
AyaMahmoud148 Oct 31, 2024
2298234
fix: enhnace package.json
AyaMahmoud148 Oct 31, 2024
52a22ec
fix: validate config.yml
AyaMahmoud148 Oct 31, 2024
aea4f53
revert: just checking the ci jobs
AyaMahmoud148 Oct 31, 2024
f0c260c
fix: run on release scheme
AyaMahmoud148 Oct 31, 2024
7fd23cb
fix: add bundling command
AyaMahmoud148 Oct 31, 2024
c5782c0
fix: metro.config.js
AyaMahmoud148 Oct 31, 2024
7d89228
fix: project.pbxproj
AyaMahmoud148 Oct 31, 2024
138f1f5
fix: update build file
AyaMahmoud148 Oct 31, 2024
4603f51
fix: release mode
AyaMahmoud148 Oct 31, 2024
eec34e6
fix: update podfile
AyaMahmoud148 Oct 31, 2024
b8eab91
fix: update build file
AyaMahmoud148 Oct 31, 2024
22de17c
fix: fix build project
AyaMahmoud148 Oct 31, 2024
4911a62
fix: add remove drived data
AyaMahmoud148 Oct 31, 2024
9dc493b
fix: fix simulator version
AyaMahmoud148 Oct 31, 2024
e0e0f43
fix: running hybrid app in release mode
AyaMahmoud148 Nov 2, 2024
11f7031
fix: update pod file
AyaMahmoud148 Nov 2, 2024
3015302
fix: try remove cache
AyaMahmoud148 Nov 2, 2024
50cabc7
revert: restrict jobs on master only
AyaMahmoud148 Nov 2, 2024
45aaf66
fix: using working directory instead of passing ios and android paths
AyaMahmoud148 Nov 3, 2024
2fd707c
fix: run build check on default example app
AyaMahmoud148 Nov 4, 2024
b7cf03f
fix: rename jobs based on guidelines
AyaMahmoud148 Nov 4, 2024
c476aa5
fix: formatter
AyaMahmoud148 Nov 4, 2024
3daf7fb
fix: add dynamic path for ios paths
AyaMahmoud148 Nov 4, 2024
bedab83
trying revert removing drived data
AyaMahmoud148 Nov 4, 2024
2109ea6
fix: delete unnicessary jobs
AyaMahmoud148 Nov 4, 2024
f066ba8
revert deleting dervied data
AyaMahmoud148 Nov 4, 2024
3ca4e81
Merge pull request #1305 from Instabug/chore/validate-release-post-ch…
AyaMahmoud148 Nov 4, 2024
5ee38ca
feat: customize js code with dream11 customization
AyaMahmoud148 Nov 7, 2024
37af37c
feat: add manual interception for android app
AyaMahmoud148 Nov 7, 2024
152bc31
feat: customizing ios app with dream11 customization
AyaMahmoud148 Nov 7, 2024
ae84d2f
fix: pod issue
AyaMahmoud148 Nov 7, 2024
f7ba380
fix: use the native gradel version
AyaMahmoud148 Nov 10, 2024
b21363e
fix: remove setCodepush for ios
AyaMahmoud148 Nov 10, 2024
339d5a6
fix: remove setCodePush for android
AyaMahmoud148 Nov 10, 2024
b2a03fe
fix: fix android interception version
AyaMahmoud148 Nov 10, 2024
1497a34
Merge pull request #1309 from Instabug/feat/customizing-app-with-Drea…
AyaMahmoud148 Nov 11, 2024
0286861
feat: Overrding Feature request to match Dream11 Configuration
AyaMahmoud148 Nov 13, 2024
9c26d9d
Merge pull request #1318 from Instabug/feat/override-feature-requests…
AyaMahmoud148 Nov 13, 2024
039a726
feat:refactor mitm proxy be dynamic with the domain and token
AyaMahmoud148 Dec 1, 2024
f0de0fd
Merge pull request #1331 from Instabug/feat/refactor-mitm-proxy-script
AyaMahmoud148 Dec 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 89 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,22 @@ commands:
- run:
name: Post comment on GitHub
command: ./scripts/notify-github.sh "<< parameters.data >>"
build_and_pack_sdk:
parameters:
working_directory:
type: string
default: ~/project
steps:
- install_node_modules
- run:
command: yarn build
working_directory: ~/project
- run:
command: yarn pack --filename InstabugSDK.tgz
working_directory: ~/project
- run:
command: yarn add file:../../InstabugSDK.tgz
working_directory: <<parameters.working_directory>>

jobs:
danger:
Expand Down Expand Up @@ -295,7 +311,7 @@ jobs:
-scheme InstabugExample \
-resultBundlePath coverage/result.xcresult \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 13 Pro Max,OS=15.5' \
-destination "platform=iOS Simulator,OS=15.5,name=iPhone 11 Pro Max" \
test | xcpretty
- when:
condition: << parameters.collect_coverage >>
Expand Down Expand Up @@ -487,6 +503,50 @@ jobs:
replace: $SNAPSHOT_VERSION
- notify_github:
data: "$(jq -Rcs '{ body: . }' scripts/snapshot-comment.md)"
build_check_android:
parameters:
working_directory:
type: string
executor:
name: android/android-machine
tag: '2024.01.1'
steps:
- advanced-checkout/shallow-checkout
- build_and_pack_sdk:
working_directory: << parameters.working_directory >>
- run:
name: Build Android
working_directory: <<parameters.working_directory>>/android
command: ./gradlew assembleRelease

build_check_ios:
parameters:
working_directory:
type: string
scheme:
type: string
workspace_path:
type: string
macos:
xcode: 13.4.1
resource_class: macos.m1.medium.gen1
steps:
- advanced-checkout/shallow-checkout
- build_and_pack_sdk:
working_directory: << parameters.working_directory >>
- install_pods:
working_directory: <<parameters.working_directory>>/ios
- run:
name: Build iOS
working_directory: <<parameters.working_directory>>/ios
command: |
yarn react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ios/main.jsbundle --assets-dest ios
rm -rf ~/Library/Developer/Xcode/DerivedData/*
xcodebuild -workspace <<parameters.workspace_path>>.xcworkspace \
-scheme <<parameters.scheme>> \
-configuration Release \
-sdk iphonesimulator \
-destination "platform=iOS Simulator,OS=15.5,name=iPhone 11 Pro Max"

workflows:
publish:
Expand Down Expand Up @@ -607,9 +667,37 @@ workflows:
filters:
branches:
only: dream11
- hold_build_check:
type: approval
- build_check_android:
name: build_check_android_default
working_directory: ~/project/examples/default
requires:
- hold_build_check
- build_check_ios:
name: build_check_ios_default
working_directory: ~/project/examples/default
scheme: InstabugExample
workspace_path: InstabugExample
requires:
- hold_build_check
- build_check_android:
name: build_check_android_hybrid
working_directory: ~/project/examples/hybrid
requires:
- hold_build_check
- build_check_ios:
name: build_check_ios_hybrid
working_directory: ~/project/examples/hybrid
scheme: HybridSampleApp
workspace_path: HybridSampleApp
requires:
- hold_build_check
- release_custom_package:
name: release_dream11
requires:
- build_check_android_hybrid
- build_check_ios_hybrid
- hold_release_dream11
filters:
branches:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ yarn-debug.log
yarn-error.log
coverage/
.jest/cache/
.yarn

# OSX
.DS_Store
Expand Down Expand Up @@ -62,7 +63,8 @@ android/keystores/debug.keystore

# Bundle artifact
*.jsbundle
/examples/default/ios/main.jsbundle.map
*.bundle
main.jsbundle.map

# Vscode local history
.history/
Expand Down
4 changes: 4 additions & 0 deletions examples/hybrid/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native-community',
};
1 change: 1 addition & 0 deletions examples/hybrid/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
100 changes: 100 additions & 0 deletions examples/hybrid/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/* eslint-disable react-native/no-inline-styles */
import { ReactNode, useEffect } from 'react';
import React from 'react';
import CodePush from 'react-native-code-push';
import axios from 'axios';
import { Button, Image, Platform, SafeAreaView, Text } from 'react-native';
import Instabug, {
CrashReporting,
InvocationEvent,
LogLevel,
NetworkInterceptionMode,
ReproStepsMode,
} from 'instabug-reactnative';

const throwHandled = () => {
try {
throw Error('This is a handled JS Crash');
} catch (err) {
if (err instanceof Error) {
CrashReporting.reportError(err);
}
}
};

const throwUnhandled = () => {
throw Error('This is an unhandled JS Crash');
};

const sendGraphQLRequest = async () => {
try {
const response = await axios.post(
'https://countries.trevorblades.com/graphql',
{
query: `
query GetCountry {
country(code: "EG") {
emoji
name
}
}
`,
},
{
headers: {
'Content-Type': 'application/json',
'ibg-graphql-header': 'GetCountry',
},
},
);
console.log('Response:', response.data.data);
} catch (error) {
console.error('Error:', error);
}
};

const App: () => ReactNode = () => {
useEffect(() => {
Instabug.init({
token: '0fcc87b8bf731164828cc411eccc802a',
invocationEvents: [InvocationEvent.floatingButton],
networkInterceptionMode:
Platform.OS === 'ios' ? NetworkInterceptionMode.native : NetworkInterceptionMode.javascript,
debugLogsLevel: LogLevel.verbose,
});
CodePush.getUpdateMetadata().then((metadata) => {
if (metadata) {
Instabug.setCodePushVersion(metadata.label);
}
});
CrashReporting.setNDKCrashesEnabled(true);
Instabug.setReproStepsConfig({
all: ReproStepsMode.enabled,
});
}, []);

return (
<SafeAreaView
style={{
minHeight: '100%',
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
}}>
<Image
source={{
uri: 'https://reactnative.dev/img/tiny_logo.png',
height: 100,
width: 100,
}}
/>
<Text style={{ fontSize: 21, fontWeight: '700' }}>React Native App</Text>
<Button title="Handled Crash" onPress={throwHandled} />
<Button title="Unhandled Crash" onPress={throwUnhandled} />
<Button title="Send GQL Request" onPress={sendGraphQLRequest} />
</SafeAreaView>
);
};

export default App;
17 changes: 17 additions & 0 deletions examples/hybrid/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @format
*/

import 'react-native';
import React from 'react';
import App from '../App';

// Note: import explicitly to use the types shipped with jest.
import { it } from '@jest/globals';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

it('renders correctly', () => {
renderer.create(<App />);
});
88 changes: 88 additions & 0 deletions examples/hybrid/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.facebook.react'

}

apply from: "../../node_modules/instabug-reactnative/android/native.gradle"
android {
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
}
}
namespace 'com.instabug.hybridsampleapp'
compileSdk 34

defaultConfig {
applicationId "com.instabug.hybridsampleapp"
minSdk 29
targetSdk 34
versionCode 1
versionName "1.0"
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.8"
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
compose = true
buildConfig = true
}
}

dependencies {
// Use consistent versions
def composeBom = platform('androidx.compose:compose-bom:2023.10.00')
implementation composeBom
androidTestImplementation composeBom
implementation project(':react-native-code-push')

// Compose dependencies
implementation "androidx.compose.ui:ui"
implementation "androidx.compose.material3:material3"
implementation "androidx.compose.ui:ui-tooling-preview"
debugImplementation "androidx.compose.ui:ui-tooling"
implementation libs.androidx.appcompat
implementation libs.androidx.appcompat.resources
implementation libs.androidx.core.ktx.v1130
implementation libs.androidx.core
implementation libs.androidx.activity
implementation libs.androidx.transition
implementation libs.androidx.annotation.experimental
implementation "com.facebook.react:react-android"
implementation "com.facebook.react:hermes-android"
implementation "com.instabug.library:instabug-with-okhttp-interceptor:${project.ext.instabug.version}"
}
configurations.all {
resolutionStrategy {
force "androidx.appcompat:appcompat:${rootProject.ext.androidXAppCompatVersion}"
force "androidx.appcompat:appcompat-resources:${rootProject.ext.androidXAppCompatVersion}"
force "androidx.core:core:${rootProject.ext.androidXCoreVersion}"
force "androidx.core:core-ktx:${rootProject.ext.androidXCoreVersion}"
}
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
Binary file added examples/hybrid/android/app/debug.keystore
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading