Giter Club home page Giter Club logo

avito-android's People

Contributors

bugtsa avatar chromico avatar deadmc avatar decsent avatar dependabot[bot] avatar dsvoronin avatar eugene-krivobokov avatar fat-fellow avatar glushen avatar int02h avatar jacks0n23 avatar kutashov avatar lukaville avatar materkey avatar midery avatar ntoskrnl avatar phansier avatar ruslanmingaliev avatar rwqwr avatar sboishtyan avatar stanlyt avatar subtle-fox avatar vadimfilimonov avatar yundin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

avito-android's Issues

Переименовать kotlin-dsl-support

Проблема

название не отражает содержимого, на самом деле там и kotlin-dsl-support и наши экстеншены для gradle, в том числе и те что для вызова из groovy

Скорее что-то вроде: gradle-api-extensions

Pod requests queue is empty => leak of emulator deployment

Describe the bug
Pod requests queue is empty => leak of emulator deployment

How to reproduce

  1. instrumentationUi started
  2. 8/14 pods Running with emulators (6 pods has insufficient cpu)
  3. 20 minutes later has cpu resources => creating new pods in deployment => crash IllegalStateException: Pod requests queue is empty

Expected behavior
Expect no deployment leak and no failed instrumentationUi for this scenario

Environment
Version: 2021.36 (fork)
2 worker nodes (openstack VMs), each has 12 cpu

Additional context
Logs:

[StatsDSender@:app:instrumentationUi] time:consumerapp.testrunner.app.ui.reservation.pod.queue:1653
[RemoteDeviceProvider@:app:instrumentationUi] Found new pod: default-462db226-8a78-4421-91ab-f3b0af6152fa-6d8768786f-t527c2021-10-27T16:52:42.650782489+03:00 
[StatsDSender@:app:instrumentationUi] time:consumerapp.testrunner.app.ui.reservation.pod.queue:1653
[RemoteDeviceProvider@:app:instrumentationUi] Found new pod: default-462db226-8a78-4421-91ab-f3b0af6152fa-6d8768786f-v9596
kotlinx.coroutines.JobCancellationException: ScopeCoroutine is cancelling; job=ScopeCoroutine{Cancelling}@16296bdd
Caused by: java.lang.IllegalStateException: Pod requests queue is empty
	at com.avito.android.runner.devices.internal.kubernetes.KubernetesReservationState.podAcquired(KubernetesReservationState.kt:42)
	at com.avito.android.runner.devices.internal.kubernetes.StatsDKubernetesReservationMetricsSender.onPodAcquired(StatsDKubernetesReservationMetricsSender.kt:25)
	at com.avito.android.runner.devices.internal.kubernetes.KubernetesReservationClaimer$initializeDevices$2$1.invokeSuspend(KubernetesReservationClaimer.kt:101)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)2021-10-27T16:52:42.650893088+03:00 [TestRunner@:app:instrumentationUi] Test run finished with error

kotlinx.coroutines.JobCancellationException: Parent job is Cancelling; job=StandaloneCoroutine{Cancelling}@11922229
Caused by: java.lang.IllegalStateException: Pod requests queue is empty
	at com.avito.android.runner.devices.internal.kubernetes.KubernetesReservationState.podAcquired(KubernetesReservationState.kt:42)
	at com.avito.android.runner.devices.internal.kubernetes.StatsDKubernetesReservationMetricsSender.onPodAcquired(StatsDKubernetesReservationMetricsSender.kt:25)2021-10-27T16:52:42.650935967+03:00 
	at com.avito.android.runner.devices.internal.kubernetes.KubernetesReservationClaimer$initializeDevices$2$1.invokeSuspend(KubernetesReservationClaimer.kt:101)2021-10-27T16:52:42.650947013+03:00 
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)2021-10-27T16:52:42.650969371+03:00 
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)2021-10-27T16:52:42.650991556+03:00 
[RemoteDeviceProvider@:app:instrumentationUi] Pod default-462db226-8a78-4421-91ab-f3b0af6152fa-6d8768786f-j8hk8 can't load device. Disconnect and delete.
Check device logs in artifacts: /job/app/app/build/test-runner/4bdd0cc9fa0288878524b47b3e7574a3d2cdb4d9.local-root/ui/devices/10.0.3.134.txt
[StatsDSender@:app:instrumentationUi] time:consumerapp.service.kubernetes.pods_delete.202:34
[RemoteDeviceProvider@:app:instrumentationUi] Pod default-462db226-8a78-4421-91ab-f3b0af6152fa-6d8768786f-j8hk8 is deleted: true
[AbstractDevice@:app:instrumentationUi] Wait device with serial: 10.0.3.137:5555 succeed in 10008 at attempt=1
[AbstractDevice@:app:instrumentationUi] Wait device with serial: 10.0.3.136:5555 succeed in 10010 at attempt=1
kotlinx.coroutines.JobCancellationException: Parent job is Cancelling; job=StandaloneCoroutine{Cancelling}@11922229
Caused by: java.lang.IllegalStateException: Pod requests queue is empty
	at com.avito.android.runner.devices.internal.kubernetes.KubernetesReservationState.podAcquired(KubernetesReservationState.kt:42)
	at com.avito.android.runner.devices.internal.kubernetes.StatsDKubernetesReservationMetricsSender.onPodAcquired(StatsDKubernetesReservationMetricsSender.kt:25)
	at com.avito.android.runner.devices.internal.kubernetes.KubernetesReservationClaimer$initializeDevices$2$1.invokeSuspend(KubernetesReservationClaimer.kt:101)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
kotlinx.coroutines.JobCancellationException: Parent job is Cancelling; job=StandaloneCoroutine{Cancelling}@11922229
Caused by: java.lang.IllegalStateException: Pod requests queue is empty
	at com.avito.android.runner.devices.internal.kubernetes.KubernetesReservationState.podAcquired(KubernetesReservationState.kt:42)
	at com.avito.android.runner.devices.internal.kubernetes.StatsDKubernetesReservationMetricsSender.onPodAcquired(StatsDKubernetesReservationMetricsSender.kt:25)2021-10-27T16:52:52.650765459+03:00 [RemoteDeviceProvider@:app:instrumentationUi] Pod default-462db226-8a78-4421-91ab-f3b0af6152fa-6d8768786f-t527c can't load device. Disconnect and delete.
Check device logs in artifacts: /job/app/app/build/test-runner/4bdd0cc9fa0288878524b47b3e7574a3d2cdb4d9.local-root/ui/devices/10.0.3.137.txt

	at com.avito.android.runner.devices.internal.kubernetes.KubernetesReservationClaimer$initializeDevices$2$1.invokeSuspend(KubernetesReservationClaimer.kt:101)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
[RemoteDeviceProvider@:app:instrumentationUi] Pod default-462db226-8a78-4421-91ab-f3b0af6152fa-6d8768786f-v9596 can't load device. Disconnect and delete.

I see this exception 4 times in one run and then:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:instrumentationUi'.
> A failure occurred while executing com.avito.gradle.worker.NonSerializableWork
   > Pod requests queue is empty

Make first page in documentation informative and helpful

Открываю https://avito-tech.github.io/avito-android/, вижу почти пустую страницу, ссылку на how to start для авито приложения.

Что хочу видеть:

  • Куда я попал, что за репозиторий и зачем
  • Какие библиотеки есть, только кратко. Не все модули, а крупные блоки - тестирование, инфра, ... Остальное уже ссылками на другие обзорные страницы по этим "блокам".
    Смотреть на описание 50+ модулей - не вариант.

Сгруппировать модули в репозитории

Когда открываю репозиторий, вижу десятки модулей.
Непонятна структура, что здесь вообще есть.

