@orderful/droid 0.42.1 → 0.43.0

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.
@@ -0,0 +1,83 @@
1
+ # Release Templates
2
+
3
+ Slack mrkdwn and PR body templates for release notifications.
4
+
5
+ ## Slack Messages
6
+
7
+ All Slack messages are posted via `droid integrations slack post`. Format as Slack mrkdwn (not GitHub markdown).
8
+
9
+ ### Release Started
10
+
11
+ ```
12
+ :rocket: *Release started — {repo_name}*
13
+
14
+ *Risk:* {risk_emoji} {risk_level}
15
+ *PR:* <{pr_url}|#{pr_number}>
16
+ *Branch:* `{release_branch}` → `{production_branch}`
17
+
18
+ {pr_summary}
19
+
20
+ Posted with :droid:
21
+ ```
22
+
23
+ Risk emojis:
24
+ - Low Risk: `:large_green_circle:`
25
+ - High Risk: `:warning:`
26
+
27
+ ### Release Complete
28
+
29
+ ```
30
+ :white_check_mark: *Release complete — {repo_name}*
31
+
32
+ *PR:* <{pr_url}|#{pr_number}>
33
+ *Branch:* `{release_branch}` → `{production_branch}`
34
+
35
+ Posted with :droid:
36
+ ```
37
+
38
+ ---
39
+
40
+ ## Release PR Body
41
+
42
+ Used when creating the release PR via `gh pr create --body`.
43
+
44
+ ```markdown
45
+ ### {repo_name} Release
46
+
47
+ **Risk:** [{risk_level}]
48
+
49
+ **When:** Imminent
50
+
51
+ **PRs included:**
52
+ {pr_list}
53
+
54
+ ---
55
+
56
+ Created with :robot: [droid](https://github.com/Orderful/droid)
57
+ ```
58
+
59
+ Where `{pr_list}` is a bulleted list of merged PRs:
60
+ ```markdown
61
+ - #{number} {title} (@{author})
62
+ - #{number} {title} (@{author})
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Terminal Fallback
68
+
69
+ When Slack is not configured, print a plain-text version to terminal:
70
+
71
+ ### Release Started (terminal)
72
+ ```
73
+ Release started — {repo_name}
74
+ Risk: {risk_level}
75
+ PR: {pr_url}
76
+ Branch: {release_branch} -> {production_branch}
77
+ ```
78
+
79
+ ### Release Complete (terminal)
80
+ ```
81
+ Release complete — {repo_name}
82
+ PR: {pr_url}
83
+ ```
@@ -0,0 +1,129 @@
1
+ # Release Workflows
2
+
3
+ Detailed step-by-step procedures for each `/release` subcommand. All commands use `gh` CLI directly.
4
+
5
+ ## Common Setup (every command)
6
+
7
+ ```bash
8
+ # 1. Read config
9
+ SLACK_CHANNEL=$(droid config --get tools.release.slack_channel)
10
+ # Default to #release-management if not set
11
+ SLACK_CHANNEL="${SLACK_CHANNEL:-#release-management}"
12
+
13
+ # 2. Get repos and filter for release repos (those with release_branch set)
14
+ droid config --get repos
15
+ # Parse JSON output — release repos have release_branch defined
16
+ ```
17
+
18
+ Detect repo from cwd or ask user. Extract `release_branch`, `production_branch` (default: `master`), and the GitHub `owner/repo` slug from the repo's remote.
19
+
20
+ ```bash
21
+ # Get owner/repo from git remote
22
+ git -C {repo_path} remote get-url origin
23
+ # Parse to extract owner/repo (e.g., "Orderful/orderful-workspace")
24
+ ```
25
+
26
+ ---
27
+
28
+ ## `/release start [repo]`
29
+
30
+ Create a release PR and notify Slack.
31
+
32
+ ### Steps
33
+
34
+ 1. **Detect repo** — match cwd or ask user to pick from release repos
35
+
36
+ 2. **Check for existing release PR:**
37
+ ```bash
38
+ gh pr list --search "[RELEASE]" --state open --base {production_branch} --head {release_branch} --json number,title,url --repo {owner}/{repo}
39
+ ```
40
+ If one exists, show it and ask: "A release PR already exists. Open it instead?"
41
+
42
+ 3. **Generate release notes** — list PRs merged to the release branch since last release:
43
+ ```bash
44
+ gh pr list --base {release_branch} --state merged --json number,title,author --limit 50 --repo {owner}/{repo}
45
+ ```
46
+ Format as a bulleted list for the PR body.
47
+
48
+ 4. **Ask risk level** — use AskUserQuestion:
49
+ - Low Risk (routine release, no breaking changes)
50
+ - High Risk (breaking changes, data migrations, or high-traffic feature)
51
+
52
+ 5. **Create the release PR:**
53
+ ```bash
54
+ gh pr create \
55
+ --base {production_branch} \
56
+ --head {release_branch} \
57
+ --title "[RELEASE] {repo_name}" \
58
+ --label "READY" \
59
+ --body "{release_pr_body}" \
60
+ --repo {owner}/{repo}
61
+ ```
62
+ See `templates.md` for the PR body template.
63
+
64
+ 6. **Post to Slack:**
65
+ ```bash
66
+ node -e 'process.stdout.write(JSON.stringify({
67
+ channel: "{slack_channel}",
68
+ text: "{slack_message}",
69
+ unfurl_links: false
70
+ }))' | droid integrations slack post
71
+ ```
72
+ See `templates.md` for the Slack message template (release started).
73
+
74
+ 7. **Confirm to user** — show PR URL and Slack post confirmation.
75
+
76
+ ---
77
+
78
+ ## `/release status`
79
+
80
+ Check release status across all configured release repos.
81
+
82
+ ### Steps
83
+
84
+ 1. **Get all release repos** from config
85
+
86
+ 2. **For each release repo**, gather:
87
+
88
+ **Open release PRs:**
89
+ ```bash
90
+ gh pr list --search "[RELEASE]" --state open --json number,title,url,statusCheckRollup --repo {owner}/{repo}
91
+ ```
92
+
93
+ 3. **Format and display** as a summary:
94
+
95
+ ```
96
+ {repo_name}
97
+ Release PR: #{number} — {CI status} (green/pending/failing)
98
+ ```
99
+
100
+ If no open release PR: "No active release"
101
+ If no release repos configured: "No release repos configured"
102
+
103
+ ---
104
+
105
+ ## `/release complete [repo]`
106
+
107
+ Close out a release — notify Slack.
108
+
109
+ ### Steps
110
+
111
+ 1. **Detect repo** — match cwd or ask user
112
+
113
+ 2. **Find the release PR:**
114
+ ```bash
115
+ # Check merged first
116
+ gh pr list --search "[RELEASE]" --state merged --base {production_branch} --head {release_branch} --json number,title,url,mergedAt --limit 1 --repo {owner}/{repo}
117
+ ```
118
+ If no merged PR found, check open:
119
+ ```bash
120
+ gh pr list --search "[RELEASE]" --state open --base {production_branch} --head {release_branch} --json number,title,url --repo {owner}/{repo}
121
+ ```
122
+ - If PR is still open (not merged): warn "Release PR #{number} is still open. Merge it first, or complete anyway?"
123
+ - If no PR found at all: warn "No release PR found. Post completion anyway?"
124
+
125
+ 3. **Post to Slack** — release complete notification (see `templates.md`).
126
+
127
+ 4. **Confirm to user:**
128
+ - "Release complete for `{repo_name}`"
129
+ - Show Slack message confirmation