Review (beta)
NOTE: Since the Review feature is currently in beta, we're not aiming to migrate any data created previous to the official (non-beta) release to make changes to the feature easier for our development team.
The Widgetbook Cloud Review feature (currently in beta) allows teams to review added, changed or removed components.
The Review feature closely relates to reviews known from Pull-Requests.
For each Pull-Request, our new widgetbook
CLI analyzes the changes to your Widgetbook and creates a review.
Frontend team members can now review each changed use-case in isolation and add comments for other team members.
Review status definitions in the review process
- Open: Reviews awaiting assessment
- Merged: Reviews associated with merged PRs, hence, also considered as merged
- Closed: Reviews linked to closed PRs, therefore, also categorized as closed
- Updating: Reviews lacking essential information for classification as open. A review becomes eligible for review (open) when:
- There is an available head build AND
- A base build is present or at least one use-case is associated with a DesignLink.
Once all changes from the review are accepted, a developer closes the Pull-Request and the review's status gets updated to merged
.
For this to work, a GitHub app integration is required.
Requirements
To use Widgetbook Cloud Review your setup has to meet the following requirements:
- Use widgetbook_generator package in version
v3.0.0-beta
(no special configuration required). - Use widgetbook package in version
v3.0.0-beta
(no special configuration required). - Use the
widgetbook
CLI from the widgetbook_cli package. - Setup a GitHub app
How the Review feature works
A Widgetbook Review allows Flutter teams to compare changes in the user interface. Within the review, the team compares the current version with a previous version. In addition, the review feature also offers to compare the current version of a Widget with the Figma design of a component.
The structure of a review has similarities to the pull request workflow.
In a pull request, developers compare a base
branch (previous version) with a feature
branch (new version) based on the lines of code changed.
For the review, our integration creates a Widgetbook Cloud review for each pull request in your Git provider.
Like how the previous code is compared to the current code on a line-by-line basis, Widgetbook Cloud teams compare a base build (last version) with a feature build (current version) on a visual use-case basis.
Therefore, Widgetbook Cloud requires an uploaded build for the base and feature branches.
Builds for review
Use the widgetbook_cli package to upload a build for the base and feature branch.
Define a CI/CD pipeline that uploads a build for each push to your base branch.
The base branch is likely your main
, master
, dev
or staging
branch.
# Install dependencies
flutter pub get
# Run the build runner
flutter pub run build_runner build --delete-conflicting-outputs
# Build the Widgetbook
flutter build web -t lib/ui_catalogs.widgetbook.dart
# Install the CLI
dart pub global activate widgetbook_cli 3.0.0-beta.22
# Run the CLI
widgetbook publish --api-key API-KEY
Review information
In addition to the required builds, a review has to be populated with information about which use cases changed.
The information on which use cases changed is extracted by the CLI when the --base-branch
argument is specified.
Widgetbook Cloud shows Reviews for each pull-request. However, only Reviews that have changes to use cases are accessible.
Currently, Widgetbook Cloud only shows use cases that have been changed, added or removed within the feature branch in comparison to the base branch. That means, that already existing use cases will not be shown even if they have never been reviewed.