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

chore: adr in code and junit5 parameterized tests (WPB-10396) #3288

Merged
merged 27 commits into from
Aug 13, 2024

Conversation

yamilmedina
Copy link
Contributor

@yamilmedina yamilmedina commented Aug 6, 2024

StoryWPB-10396 ADR revisited


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

  • Add ADRs
  • Add junit5 Parameterized tests, and its ADR at docs/adr/0003-introducing-junit5-parametrizable-tests.md

Issues

As part of the discussion in the last collective, this is the revamp ADRs effort, so we can have it in our review process and more important whenever we are including at least these 2 important categories:

  • Refactor that changes the way we do something or the software design (see. )
  • New library introduced, or replaced.

Causes (Optional)

  • New ADRs needs to be added under docs/adr folder.
  • The PR will be commented by the action if there is a new ADR document, to bring visibility to the reviewers.
  • When merged to develop, this will generate a web page with all the ADRs the project has: https://wireapp.github.io/wire-android

Attachments (Optional)

https://wireapp.github.io/wire-android/


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@codecov-commenter
Copy link

codecov-commenter commented Aug 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.53%. Comparing base (9d2b37f) to head (58b4464).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3288   +/-   ##
========================================
  Coverage    44.53%   44.53%           
========================================
  Files          453      453           
  Lines        15328    15328           
  Branches      2561     2561           
========================================
  Hits          6827     6827           
+ Misses        7784     7783    -1     
- Partials       717      718    +1     

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d2b37f...58b4464. Read the comment docs.

Copy link
Contributor

github-actions bot commented Aug 6, 2024

Built wire-android-staging-compat-pr-3288.apk is available for download

@AndroidBob
Copy link
Collaborator

AndroidBob commented Aug 6, 2024

New ADR(s) in this PR 📚:

Decision record template by Michael Nygard

This is the template in Documenting architecture decisions - Michael Nygard.
You can use adr-tools for managing the ADR files.

In each ADR file, write these sections:

Title

Status

What is the status, such as proposed, accepted, rejected, deprecated, superseded, etc.?

Context

What is the issue that we're seeing that is motivating this decision or change?

Decision

What is the change that we're proposing and/or doing?

Consequences

What becomes easier or more difficult to do because of this change?

1. Record architecture decisions

Date: 2024-08-05

Status

Accepted

Context

We agreed in the past to use ADR's, but we lost track of it as we were using confluence to keep
them. This concern was raised in the last collective, and we need to decide how to proceed.

Decision

We will use Architecture Decision Records in the code and as part of the review process.
We will use the Lightway ADR template to keep the ADRs simple and
easy to maintain.

Consequences

  • We need to add a new folder to the repository, docs/adr, to keep the architecture decision
    records.
  • Whenever a new refactoring or library is introduced, a new ADR should be created.
  • You can always request in the Pull request review process to add a new ADR, if you think it's
    necessary.

2. Calling activity refactor

Date: 2024-08-01

Status

Accepted

Context

To support a second incoming call we need to refactor the code so we can handle the ongoing content
context, without losing the current context.

This is a retroactive decision record implemented
on #3264

Decision

Create 2 separate activities, one for the Incoming/Outgoing calls and another for the ongoing call.
In this way, we can keep the context of the ongoing call and handle the incoming/outgoing calls.

The design and interaction will look like this:

Consequences

  • StartingActivity will handle Incoming and Outgoing calls content, these contents are disposable
    and can be recreated when receiving a new call.
  • OngoingCallActivity will handle the ongoing call content, this content is not disposable and
    should be kept during the call.

3. Use parameterizable tests in JUnit5

Date: 2024-08-05

Status

Proposed

Context

Sometimes we need to write multiple tests for the same scenario, changing only the input values.

Decision

We will use parameterizable tests in JUnit5 to avoid writing multiple tests for the same scenario.

Consequences

  • Introduction of @ParameterizedTest annotation in the test class
    and library.
  • The test method will receive the parameters as arguments.

@wireapp wireapp deleted a comment from github-actions bot Aug 6, 2024
@yamilmedina yamilmedina changed the title chore: adr in code and tests chore: adr in code and tests (WPB-8645) Aug 6, 2024
@echoes-hq echoes-hq bot added the echoes: throughput/ci-maintenance Changes we need to do to keep CI healthy and fast label Aug 6, 2024
@yamilmedina yamilmedina changed the title chore: adr in code and tests (WPB-8645) chore: adr in code and tests (WPB-10396) Aug 6, 2024

## Status

Proposed
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: Change to Accepted when PR approved

Copy link
Contributor

github-actions bot commented Aug 6, 2024

Built wire-android-staging-compat-pr-3288.apk is available for download

Copy link
Contributor

github-actions bot commented Aug 6, 2024

Built wire-android-dev-debug-pr-3288.apk is available for download

Copy link
Contributor

@alexandreferris alexandreferris left a comment

Choose a reason for hiding this comment

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

Amazing! 😍 looking forward for it

Comment on lines +20 to +23
enum class TestParams(val input: OtherUser, val expected: String) {
FEDERATED_USER(OTHER_USER.copy(userType = UserType.FEDERATED, handle = "handle"), "handle@domain"),
REGULAR_USER(OTHER_USER.copy(userType = UserType.GUEST, handle = "handle"), "handle"),
NO_HANDLE_USER(OTHER_USER.copy(userType = UserType.INTERNAL, handle = null), "")
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

github-actions bot commented Aug 9, 2024

Built wire-android-staging-compat-pr-3288.apk is available for download

Copy link
Contributor

github-actions bot commented Aug 9, 2024

Built wire-android-dev-debug-pr-3288.apk is available for download

Copy link

sonarcloud bot commented Aug 9, 2024

Copy link
Contributor

github-actions bot commented Aug 9, 2024

Built wire-android-staging-compat-pr-3288.apk is available for download

Copy link
Contributor

github-actions bot commented Aug 9, 2024

Built wire-android-dev-debug-pr-3288.apk is available for download

@yamilmedina yamilmedina changed the base branch from develop to release/candidate August 9, 2024 14:22
@echoes-hq echoes-hq bot added echoes: bugs Technical or functional defects in the product echoes: features End-user visible changes intended to create customer value echoes: technical-debt Changes intended at mitigating risks echoes/initiative: product-metrics-in-countly Analytics and KPIs labels Aug 9, 2024
@pull-request-size pull-request-size bot added size/XL and removed size/S labels Aug 9, 2024
Copy link

Ups 🫰🟨

This PR is too big. Please try to break it up into smaller PRs.

@yamilmedina yamilmedina changed the base branch from release/candidate to develop August 9, 2024 14:23
@pull-request-size pull-request-size bot added size/S and removed size/XL labels Aug 9, 2024
Copy link
Member

@vitorhugods vitorhugods left a comment

Choose a reason for hiding this comment

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

❤️

@MohamadJaara MohamadJaara added this pull request to the merge queue Aug 13, 2024
Merged via the queue into develop with commit 5bd3261 Aug 13, 2024
18 checks passed
@MohamadJaara MohamadJaara deleted the chore/adr-and-tests branch August 13, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: bugs Technical or functional defects in the product echoes: features End-user visible changes intended to create customer value echoes/initiative: product-metrics-in-countly Analytics and KPIs echoes: technical-debt Changes intended at mitigating risks echoes: throughput/ci-maintenance Changes we need to do to keep CI healthy and fast size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants