-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Initial implementation of UI for showing percentage completed * Fix error when loading artefact builds * Update code to show exact counts * Fix import issues * Fix mypy errors * Fix issue with tests * Add doc-string to new helper methods * Implement new logic for fetching * Fix ruff issue * Remove unnecessary changes on frontend * Small improvements * Fix user avatar * Implement PR suggestions * Fix automated tests * Fix mypy errors
- Loading branch information
1 parent
e8b9fef
commit a339e5b
Showing
15 changed files
with
250 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import 'package:riverpod_annotation/riverpod_annotation.dart'; | ||
|
||
import '../models/family_name.dart'; | ||
import '../models/test_execution.dart'; | ||
import 'artefact_builds.dart'; | ||
import 'family_artefacts.dart'; | ||
|
||
part 'review_test_execution.g.dart'; | ||
|
||
@riverpod | ||
class ReviewTestExecution extends _$ReviewTestExecution { | ||
@override | ||
Future<void> build() async { | ||
return; | ||
} | ||
|
||
Future<void> reviewTestExecution( | ||
int testExecutionId, | ||
String reviewComment, | ||
List<TestExecutionReviewDecision> reviewDecision, | ||
FamilyName familyName, | ||
int artefactId, | ||
) async { | ||
await ref | ||
.read(artefactBuildsProvider(artefactId).notifier) | ||
.changeReviewDecision( | ||
testExecutionId, | ||
reviewComment, | ||
reviewDecision, | ||
); | ||
|
||
final artefactBuilds = | ||
ref.read(artefactBuildsProvider(artefactId)).requireValue; | ||
|
||
final newCompletedTestExecutionsCount = artefactBuilds | ||
.map( | ||
(build) => build.testExecutions | ||
.where((testExecution) => testExecution.reviewDecision.isNotEmpty) | ||
.length, | ||
) | ||
.fold(0, (a, b) => a + b); | ||
|
||
await ref | ||
.read(familyArtefactsProvider(familyName).notifier) | ||
.updateCompletedTestExecutionsCount( | ||
artefactId, | ||
newCompletedTestExecutionsCount, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.