fix(ci): unblock PR checks — checkout in migration-lock, seed-proof leadership spec

migration-lock ran `gh pr list --json files` without actions/checkout, so
every PR failed the job in 3s with "not a git repository". The leadership
portfolio spec asserted the exact global hit set with fixed names, which the
minimal seed (Seed Liderança Um/Dois) collides with via word-start 'Lider';
switch to the unique-token pattern already used by the demands spec.
This commit is contained in:
Francisco Ignácio Fontoura Solla 2026-07-30 13:25:49 -03:00
parent 914fb5a7e7
commit 5b4ab9c020
2 changed files with 10 additions and 4 deletions

View file

@ -88,6 +88,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
# gh expands --json files via git, so it needs the repo checked out.
- uses: actions/checkout@v4
- name: Count open PRs touching schema files
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -69,8 +69,11 @@ describe('searchHomeLeaderships (B49)', () => {
const other = await fixtures.getMunicipality('feira-de-santana')
await fixtures.assignMunicipalityAdvisors(administered.id, [advisor.id])
const inScope = await fixtures.createContact({ name: 'Lider Cairu' })
const outOfScope = await fixtures.createContact({ name: 'Lider Feira' })
// Unique token per run: the minimal seed ships leaderships whose contact
// names collide with fixed queries like 'Lider' (word-start match).
const scopeToken = fixtures.value('scope-lideranca')
const inScope = await fixtures.createContact({ name: `${scopeToken} Cairu` })
const outOfScope = await fixtures.createContact({ name: `${scopeToken} Feira` })
const scopedLeadership = await fixtures.createLeadership({
contact: inScope.id,
municipalities: [administered.id],
@ -80,10 +83,10 @@ describe('searchHomeLeaderships (B49)', () => {
municipalities: [other.id],
})
const advisorResult = await searchHomeLeaderships(payload, advisor, 'Lider')
const advisorResult = await searchHomeLeaderships(payload, advisor, scopeToken)
expect(advisorResult.map((hit) => hit.id)).toEqual([scopedLeadership.id])
const coordinatorResult = await searchHomeLeaderships(payload, coordinator, 'Lider')
const coordinatorResult = await searchHomeLeaderships(payload, coordinator, scopeToken)
expect(coordinatorResult.map((hit) => hit.id).sort((a, b) => a - b)).toEqual(
[scopedLeadership.id, otherLeadership.id].sort((a, b) => a - b),
)