Skip to content

Changing azure-pipelines.yml (and other non-GitHub/GitLab CI files) selects only tests that read it #183

Closed

Description

@FredApps

What went wrong?

DiffCI left out a test that should have run (a miss)

DiffCI version

0.3.54 (published CLI), core main 40aa308

Command you ran

A TypeScript/JS project whose CI is Azure Pipelines, the platform the DiffCIObserve task in integrations/azure-devops targets. One test reads the pipeline file, and the change narrows the pipeline's test step:

git init -q az && cd az && mkdir src test
echo 'export const a = () => 1;' > src/a.js
printf "import test from 'node:test';\nimport assert from 'node:assert';\nimport { a } from '../src/a.js';\ntest('a', () => assert.equal(a(), 1));\n" > test/a.test.js
printf "import test from 'node:test';\nimport assert from 'node:assert';\nimport { readFileSync } from 'node:fs';\ntest('pipeline installs first', () => assert.match(readFileSync('azure-pipelines.yml', 'utf8'), /npm ci/));\n" > test/pipeline.test.js
echo '{"name":"x","type":"module","scripts":{"test":"node --test"}}' > package.json
echo '{"compilerOptions":{"allowJs":true,"module":"NodeNext","moduleResolution":"NodeNext","noEmit":true},"include":["src","test"]}' > tsconfig.json
printf 'trigger: [main]\npool: { vmImage: ubuntu-latest }\nsteps:\n  - script: npm ci\n  - script: npm test\n' > azure-pipelines.yml
git add . && git commit -qm base
printf 'trigger: [main]\npool: { vmImage: ubuntu-latest }\nsteps:\n  - script: npm ci\n  - script: npm test -- --test-name-pattern=pipeline\n' > azure-pipelines.yml
git commit -qam change
npx -y -p @diffci.com/[email protected] diffci observe --no-send --base HEAD~1 --head HEAD

Environment

Ubuntu, Node 24, npm, terminal

Output

DiffCI observation: OBSERVED (complete)
  selection: 1/2 test files, from 1 changed file(s)
  would have run: node --test test/pipeline.test.js

The same repository with .gitlab-ci.yml in place of azure-pipelines.yml gives selection: 0/2 … fallback: CI workflow definition(s) changed; full validation required: .gitlab-ci.yml. Without a test that reads the file, the Azure change gets Unknown changed file: azure-pipelines.yml.

Cause

isConventionalCiConfigPath (src/git/ci-config-paths.ts:22-27) only knows .github/workflows/ and GitLab names. Every other CI definition goes down the unknown-file path, where reference resolution narrows it to the tests that name it. This is the same failure the module's header describes for GitLab before 2026-11-05. It affects azure-pipelines.yml and the other conventional CI definitions: .circleci/config.yml, bitbucket-pipelines.yml, .travis.yml, Jenkinsfile and .buildkite/.

What you expected

Changing a conventional CI definition decides which commands CI runs, so it sets the CI-definition signal and runs every test, as .gitlab-ci.yml and .github/workflows/* already do. test/a.test.js is selected.

Activity

  1. added a commit that references this issue on Nov 18, 2026
    27e3fb1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions