forked from coder/agentapi
-
Notifications
You must be signed in to change notification settings - Fork 0
[codex] add taskfile common tasks #486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,59 +1,142 @@ | ||
| version: '3' | ||
|
|
||
| tasks: | ||
| # Quality gate - runs strict lint, type check, tests, and security | ||
| quality: | ||
| desc: "Run full strict quality pipeline (lint/test/security)" | ||
| build: | ||
| desc: Build every detected language target. | ||
| cmds: | ||
| - task: lint | ||
| - task: test | ||
| - task: lint:security | ||
| - task: fmt | ||
| - task: build:go | ||
| - task: build:chat | ||
| - task: build:docs | ||
|
|
||
| quality:strict: | ||
| desc: "Run strict quality with extra checks" | ||
| build:go: | ||
| internal: true | ||
| status: | ||
| - test ! -f go.mod | ||
| cmds: | ||
| - golangci-lint run ./... --timeout 5m | ||
| - go test ./... -race -covermode=atomic | ||
| - go vet ./... | ||
| - staticcheck ./... || true | ||
| - gosec -fs ./... || true | ||
| - | | ||
| bash -euo pipefail -c ' | ||
| export GOCACHE="$PWD/.cache/go-build" | ||
| mkdir -p "$GOCACHE" | ||
| go build -o ./agentapi ./main.go | ||
| ' | ||
|
|
||
| lint: | ||
| build:chat: | ||
| internal: true | ||
| status: | ||
| - test ! -f package.json | ||
| dir: chat | ||
| cmds: | ||
| - golangci-lint run ./... | ||
| - bun install --frozen-lockfile | ||
| - bun run build | ||
|
|
||
| lint:security: | ||
| build:docs: | ||
| internal: true | ||
| status: | ||
| - test ! -f package.json | ||
| dir: docs | ||
| cmds: | ||
| - go vet ./... | ||
| - staticcheck ./... || true | ||
| - gosec -fs ./... || true | ||
| - npm install | ||
| - npm run build | ||
|
|
||
| fmt: | ||
| test: | ||
| desc: Run tests for detected language targets. | ||
| cmds: | ||
| - gofmt -l -w -s . | ||
| - goimports -l -w -s . | ||
| - task: test:go | ||
|
|
||
| test: | ||
| test:go: | ||
| internal: true | ||
| status: | ||
| - test ! -f go.mod | ||
| cmds: | ||
| - go test ./... | ||
| - | | ||
| bash -euo pipefail -c ' | ||
| export GOCACHE="$PWD/.cache/go-build" | ||
| mkdir -p "$GOCACHE" | ||
| go test -short ./... | ||
| ' | ||
|
|
||
| build: | ||
| lint: | ||
| desc: Run linters for detected language targets. | ||
| cmds: | ||
| - make build | ||
| - task: lint:go | ||
| - task: lint:chat | ||
|
|
||
| docs:install: | ||
| dir: docs | ||
| lint:go: | ||
| internal: true | ||
| status: | ||
| - test ! -f go.mod | ||
| cmds: | ||
| - npm install | ||
| - | | ||
| bash -euo pipefail -c ' | ||
| export GOCACHE="$PWD/.cache/go-build" | ||
| mkdir -p "$GOCACHE" | ||
| go vet ./... | ||
| ' | ||
|
|
||
| docs:build: | ||
| dir: docs | ||
| lint:chat: | ||
| internal: true | ||
| status: | ||
| - test ! -f chat/package.json | ||
| dir: chat | ||
| cmds: | ||
| - bun install --frozen-lockfile | ||
| - bun run lint | ||
|
|
||
| clean: | ||
| desc: Remove generated build artifacts. | ||
| cmds: | ||
| - task: clean:go | ||
| - task: clean:chat | ||
| - task: clean:docs | ||
|
|
||
| clean:go: | ||
| internal: true | ||
| status: | ||
| - test ! -f go.mod | ||
| cmds: | ||
| - npm run docs:build | ||
| - | | ||
| python3 - <<'PY' | ||
| from pathlib import Path | ||
| import os | ||
| import subprocess | ||
| import shutil | ||
|
|
||
| quality: | ||
| os.environ["GOCACHE"] = str(Path(".cache/go-build").resolve()) | ||
| Path(os.environ["GOCACHE"]).mkdir(parents=True, exist_ok=True) | ||
| subprocess.run(["go", "clean", "-cache", "-testcache"], check=True) | ||
| for path in [Path("agentapi"), Path("coverage.out"), Path(".cache/go-build")]: | ||
| if path.is_file() or path.is_symlink(): | ||
| path.unlink() | ||
| elif path.is_dir(): | ||
| shutil.rmtree(path) | ||
| PY | ||
|
|
||
| clean:chat: | ||
| internal: true | ||
| status: | ||
| - test ! -f chat/package.json | ||
| cmds: | ||
| - task lint | ||
| - task test | ||
| - task docs:build | ||
| - | | ||
| python3 - <<'PY' | ||
| from pathlib import Path | ||
| import shutil | ||
|
|
||
| for path in [Path("chat/.next"), Path("chat/out"), Path("chat/.turbo")]: | ||
| if path.exists(): | ||
| shutil.rmtree(path) | ||
| PY | ||
|
|
||
| clean:docs: | ||
| internal: true | ||
| status: | ||
| - test ! -f docs/package.json | ||
| cmds: | ||
| - | | ||
| python3 - <<'PY' | ||
| from pathlib import Path | ||
| import shutil | ||
|
|
||
| for path in [Path("docs/.vitepress/dist"), Path("docs/.vitepress/cache"), Path("docs/.generated")]: | ||
| if path.exists(): | ||
| shutil.rmtree(path) | ||
| PY | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,60 +1,142 @@ | ||
| version: '3' | ||
|
|
||
| tasks: | ||
| # Quality gate - runs strict lint, type check, tests, and security | ||
| quality: | ||
| desc: "Run full strict quality pipeline (lint/test/security)" | ||
| build: | ||
| desc: Build every detected language target. | ||
| cmds: | ||
| - task: lint | ||
| - task: test | ||
| - task: lint:security | ||
| - task: fmt | ||
| - task: build:go | ||
| - task: build:chat | ||
| - task: build:docs | ||
|
|
||
| quality:strict: | ||
| desc: "Run strict quality with extra checks" | ||
| build:go: | ||
| internal: true | ||
| status: | ||
| - test ! -f go.mod | ||
| cmds: | ||
| - golangci-lint run ./... --timeout 5m | ||
| - go test ./... -race -covermode=atomic | ||
| - go vet ./... | ||
| - staticcheck ./... || true | ||
| - gosec -fs ./... || true | ||
| - | | ||
| bash -euo pipefail -c ' | ||
| export GOCACHE="$PWD/.cache/go-build" | ||
| mkdir -p "$GOCACHE" | ||
| go build -o ./agentapi ./main.go | ||
| ' | ||
|
|
||
| lint: | ||
| build:chat: | ||
| internal: true | ||
| status: | ||
| - test ! -f package.json | ||
| dir: chat | ||
| cmds: | ||
| - golangci-lint run ./... | ||
| - bun install --frozen-lockfile | ||
| - bun run build | ||
|
|
||
| lint:security: | ||
| build:docs: | ||
| internal: true | ||
| status: | ||
| - test ! -f package.json | ||
| dir: docs | ||
| cmds: | ||
| - go vet ./... | ||
| - staticcheck ./... || true | ||
| - gosec -fs ./... || true | ||
| - npm install | ||
| - npm run build | ||
|
|
||
| fmt: | ||
| test: | ||
| desc: Run tests for detected language targets. | ||
| cmds: | ||
| - gofmt -l -w -s . | ||
| - goimports -l -w -s . | ||
| - task: test:go | ||
|
|
||
| test: | ||
| test:go: | ||
| internal: true | ||
| status: | ||
| - test ! -f go.mod | ||
| cmds: | ||
| - go test ./... | ||
| - | | ||
| bash -euo pipefail -c ' | ||
| export GOCACHE="$PWD/.cache/go-build" | ||
| mkdir -p "$GOCACHE" | ||
| go test -short ./... | ||
| ' | ||
|
|
||
| build: | ||
| lint: | ||
| desc: Run linters for detected language targets. | ||
| cmds: | ||
| - make build | ||
| - task: lint:go | ||
| - task: lint:chat | ||
|
|
||
| docs:install: | ||
| dir: docs | ||
| lint:go: | ||
| internal: true | ||
| status: | ||
| - test ! -f go.mod | ||
| cmds: | ||
| - npm install | ||
| - | | ||
| bash -euo pipefail -c ' | ||
| export GOCACHE="$PWD/.cache/go-build" | ||
| mkdir -p "$GOCACHE" | ||
| go vet ./... | ||
| ' | ||
|
|
||
| docs:build: | ||
| dir: docs | ||
| lint:chat: | ||
| internal: true | ||
| status: | ||
| - test ! -f chat/package.json | ||
| dir: chat | ||
| cmds: | ||
| - npm install | ||
| - npm run docs:build | ||
| - bun install --frozen-lockfile | ||
| - bun run lint | ||
|
|
||
| clean: | ||
| desc: Remove generated build artifacts. | ||
| cmds: | ||
| - task: clean:go | ||
| - task: clean:chat | ||
| - task: clean:docs | ||
|
|
||
| clean:go: | ||
| internal: true | ||
| status: | ||
| - test ! -f go.mod | ||
| cmds: | ||
| - | | ||
| python3 - <<'PY' | ||
| from pathlib import Path | ||
| import os | ||
| import subprocess | ||
| import shutil | ||
|
|
||
| quality: | ||
| os.environ["GOCACHE"] = str(Path(".cache/go-build").resolve()) | ||
| Path(os.environ["GOCACHE"]).mkdir(parents=True, exist_ok=True) | ||
| subprocess.run(["go", "clean", "-cache", "-testcache"], check=True) | ||
| for path in [Path("agentapi"), Path("coverage.out"), Path(".cache/go-build")]: | ||
| if path.is_file() or path.is_symlink(): | ||
| path.unlink() | ||
| elif path.is_dir(): | ||
| shutil.rmtree(path) | ||
| PY | ||
|
|
||
| clean:chat: | ||
| internal: true | ||
| status: | ||
| - test ! -f chat/package.json | ||
| cmds: | ||
| - task lint | ||
| - task test | ||
| - task docs:build | ||
| - | | ||
| python3 - <<'PY' | ||
| from pathlib import Path | ||
| import shutil | ||
|
|
||
| for path in [Path("chat/.next"), Path("chat/out"), Path("chat/.turbo")]: | ||
| if path.exists(): | ||
| shutil.rmtree(path) | ||
| PY | ||
|
|
||
| clean:docs: | ||
| internal: true | ||
| status: | ||
| - test ! -f docs/package.json | ||
| cmds: | ||
| - | | ||
| python3 - <<'PY' | ||
| from pathlib import Path | ||
| import shutil | ||
|
|
||
| for path in [Path("docs/.vitepress/dist"), Path("docs/.vitepress/cache"), Path("docs/.generated")]: | ||
| if path.exists(): | ||
| shutil.rmtree(path) | ||
| PY |
6 changes: 6 additions & 0 deletions
6
docs/sessions/20260428-taskfile-agentapi-plusplus/00_SESSION_OVERVIEW.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Session Overview | ||
|
|
||
| - Goal: add a common `Taskfile.yml` with `build`, `test`, `lint`, and `clean` tasks. | ||
| - Scope: root repo and the nested `agentapi-plusplus/` checkout both have tracked `Taskfile.yml` files. | ||
| - Success criteria: task list is language-aware, `task --list` works, and the branch is published through PR merge. | ||
|
|
12 changes: 12 additions & 0 deletions
12
docs/sessions/20260428-taskfile-agentapi-plusplus/01_RESEARCH.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Research | ||
|
|
||
| - Detected languages: | ||
| - Go via `/tmp/wt-taskfile-agentapi-plusplus/go.mod` | ||
| - Frontend docs via `/tmp/wt-taskfile-agentapi-plusplus/chat/package.json` | ||
| - Documentation site via `/tmp/wt-taskfile-agentapi-plusplus/docs/package.json` | ||
| - Repo scripts inspected: | ||
| - `chat/package.json` exposes `build` and `lint` | ||
| - `docs/package.json` exposes `build` | ||
| - Validation: | ||
| - `task --dir /tmp/wt-taskfile-agentapi-plusplus --list` succeeds and exposes `build`, `test`, `lint`, and `clean` | ||
|
|
7 changes: 7 additions & 0 deletions
7
docs/sessions/20260428-taskfile-agentapi-plusplus/02_SPECIFICATIONS.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Specifications | ||
|
|
||
| - `build` should invoke the detected language targets. | ||
| - `test` should run the available test target(s) for the repo. | ||
| - `lint` should run the available lint target(s) for the repo. | ||
| - `clean` should remove generated artifacts for the detected targets. | ||
|
|
7 changes: 7 additions & 0 deletions
7
docs/sessions/20260428-taskfile-agentapi-plusplus/03_DAG_WBS.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # DAG / WBS | ||
|
|
||
| 1. Confirm repo languages and scripts. | ||
| 2. Validate `Taskfile.yml` structure with `task --list`. | ||
| 3. Publish branch and open PR. | ||
| 4. Merge the PR after reviewless admin squash merge. | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lint:chat status check skips task incorrectly
Medium Severity
The
lint:chattask setsdir: chatwhile itsstatuscheck usestest ! -f chat/package.json. Becausestatusruns from the task'sdir, it actually probeschat/chat/package.json, which never exists, so the status returns success andtasktreats the task as up-to-date and skips it. As a resulttask lintsilently never runs the chat linter, contradicting the PR description. The siblingbuild:chattask uses the correct relative pathpackage.json.Additional Locations (1)
agentapi-plusplus/Taskfile.yml#L75-L83Reviewed by Cursor Bugbot for commit fb85236. Configure here.