feat(ci): add --force flag to glab ci cancel job

Description

Add support for the --force flag (-f) in the glab ci cancel job command.

This flag maps to the force parameter in the GitLab Jobs API, allowing users to cancel jobs that run in protected environments — which was previously not possible via glab.

The implementation uses CancelJobWithOptions from the SDK v2 (with a //nolint:staticcheck comment since the method is deprecated in favor of a future v4 merge into CancelJob).

Changes

  • internal/commands/ci/cancel/job/job.go: Added --force / -f flag and updated runCancelation to call CancelJobWithOptions when force mode is enabled.
  • internal/commands/ci/cancel/job/job_test.go: Added tests for normal cancel, multiple cancel, error handling, force cancel, and force cancel of multiple jobs.
  • docs/source/ci/cancel/job.md: Auto-regenerated via make gen-docs.

Resolves #8290 (closed)

How has this been tested?

Unit tests added for all new code paths:

  • TestCIJobCancel — single job cancel
  • TestCIJobCancelMultiple — multiple jobs cancel
  • TestCIJobCancelError — API error handling
  • TestCIJobCancelWithForce — single job force-cancel
  • TestCIJobCancelWithForceMultiple — multiple jobs force-cancel

All tests pass: go test ./internal/commands/ci/cancel/job/...

Merge request reports

Loading