Configure Bitbucket Pipelines
Status: ⚠️ The NEO pipeline is generated and uses the real engine, but today it doesn't trigger on its own when a PR has a label. Bitbucket doesn't allow filtering by label inside the YAML, and the component that would do it from the outside (a webhook handler) isn't implemented yet. In the meantime, the pipeline is started by hand.
Value in qa-stack.yaml |
stack.pipeline_provider: bitbucket |
| File | bitbucket-pipelines.yml (at the root: Bitbucket doesn't allow any other location) |
| Reference copy | .bitbucket/neo-ci-jobs/neo-ci-manager.yml (Bitbucket doesn't read it) |
NEO pipeline |
custom → qa-feature-e2e |
| How it's triggered | By hand, from the Bitbucket interface or through the API |
| Image | registry.gitlab.crowdaronline.com/lippia/products/neo/crowdar-engine-mvp:c4cd2740-playwright (private registry) |
1. What lippia-neo-ci-bootstrap generates
If the repository doesn't have bitbucket-pipelines.yml
It writes the complete file at the root and saves an identical copy in .bitbucket/neo-ci-jobs/neo-ci-manager.yml, just for reference.
If the repository already has bitbucket-pipelines.yml
Bitbucket doesn't allow splitting the pipeline across several files (it has no include:), so there's no one-line integration like in GitLab. lippia-neo-ci-bootstrap:
- Shows you your current
bitbucket-pipelines.ymland the proposed merge: yourdefinitions.stepsandpipelines.custom.*, plus theNEOones. - Asks for your confirmation before writing.
- Still saves the reference copy of the full template in
.bitbucket/neo-ci-jobs/.
Review the diff carefully: if your pipeline already uses anchors or the same step names (
initial-setup,feature-e2e…), there may be clashes.
2. The NEO pipeline
| Custom pipeline | Steps | What it does |
|---|---|---|
qa-feature-e2e |
initial-setup → feature-e2e |
Detects the framework and installs dependencies. Then it clones the skills, writes .env.tests, reads the PR (neo event), runs the feature-new-end-to-end plan, pushes the results to a branch, and comments the result on the PR |
Two Bitbucket quirks that explain how it's built:
- Each step runs in a new container, and variables from one step don't carry over to the next. That's why
initial-setupwrites aci.envfile (which travels as an artifact) andfeature-e2eloads it. - There's no
when: alwaysat the step level, which means you can't force a step to run if the previous one failed. That's why the report is done in theafter-scriptoffeature-e2e, which always runs, and not in a separate step.
The file also includes example pipelines from the previous design (
default,pull-requests/**,branches/main,qa-full,qa-scheduled,qa-ui-only,qa-api-only). Those don't use the engine: they only doecho. If you don't need them, you can delete them so they don't run on every push.
3. Step by step
Step 1 — Enable Pipelines
In Bitbucket: Repository settings → Pipelines → Settings → Enable Pipelines.
Step 2 — Generate the file
With qa-stack.yaml already created (pipeline_provider: bitbucket), ask the assistant:
Generate the project's CI with lippia-neo-ci-bootstrap
Review the file (or the proposed merge) and commit it.
Step 3 — Add the variables
In Bitbucket: Repository settings → Pipelines → Repository variables.
| Variable | Secured? | What it's for |
|---|---|---|
CROWDAR_REGISTRY_USER |
No | User to download the crowdar-engine-mvp image from Crowdar's GitLab registry |
CROWDAR_REGISTRY_TOKEN |
Yes | That user's token |
SKILLS_REPO_TOKEN |
Yes | Token with read access to crowdar-qa-skills (it's on GitLab) |
ANTHROPIC_API_KEY |
Yes | Claude models |
OPENAI_API_KEY |
Yes | OpenAI models, if the plan uses them |
CROWDAR_CI_TOKEN |
Yes | Commenting on the PR and pushing the results branch |
APP_USER / APP_PASSWORD |
APP_PASSWORD: Yes |
The app's test user |
APP_BASE_URL |
No | URL of the app under test |
If your user stories come from Jira or Azure DevOps, add their variables too (see the general table), with the tokens marked as Secured. Bitbucket exposes repository variables as environment variables in every step, so the engine receives them without touching the YAML.
Step 4 — Run the pipeline
Until automatic triggering exists:
- Go to Pipelines → Run pipeline.
- Choose the PR's branch.
- Choose the
custom: qa-feature-e2epipeline and run it.
You can also start it through the Bitbucket API (POST /repositories/{workspace}/{repo_slug}/pipelines/) specifying that custom pipeline.
⚠️ The
feature-e2estep usesneo event --provider bitbucketto read the PR. If you start it by hand without an associated PR, it may not find the PR data. Run it on the branch of an open PR.
To run it on a schedule
Bitbucket schedules are configured in the interface (Pipelines → Schedules), not in the YAML. The file includes a reference custom: qa-scheduled pipeline, but it's from the previous design and only does echo.
4. Common problems (and what to do)
| What you see | Why it may happen | What to do |
|---|---|---|
The NEO pipeline doesn't run when you add a label |
Current limitation: Bitbucket doesn't filter by label and the webhook doesn't exist yet | Start qa-feature-e2e by hand (Step 4) |
Pipelines that only do echo run on every push |
They're the example pipelines from the previous design | Delete default, pull-requests/**, and branches/main if you don't use them |
| Error downloading the image | CROWDAR_REGISTRY_USER / CROWDAR_REGISTRY_TOKEN are missing or don't have access |
Check the variables |
| The skills clone fails | SKILLS_REPO_TOKEN is missing or doesn't have read access |
Check the variable |
feature-e2e can't find the detected framework |
The ci.env from initial-setup didn't arrive |
Run both steps together within the same qa-feature-e2e pipeline |
| The results PR isn't opened | The job pushes the branch, but doesn't create the PR | Open the PR by hand from that branch |
| The results from a previous run aren't there | Bitbucket artifacts only live within the same pipeline | Download them when each run finishes |