Skip to content

feat: upgrade to backport@11 with smoke test suite#177

Merged
sorenlouv merged 9 commits into
mainfrom
v11-beta
Mar 16, 2026
Merged

feat: upgrade to backport@11 with smoke test suite#177
sorenlouv merged 9 commits into
mainfrom
v11-beta

Conversation

@sorenlouv
Copy link
Copy Markdown
Owner

Summary

  • Upgrade to backport@11.0.0-beta.1 with unified error handling and new response types
  • Convert from yarn to npm, replace Jest with Vitest, align dependencies with backport
  • Add ignore_error_codes input to control which errors fail CI (defaults: merge-conflict-exception, no-branches-exception)
  • Add automated smoke test suite (npm run test:e2e) that validates the action against the backport-org/backport-demo repository
  • Add ESLint with import ordering, TypeScript strict mode, and Prettier

Smoke test coverage (8 assertions)

Test Assertions
Happy path — backport to production via label Workflow succeeds, backport PR created, status comment posted on source PR
No labels — action should not fail CI Workflow succeeds (no-branches-exception ignored), no backport PR created
Merge conflict auto-resolutionautoResolveConflictsWithTheirs Workflow succeeds, backport PR created despite conflict, PR body mentions --strategy-option=theirs

Test plan

  • Unit tests pass (20/20 via Vitest)
  • Smoke test passes (8/8 assertions)
  • Smoke test correctly detects failures (verified by intentionally breaking the action)
  • Review dist/index.js bundle size change (expected: large diff due to major version bump of backport dependency)

Made with Cursor

Søren Louv-Jansen added 9 commits March 16, 2026 17:21
Replace all yarn commands with npm equivalents across package.json
scripts, CI workflows, husky hooks, and documentation. Delete
yarn.lock and generate package-lock.json. Rebuild dist/.

Made-with: Cursor
- Update error handling to use the new BackportResponse type where all
  errors are in the results array
- Add ignore_error_codes input with sensible defaults
  (merge-conflict-exception, no-branches-exception)
- Update @vercel/ncc to 0.38.4 for modern JS syntax support
- Fix tests to use vi.mock for ESM compatibility

Made-with: Cursor
Major bumps: @actions/core 3.x, @actions/exec 3.x, @actions/github 9.x,
@octokit/action 8.x, @octokit/graphql 9.x. Minor/patch bumps for lodash,
@types/lodash, @typescript-eslint/*, and lint-staged.

Fix tests to mock @actions/core at module level since v3 is a proper ESM
module whose exports cannot be spied on with vi.spyOn.

Made-with: Cursor
Fixes runtime crash in bundled environments where backport's
package.json could not be found.

Made-with: Cursor
Replace the bash e2e-test.sh with a TypeScript smoke test under
scripts/smoke-test/. Add @octokit/rest, chalk, and p-retry as dev
dependencies. Condense the release SKILL.md to reference the
automated smoke test.

Made-with: Cursor
Move scripts to their own tsconfig.json so ncc only bundles src/.
Remove stale dist/ artifacts (modules/, workers, etc.) that were
incorrectly included.

Made-with: Cursor
Add assertion to happy path test verifying the action posts a status
comment on the source PR. Add Test 3 that creates a deliberate merge
conflict and verifies autoResolveConflictsWithTheirs produces a
backport PR with the conflict resolved.

Made-with: Cursor
@sorenlouv sorenlouv merged commit c0d1fb5 into main Mar 16, 2026
1 check passed
@sorenlouv sorenlouv deleted the v11-beta branch March 16, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant