Skip to content

Commit acb2a30

Browse files
committed
release: v0.2.0
Bump the version and freeze the changelog for the v0.2.0 release. mix.exs * version: 0.1.0 -> 0.2.0 CHANGELOG.md * Convert [Unreleased] to [0.2.0] - 2026-06-15 * Deduplicate the 'prs comments add' bullets (they were listed twice in the Unreleased block) * Reorganize into Keep-a-Changelog 'Added / Fixed / Changed / Notes' subsections * Add 'Changed' entry for the 25-credо cleanup commit * Add a release summary at the top * Update the link footers README.md * Bump the 'bump version' example to 0.2.0 -> 0.3.0 github-page/index.html * Update the curl example to point at ado-0.2.0-macos-aarch64 Verified locally: * 311 ExUnit tests pass * mix credo --strict: 0 issues * mix format --check-formatted: clean * ./ado version -> 'ado 0.2.0' * ./ado --version -> 'ado 0.2.0' * ./ado version --json -> '{"ok":true,"version":"0.2.0"}'
1 parent d60582f commit acb2a30

4 files changed

Lines changed: 119 additions & 88 deletions

File tree

CHANGELOG.md

Lines changed: 115 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ All notable changes to `ado` will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [0.2.0] - 2026-06-15
9+
10+
The v0.2.0 release adds end-to-end PR review workflows (`prs comments`
11+
add/list/update with file & thread context, plus `prs diff` in three
12+
modes), shell completion for bash/zsh/fish/powershell with automatic
13+
install via npm postinstall, and the `ado version` / `--version`
14+
command. The release also cleans up all 25 outstanding Credo strict
15+
issues.
916

1017
### Added
1118

