Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Test Menu options for Country selection and Measurement (EXPOSUREAPP-2229) #1086

Merged
merged 24 commits into from
Sep 3, 2020

Conversation

mertsafter
Copy link
Contributor

@mertsafter mertsafter commented Aug 28, 2020

Description

Some implementations for interoperability

  • Country Selection in Test Menu
  • Measurement of Diagnostic Key Retrieval and Risk Calculation in Test Menu
  • Usage of ApplicationConfiguration for country codes (TODO: Need to align property name with backend)

@mertsafter mertsafter requested a review from a team August 28, 2020 13:57
@harambasicluka harambasicluka added the maintainers Tag pull requests created by maintainers label Aug 28, 2020
@harambasicluka harambasicluka marked this pull request as draft August 28, 2020 16:16
@mertsafter
Copy link
Contributor Author

Had to adjust the unit tests to respect the country filter. Also there were some linting issues, because of that the build failed. Should be fixed now.

@harambasicluka harambasicluka marked this pull request as ready for review August 31, 2020 09:17
@harambasicluka harambasicluka marked this pull request as draft August 31, 2020 09:18
@mertsafter mertsafter marked this pull request as ready for review August 31, 2020 15:23
@mertsafter mertsafter changed the base branch from feature/interoperability to dev September 1, 2020 11:25
@mertsafter mertsafter changed the base branch from dev to feature/interoperability September 1, 2020 11:26
@d4rken d4rken self-requested a review September 1, 2020 13:07
Copy link
Contributor

@harambasicluka harambasicluka left a comment

Choose a reason for hiding this comment

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

Small string changes required.

Corona-Warn-App/src/main/res/values-de/strings.xml Outdated Show resolved Hide resolved
Corona-Warn-App/src/main/res/values-bg/strings.xml Outdated Show resolved Hide resolved
Corona-Warn-App/src/main/res/values-en/strings.xml Outdated Show resolved Hide resolved
Corona-Warn-App/src/main/res/values-pl/strings.xml Outdated Show resolved Hide resolved
Corona-Warn-App/src/main/res/values-ro/strings.xml Outdated Show resolved Hide resolved
Corona-Warn-App/src/main/res/values-en/strings.xml Outdated Show resolved Hide resolved
Corona-Warn-App/src/main/res/values-tr/strings.xml Outdated Show resolved Hide resolved
Corona-Warn-App/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
Corona-Warn-App/src/main/res/values/strings.xml Outdated Show resolved Hide resolved
Copy link
Member

@d4rken d4rken left a comment

Choose a reason for hiding this comment

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

Looks mostly good, a few extra changes here and there as we should leave the code always a bit better, sprinkle in some refactoring ❤️ .

@d4rken d4rken self-assigned this Sep 1, 2020
@sonarcloud
Copy link

sonarcloud bot commented Sep 3, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 1 Code Smell

45.4% 45.4% Coverage
0.0% 0.0% Duplication

@d4rken d4rken merged commit b8d0ed3 into feature/interoperability Sep 3, 2020
@d4rken d4rken deleted the feature/interoperability-2229 branch September 3, 2020 15:27
d4rken added a commit that referenced this pull request Sep 18, 2020
* Added first set of country flags

Signed-off-by: Kolya Opahle <k.opahle@sap.com>

* Added first implementation of Submission Country Selection Screen. (Currently not part of nav graph).
Moved stuff inside of submission package into subpackages

Signed-off-by: Kolya Opahle <k.opahle@sap.com>

* Added missing changes to nav_graph file

