pipeline-worker 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -37
- package/package.json +2 -4
- package/.env.example +0 -27
- package/.pipeline-worker.yml.example +0 -24
package/README.md
CHANGED
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/pipeline-worker)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
|
|
7
|
-
Automate the last mile of your local changes: pipeline-worker takes the uncommitted diff in your repo and drives it — unattended
|
|
8
|
-
|
|
9
|
-

|
|
7
|
+
Automate the last mile of your local changes: pipeline-worker takes the uncommitted diff in your repo and drives it — unattended to a green merge request.
|
|
10
8
|
|
|
11
9
|
1. Captures your staged + unstaged changes (your working tree is never touched).
|
|
12
10
|
2. Replays them in a disposable git worktree.
|
|
@@ -31,63 +29,69 @@ npm install -g pipeline-worker
|
|
|
31
29
|
|
|
32
30
|
## Quick start
|
|
33
31
|
|
|
32
|
+
Set these once in your shell profile (`~/.zshrc` / `~/.bashrc`) and every
|
|
33
|
+
repo on the machine picks them up — no per-repo setup needed:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
export PIPELINE_WORKER_AGENT=claude
|
|
37
|
+
export PIPELINE_WORKER_FORGE=gitlab
|
|
38
|
+
export PIPELINE_WORKER_GITLAB_HOST=https://gitlab.example.com
|
|
39
|
+
export PIPELINE_WORKER_GITLAB_TOKEN=glpat-xxxxx
|
|
40
|
+
export PIPELINE_WORKER_GITLAB_REPO_BASE=$HOME/REPO # local dir that mirrors the GitLab namespace root — enables auto-detected projectId in any repo underneath it
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Then, in any repo:
|
|
44
|
+
|
|
34
45
|
```sh
|
|
35
46
|
cd your-repo
|
|
36
|
-
cp $(npm root -g)/pipeline-worker/.env.example .env # set tokens & defaults
|
|
37
|
-
cp $(npm root -g)/pipeline-worker/.pipeline-worker.yml.example .pipeline-worker.yml
|
|
38
47
|
# hack, hack, hack — leave the changes uncommitted, then:
|
|
39
48
|
pipeline-worker
|
|
40
49
|
```
|
|
41
50
|
|
|
42
51
|
## Configuration
|
|
43
52
|
|
|
44
|
-
|
|
53
|
+
pipeline-worker is configured entirely through real environment variables — set them in your shell profile once, and every repo picks them up.
|
|
45
54
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
|
|
|
53
|
-
| `
|
|
54
|
-
|
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `pollIntervalSeconds` | `PIPELINE_WORKER_POLL_INTERVAL_SECONDS` | `15` | pipeline poll cadence; use `60` for slow pipelines |
|
|
55
|
+
| Env var | Default | Meaning |
|
|
56
|
+
| --------------------------------------- | ---------------------------- | ----------------------------------------------------------------------------- |
|
|
57
|
+
| `PIPELINE_WORKER_AGENT` | `claude` | `claude` or `copilot` |
|
|
58
|
+
| `PIPELINE_WORKER_FORGE` | `gitlab` | `gitlab` or `github` |
|
|
59
|
+
| `PIPELINE_WORKER_GITLAB_HOST` | — | e.g. `https://gitlab.example.com` |
|
|
60
|
+
| `PIPELINE_WORKER_GITLAB_PROJECT_ID` | — | numeric project id |
|
|
61
|
+
| `PIPELINE_WORKER_GITLAB_REPO_BASE` | — | local dir mirroring the GitLab namespace root, for auto-detecting `projectId` |
|
|
62
|
+
| `PIPELINE_WORKER_GITLAB_TOKEN` | — | GitLab API token |
|
|
63
|
+
| `PIPELINE_WORKER_GITHUB_REPO` | — | `owner/name` slug |
|
|
64
|
+
| `PIPELINE_WORKER_GITHUB_TOKEN` | falls back to `GITHUB_TOKEN` | GitHub token |
|
|
65
|
+
| `PIPELINE_WORKER_POLL_INTERVAL_SECONDS` | `15` | pipeline poll cadence; use `60` for slow pipelines |
|
|
58
66
|
|
|
59
|
-
|
|
67
|
+
`build` / `lint` / `test` local check commands and `maxFixAttempts` (default `5`) are not configurable via env var — see auto-detection below.
|
|
60
68
|
|
|
61
69
|
### Check command auto-detection
|
|
62
70
|
|
|
63
|
-
|
|
71
|
+
`build` / `lint` / `test` are picked from the repo's toolchain (first marker found wins; mixed-language repos should set the commands explicitly):
|
|
64
72
|
|
|
65
|
-
| Toolchain
|
|
66
|
-
|
|
|
67
|
-
| Node / TypeScript | `package.json`
|
|
68
|
-
| .NET
|
|
69
|
-
| Go
|
|
70
|
-
| Python
|
|
73
|
+
| Toolchain | Marker | build | lint | test |
|
|
74
|
+
| ----------------- | ------------------------------------------------------ | ---------------- | ----------------------------------- | ------------------------------------------------ |
|
|
75
|
+
| Node / TypeScript | `package.json` | `npm run build` | `npm run lint` | `npm test` — each only if the script is declared |
|
|
76
|
+
| .NET | `*.sln` / `*.csproj` / `*.fsproj` / `*.vbproj` at root | `dotnet build` | `dotnet format --verify-no-changes` | `dotnet test` |
|
|
77
|
+
| Go | `go.mod` | `go build ./...` | `go vet ./...` | `go test ./...` |
|
|
78
|
+
| Python | `pyproject.toml` / `setup.py` / `requirements.txt` | — | — | `pytest` |
|
|
71
79
|
|
|
72
|
-
A stage with no command (
|
|
80
|
+
A stage with no command (`—`) is skipped. If no toolchain is detected and no commands are configured, all local checks are skipped with a warning.
|
|
73
81
|
|
|
74
82
|
## Commands
|
|
75
83
|
|
|
76
|
-
| Command
|
|
77
|
-
|
|
|
78
|
-
| `pipeline-worker` (or `pipeline-worker run`) | Capture the current diff and drive it to a green MR/PR
|
|
79
|
-
| `pipeline-worker serve`
|
|
80
|
-
| `pipeline-worker resume --branch <name>`
|
|
81
|
-
| `pipeline-worker status --branch <name>`
|
|
84
|
+
| Command | What it does |
|
|
85
|
+
| -------------------------------------------- | ------------------------------------------------------------------------- |
|
|
86
|
+
| `pipeline-worker` (or `pipeline-worker run`) | Capture the current diff and drive it to a green MR/PR |
|
|
87
|
+
| `pipeline-worker serve` | Start the forge MCP server over stdio (used by the agent during fix runs) |
|
|
88
|
+
| `pipeline-worker resume --branch <name>` | Resume watching/fixing a run after a crash |
|
|
89
|
+
| `pipeline-worker status --branch <name>` | Print the persisted state of a run |
|
|
82
90
|
|
|
83
91
|
## How the fix loop stays bounded
|
|
84
92
|
|
|
85
93
|
Every retry path has a cap: local checks abort the run before an MR is ever opened; pipeline polling gives up after a 2-hour safety window; fix attempts stop at `maxFixAttempts`; a fix attempt that changes no files, or a pipeline that ends `canceled`/`skipped`, escalates immediately instead of spending agent tokens. Escalation always leaves a comment on the MR/PR so a human knows to take over.
|
|
86
94
|
|
|
87
|
-
## Contributing
|
|
88
|
-
|
|
89
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md). Please note the [Code of Conduct](CODE_OF_CONDUCT.md) and report vulnerabilities per [SECURITY.md](SECURITY.md).
|
|
90
|
-
|
|
91
95
|
## License
|
|
92
96
|
|
|
93
97
|
[MIT](LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pipeline-worker",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Automated git-worktree workflow: captures intent from a diff via Claude Code or GitHub Copilot CLI, runs build/lint/test, opens a GitLab MR or GitHub PR, and auto-fixes failing pipelines — with a companion forge MCP server (TOON-encoded responses).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Mohan TN <mohan.tn100@gmail.com>",
|
|
@@ -34,9 +34,7 @@
|
|
|
34
34
|
"files": [
|
|
35
35
|
"dist",
|
|
36
36
|
"README.md",
|
|
37
|
-
"LICENSE"
|
|
38
|
-
".pipeline-worker.yml.example",
|
|
39
|
-
".env.example"
|
|
37
|
+
"LICENSE"
|
|
40
38
|
],
|
|
41
39
|
"engines": {
|
|
42
40
|
"node": ">=20.12"
|
package/.env.example
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Copy to .env at your repo root. Values here are defaults only — variables
|
|
2
|
-
# already set in the real environment always take precedence, and .env is
|
|
3
|
-
# loaded automatically by every pipeline-worker command.
|
|
4
|
-
#
|
|
5
|
-
# Tokens belong here or in the real environment — NEVER in .pipeline-worker.yml.
|
|
6
|
-
|
|
7
|
-
# Which coding agent runs intent capture and CI fixes: claude | copilot
|
|
8
|
-
PIPELINE_WORKER_AGENT=claude
|
|
9
|
-
|
|
10
|
-
# Which forge hosts the repo: gitlab | github
|
|
11
|
-
PIPELINE_WORKER_FORGE=gitlab
|
|
12
|
-
|
|
13
|
-
# Seconds between pipeline polls (default 15; use e.g. 60 for slow pipelines)
|
|
14
|
-
PIPELINE_WORKER_POLL_INTERVAL_SECONDS=15
|
|
15
|
-
|
|
16
|
-
# --- GitLab (PIPELINE_WORKER_FORGE=gitlab) ---
|
|
17
|
-
PIPELINE_WORKER_GITLAB_HOST=https://gitlab.example.com
|
|
18
|
-
PIPELINE_WORKER_GITLAB_PROJECT_ID=12345
|
|
19
|
-
PIPELINE_WORKER_GITLAB_TOKEN=
|
|
20
|
-
|
|
21
|
-
# --- GitHub (PIPELINE_WORKER_FORGE=github) ---
|
|
22
|
-
# PIPELINE_WORKER_GITHUB_REPO=owner/name
|
|
23
|
-
# PIPELINE_WORKER_GITHUB_TOKEN= # falls back to GITHUB_TOKEN if unset
|
|
24
|
-
# PIPELINE_WORKER_GITHUB_API_URL=https://api.github.com # override for GitHub Enterprise
|
|
25
|
-
|
|
26
|
-
# Optional: path to the YAML config file (default: <repo>/.pipeline-worker.yml)
|
|
27
|
-
# PIPELINE_WORKER_CONFIG=
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Copy to .pipeline-worker.yml at your repo root and adjust. Every value can also be
|
|
2
|
-
# set (or overridden) via environment variables / a .env file — see
|
|
3
|
-
# .env.example. Tokens must ONLY be set as environment variables
|
|
4
|
-
# (PIPELINE_WORKER_GITLAB_TOKEN / PIPELINE_WORKER_GITHUB_TOKEN) — never in this file.
|
|
5
|
-
|
|
6
|
-
agent: claude # or: copilot (no runtime fallback between the two)
|
|
7
|
-
forge: gitlab # or: github
|
|
8
|
-
|
|
9
|
-
gitlab:
|
|
10
|
-
host: https://gitlab.example.com
|
|
11
|
-
projectId: 12345
|
|
12
|
-
|
|
13
|
-
# github:
|
|
14
|
-
# repo: owner/name
|
|
15
|
-
|
|
16
|
-
# Check commands default to the repo's detected toolchain (Node/TypeScript,
|
|
17
|
-
# .NET, Go, Python — see README "Check command auto-detection"). Uncomment to
|
|
18
|
-
# override; an empty string ('') skips that stage.
|
|
19
|
-
# build: npm run build
|
|
20
|
-
# lint: npm run lint
|
|
21
|
-
# test: npm test
|
|
22
|
-
|
|
23
|
-
maxFixAttempts: 5
|
|
24
|
-
pollIntervalSeconds: 15 # per-repo pipeline poll cadence; bump to 60 for slow pipelines
|