GitHub App integration for Currents dashboard
Currents integration with GitHub allows posting results of your cypress tests as:
GitHub App integration with Currents - PR Comment example
To set up an integration:
- Open your project settings (Manage Project)
- Click “Connect” in “Connect your GitHub repositories” section.
Your browser will be redirected to GitHub; you will need to approve installing “currents.bot” GitHub App for your organization.
Setting up GitHub integration with Currents Dashboard
During the installation, the following permissions are requested:
- read and write to issues (for posting PR comments)
- read and write to Pull Requests (for posting PR comments)
- read and write to commit statuses (for posting commit status updates)
After approving the permissions, your browser will navigate back to Project Settings screen. To complete the setup, you will need to associate a repository with the project and then save the changes.
Changing repository for GitHub integration
To change the GitHub repository associated with a project, select the new repository from the dropdown list and click “Save”
Use the following settings to change the behaviour of your GitHub Integration.
Set the commit status label to distinguish the GitHub status checks one from another. For example, when multiple Current Dashboard projects are connected to the same repository, setting the Commit Status label will conveniently display the status check for each project separately.
Please note - using the same status for the same repo across different projects can create a conflict - runs from both projects will overwrite the associated status check item.
An example of multiple status check items
Enabling PR comments will post a summary of your run to the associated GitHub PR. The comment will be posted:
- after run’s completion - with the details of test results
- after run’s timeout - with the last known test results
Re-running cypress tests for the same PR will delete the previous comment and post a new one with the most recent result unless Keep Old Results option is enabled
GitHub integration - PR comment example
Enabling the "Failed Runs Only" toggle would prevent posting a comment for successful runs - i.e. runs that have 0 failed or skipped tests.
You can customize what event can trigger posting a PR comment:
- Run Finish - will post a comment when a run completes its execution without cancellation or a timeout
- Run Cancelled - will post a comment upon the run's cancellation, due to Fail Fast Strategyor cancellation via the Dashboard. See more at Canceling Runs
When enabled, old results posted as a PR comment will be preserved, i.e. the integration will keep the comments with the results of the previous runs.
Enabling Commit Status checks will trigger updates for the associated commit - the status depends on the outcomes of your run:
- “Pending” for on-going runs
- “Failed” for failed or timed out runs
- “Passed” for successful runs
GitHub Integration - commit status check example
To detach a repository from a project, navigate to Project Settings and click “Disconnect Repository”.
GitHub integration - remove repository
To completely remove GitHub integration, navigate to Project Settings, click “Configure” and then uninstall “currents-bot” Github App. Uninstalling the app will automatically detach all the projects from their respective repositories.
Disconnecting GitHub Integration
Please note: your CI environment must expose git commit information in order for cypress agent to send commit details (sha, repository URL etc.) and enable the integration.
Cypress agents use https://github.com/cypress-io/commit-info package to discover git-related information.
- To expose your git information, please make sure that
.gitdirectory is present in your CI environment
- You can explicitly provide git information via environment variables
Behind the scenes, Currents is using git commit data do to identify the PR (issue) to comment on.
The simplified flow is:
- 1.Get the list of pull requests associated with the commit using an API call:
- 2.Select a PR with HEAD commit matching the reported commit sha
Sometimes the commit sha reported for a run is different from PR's HEAD commit - our integration would not be able to detect the Pull Requests and won't post a comment and status checks.
Please contact our support via in-app chat and share:
- Run that is affected
- Commit sha of the affected run
- HEAD commit sha of the associated Pull Request