Skip to content

Release:v13.0.0 #463

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

Merged
merged 23 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1592118
feat: Mapping-Session-Replay-links-api
ahmedAlaaInstabug Feb 20, 2024
6c82d6d
featL add changelog data
ahmedAlaaInstabug Feb 20, 2024
15ea612
Update CHANGELOG.md
ahmedAlaaInstabug Feb 20, 2024
93da06b
Update CHANGELOG.md
ahmedAlaaInstabug Feb 20, 2024
cb2f1a7
Update CHANGELOG.md
ahmedAlaaInstabug Mar 3, 2024
080a318
Update CHANGELOG.md
ahmedAlaaInstabug Mar 3, 2024
3699871
Update CHANGELOG.md
ahmedAlaaInstabug Mar 6, 2024
5571c3d
Map: willRedirectToAppStore() api for android & iOS
AndrewAminInstabug Mar 21, 2024
686a20b
fix: willRedirectToAppStore iOS signature
AndrewAminInstabug Mar 21, 2024
3ede9b6
revert: non related files (build.gradle, Info.plist, Podfile, ... )
AndrewAminInstabug Mar 25, 2024
2f1aa27
chore: rename [willRedirectToAppStore] to [willRedirectToStore],
AndrewAminInstabug Apr 16, 2024
a3416a7
chore: remove useless comments
AndrewAminInstabug Apr 16, 2024
ae1f238
Merge pull request #445 from Instabug/feat/Mapping-Session-Replay-lin…
ahmedAlaaInstabug Apr 21, 2024
33bee16
chore: improve the documentation of the mapping API
AndrewAminInstabug Apr 22, 2024
5a190d5
Merge branch 'dev' into feat/map_custom_app_rating_api
ahmedAlaaInstabug Apr 22, 2024
08a6fdd
Merge pull request #453 from Instabug/feat/map_custom_app_rating_api
ahmedAlaaInstabug Apr 23, 2024
378ce7a
chore(ios): bump SDL to v13.0.0
ahmedAlaaInstabug Apr 23, 2024
84da8e5
Merge pull request #456 from Instabug/chore(ios)-bump-SDK-to-v13.0.0
ahmedAlaaInstabug Apr 23, 2024
aa45682
ci: upgrade android orb, node orbe android image (#454)
AndrewAminInstabug Apr 23, 2024
a639ab7
chore(android): bump sdk to v13.0.0 (#455)
ahmedAlaaInstabug Apr 23, 2024
c1f7851
feat: support app flows APIs (#446)
abdelhamid-f-nasser Apr 23, 2024
d556899
fix: resolve failing tests (#458)
ahmedAlaaInstabug Apr 28, 2024
aaca54e
Release: 13.0.0 (#462)
ahmedAlaaInstabug Apr 29, 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
72 changes: 35 additions & 37 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
version: 2.1

orbs:
android: circleci/[email protected]
android: circleci/android@2.5.0
flutter: circleci/[email protected]
node: circleci/[email protected]
node: circleci/[email protected]
advanced-checkout: vsco/[email protected]

commands:
setup_flutter:
Expand Down Expand Up @@ -46,7 +47,7 @@ commands:
steps:
- run:
name: Install XCUITest Driver
command: appium driver install xcuitest@4.35.0
command: appium driver install xcuitest@7.14.0
- when:
condition:
equal:
Expand All @@ -55,7 +56,7 @@ commands:
steps:
- run:
name: Install UIAutomator2 Driver
command: appium driver install uiautomator2@2.29.5
command: appium driver install uiautomator2@3.1.0
- run:
name: Launch Appium
# Enable --relaxed-security for `mobile: shell` command that Captain uses internally.
Expand Down Expand Up @@ -103,13 +104,12 @@ commands:
name: Build Pigeons
command: dart run build_runner build --delete-conflicting-outputs


jobs:
danger:
executor:
name: node/default
steps:
- checkout
- advanced-checkout/shallow-checkout
- node/install-packages:
pkg-manager: yarn
override-ci-command: yarn install --frozen-lockfile --network-concurrency 1
Expand All @@ -126,7 +126,7 @@ jobs:
docker:
- image: cirrusci/flutter:<<parameters.version>>
steps:
- checkout
- advanced-checkout/shallow-checkout
- install_flutter_and_dart_packages:
generate_pigeons: true
- run: flutter test --coverage
Expand All @@ -142,16 +142,10 @@ jobs:
executor:
name: android/android-machine
resource-class: xlarge
tag: 2022.04.1
tag: default
steps:
- checkout
- advanced-checkout/shallow-checkout
- setup_flutter
- android/start-emulator-and-run-tests:
system-image: system-images;android-30;google_apis;x86
additional-avd-args: -d "Nexus 5"
post-emulator-launch-assemble-command: cd example && flutter build apk
run-tests-working-directory: example/android
test-command: ./gradlew app:connectedAndroidTest -Ptarget=`pwd`/../test_driver/example.dart
- android/run-tests:
working-directory: example/android
test-command: ./gradlew test
Expand All @@ -160,42 +154,46 @@ jobs:
executor:
name: android/android-machine
resource-class: xlarge
tag: 2022.04.1
tag: default
steps:
- checkout
- advanced-checkout/shallow-checkout
- setup_captain:
platform: android
- setup_flutter
- android/start-emulator-and-run-tests:
system-image: system-images;android-30;google_apis;x86
additional-avd-args: -d "pixel_4"
post-emulator-launch-assemble-command: cd example || true && flutter build apk --debug
test-command: cd e2e || true && dotnet test
run-tests-working-directory: e2e
additional-avd-args: --device 3
system-image: system-images;android-33;default;x86_64
post-emulator-launch-assemble-command: cd example && flutter build apk --debug
test-command: dotnet test

test_ios:
macos:
xcode: 13.4.1
xcode: 15.2.0
resource_class: macos.m1.medium.gen1
environment:
INSTABUG_SOURCEMAPS_UPLOAD_DISABLE: true
steps:
- checkout
- advanced-checkout/shallow-checkout
- setup_ios
- run:
name: Build and run tests
working_directory: example/ios
working_directory: ~/project/example/ios
command: |
xcodebuild -allowProvisioningUpdates \
-workspace Runner.xcworkspace \
-scheme Runner \
-sdk iphonesimulator \
-destination 'name=iPhone 12 Pro Max' \
test | xcpretty
-workspace Runner.xcworkspace \
-scheme Runner \
-resultBundlePath coverage/result.xcresult \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 15 Pro Max,OS=17.2' \
test | xcpretty

e2e_ios_captain:
macos:
xcode: 13.4.1
xcode: 15.2.0
resource_class: macos.m1.medium.gen1
steps:
- checkout
- advanced-checkout/shallow-checkout
- setup_captain:
platform: ios
- setup_ios
Expand All @@ -213,7 +211,7 @@ jobs:
docker:
- image: cirrusci/flutter
steps:
- checkout
- advanced-checkout/shallow-checkout
- install_flutter_and_dart_packages:
generate_pigeons: false
- run:
Expand All @@ -224,7 +222,7 @@ jobs:
docker:
- image: cirrusci/flutter
steps:
- checkout
- advanced-checkout/shallow-checkout
- install_flutter_and_dart_packages:
generate_pigeons: true
- run:
Expand All @@ -235,7 +233,7 @@ jobs:
docker:
- image: cirrusci/flutter
steps:
- checkout
- advanced-checkout/shallow-checkout
- install_flutter_and_dart_packages:
generate_pigeons: true
- run:
Expand All @@ -245,11 +243,11 @@ jobs:

release:
macos:
xcode: 13.4.1
xcode: 15.2.0
resource_class: macos.m1.medium.gen1
working_directory: "~"
steps:
- checkout:
- advanced-checkout/shallow-checkout:
path: ~/project
# Flutter doesn't support Apple Silicon yet, so we need to install Rosetta use Flutter on M1 machines.
- run:
Expand Down Expand Up @@ -284,6 +282,7 @@ workflows:
version: 2
build-test-and-approval-deploy:
jobs:
- test_android
- danger:
requires:
- test_flutter-stable
Expand All @@ -293,7 +292,6 @@ workflows:
- test_flutter:
name: test_flutter-2.10.5
version: 2.10.5
- test_android
- e2e_android_captain
- test_ios
- e2e_ios_captain
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [13.0.0](https://github.com/Instabug/Instabug-React-Native/compare/v12.7.0...dev) (April 29, 2024)

### Added

- Adds custom app rating api ([#453](https://github.com/Instabug/Instabug-Flutter/pull/453))
- Add `SessionReplay.getSessionReplayLink` API which retrieves the current session's replay link ([#445](https://github.com/Instabug/Instabug-Flutter/pull/445)).
- Add support for App Flows APIs `APM.startFlow`, `APM.endFlow` and `APM.setFlowAttribute` ([#446](https://github.com/Instabug/Instabug-Flutter/pull/446)).

### Deprecated

- Deprecate execution traces APIs `APM.startExecutionTrace`, `APM.setExecutionTraceAttribute`, `APM.endExecutionTrace`, `Trace.setAttribute` and `Trace.end` in favor of the new app flow APIs ([#446](https://github.com/Instabug/Instabug-Flutter/pull/446)).

### Changed
- Bump Instabug Android SDK to v13.0.0 ([#455](https://github.com/Instabug/Instabug-Flutter/pull/455)). [See release notes](https://github.com/Instabug/Instabug-Android/releases/tag/v13.0.0).
- Bump Instabug iOS SDK to v13.0.0 ([#446](https://github.com/Instabug/Instabug-Flutter/pull/446)). [See release notes](https://github.com/Instabug/Instabug-iOS/releases/tag/13.0.0).

## [12.7.0](https://github.com/Instabug/Instabug-Flutter/compare/v12.5.0...v12.7.0) (February 15, 2024)

### Added
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.instabug.flutter'
version '12.7.0'
version '13.0.0'

buildscript {
repositories {
Expand Down Expand Up @@ -41,7 +41,7 @@ android {
}

dependencies {
api 'com.instabug.library:instabug:12.7.1'
api 'com.instabug.library:instabug:13.0.0'

testImplementation 'junit:junit:4.13.2'
testImplementation "org.mockito:mockito-inline:3.12.1"
Expand Down
34 changes: 29 additions & 5 deletions android/src/main/java/com/instabug/flutter/modules/ApmApi.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
package com.instabug.flutter.modules;

import android.util.Log;

import androidx.annotation.NonNull;

import androidx.annotation.Nullable;
import com.instabug.apm.APM;
import com.instabug.apm.model.ExecutionTrace;
import com.instabug.apm.networking.APMNetworkLogger;
import com.instabug.flutter.generated.ApmPigeon;
import com.instabug.flutter.util.Reflection;
import com.instabug.flutter.util.ThreadManager;

import io.flutter.plugin.common.BinaryMessenger;
import org.json.JSONObject;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

import io.flutter.plugin.common.BinaryMessenger;

public class ApmApi implements ApmPigeon.ApmHostApi {
private final String TAG = ApmApi.class.getName();
private final HashMap<String, ExecutionTrace> traces = new HashMap<>();
Expand Down Expand Up @@ -95,6 +92,33 @@ public void run() {
);
}

@Override
public void startFlow(@NonNull String name) {
try {
APM.startFlow(name);
} catch (Exception e) {
e.printStackTrace();
}
}

@Override
public void setFlowAttribute(@NonNull String name, @NonNull String key, @Nullable String value) {
try {
APM.setFlowAttribute(name, key, value);
} catch (Exception e) {
e.printStackTrace();
}
}

@Override
public void endFlow(@NonNull String name) {
try {
APM.endFlow(name);
} catch (Exception e) {
e.printStackTrace();
}
}

@Override
public void setExecutionTraceAttribute(@NonNull String id, @NonNull String key, @NonNull String value) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void setCurrentPlatform() {
@Override
public void setEnabled(@NonNull Boolean isEnabled) {
try {
if(isEnabled)
if (isEnabled)
Instabug.enable();
else
Instabug.disable();
Expand Down Expand Up @@ -171,13 +171,12 @@ public void setSessionProfilerEnabled(@NonNull Boolean enabled) {

@Override
public void setValueForStringWithKey(@NonNull String value, @NonNull String key) {
if(ArgsRegistry.placeholders.containsKey(key)) {
if (ArgsRegistry.placeholders.containsKey(key)) {
InstabugCustomTextPlaceHolder.Key resolvedKey = ArgsRegistry.placeholders.get(key);
placeHolder.set(resolvedKey, value);
Instabug.setCustomTextPlaceHolders(placeHolder);
}
else {
Log.i(TAG, "Instabug: " + key + " is only relevant to iOS.");
} else {
Log.i(TAG, "Instabug: " + key + " is only relevant to iOS.");
}
}

Expand Down Expand Up @@ -397,4 +396,9 @@ public void networkLog(@NonNull Map<String, Object> data) {
Log.e(TAG, "Network logging failed");
}
}

@Override
public void willRedirectToStore() {
Instabug.willRedirectToStore();
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.instabug.flutter.modules;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.instabug.flutter.generated.SessionReplayPigeon;
import com.instabug.library.OnSessionReplayLinkReady;
import com.instabug.library.sessionreplay.SessionReplay;

import io.flutter.plugin.common.BinaryMessenger;
Expand Down Expand Up @@ -33,4 +35,11 @@ public void setInstabugLogsEnabled(@NonNull Boolean isEnabled) {
public void setUserStepsEnabled(@NonNull Boolean isEnabled) {
SessionReplay.setUserStepsEnabled(isEnabled);
}

@Override
public void getSessionReplayLink(@NonNull SessionReplayPigeon.Result<String> result) {
SessionReplay.getSessionReplayLink(result::success);
}


}
33 changes: 33 additions & 0 deletions android/src/test/java/com/instabug/flutter/ApmApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,39 @@ public void testEndExecutionTrace() {
verify(mTrace).end();
}

@Test
public void testStartFlow() {
String appFlowName = "appFlowName";

api.startFlow(appFlowName);

mAPM.verify(() -> APM.startFlow(appFlowName));
mAPM.verifyNoMoreInteractions();
}

@Test
public void testEndFlow() {
String appFlowName = "appFlowName";

api.startFlow(appFlowName);

mAPM.verify(() -> APM.startFlow(appFlowName));
mAPM.verifyNoMoreInteractions();
}

@Test
public void testSetFlowAttribute() {
String appFlowName = "appFlowName";
String flowAttributeKey = "attributeKey";
String flowAttributeValue = "attributeValue";


api.setFlowAttribute(appFlowName, flowAttributeKey, flowAttributeValue);

mAPM.verify(() -> APM.setFlowAttribute(appFlowName, flowAttributeKey, flowAttributeValue));
mAPM.verifyNoMoreInteractions();
}

@Test
public void testStartUITrace() {
String name = "login";
Expand Down
Loading