Pull Request Reviews provide a comparison of a Site monitored in Calibre and a preview deployment. You can use Pull Request reviews to compare between a branch and your live Site, before changes are merged.
Each Pull Request Review tests preview deployments using the same conditions as your Site. This includes the same test location, authentication, headers, cookies, Test Profiles, and Pages. You can override authentication, headers, and cookies if needed.
Each deployment must have a unique hostname (e.g.: my-preview-url-123.example.com in order to use Pull Request reviews.
1# This command will:2# - Block until performance tests have been completed (`--waitForResult`)3# - Return a failure if this PR fails specified performance budgets (`--failOnUnmetBudget`)4# - Write `comparison_report.md`, a markdown formatted Performance report5calibre site create-pull-request-review \6 --site="calibre" \7 --title="(fix): Reduce bundle size" \8 --url="https://my-pr-123.example.com" \9 --branch="$(git rev-parse --abbrev-ref HEAD)" \10 --sha="$(git rev-parse HEAD)" \11 --waitForResult \12 --failOnUnmetBudget \13 --markdown > comparison_report.md
1#!/usr/bin/env node23import { PullRequestReview } from 'calibre'45const createPRReview = async () => {6 // Required7 const url = 'https://my-pr-123.example.com'8 const title = '(fix): Reduce bundle size'9 const branch = 'fix/reduce-bundle-size'10 const sha = '9ff192958fe518f0bb06b2e25ab5836f52353d8e'11 const site = 'my-calibre-site-slug'1213 // Create the PR Review14 const { uuid } = await PullRequestReview.create({15 url,16 title,17 branch,18 sha,19 site20 })2122 console.log('Pull Request Review queued:', branch)2324 // Wait for tests to run25 const results = await PullRequestReview.waitForReviewCompletion(site, branch)2627 // Output the formatted JSON response28 console.log(JSON.stringify(results, null, 2))29}3031createPRReview()
You can read CLI documentation for calibre site create-pull-request-review here.
1# Pro tip: Add the --markdown flag for Markdown,2# or --json flag for JSON output3calibre site pull-request-review \4 --site="my-calibre-site-slug" \5 --branch="fix/reduce-bundle-size"
1#!/usr/bin/env node23import { PullRequestReview } from 'calibre'45const getPRReview = async () => {6 // Required7 const site = 'my-calibre-site-slug'8 const branch = 'fix/reduce-bundle-size'910 // Fetch the Pull Request Review11 const results = await PullRequestReview.getPRReviewByBranch(site, branch)1213 // Output the formatted JSON response14 console.log(JSON.stringify(results, null, 2))15}1617getPRReview()
You can read CLI documentation for calibre site pull-request-review here.
1calibre site pull-request-reviews --site <site>
1#!/usr/bin/env node23import { PullRequestReview } from 'calibre'45const getPRReviews = async () => {6 // Required7 const site = 'my-calibre-site-slug'89 // Fetch a list of Pull Request Reviews10 const results = await PullRequestReview.list(site)1112 // Output the formatted JSON response13 console.log(JSON.stringify(results, null, 2))14}1516getPRReviews()
1TITLE | BRANCH | SHA | STATUS | CREATED2[UI] Add new dropdowns | feat/new-dropdowns | 8de2a10… | completed | 6:15PM 6-Sep-20233[Perf] Add lightbox alternative | perf/remove-lightbox | 05ae42a… | completed | 3:52PM 25-Aug-20234[UI] Migrate menus from Reach to Radix… | migrate-from-reach-menu | 241ccbb… | completed | 4:48PM 22-Aug-20235[Docs] Update FAQs | docs/update-faqs | 78f9a44… | completed | 5:31PM 15-Aug-2023
1[2 {3 "title": "[UI] Add new dropdowns",4 "status": "completed",5 "branch": "feat/new-dropdowns",6 "sha": "8de2e10a4a1f7fe46daf5532095842bda6491ea1",7 "createdAt": "2023-09-06T08:15:58Z"8 },9 {10 "title": "[Perf] Add lightbox alternative",11 "status": "completed",12 "branch": "perf/remove-lightbox",13 "sha": "05ae42a94a0cf860454b3226b4f3f016ed32430f",14 "createdAt": "2023-08-25T05:52:37Z"15 },16 {17 "title": "[UI] Migrate menus from Reach to Radix UI",18 "status": "completed",19 "branch": "migrate-from-reach-menu",20 "sha": "241ecbb0d2c396c9413adb816fa3ca212eff00da",21 "createdAt": "2023-08-22T06:48:03Z"22 },23 {24 "title": "[Docs] Update FAQs",25 "status": "completed",26 "branch": "docs/update-faqs",27 "sha": "78a9e442d4f952b612e2d9627b43e61cd5c7e044",28 "createdAt": "2023-08-15T07:31:48Z"29 }30]
You can read CLI documentation for calibre site pull-request-reviews here.
On this page