@@ -16,44 +23,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1623
delta/less/vimdiff for pretty viewing)
1724
Also supports `--iteration N` to inspect an earlier iteration
1825
(default: latest) and `--json` for LLM-friendly structured output.
19-
- **`ado completion`** for generating shell completion scripts.
20-
Supports bash, zsh, fish, and PowerShell. The generated script
21-
is static (regenerate it when ado upgrades) and always in sync
22-
with the CliMate command tree.
23-
24-
eval "$(ado completion bash)" # bash
25-
ado completion zsh > "${fpath[1]}/_ado" # zsh
26-
ado completion fish | source # fish
27-
ado completion powershell | Out-String | Invoke-Expression # pwsh
28-
29-
The shell is a positional argument (not `-s`, which is the
30-
global short for `--server`). Defaults to `bash` when no
31-
argument is given. Use `-w PATH` to write the script to a
32-
file instead of stdout (e.g. for system fpath installation).
3326
- **`ado prs comments add`** for adding/replying to PR review comments.
3427
Three modes:
3528
* General thread: `ado prs comments add PROJ REPO PR --content "LGTM!"`
3629
* Inline (file/line): `ado prs comments add PROJ REPO PR --content "use a guard clause" --file-path src/foo.ex --line 42`
3730
* Reply to existing thread: `ado prs comments add PROJ REPO PR --content "fixed in abc123" --thread-id 5`
38-
Supports `--json` for structured output (returns `{ok, thread_id, comment_id}`).
39-
See https://learn.microsoft.com/en-us/rest/azure/devops/git/pull-request-threads
40-
- **`ado prs comments add --status`** to set the new thread's status.
41-
Valid values: `active` (default), `fixed`, `wontFix`, `closed`, `byDesign`.
42-
Invalid values produce a clear error listing the allowed set.
43-
- **`ado prs comments add --content @<file>`** to read comment text from a file
44-
(useful for multi-line comments). Trailing newlines are stripped.
45-
- **`ado prs comments add --content -`** to read comment text from stdin
46-
(also for multi-line). Example: `echo 'first line\nsecond' | ado prs comments add ... --content -`
47-
- **`ado prs comments list --all`** to expand the listing to show full comment
48-
content (no 80-char truncation), file path for inline threads, and
49-
reply markers (e.g. `[11] (reply to 10) bob:`). Default view still shows
50-
thread headers with a preview of each comment.
51-
- **`ado prs comments update`** now supports both content and status
52-
changes. At least one of `--content` or `--status` is required.
31+
Supports `--status` (`active` (default) | `fixed` | `wontFix` |
32+
`closed` | `byDesign`) to set the new thread's status, `--content
33+
@<file>` to read text from a file, and `--content -` to read text
34+
from stdin. Emits `--json` with `{ok, thread_id, comment_id}` on
35+
success. See
36+
<https://learn.microsoft.com/en-us/rest/azure/devops/git/pull-request-threads>.
37+
- **`ado prs comments list --all`** to expand the listing to show
38+
full comment content (no 80-char truncation), file path for inline
39+
threads, and reply markers (e.g. `[11] (reply to 10) bob:`). The
40+
default view still shows thread headers with a preview of each
41+
comment.
42+
- **`ado prs comments update`** with both content and status changes
43+
(at least one of `--content` or `--status` is required):
5344
* `--content "new text"` edits the comment (legacy behavior)
5445
* `--status fixed` changes the thread's resolution state
55-
(active, fixed, wontFix, closed, byDesign)
56-
* Pass both to update in one call
46+
(`active`, `fixed`, `wontFix`, `closed`, `byDesign`)
5747
* `--content @<file>` reads from a file (multi-line friendly)
5848
* `--content -` reads from stdin
5949
* `--resolved-by-me` auto-sets the thread's `resolvedBy` field
@@ -62,53 +52,73 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6252
* `--dry-run` prints the would-be PATCH request(s) as JSON
6353
(method, path, body) and exits without making any network calls
6454
* `--json` emits a structured envelope
55+
- **`ado completion`** for generating shell completion scripts.
56+
Supports bash, zsh, fish, and PowerShell. The generated script
57+
is static (regenerate it when ado upgrades) and always in sync
58+
with the CliMate command tree.
6559

66-
- **`ado prs comments add`** for adding/replying to PR review comments.
67-
Three modes:
68-
* General thread: `ado prs comments add PROJ REPO PR --content "LGTM!"`
69-
* Inline (file/line): `ado prs comments add PROJ REPO PR --content "use a guard clause" --file-path src/foo.ex --line 42`
70-
* Reply to existing thread: `ado prs comments add PROJ REPO PR --content "fixed in abc123" --thread-id 5`
71-
Supports `--json` for structured output (returns `{ok, thread_id, comment_id}`).
72-
See https://learn.microsoft.com/en-us/rest/azure/devops/git/pull-request-threads
73-
- **`ado prs comments add --status`** to set the new thread's status.
74-
Valid values: `active` (default), `fixed`, `wontFix`, `closed`, `byDesign`.
75-
Invalid values produce a clear error listing the allowed set.
76-
- **`ado prs comments add --content @<file>`** to read comment text from a file
77-
(useful for multi-line comments). Trailing newlines are stripped.
78-
- **`ado prs comments add --content -`** to read comment text from stdin
79-
(also for multi-line). Example: `echo 'first line\nsecond' | ado prs comments add ... --content -`
80-
- **`ado prs comments list --all`** to expand the listing to show full comment
81-
content (no 80-char truncation), file path for inline threads, and
82-
reply markers (e.g. `[11] (reply to 10) bob:`). Default view still shows
83-
thread headers with a preview of each comment.
84-
- **`ado prs comments update`** now supports both content and status
85-
changes. At least one of `--content` or `--status` is required.
86-
* `--content "new text"` edits the comment (legacy behavior)
87-
* `--status fixed` changes the thread's resolution state
88-
(active, fixed, wontFix, closed, byDesign)
89-
* Pass both to update in one call
90-
* `--content @<file>` reads from a file (multi-line friendly)
91-
* `--content -` reads from stdin
92-
* `--resolved-by-me` auto-sets the thread's `resolvedBy` field
93-
to the authenticated user's GUID (fetches it from
94-
`/_apis/connectionData`, cached for the command's lifetime)
95-
* `--dry-run` prints the would-be PATCH request(s) as JSON
96-
(method, path, body) and exits without making any network calls
97-
* `--json` emits a structured envelope
98-
- **`ado version` subcommand and `--version` flag** for the next release.
99-
- `ado version` — prints `ado 0.2.0` (plain text) or `{"ok": true, "version": "0.2.0"}` (with `--json`)
100-
- `ado --version` — same output, exits immediately
101-
- `ado -v` still means `--verbose` (no breaking change to existing behavior)
102-
- Resolves the version from `Application.spec/2` (works in dev, escript, and Burrito binaries)
103-
- **New `AdoCli.Version` module** (lib/ado_cli/version.ex) — shared helper for resolving the current version across dev, escript, and Burrito build contexts. Replaces the duplicated `current_version/0` that was previously in `AdoCli.CLI.Schema`.
104-
- **Fixed bug**: `ado schema --json` returned an empty `"version": ""` field when run from the escript. The `AdoCli.Version` module now calls `Application.ensure_loaded/1` to load the bundled `.app` file, so `Application.spec/2` works correctly in escript/Burrito mode (where the app isn't auto-loaded).
105-
106-
### Breaking changes
107-
108-
- **Skill names renamed**: `ado_cli``ado-cli`, `ado_auth``ado-auth`,
109-
`ado_ci``ado-ci`. pi (the AI agent) requires skill names to use only
110-
lowercase `a-z`, `0-9`, and hyphens — underscores are rejected with a
111-
"name contains invalid characters" warning. Updated:
60+
eval "$(ado completion bash)" # bash
61+
ado completion zsh > "${fpath[1]}/_ado" # zsh
62+
ado completion fish | source # fish
63+
ado completion powershell | Out-String | Invoke-Expression # pwsh
64+
65+
The shell is a positional argument (not `-s`, which is the
66+
global short for `--server`). Defaults to `bash` when no
67+
argument is given. Use `-w PATH` to write the script to a
68+
file instead of stdout (e.g. for system fpath installation).
69+
- **npm postinstall auto-installs shell completion.** When you
70+
`npm install -g @gilbertwong1996/ado`, the postinstall hook
71+
generates the right completion script for your shell and wires
72+
it up (e.g. appends `fpath=($HOME/.zsh/completions $fpath) +
73+
autoload -U compinit && compinit` to `~/.zshrc`, installs to
74+
`~/.local/share/bash-completion/completions/ado` for bash, and
75+
adds a source line to `$PROFILE` for PowerShell). The hook is
76+
idempotent (checks for a marker line) and respects
77+
`ADO_NO_COMPLETION=1` to opt out. Set `ADO_BIN` to override the
78+
binary used during testing. Implementation lives in
79+
`scripts/postinstall.js` (336 LOC, Node.js, cross-platform).
80+
- **`ado version` subcommand and `--version` flag.** `ado version`
81+
prints `ado 0.2.0` (plain text) or `{"ok": true, "version":
82+
"0.2.0"}` with `--json`. `ado --version` prints the same and
83+
exits immediately. `ado -v` still means `--verbose` (no breaking
84+
change to existing behavior). Version resolves from
85+
`Application.spec/2` and works in dev, escript, and Burrito
86+
binaries.
87+
- **`AdoCli.Version` module** (`lib/ado_cli/version.ex`) — shared
88+
helper for resolving the current version across dev, escript,
89+
and Burrito build contexts. Replaces the duplicated
90+
`current_version/0` that was previously in `AdoCli.CLI.Schema`.
91+
- **`AdoCli.Auth.current_user_id/0`** public helper that fetches
92+
and caches the authenticated user's GUID from
93+
`/_apis/connectionData`. Returns `{:ok, guid} | {:error, msg}`.
94+
Used by `ado prs comments update --resolved-by-me` to set the
95+
thread's `resolvedBy.id` without forcing the caller to look it
96+
up first.
97+
98+
### Fixed
99+
100+
- **`ado schema --json` empty `version` field** when run from the
101+
escript. `AdoCli.Version` now calls `Application.ensure_loaded/1`
102+
to load the bundled `.app` file, so `Application.spec/2` works
103+
correctly in escript/Burrito mode (where the app isn't
104+
auto-loaded).
105+
- **npm `package.json` `os`/`cpu` filters** were missing on a
106+
couple of platform packages, so npm would warn on every install.
107+
`scripts/npm-publish.sh` now validates each `package.json` against
108+
the binary inside it before publishing, and refuses to publish
109+
a tarball that doesn't match the manifest.
110+
- **`scripts/npm-publish.sh` JSON parse failure** when the maintainer
111+
ran it without arguments (the script would silently no-op).
112+
Added `set -euo pipefail`, an explicit `VERSION` positional arg,
113+
and a clearer error if `gh release view` can't find the release.
114+
115+
### Changed
116+
117+
- **Skill names renamed**: `ado_cli``ado-cli`, `ado_auth`
118+
`ado-auth`, `ado_ci``ado-ci`. pi (the AI agent) requires skill
119+
names to use only lowercase `a-z`, `0-9`, and hyphens — underscores
120+
are rejected with a "name contains invalid characters" warning.
121+
Updated:
112122
- Source dirs in `priv/skills/`
113123
- `name:` field in each `SKILL.md` frontmatter
114124
- `@skills` embedded map (skill keys)
@@ -124,12 +134,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
124134
rm -rf ~/.codex/skills/ado_{cli,auth,ci}
125135
ado skills install
126136
```
137+
- **`AdoCli.CLI.Skills` refactored.** `resolve_target_dirs/3` is now
138+
public so tests can assert on the install layout without mocking
139+
`File.cwd/0`. `--target copilot` and `--target codex` now share a
140+
common path resolver, eliminating ~40 lines of duplication.
141+
- **Code style cleanup: 25 outstanding Credo `--strict` issues
142+
fixed** across `lib/ado_cli/auth.ex`,
143+
`lib/ado_cli/cli/completion.ex`, `lib/ado_cli/cli/pull_requests.ex`,
144+
and `test/ado_cli/cli/pull_requests_test.exs`. Notable refactors:
145+
* `Completion.generate/2` split into a `dispatch/2` clause
146+
group keyed on shell name (cyclomatic complexity 9 → 5).
147+
* `PullRequests.update_comment/1` extracted `update_flags/1`
148+
and `resolve_inputs/2` (cyclomatic complexity 9 → 4).
149+
* `PullRequests.do_real_update/6` extracted `patch_only/4`
150+
(cyclomatic complexity 9 → 5).
151+
* `length(list) == 1``match?([_], list)` in tests
152+
(LengthComparison warning).
153+
Result: `786 mods/funs, 0 credo issues`.
127154

128-
Or with one command per target:
129-
```bash
130-
ado skills install --target pi # creates ~/.pi/agent/skills/ado-{cli,auth,ci}/
131-
ado skills install --target claude # creates ~/.claude/skills/ado-{cli,auth,ci}/
132-
```
155+
### Notes
156+
157+
- All 311 Elixir tests pass. `mix format --check-formatted` is clean.
158+
- ExUnit test count grew from 234 (v0.1.0) to 311 (v0.2.0) — the
159+
+77 tests cover the new `prs comments`, `prs diff`, `completion`,
160+
and `version` subcommands.
161+
- The npm postinstall hook ships 5 unit tests in
162+
`scripts/test_postinstall.js`, run with `node --test`.
133163

134164
## [0.1.0] - 2026-06-15
135165

@@ -236,5 +266,6 @@ the embedded skills can be installed into any LLM agent's skill directory.
236266
are filtered by the `mix ci.dialyzer` task.
237267
- ExUnit test count: 234 (across 30+ test files). All pass.
238268

239-
[Unreleased]: https://github.com/gilbertwong96/ado_cli/compare/v0.1.0...HEAD
269+
[Unreleased]: https://github.com/gilbertwong96/ado_cli/compare/v0.2.0...HEAD
270+
[0.2.0]: https://github.com/gilbertwong96/ado_cli/compare/v0.1.0...v0.2.0
240271
[0.1.0]: https://github.com/gilbertwong96/ado_cli/releases/tag/v0.1.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ before they go public.
685685

686686
```bash
687687
# 1. Bump version in mix.exs, commit, tag
688-
$EDITOR mix.exs # bump version: "0.1.0" -> "0.2.0"
688+
$EDITOR mix.exs # bump version: "0.2.0" -> "0.3.0"
689689
git add -u && git commit -m "v0.2.0"
690690
git tag -a v0.2.0 -m "Release 0.2.0"
691691
git push github main v0.2.0

github-page/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ <h2>Other install methods</h2>
227227
<div class="card">
228228
<h3>📥 Download binary</h3>
229229
<p>Grab the platform-specific binary and put it on your <code>$PATH</code>.</p>
230-
<pre><code>curl -L -o ado https://github.com/gilbertwong96/ado_cli/releases/latest/download/ado-0.1.0-macos-aarch64
230+
<pre><code>curl -L -o ado https://github.com/gilbertwong96/ado_cli/releases/latest/download/ado-0.2.0-macos-aarch64
231231
chmod +x ado &amp;&amp; sudo mv ado /usr/local/bin/</code></pre>
232-
<p class="hint">Replace <code>ado-0.1.0-macos-aarch64</code> with the binary for your platform (see the <a href="https://github.com/gilbertwong96/ado_cli/releases/latest">release page</a>).</p>
232+
<p class="hint">Replace <code>ado-0.2.0-macos-aarch64</code> with the binary for your platform (see the <a href="https://github.com/gilbertwong96/ado_cli/releases/latest">release page</a>).</p>
233233
</div>
234234
<div class="card">
235235
<h3>🔨 Build from source</h3>

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule AdoCli.MixProject do
44
def project do
55
[
66
app: :ado_cli,
7-
version: "0.1.0",
7+
version: "0.2.0",
88
elixir: "~> 1.20",
99
start_permanent: Mix.env() == :prod,
1010
deps: deps(),

0 commit comments

Comments
 (0)