Instead of zipping up your source code and uploading it, you can connect a Git repository directly to a Knowledge Base. Play imports the code as evidence and keeps it up to date as the repository changes, so blueprints and test generation always work from your latest code.
This currently supports GitHub (cloud). Play only ever reads the repository - it never pushes or writes back to it.
What this feature does
-
Connects a GitHub repository to a Knowledge Base using a token you provide
-
Imports the repository's source files as evidence for test generation
-
Keeps the Knowledge Base current as the branch changes - automatically, or on demand
-
Re-imports only what actually changed on each sync, not the whole repository
Before you start
You need a connector, which holds the credential Play uses to read your repositories. A connector is set up once per team by a team admin, and then anyone with access to the team's Knowledge Bases can import from it.
You'll also need a GitHub Personal Access Token (PAT) with read access to the repositories you want to import. The minimum permissions are:
-
Fine-grained token - Repository permissions:
Contents: Read-onlyandMetadata: Read-only. AddWebhooks: Read and writeonly if you want push-based automatic sync. -
Classic token - the
reposcope (orpublic_repofor public repositories only). Thereposcope already includes webhook access, so no extra scope is needed for automatic sync.
The token is stored securely and is never shown again - only the last four characters are displayed so you can recognise it.
For this version-control feature, start by creating a GitHub key or PAT with the minimum repository access your workflow needs. To configure a repository in Play, the token must be allowed to see the target repo and read its metadata and files. If you enable automatic sync, it also needs permission to create or manage the webhook. Play does not write back to the repository, create commits, or edit files as part of this import flow, so commit-write permissions are not required here.
Set up a connector (team admins)
-
Go to
Team Settings→Source Control. -
Select
+ New connector. -
Choose
GitHuband paste your Personal Access Token. Play shows the GitHub account associated with the token automatically. -
Select
Test connectionto confirm the token works, thenSave.
The connector now appears in the list and can be reused for any Knowledge Base in that team.
Repository choices show the full owner/repository name, including the organization name for organization repositories. GitHub can also list repositories shared with your account as a collaborator. The token still needs access to the repository's branch and files for an import to succeed.
Import a repository into a Knowledge Base
-
Open the Knowledge Base and go to the
Sourcestab. -
Under
Import from Git, select the connector you want to use. -
Choose the repository and the branch to import.
-
(Optional) Narrow the import with a subpath (for example
src/) and include / exclude globs (for example**/*.ts) so you only bring in the files that matter. -
Select
Import. -
Follow the status as it moves from
queuedtosyncingtocompleted. The imported repository then appears as a source in the Knowledge Base.
You can connect several repositories to the same Knowledge Base - select Add repository and repeat the steps above. You can even connect the same repository more than once on a different branch or subpath; only an exact repeat (same repository, branch, and subpath) is rejected. There's a limit on how many repositories a single Knowledge Base can hold (10 by default); once you reach it, disconnect one to free a slot.
Aim for a focused set of 300 source files or fewer. If your repository is larger, use the subpath and glob filters to target the part you care about - otherwise only the first 300 eligible files are imported.
Keep the Knowledge Base in sync
Once a repository is connected, you have two ways to keep it current:
-
Sync now - re-import the latest commit on demand.
-
Auto-sync - turn on the
Auto-synctoggle and Play keeps the Knowledge Base in step with the branch:-
If your token can register a webhook, it's set up automatically and pushes sync within seconds.
-
If it can't, the panel shows a Payload URL and Secret to add manually in GitHub (
Settings→Webhooks→Add webhook, with Content typeapplication/jsonand Just the push event). The status flips toactiveas soon as GitHub's first delivery arrives. -
Either way, a periodic check (roughly every 15 minutes) acts as a backstop, so changes still sync even if a webhook is missed.
-
What gets imported - and what doesn't
To keep the Knowledge Base focused and safe, the import:
-
Includes text and source-code files (common code, markup, and document file types)
-
Skips binaries and images, build output (such as
node_modules,dist,build), files larger than 5 MB, and obvious secret files (such as.envfiles, keys, and certificates) -
Caps each repository at 300 files - use the subpath and include globs to stay within that and keep results relevant (the cap applies per repository, so each connected repository gets its own 300-file budget)
Anything that is imported becomes searchable evidence in the Knowledge Base. Secret files are skipped automatically, but a secret hard-coded inside an ordinary source file would still be embedded - treat a connected repository as readable by anyone with access to that Knowledge Base.
Change or remove a connected repository
-
A Knowledge Base can be connected to multiple repositories (up to a limit, 10 by default). Select
Add repositoryto connect another, orDisconnectto remove one. -
Disconnecting a repository removes that repository's imported source and its evidence from the Knowledge Base; the other connected repositories are untouched.
-
To switch a repository - for example to a different branch - you can either disconnect it and connect the new one, or (if you're under the limit) simply add the new one alongside it.
Troubleshooting
-
I don't see "Import from Git" or the "Source Control" tab. The feature may not be enabled for your team yet - ask your administrator.
-
The import shows
failed. Check the connector token, the branch name, and your filters. The specific reason is shown on the import. Previously imported content is left untouched when a sync fails. -
A repository is listed but its branches or files cannot be loaded. Check that the PAT includes that repository and has
Contents: Read-onlyaccess. GitHub may list repositories associated with your account even when the token cannot read their contents. -
Auto-sync isn't picking up pushes. Confirm the webhook in GitHub points at the shown URL with the matching secret and is subscribed to the push event. The periodic backstop will still bring changes in within about 15 minutes.