Предложение

  1. Сгруппировать часть модулей по типу/задаче:
test-annotations
test-okhttp

vs

test/
  annotations
  okhttp
  1. Сгруппировать вместе все модули по инфраструктуре (gradle плагины и их зависимости)
infrastructure/
testing/

Make TestRunner usable outside Avito

Is your feature request related to a problem? Please describe.

Right now TestRunner is tied with internal Avito report service.

Describe the solution you'd like

Make an abstraction for Reports and provide open implementation alternative (like Allure)

Additional context

Keep in mind that test reports sent one by one per test during suite run.
It looks like blocker and it's even better for us to change this mechanism and gather all results before sending it in single place.
Current sending mechanism could have negative impact on suite stability and speed.

  • Send test results after whole suite
  • Make reports abstract
  • Create allure reports implementation
  • How-to runner documentation

Alternatives

https://reportportal.io/

Удалить модуль resource-manager-exceptions

Is your feature request related to a problem? Please describe.
Модуль resource-manager-exceptions был создан для ускорения переноса на github. В таком виде он выглядит специфичным для авито.

Describe the solution you'd like
В начале сделать классы из модуля не специфичными для авито.
Дальше есть два пути: оставить модуль и переименовать его или вмержить в модуль использования.

Describe alternatives you've considered
Удалить эти классы и использовать классы стандартных ошибок

Добавить в Avito test runner возможность конфигурирования сервисного аккаунта для подов

Мы столкнулись с проблемой запуска эмуляторов в нашем кластере и решили проверит работу ранера на контейнерах с эмуляторами которые хостятся в корпоративном artifactory.
Но столкнулись с проблемой, что у подов нет прав на скачивания контейнеров (ну или поды не могут создаться) так как корпоративный artifactory закрыт без авторизации даже на чтение.
[KubernetesApi@:android-test:ui-testing-core-app:instrumentationUi] Can't start pod: Back-off pulling image "<имя контейнера>"

Мы смогли настроить кластер по этой инструкции https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#add-imagepullsecrets-to-a-service-account

Настроили сервисный аккаунт и теперь поды создаются.
Но для того чтобы ранер работал необходимо каждый раз на новом кластере производить определенные действия.
У нас время жизни кластеров ограничено. Обычно это дни (не больше 10 дней)
И получается каждые 10 дней нам придется вызывать скрипты по настройке сервисного аккаунта.

Было бы здорово (если это вообще возможно) добавить возможность настройки сервисного аккаунта на уровне Avito test runner

Detect JDK-8143378 on MacOS

Is your feature request related to a problem? Please describe.
Баг в osx: https://stackoverflow.com/a/39698914
В gradle 5.6.4 сделали workaround: https://github.com/gradle/gradle/pull/11134/files#diff-8ccc2d62faf77b09104bc8d931288983
но мы нарвались в своем коде: #88

Describe the solution you'd like

  • fail fast: build-check ловит эту проблему
  • Создать issue в gradle, попробовать продать идею что это должна детектировать система сборки

Describe alternatives you've considered
Если не детектировать, то опять может выстрелить. Тяжело это заметить по косвенным признакам, воспроизводится не у всех.
Может сработать в стороннем коде, который нам не подконтролен. Поэтому нужно самим исправлять причину.

Additional context
В истории build-check есть готовая реализация (приватный репозиторий)

Локально не работает com.avito.android.AndroidSdkKt#androidHomeFromLocalPropertiesFallback

Describe the bug
В com.avito.android.AndroidSdkKt#androidHomeFromLocalPropertiesFallback определяется путь до local.properties и там используется поиск с помощью директории buildSrc, которой больше нет

How to reproduce
Запустить локально любой тест в котором используется com.avito.android.AndroidSdkKt#androidHomeFromLocalPropertiesFallback

Expected behavior
можем найти local.properties как и на ci прогонах

Do not allow blank instrumentation args

Is your feature request related to a problem? Please describe.
Если передать пустой ключ или значение в instrumentation args, то получим очень сложный баг.
у команды не простой синтаксис, а строчку мы крафтим очень наивно

am instrument -e myKey myValue -e mySecondKey mySecondValue
Если пропустить myValue , то -e станет значением для myKey и дальше все поедет.

Также нужно учесть значения перечисляемые через запятую

Describe the solution you'd like
Можно либо падать явно сообщая о том что такие значения недопустимы (предпочтительный вариант)

Почему предпочтительно падать?
Значения доставляются проходя долгий путь и легко ошибиться и забыть его проставить где-то. Лучше заставить автора явно убирать этот ключ если он не обязательный, логику лучше держать выше, на месте добавления в мапу

Describe alternatives you've considered
Можно пропускать пары без значения, но кажется это породить много ненужных расследований

TypeText.writeText is crashing on Android 13

Describe the bug
Due to the recent renaming of the mIInputContext field to mFallbackInputConnection, everything crashes when trying to write text on Android 13.

How to reproduce
Launch any test with TextFieldElement.write(text) on Android 13

Expected behavior
Everything should work as expected

Screenshots
No need

Environment:
Android 13 and later

Starcktrace
Caused by: java.lang.NoSuchFieldException: No field mIInputContext in class Landroid/view/inputmethod/InputMethodManager; (declaration of ‘android.view.inputmethod.InputMethodManager’ appears in /system/framework/framework.jar!classes3.dex) at java.lang.Class.getDeclaredField(Native Method) at com.avito.android.test.util.ReflectionKt.getFieldByReflectionWithAnyField(Reflection.kt:10) at com.avito.android.test.element.field.actions.TypeText.writeText(TypeText.kt:78) at com.avito.android.test.element.field.actions.TypeText.perform(TypeText.kt:53) at com.avito.android.test.interceptor.ActionInterceptor$Proxy.perform(Interceptor.kt:29) at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:2) at androidx.test.espresso.ViewInteraction.doPerform(ViewInteraction.java:25) at androidx.test.espresso.ViewInteraction.-$$Nest$mdoPerform(Unknown Source:0) at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:7) at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:1)

Indicate clearly avito specific documentation

Когда захожу в документацию, путаюсь во многих разделах и не понимаю, речь идет про код в гитхабе, про авито приложение или применимо ко всему.
Например, в how to start, contribution

Предложение

Попробовать явно выделить авито специфичную документацию в отдельный корневой раздел.
Возможно, захотим перенести в приватный репозиторий.
Как минимум, будут понимать, это только про авито приложение, или что-то универсальное.

Возможная структура:

  • Product
  • Topic
  • Avito
    • Avito product
    • Avito topic

Merge :test-okhttp and :in-house mock api into single module

Is your feature request related to a problem? Please describe.
Два очень похожих (почти дубликаты, но есть различия в API) решения для тестирования при помощи okhttpmockwebserver лежат в разных местах, проще будет поддерживать одно, т.к. у них одна цель

Describe the solution you'd like
Новый единый модуль, который будет использоваться как в тестах на плагины (там где нужен mockwebserver), так и в android ui тестах

Comments in documentation

Is your feature request related to a problem? Please describe.
Читаю документацию, встречаю что-то непонятное, либо не могу найти.
Чтобы спросить, нужно написать либо в чат, либо создать issue.
Это повышает порог входа, мне проще забить и не спрашивать.

Describe the solution you'd like

  • На странице могу оставить быстро комментарий или вопрос
  • Комментарии не накапливаются мертвым грузом, закрываются (см. ниже)

Describe alternatives you've considered

