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

RTW-313: Implement percentage completed UI #189

Merged
merged 17 commits into from
Jul 26, 2024

Conversation

andrejvelichkovski
Copy link
Contributor

@andrejvelichkovski andrejvelichkovski commented Jul 9, 2024

Description

This change implements a progress bar that indicates how many of the Test Executions in an Artefact have been completed ( reviewed).

There are two parts to this implementation:

  1. Viewing it for a single artefact only - this case can be trivially computed on the frontend, without any changes on the backend
  2. Viewing it for all artefacts on the dashboard page - this is more complicated to implement as we don't fetch all test executions when loading the artefacts on the dashboard page.

We solve case (1) with front-end only changes. To resolve case (2) we also implement a backend change, to expose the following two parameters for all artefacts available:

  • all_test_executions_count
  • completed_test_executions_count

UI component changes

Dashboard

dashboard

Artefact View

artefact-view

Updated tooltip

tooltip

Resolved issues

This PR resolves RTW-313.

Documentation

This is a UX improvement and we don't have any documentation for such components yet.

Web service API changes

The change adds two fields to the ArtefactDTO, both integers. There are currently two endpoints that return ArtefactDTO objects:

  • /artefacts
  • /artefacts/{ID}

Tests

This change was both manually tested and an automated test was added

Known limitations

Currently, we only fetch the dashboard page when we firstly load the page, to avoid making extra requests. This limits the correctness of data we show on the dashboard. Consider the following case:

  1. The user loads the dashboard - the data is fresh from the DB
  2. The user loads and approves one test executions in an artefact - the data is correctly shown in the top bar in the artefact view
  3. The user goes back to the dashboard, the old data is still present as the front-end hasn't re-loaded the new data.

@andrejvelichkovski andrejvelichkovski changed the title Implement percentage completed UI RTW-313: Implement percentage completed UI Jul 11, 2024
@andrejvelichkovski andrejvelichkovski marked this pull request as ready for review July 22, 2024 13:45
Copy link
Collaborator

@omar-selo omar-selo left a comment

Choose a reason for hiding this comment

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

Very useful feature!

backend/tests/controllers/artefacts/test_artefacts.py Outdated Show resolved Hide resolved
backend/test_observer/controllers/artefacts/models.py Outdated Show resolved Hide resolved
backend/test_observer/controllers/artefacts/artefacts.py Outdated Show resolved Hide resolved
backend/test_observer/controllers/artefacts/helpers.py Outdated Show resolved Hide resolved
frontend/lib/providers/artefact_builds.dart Outdated Show resolved Hide resolved
frontend/lib/ui/artefact_page/artefact_page_body.dart Outdated Show resolved Hide resolved
grouped_builds[build.architecture].append(build)

return [
max(builds, key=lambda b: b.revision if b.revision else 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@omar-selo can you please help me verify that it is fine to assign revision to 0 if it is None. Mypy was complaining because the key here can be null.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be fine

Copy link
Collaborator

@omar-selo omar-selo left a comment

Choose a reason for hiding this comment

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

Looks good to me

@andrejvelichkovski andrejvelichkovski merged commit a339e5b into main Jul 26, 2024
3 of 4 checks passed
@andrejvelichkovski andrejvelichkovski deleted the implement-percentage-completed-ui branch July 26, 2024 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants