Skip to content

CLI: Fix issue when running deploy with no locally changed workflows#1287

Merged
josephjclark merged 13 commits intorelease/nextfrom
tracking-deploy-bug
Mar 13, 2026
Merged

CLI: Fix issue when running deploy with no locally changed workflows#1287
josephjclark merged 13 commits intorelease/nextfrom
tracking-deploy-bug

Conversation

@josephjclark
Copy link
Collaborator

@josephjclark josephjclark commented Mar 4, 2026

This PR fixes #1269

Adds unit tests in support.

Note that I've force-updated the version hash in the text fixture (to what I think is the correct version). Will keep an eye on whether that's the right thing to do or not.

AI Usage

Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

@github-project-automation github-project-automation bot moved this to New Issues in Core Mar 4, 2026
@josephjclark josephjclark force-pushed the tracking-deploy-bug branch 2 times, most recently from 0a42b8d to 5cb6336 Compare March 9, 2026 10:19
@josephjclark josephjclark changed the title Tracking deploy bug CLI: Fix issue when running deploy with no locally changed workflows Mar 11, 2026
@josephjclark josephjclark changed the base branch from main to release/next March 12, 2026 12:09
@josephjclark
Copy link
Collaborator Author

Unfortunately farhan's integration testis still failing here - which plays into my fear that while I've fixed A bug here, I haven't fixed the one I was looking for.

On the other hand, maybe that test just isn't quite right. I'll have to dig deeper.

@josephjclark
Copy link
Collaborator Author

gonna release this now - if there's still a problem I'll fix it in isolation

@josephjclark josephjclark merged commit b0620f3 into release/next Mar 13, 2026
6 checks passed
@github-project-automation github-project-automation bot moved this from New Issues to Done in Core Mar 13, 2026
@josephjclark josephjclark deleted the tracking-deploy-bug branch March 13, 2026 11:33
josephjclark added a commit that referenced this pull request Mar 13, 2026
* cli: ensure --endpoint flag is respected in deploy

* fastlanes

* Add --queues CLI option for slot group configuration (#1288)

Introduce queue-aware slot allocation to support fast lanes. Workers can
now dedicate specific slots to specific queues via a new `--queues` flag
(e.g. `--queues "fast_lane:1 manual,*:4"`).

- Add parseQueues() with SlotGroup type and full validation
- Add --queues CLI option with WORKER_QUEUES env var support
- Enforce mutual exclusivity between --queues and --capacity
- Derive effectiveCapacity from slot groups in start.ts
- Add queues field to ClaimPayload in lexicon

* Review fixes: remove dead code, add TODO and duplicate queue warnings

- Remove unreachable ?? 5 fallback in start.ts (capacity always has default)
- Add TODO(#1289) for passing slotGroups to createWorker
- Warn on duplicate queue names within a preference chain
- Warn on identical queue configurations across slot groups
- Add test for WORKER_QUEUES + WORKER_CAPACITY env var mutual exclusivity

* Add changeset for queues CLI option

* Fix ws-worker build: make capacity non-optional in Args type

capacity always receives a default value via setArg, so the type
should reflect that rather than requiring a runtime fallback.

* Fix formatting for prettier

* Implement per-group workloops and queue-aware claiming (#1289)

Each slot group now gets its own independent workloop, tracks its own
active runs and capacity, and sends queue-scoped claims to Lightning.
The join payload includes a queues map so Lightning knows the slot
distribution. Default behavior (no --queues) is preserved with a single
manual,* group.

* Extract groupHasCapacity helper to consolidate repeated capacity checks

The pattern of computing pending claims and comparing against maxSlots
was duplicated 4 times across server.ts. Extracts it into a single
groupHasCapacity() function in parse-queues.ts with 5 unit tests.

* Consolidate redundant claim tests

Fold run-to-group tracking assertions into the existing execute test,
remove the redundant workloop-stop test (already covered), and drop
the now-covered todo.

* Fix formatting for prettier

* Fix CLI args ignored when invoked via pnpm start

pnpm v7+ passes the '--' separator through to process.argv, causing
yargs to treat all subsequent flags as positional arguments. Strip a
leading '--' before parsing so --queues and other flags work correctly
whether invoked via pnpm, npm, or directly.

* Add ES2021 lib to ws-worker tsconfig for Promise.any

The per-group workloops use Promise.any which requires ES2021 or later
in the TypeScript lib setting.

* Add JUnit XML test reporting for CircleCI Tests tab

Pipes AVA TAP output through tap-xunit to generate JUnit XML,
enabling test results to display in CircleCI's Tests UI.

* Fix tap-xunit not found by using npx

* Add per-package test:ci scripts for clean JUnit XML output

Each package now produces its own XML file instead of piping
combined pnpm -r output through tap-xunit, which was corrupted
by pnpm's interleaved logging.

* Fix "no tests found" warning in worker.test.ts

Remove redundant env var guard wrapping an already-skipped test.
AVA now sees the test as registered but skipped instead of finding
zero tests and emitting a warning that causes a non-zero exit.

* Refactor claim() to accept group as a standalone parameter

Move group from ClaimOptions to a required positional parameter,
making the function signature clearer about its dependencies.

* Rename slots/queues terminology to workloops and merge runtime types

- Rename --queues CLI option to --workloops (env: WORKER_WORKLOOPS)
- Change queue separator from comma to angle bracket (fast_lane>*:4)
- Rename SlotGroup → WorkloopConfig, maxSlots → capacity
- Merge RuntimeSlotGroup + Workloop into single Workloop interface
  with stub stop/isStopped that get overwritten by startWorkloop()
- Rename parse-queues.ts → parse-workloops.ts
- Update all imports, types, variable names, and tests

* Separate workloop parsing from runtime with WorkloopHandle pattern

Move Workloop, createWorkloop, and workloopHasCapacity out of
parse-workloops.ts (pure parsing) into api/workloop.ts (runtime).

startWorkloop now returns a WorkloopHandle { stop, isStopped } instead
of mutating the Workloop object. ServerApp stores handles in a
workloopHandles Map, keeping Workloop as pure state with no lifecycle
methods. Also fixes syntax error on claim.ts L81 and updates error
message expectations in tests.

* Fastlanes simpler workloops (#1297)
* remove app.openClaims, which is not useful anymore

* possible flaky test fix

* CLI: Fix issue when running deploy with no locally changed workflows (#1287)

* added a unit test for deploying a new project

* remove only

* enable mock lightning to load a project from yaml

* update tests

* failed attempt to repro

* fix issue where a project with no local diffs can wrongly report diffs on deploy]#

* fix types

* fix tests

* approve builds

* fix test

* remove dev log

* revert dev log

* fix lockfile

* tweak test code for stability

* another stability test tweak

* versions

---------

Co-authored-by: Stuart Corbishley <corbish@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

New Deploy: incorrect change warnings

1 participant