Using Gostly
CI integration
Keep the API environment behind a test alongside your code. Review service-definition changes before applying them, then run your existing test command against the prepared Gostly stack.
Choose the workflow
- Plan and apply: manage a version-controlled service definition on a selected stack. GitHub Actions and GitLab examples separate planning, human approval and applying the approved plan.
- Run regression checks: wrap your test command with the provider-neutral CI runner. Scaffolds are available for GitHub Actions, GitLab and CircleCI.
Your pipeline starts the stack and supplies its test command. Gostly supplies the configured API environment and the selected CI gate; it does not deploy your application or replace its regression suite.
Before you begin
Use a compatible source installation that includes the Gostly CI runner and the provider examples. Prepare the target stack, API address, service definition and reviewed fixtures or code models. Keep credentials in the CI provider's protected configuration.
For OIDC authentication, an administrator creates the service accounts and trust policies the jobs will use. Planning and applying should use separate accounts. An apply credential needs the definition-apply scope; ordinary write access does not include it.
Plan before applying
- Keep the service definition in
.gostly/services.yamland give it a stable definition identity for the repository. - Run the plan job on the proposed change. Review service actions, conflicts and any dashboard changes the plan retains.
- Plan again on the default-branch commit. Require a person to approve that plan through the provider's protected environment or manual job.
- Apply using the approved plan digest. If the stack changed while approval was pending, the API refuses the stale plan and applies nothing. Generate and approve the new plan before applying it.
The OIDC examples exchange the provider's job identity for a short-lived, scoped service-account credential. A stored key is a separate supported choice. Configure repository, branch and environment trust to match the job's actual authority.
Run tests with a gate
The CI runner validates a run manifest, prepares the declared inputs, runs your command and evaluates the selected gate. The default miss gate checks requests the prepared library could not answer. The episode gate uses an isolated episode and verifies the exported execution journal; the tests must carry the run's journal headers.
The runner writes a JSON result, JUnit output and a Markdown summary. The selected full-evidence mode also retains a redacted test log and evidence bundle. Inspect both the application test result and the gate result.
A failed test, refused behavior document, unavailable stack and incomplete evidence are different outcomes. Keep those distinctions in the required CI check rather than treating an attempted run as a pass.
Reuse code models
A CI manifest can take committed code models, compile them into a definition and fixtures, and prepare them before the tests run. Review and commit the model, not its private operator report. Retain the model and definition identities with the result.
Related documentation
- Code models: derive reusable service inputs from recordings.
- Proxy Setup: route a client through Gostly.
- Episodes: understand isolated state, journals and reset lifetime.
- CI regression guide: follow a failing client assertion and its corrected result.