mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 17:37:40 +00:00
* ci: full checks on main pushes, changed-file lint on PRs, Slack alert when main breaks PR Checks now also runs on every push to main, with each commit in its own concurrency group so main runs never cancel one another. On a push the path router gets an empty diff, which already fails closed to every job, and the input-scoped steps (localization extraction, VM rollback replay, orcad smoke) run in full. Advisory E2E lanes stay PR-only. On PRs the per-file passes (root oxlint, JS-plugin oxlint, anti-slop, ast-grep and oxfmt) check only the changed paths. Everything is checked when the diff cannot be resolved, a lint toolchain input changes (oxlint/oxfmt/ast-grep configs and plugins, package.json, the lockfile, .gitignore, pr.yml), or more than 1500 paths change. Whole-program checks stay unscoped. A new workflow follows completed main runs and posts to the release Slack webhook only when main turns red, and once when it turns green again. * ci: alert once per main health streak and tolerate a malformed Slack mapping
26 lines
1.0 KiB
JavaScript
26 lines
1.0 KiB
JavaScript
import { describe, expect, it } from 'vitest'
|
|
import { selectPullRequestDiffBase } from './git-pull-request-diff-base.mjs'
|
|
|
|
describe('pull request diff base selection', () => {
|
|
it('uses the merge commit first parent for pull request checkouts', () => {
|
|
expect(
|
|
selectPullRequestDiffBase('event-base', ['current-base', 'pull-request-head'], 'pull_request')
|
|
).toBe('current-base')
|
|
})
|
|
|
|
it('keeps the requested base outside synthetic pull request merges', () => {
|
|
expect(selectPullRequestDiffBase('requested-base', ['parent'], 'pull_request')).toBe(
|
|
'requested-base'
|
|
)
|
|
expect(selectPullRequestDiffBase('requested-base', ['parent', 'other'], 'push')).toBe(
|
|
'requested-base'
|
|
)
|
|
})
|
|
|
|
it('uses the first parent for main pushes, which carry no payload base', () => {
|
|
expect(selectPullRequestDiffBase('', ['previous-main'], 'push')).toBe('previous-main')
|
|
expect(selectPullRequestDiffBase(undefined, ['previous-main'], 'push')).toBe('previous-main')
|
|
expect(selectPullRequestDiffBase('', [], 'push')).toBe('')
|
|
})
|
|
})
|