Что категорически не понравилось:
discuss и альтернативы (https://gohugo.io/content-management/comments/).
Пробовали такое в Confluence, не видел ни одного успешного примера. Комментарии устаревали, начинали врать или просто быть бесполезными. Мне кажется, что вреда от этого больше чем пользы. Хотел бы услышать аргументы в пользу такого решения, желательно с хорошими примерами, где это взлетело.
Есть статьи и обсуждения в проектах, где как раз с discuss переход на обычные issues.

Что может быть зайдет:

  • Более простой способ создать issue из выделенного текста.
  • Как в google docs, выделить кусок текста и прокомментировать.
  • Форма обратной связи, когда могу быстро написать что не нашел, что было непонятно.

Крайний вариант:
Не усложнять, оставить только issues и чаты.
Вернуться к этому если будут конкретные примеры когда этого не хватает.

Additional context
Надо учесть как будем обрабатывать эти сообщения и "закрывать", чтобы это не было впустую.

Find ways to share remaining utility scripts

Is your feature request related to a problem? Please describe.
У нас есть полезные скрипты вне gradle, которые лежат в приватном репозитории авито приложения. Мы ссылаемся на них в документации. В основном это автоматизация ручных действий:

  • clean.py
  • mirakle.py
  • шаблоны для проекта
  • git hooks
  • benchmarsks scripts

Хочу использовать их и подключать к любому репозиторию.

Describe the solution you'd like

  • Решили что переносим, а что нет смысла шарить. Создали задачи.
  • Если это не gradle plugin, предоставили решение, которое в одно простое действие доставит эти утилиты

Describe alternatives you've considered

  • gradle plugin если утилита рассчитывает на то что проект не сломан
  • pip

Additional context
Важно найти удобный механизм и научиться им пользоваться.
Отдельно уже будем решать, что именно шарить, каким способом.
Например, clean.py полностью в gradle не перенести. Он создан на тот случай, когда проекту плохо и он возможно даже не конфигурируется.

Can't use modules in androidTestImplementation with `transitive = true`

Describe the bug
Есть часть модулей, которые нужно подключать к приложению, например :in-house, :test-report, им нужны transitive dependencies, но сейчас среди них есть gradleApi, androidGradlePlugin и прочее что не должно там оказываться.
Раньше все что прилетало из buildSrc было без транзитивных зависимостей, но это только скрывало проблему.

How to reproduce
Подключить test-report в androidTestImplementation, получить кучу нежелательных классов в рантайме (скорее всего зависимости даже не зарезолвятся).
Если сделать transitive = false, будут падения в компайл или рантайме

Expected behavior
Могу безбоязненно подключать модули в androidTestImplementation, все их транзитивные зависимости там не случайно

Execution lintDependencies causes `Cannot get property 'internalModule' on extra properties extension as it does not exist`

Hi folks!
Thank you for sharing this repo. That's really awesome!

Describe the bug
I've added lintDependencies plugin as descibed here to my project.
Execution ./gradlew lintDependencies causes the error below

Caused by: org.gradle.api.plugins.ExtraPropertiesExtension$UnknownPropertyException: Cannot get property 'internalModule' on extra properties extension as it does not exist
	at org.gradle.internal.extensibility.DefaultExtraPropertiesExtension.get(DefaultExtraPropertiesExtension.java:43)
	at com.avito.kotlin.dsl.PropertyInProjectExtras.getValue(ProjectExtensions.kt:92)
	at com.avito.impact.configuration.InternalModuleKt.getInternalModule(InternalModule.kt)
	at com.avito.android.lint.dependency.DependencyResolver.sourceSetOutput(DependencyResolver.kt:146)
	at com.avito.android.lint.dependency.DependencyResolver.classReferences(DependencyResolver.kt:76)
	at com.avito.android.lint.dependency.DependencyResolver.suspiciousDependencies(DependencyResolver.kt:33)
	at com.avito.android.lint.DependenciesLintTask.resolveIssues(DependenciesLintTask.kt:37)
	at com.avito.android.lint.DependenciesLintTask.action(DependenciesLintTask.kt:28)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)

How to reproduce
I've prepared simple repo here https://github.com/BorisOsipov/lintDependencies
Just run ./gradlew lintDependencies

Sample project just generated by Android Studio with applied plugin.
I have the same issue in my production app repo.

Environment:

  • gradle-5.6.4
  • java 1.8.0_231

Save test artifacts to runner output folder

Is your feature request related to a problem? Please describe.

For now test artifacts (like: videos, pictures, logs) are only uploaded to file storage and represented as a url's in report

Describe the solution you'd like

Artifacts should be saved to test output folder by default

Additional context

Take into consideration that current AvitoReport behavior shouldn't be changed because it would take a lot of disk space for us.


Try not to copy files multiple times as it is already copied from device to temp directory

'checkBuildEnvironment' not found on a KMM project with Cocoapods

I'm using build checks on a kotlin multiplatform project. At first I was using a regular setup (project generated with the android studio plugin), and it worked well. But then I moved my shared project to cocoapods using this guide, build checks started failing with the following error:

* What went wrong:
Task 'checkBuildEnvironment' not found in project ':shared'.

I'd created a sample project which shows the error
In case you don't have Xcode, you can just test it with

 ./gradlew -p shared :shared:syncFramework -Pkotlin.native.cocoapods.target=ios_x64 -Pkotlin.native.cocoapods.configuration=Debug -Pkotlin.native.cocoapods.cflags= -Pkotlin.native.cocoapods.paths.headers= '-Pkotlin.native.cocoapods.paths.frameworks= "shared/build/cocoapods/framework"'

that's the command run by xcode in order to build the module.

UI Impact analysis through module pointers

Problem

Android gradle plugin 3.6 makes namespacedRClass on by default, so transitive resources doesn't merge up through modules graph.
It breaks our approach to map R.id constants with it's modules as id's are no longer statically resolved.

Proposal

We could add new field for com.avito.android.screen.Screen:

interface Screen {
    val rootId: Int
+   val module: String
}

rootId is still needed for isOpened method

module is a module path, like :lib:foo, it should point to the closest to app module containing this screen logic

Q: Will at be harder to support?
A: A bit, modules are more or less stable, but we lost isOpened guarantees (isOpened check kept rootId actual)

Q: What if someone renames module?
A: if module field point on nonexistent module we could fail build on analysis with descriptive error

Q: What if screen moved to another module?
A: Incorrect module pointers will lead to incorrect ui impact analysis results. Runtime check could be added to match computed rootId with module based on info from module's intermediates

Future

We are going to left a small(and decreasing) amount of e2e tests in app module, and move component tests to library modules, so this impact analysis approach will be less effective, as libraries inherits standard "per module"
impact analysis.

Why not remove all ui impact analysis code at all?

  1. We want to keep our PR times at current level before component tests goes to modules
  2. Some of it's logic could be reused, for example to find new and changed tests on PR

Published source.jar files are empty

Describe the bug
Публикуем исходники библиотеки как артефакт, но внутри нет классов, пусто.

Из-за этого в IDE неудобно работать, не могу провалиться в реализацию класса.
Декомпиляция class в java средствами IDE показывает не то что ожидал, шумно и не по делу.

How to reproduce
Проверил в test-annotations-2020.1.26-sources.jar из artifactory.
IDE не находит jar, когда запрашиваю "Download Sources"

Expected behavior
В IDE могу провалиться в исходный файл.

Environment:
AS 3.6 RC1

Additional context

Absolute links to static files in documentation are broken

Добавил картинку в docs/static, ссылаюсь на нее через абсолютный путь, не работает.

https://avito-tech.github.io/image/my_image.png <-- resolved link
https://avito-tech.github.io/avito-android/image/my_image.png <--- valid link

DoD

  • В документации описано как использовать абсолютные пути
  • Поправили все ссылки на картинки

Идеи

Скорее всего в конфиге hugo есть настройка, чтобы автоматически добавлять путь. Мы его явно указываем, значит можно определить.
Для картинок можем исползовать github cdn

