Skip to content

chore: sync dev with main - #38

Merged
vig-os-release-app[bot] merged 6 commits into
devfrom
chore/sync-main-to-dev-2-1
Jul 14, 2026
Merged

vig-os-release-app[bot] merged 6 commits into
devfrom
chore/sync-main-to-dev-2-1

Conversation

@vig-os-release-app

Copy link
Copy Markdown
Contributor

Syncs dev with main (sync-main-to-dev workflow).

c-vigo and others added 6 commits July 13, 2026 18:50
Replace the legacy apt/Debian-based .devcontainer/ with the devkit 1.1.0
direnv scaffold: Nix flake + .envrc, mode-aware CI, and the shared standards
kit. Wire the Node toolchain for this JS action -- nodejs in the flake
dev-shell and npm-mapped justfile.project recipes (sync/lint/test/build/
bundle). Opt into the flake-generated pre-commit config (flake-sourced
tooling, NixOS-safe typos) and restore the Node/Action .gitignore entries the
Python-only scaffold dropped (dist/index.js stays committed).

Refs: #29
commit-action is a TypeScript action with no Python code; point the CodeQL
language matrix at javascript-typescript (+ actions). The repo's GitHub
default CodeQL setup was disabled so this advanced config is authoritative
(the two cannot coexist).

Refs: #29
The sync/lint/test recipes were mapped to npm, but `update` still ran
`uv lock --upgrade` unconditionally, which fails on a Node repo. Branch on
package.json -> `npm update`.

Refs: #29
## Adopt the vigOS devkit 1.1.0 (direnv) — first rollout pilot

First real deployment of the mode-aware devkit (1.1.0) to a consumer
repo, in
**direnv** mode. This is the pilot for the wider vigOS rollout.

### What changed
- **Replaced the legacy apt/Debian `.devcontainer/`** with the devkit
1.1.0
direnv scaffold (Nix flake + `.envrc`, mode-aware CI, shared standards
kit).
Pruned via `--prune-devcontainer`, which removes the old
`post-create.sh`
  (the Debian-only script from #30).
- **Wired the Node toolchain** for this JS action: `nodejs` in the flake
dev-shell + npm-mapped `justfile.project` recipes (`sync`/`lint`/`test`/
`build`/`bundle`). Build tools (tsc, jest, ncc, tsx, eslint, prettier)
come
  from `npm ci`; nixpkgs provides node + npm.
- **Opted into the flake-generated pre-commit config** (`hooks = { }`),
so hooks
use flake-sourced tools — fixes the `typos` hook, which previously
downloaded
a glibc binary that cannot run on NixOS. Adds commit-message validation
+
  branch-naming enforcement.
- **Restored Node/Action `.gitignore` entries** the Python-only scaffold
dropped
(`node_modules/`, `*.tsbuildinfo`, `coverage/`) and removed the blanket
  `dist/` ignore so the committed `dist/index.js` bundle stays tracked.

### Verification (local, NixOS, direnv)
- `just sync/lint/test/build/bundle` all pass — **80 jest tests green**,
tsc
  compiles, ncc bundles `dist/index.js`.
- `just precommit` **fully green** (typos now via the flake;
`no-commit-to-branch`
  satisfied by this branch name).
- Dev-shell delivers node v24.16.0 + npm 11.13.0 + the devkit toolchain
with no
  Nix eval warnings.

### Notes / follow-ups (not in this PR)
- The action **runtime stays `node20`** (`action.yml`); the dev-shell
builds with
node24, which is fine for the pure-JS, ncc-bundled output. Runtime
migration is
  tracked separately (#28, #14).
- **Full release flow not adopted yet:** base is `main` (no `dev`
branch); the
scaffolded release / `sync-main-to-dev` workflows assume a `dev` branch.
Adopt
  the dev→main flow as a follow-up.
- Devkit gap found during this pilot and filed upstream:
[`vig-os/devkit#1024`](vig-os/devkit#1024) —
scaffold
  `.gitignore` is Python-only (worked around here).
- Pre-existing Dependabot findings on `main` (npm deps) are untouched
here.

Closes #29
Closes #30
The sync job checked out `dev` and then invoked the local action
`./.github/actions/setup-devkit-toolchain`. GitHub resolves `uses: ./…`
against the checked-out workspace, so once `main` gained `.github/actions/`
(#32) and `dev` had not, the job failed with "Can't find 'action.yml' …
under .github/actions/setup-devkit-toolchain".

That deadlocked the sync: the PR that would carry the action onto `dev` is
the very PR this job opens, so `dev` could never catch up.

Drop `ref: dev` so the workspace is the triggering `main` SHA, where the
action is guaranteed to exist. No step needs dev's working tree — the
re-check, conflict detection, sync-branch creation and PR steps all operate
on remote refs (origin/main, origin/dev) or the GitHub API.

This file is the devkit scaffold verbatim, so the defect ships to every
scaffolded repo; filed upstream as vig-os/devkit#1034. This is the local fix
so development can continue without waiting on a devkit release.

Refs: #36
## Unblock `Sync main to dev`

`dev` is stuck 4 commits behind `main` and cannot catch up: the sync
workflow has
been failing on every push to `main` since #32.

Failing run:
https://github.com/vig-os/commit-action/actions/runs/29314999211

### The bug

The `sync` job checks out `dev`, then invokes a **local** composite
action:

```yaml
      - name: Checkout dev
        with:
          ref: dev                                        # ← workspace is now dev's tree
      - name: Set up devkit toolchain
        uses: ./.github/actions/setup-devkit-toolchain    # ← resolved from dev's tree
```

GitHub resolves `uses: ./…` against the **checked-out workspace**, not
the
workflow's ref. `.github/actions/` landed on `main` with the devkit
1.1.0 adoption
(#32) and does not exist on `dev`, so the step dies:

```
Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under
'…/.github/actions/setup-devkit-toolchain'.
```

`resolve-toolchain` and `check` pass because they check out the
**default** ref
(`main`), where the action does exist. Only `sync` pins `dev`.

This is a **bootstrap deadlock** — the only thing that would carry the
action onto
`dev` is the very sync PR this job can no longer open. It cannot
self-heal.

### The fix

Drop `ref: dev`, so the workspace is the triggering `main` SHA where the
action is
guaranteed to exist.

Nothing downstream reads dev's **working tree**. Every subsequent step
already
operates on remote refs or the API:

| Step | Operates on |
|---|---|
| Re-check if dev is still behind main | `git fetch origin main dev` →
`git rev-list --count origin/main ^origin/dev` |
| Detect merge conflicts | `git merge-tree --write-tree origin/dev
origin/main` |
| Create sync branch from main | `git checkout -b "$SYNC_BRANCH"
origin/main` |
| Existing-PR check · stale-branch cleanup · Create PR · auto-merge |
`gh` / REST API |

`fetch-depth: 0` and the commit-app token are unchanged, so merge-base
and push
behavior are identical. The job now builds against the *newer* tree —
the one whose
actions it actually references.

### Upstream

This file is the devkit scaffold template **verbatim** (`diff` against
`assets/workspace/.github/workflows/sync-main-to-dev.yml` on
`devkit@main` is
empty), so the defect ships to every scaffolded repo. The devkit's own
copy has the
same pattern with `./.github/actions/setup-env` — latent, one rename
away from
firing.

Filed upstream as **vig-os/devkit#1034**. This PR is the **local** fix
so
development can continue without waiting on a devkit release. A header
comment and
a step comment mark the divergence so a future re-scaffold does not
silently revert
it.

### Verification

- `just precommit` fully green locally (incl. `yamllint --strict`,
`check-yaml`).
- Behavioral proof is the next push to `main`: merging this PR itself
triggers
`Sync main to dev`, which should now open the `chore/sync-main-to-dev-*`
PR that
  finally brings `.github/actions/` onto `dev`.

Refs: #36
@vig-os-release-app
vig-os-release-app Bot merged commit bf47c09 into dev Jul 14, 2026
10 checks passed
@commit-action-bot
commit-action-bot Bot deleted the chore/sync-main-to-dev-2-1 branch July 14, 2026 08:23
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