* Test Menu options for Country selection and Measurement (EXPOSUREAPP-2229) (#1086)

* Implement country filter (#2229)

* Implement measure for Risk calculation and Key Retrieval (#2229)

* Some code cleanup for measureRiskLevelAndKeyRetrieval

* Some code cleanup (#2229)

* Implement usage of AppConfig usage for country codes (#2229)

* change CURRENT_COUNTRY val to var

* Suppress "LongMethod" warning (#2229)

* Adjust unit tests to respect new country filter

* Align with backend for app config country property name

* Display total file size of keys in results (#2229)

* Fix linting issue

* Update strings.xml files

* Do refactoring and some code clean up

* Move RiskLevel and Key retrieval measurement in own class

* Move code in logical classes. Remove translation in test fragment

* Fix linting and Unit tests

* Remove 3hour boolean check from debug class.

* Refactor CountryWrapper and missing dates check.

* Fix linting and Unit tests

* Add Unit test for getMissingDates

* Code cleanup

* Hide keyboard on action

* Extend statistics for api submission

* Set callback to null after invoked

Co-authored-by: Mert Safter <mert.safter@sap.com>
Co-authored-by: Matthias Urhahn <matthias.urhahn@sap.com>

* Overhaul of DiagnosisKey related Download and Caching Mechanisms (EXPOSUREAPP-2469) (#1136)

* Rework of keyfile download and caching.
* Supports interop
* More modular for better testing and build flavour based behavior adjustments
* More resilient handling of failed downloads
* Preperations for future hourly download and serverside checksums

TODO: Finish unit tests, keycache migration and cache health check

* First batch of unit tests and some fixes for incorrect behavior that the tests surfaced.

* Added unit tests for the KeyCacheRepository

TODO: Tests for downloader and migration.

* Implemented POC for migration old key files.

* Fixed legacy file migration and cleanup, improved logging.

* Added unit tests for legacy key file migration.

* Add fallback for different file hashes in the header.

* Yes kLint, we know it's a long method,
but for this it's better to read it in one block vs jumping to extra methods.

* More linting issues, adjusting project code style prevent a few of these in the future.

* Added missing unit tests for `KeyFileDownloader` and fixed faulty behavior that was noticed during testing.

* CRUD (instrumentation) test for `KeyCacheDatabase`

* Remove unused `FileStorageHelper` and related constants+tests.

* Fix last3Hours unit test in deviceRelease mode, we need to explicitly enable debug for these tests.

* Until we have more information about the hashsum's format in the header, default to `ETag

* Split app config server API from diagnosis key download API,
and reintroduce caching for the app config download.

* Add test to check that the cache is used on flaky connections.

* Code changes based on PR comment, part #1.

* Code fluff, formatting.

* Handle download errors correctly.

* Refactoring:
* Remove unnecessary `currentDate` we always start with the newest date from the servers index.
* Make a specialised class for header validation

* Let legacy cache migration abort early, depending on whether the key dir exists.

* If we can't create the base directory for the key repo, throw an exception.

* Delete cache entry if a download fails.

* Fixed test regression due to refactoring.

* Consolidate staleness check into `getStale`

* Consolidate clean up for failed downloads into the download method.
Added tests to check that we delete the keycache entry if the download fails (which we didn't for hours :O!)

* Because the hour-mode uses caching too, we add an explicit button to the test menu that clears the cache.

* Add comment with reference to ticket regarding follow up on the other headers.

* Move expected storage size per country into a named constant.

Co-authored-by: Matthias Urhahn <matthias.urhahn@sap.com>

* Implementation of tests for the interoperability countries selection screen (EXPOSUREAPP-2439) (#1140)

* Added initial set of viewModel tests

Signed-off-by: Kolya Opahle <k.opahle@sap.com>

* Fail tests on unexpected null.

Co-authored-by: Matthias Urhahn <matthias.urhahn@sap.com>

Co-authored-by: Kolya Opahle <k.opahle@sap.com>
Co-authored-by: apopovsap <66370584+apopovsap@users.noreply.github.com>
Co-authored-by: Mert Safter <69803294+MertSafter@users.noreply.github.com>
Co-authored-by: Mert Safter <mert.safter@sap.com>
Co-authored-by: Matthias Urhahn <matthias.urhahn@sap.com>
Co-authored-by: Matthias Urhahn <darken@darken.eu>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
maintainers Tag pull requests created by maintainers sprint5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants