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 internal package to libnavigation-core #2839

Merged
merged 1 commit into from
Apr 28, 2020

Conversation

Guardiola31337
Copy link
Contributor

@Guardiola31337 Guardiola31337 commented Apr 25, 2020

Description

This PR adds internal package to libnavigation-core

Splitting #2417 in different PRs

Fix #2583
Fix #2417
Fix #2811 (comment)

Refs. #2811 #2820 #2836

As this is going to be a big refactor the plan here is to open small PRs and move stuff incrementally making the review easier. Even trying to do so this first PR included changes in 94 files 😱 (mostly moving files around)

  • I have added any issue links
  • I have added all related labels (bug, feature, new API(s), SEMVER, etc.)
  • I have added the appropriate milestone and project boards

Goal

The goal here is to add internal package to 1.0 modules and the APIs designed only for local usage

Implementation

  • Move classes around to internal package
  • Add internal modifier
  • Fix package across codebase
  • Make APIs Java friendly
  • Remove duplication and never used code
  • Overall cleanup

Will follow up with #2417 (comment) (added TODOs in the code)

Testing

  • I have tested locally (including SNAPSHOT upstream dependencies if needed) through testapp/demo app and run all activities to avoid regressions
  • I have tested via a test drive, or a simulation/mock location app
  • New and existing unit tests pass locally with my changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have updated the CHANGELOG including this PR

@Guardiola31337 Guardiola31337 added ✓ ready for review backwards incompatible Requires a SEMVER major version change. Core Work related to core navigation and integrations. labels Apr 25, 2020
@Guardiola31337 Guardiola31337 added this to the v1.0.0 milestone Apr 25, 2020
@Guardiola31337 Guardiola31337 self-assigned this Apr 25, 2020
@Guardiola31337 Guardiola31337 force-pushed the pg-internal-libnavigation-core branch 2 times, most recently from a597570 to 107a1d2 Compare April 25, 2020 01:30
@codecov-io
Copy link

codecov-io commented Apr 25, 2020

Codecov Report

Merging #2839 into master will increase coverage by 0.04%.
The diff coverage is 55.95%.

@@             Coverage Diff              @@
##             master    #2839      +/-   ##
============================================
+ Coverage     35.00%   35.05%   +0.04%     
- Complexity     2107     2108       +1     
============================================
  Files           541      543       +2     
  Lines         19422    19390      -32     
  Branches       1841     1841              
============================================
- Hits           6799     6797       -2     
+ Misses        11807    11777      -30     
  Partials        816      816              

@Guardiola31337 Guardiola31337 force-pushed the pg-internal-libnavigation-core branch 2 times, most recently from 2098246 to 03c679a Compare April 28, 2020 14:23
)
annotation class FeedbackType
annotation class Type
Copy link
Contributor

Choose a reason for hiding this comment

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

are you sure you want to change this to Type? to be consistent, looks you'll want to follow up and change all of these 🤔

Screen Shot 2020-04-28 at 9 44 41 AM

Copy link
Contributor

Choose a reason for hiding this comment

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

Also there are enough "Type" objects

Screen Shot 2020-04-28 at 9 53 38 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BicycleType is an enum. It's also for the Onboard module (not actively under development at the moment) so for now I'm going to leave it as is.
DirectionsRouteType is from the legacy.

)
annotation class FeedbackSource
annotation class Source
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

but also my preference is FeedbackSource. There's already a few "Source" objects

Screen Shot 2020-04-28 at 9 52 27 AM

val jobControl = ThreadController.getIOScopeAndRootJob()
(0 until maxCoroutines).forEach {
jobControl.scope.launch {
delay(maxDelay)
Copy link
Contributor

Choose a reason for hiding this comment

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

= coroutineRule.runBlockingTest

this will delay the test thread no?

Copy link
Contributor

Choose a reason for hiding this comment

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

oh this change was ThreadControllerKtTest to ThreadControllerTest. up to you to update

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually this doesn't affect the test as the launch is async i.e. the delay is not blocking.

import com.google.gson.annotations.SerializedName
import java.util.Date

internal data class ReplayLocationDto(
Copy link
Contributor

Choose a reason for hiding this comment

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

👋

* @param screenshot encoded screenshot (optional)
*/
@JvmStatic
fun postUserFeedback(
@FeedbackEvent.FeedbackType feedbackType: String,
@FeedbackEvent.Type feedbackType: String,
description: String,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not adding @FeedbackEvent.Description for now cc @JunDai

@@ -425,9 +425,9 @@ internal object MapboxNavigationTelemetry : MapboxNavigationTelemetryInterface {
* The method may suspend until it collects 40 location events. The worst case scenario is a 40 location suspension, 20 is best case
*/
override fun postUserFeedback(
@FeedbackEvent.FeedbackType feedbackType: String,
@FeedbackEvent.Type feedbackType: String,
description: String,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not adding @FeedbackEvent.Description for now cc @JunDai

@@ -439,9 +439,9 @@ internal object MapboxNavigationTelemetry : MapboxNavigationTelemetryInterface {
* Helper class that posts user feedback. The call is available only after initialization
*/
private fun postUserFeedbackHelper(
@FeedbackEvent.FeedbackType feedbackType: String,
@FeedbackEvent.Type feedbackType: String,
description: String,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above re: @FeedbackEvent.Description cc @JunDai

@@ -5,9 +5,9 @@ import com.mapbox.navigation.core.telemetry.events.FeedbackEvent

internal interface MapboxNavigationTelemetryInterface {
fun postUserFeedback(
@FeedbackEvent.FeedbackType feedbackType: String,
@FeedbackEvent.Type feedbackType: String,
description: String,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above re: @FeedbackEvent.Description cc @JunDai

@Guardiola31337 Guardiola31337 added the UI Work related to visual components, Android Auto, Camera, 3D, voice, etc. label Apr 28, 2020
@Guardiola31337 Guardiola31337 merged commit 76eb99b into master Apr 28, 2020
@Guardiola31337 Guardiola31337 deleted the pg-internal-libnavigation-core branch April 28, 2020 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards incompatible Requires a SEMVER major version change. Core Work related to core navigation and integrations. UI Work related to visual components, Android Auto, Camera, 3D, voice, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move classes and properties from base module Add internal package to 1.0 modules
4 participants