Documentation

Build Speed Chart

Displays the total build time job linked to the pull request, along with 3 months of historical averages.


Custom Scripts

Custom scripts can be embedded into pull requests using Golang HTML templates. Templates are evaluated as runs progress and appended to your webapp.io bot comment.

Due to limitations with Github flavored markdown, HTML tags must not be tabbed.

Helper Functions

A number of helper functions have been defined to interact with Layerfiles and jobs.

layerfileStatusEquals

go

layerfileStatusEquals(layerfileRelativePath string, status string) bool

The layerfileStatusEquals function accepts two string parameters layerfileRelativePath and status, then returns a boolean if the Layerfile defined in the first argument matches the status in the second.

The Layerfile relative path is the path to the Layerfile relative to the root of your project.

Layerfile status can be one of the following ['NEW', 'RUNNING', 'SUCCESS', 'FAILURE', 'ERROR', 'WAITING_PARENTS', 'CANCELLED'].

jobStatusEquals

go

jobStatusEquals(status string) bool

The jobStatusEquals function accepts one string parameter status and returns a boolean if the job matches the status .

Job status can be one of the following ['ERROR', 'SUCCESS'].

go

previewEnvironmentLink(path string) string

The jobStatusEquals function accepts one string parameter path and returns a string with a URL to that path on your preview environment.

Example

gohtml

{{ if layerfileStatusEquals ".layerfiles/cypress/Layerfile" "SUCCESS"}} <div> All Cypress tests passed </div> {{ end }} {{ if layerfileStatusEquals ".layerfiles/cypress/Layerfile" "FAILURE"}} <div> Cypress tests failed. Check these pages: <ul> <li> <a href="{{ previewEnvironmentLink "/"}}">Landing page</a> </li> <li> <a href="{{ previewEnvironmentLink "/pricing"}}">Pricing page</a> </li> <li> <a href="{{ previewEnvironmentLink "/security"}}">Security page</a> </li> </ul> </div> {{ end }} {{ if jobStatusEquals "SUCCESS"}} <div> Job has passed view preview environment <a href="{{ previewEnvironmentLink "/"}}">here</a>. </div> {{ end }}

Layerfile Status

Display a list of Layerfiles and their current status.

Editor

Max number of Layerfiles:

The maxiumum number of Layerfiles to show, after this value the list will be truncated.

Layerfiles to Exclude:

Any Layerfiles matching any specified regexes will be excluded from the list.


Link to Preview Environment

Links to the main preview environment of the job linked to the current pull request. Renders an image containing a screenshot of the root of the preview environment.

Editor

Link to Image:

Image rendered in comment. Default is screenshot of root of the preview environment.


Alt Text:

Alt text of image.


Height:

Height of the image.


Width:

Width of the image.


Corner Radius:

Corner radius of the image.


Link:

The link the associated with the image. Default is to root of the preview environment.


Align:

Alignment of the image, left, center or right.


Performance Graphs for Specific Pages

Specify up to four pages to generate a performance score against. Scores are generated using Google Lighthouse.

Editor

Title:

Title of page


Path:

Path to page to score


Site Performance Graph

Display a performance and SEO score for the root of the preview environment linked to the PR. Computes a delta versus the scores of the last 10 jobs in the repository. Scores are generated using Google Lighthouse.