remove implicit dependency on deprecated jcenter

Is your feature request related to a problem? Please describe.
jcenter is deprecated so i would like to remove it from my project but it is impossible because toast-rule implicitly depends on it.

> Could not resolve all files for configuration ':***:***AndroidTestRuntimeClasspath'.
   > Could not find com.forkingcode.espresso.contrib:espresso-descendant-actions:1.4.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/forkingcode/espresso/contrib/espresso-descendant-actions/1.4.0/espresso-descendant-actions-1.4.0.pom
       - https://repo.maven.apache.org/maven2/com/forkingcode/espresso/contrib/espresso-descendant-actions/1.4.0/espresso-descendant-actions-1.4.0.pom
       - https://jitpack.io/com/forkingcode/espresso/contrib/espresso-descendant-actions/1.4.0/espresso-descendant-actions-1.4.0.pom
       - https://maven.google.com/com/forkingcode/espresso/contrib/espresso-descendant-actions/1.4.0/espresso-descendant-actions-1.4.0.pom
       - https://zendesk.jfrog.io/zendesk/repo/com/forkingcode/espresso/contrib/espresso-descendant-actions/1.4.0/espresso-descendant-actions-1.4.0.pom
     Required by:
         project *** > com.avito.android:toast-rule:2022.14 > com.avito.android:ui-testing-core:2022.14

espresso-descendant-actions is only available in jcenter: https://mvnrepository.com/artifact/com.forkingcode.espresso.contrib/espresso-descendant-actions

Describe the solution you'd like
i would like toast-rule (and all libs in perspective) not to depend on jcenter

Should we abandon testFixtures usage?

There is a problem that really hurts our productivity:

# we use testFixtures, and it has problems when project includes android modules
# temporary set this to false in `~/.gradle/gradle.properties` to work with modules that uses testFixtures as a workaround
# https://issuetracker.google.com/issues/139438142
# https://docs.gradle.org/current/userguide/java_testing.html#sec:java_test_fixtures
# You can also use Android Studio to work with project, it seems like it has no such problem

Should we drop it for more straightforward approach, at least temporary?

First thing comes to mind is just place fixtures in runtimeClasspath and package it this regular code?
It looks dirty, but we can use some additional instruments to point out it's "testing only" purpose.
Like maybe https://kotlinlang.org/docs/reference/opt-in-requirements.html custom annotation, or maybe you know better ways.

Prevent new comments in Russian in code

Мы хотим чтобы код был понятен всем, но при этом уже накопилось много комментариев в коде на русском.
Даже если и переведем все, хочется простой quality gate, который позволит хотя-бы не ухудшать текущее состояние.

Предложение:
git-hook, который проверяет наличие русского для измененных файлов с кодом.
Новые файлы, переименования и т.п. не трогаем, чтобы не блокировать рефакторинги и перенос новых модулей.

В дефолтных примерах git hooks уже есть похожий, его нужно только немного доработать.

неудобно тестировать build-checks

Сейчас все проверки применяются, все не опциональное, нельзя потестировать одну проверку интеграционно в изоляции

More stable and explicit artifact ids in modules

При публикации артефакта формируем его имя автоматически.

artifactId = path.removePrefix(":").replace(':', '-')

Это неявно, легко сломать при рефакторинге.
Хочется разделять артефакт, как контракт, и организацию кода по модулям.

Предложение

Проставлять id явно, это должен быть обязательный атрибут если хочу публиковать.

Tool proposal for docs translation

Hi team, it looks like documentation for this project is written in Russian originally and then translated into English (saw some of the docs are partially translated).
Wondering if you would be open to checking out a free localization tool that we are developing: gitlocalize.com
It syncs with GitHub, supports .md and can hopefully make your translation efforts easier.
Feel free to shoot me an email at ilya[at]gitlocalize.com if you have any questions or need help with setting up a project.
Cheers,
-I

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.