Skip to content

Commit b4c8eb4

Browse files
Docs/issues README review and GemDocs links (#30)
* Adds dynamic (version-specific) URLs for GemDocs documentation links. * Cleans up numerous typos. * Fixes markup syntax errors. * Removes literals from reference term listings. * Clarifies --tags usage.
1 parent a88dbb3 commit b4c8eb4

3 files changed

Lines changed: 73 additions & 47 deletions

File tree

README.adoc

Lines changed: 70 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
:toclevels: 3
44
:this_prod_vrsn: 0.2.0
55
:next_prod_vrsn: 0.3.0
6-
:docker_base_command: docker run -it --rm -v $(pwd):/workdir -e GITHUB_TOKEN=$ISSUER_API_TOKEN docopslab/issuer
6+
:docker_base_command: docker run -it --rm -v $(pwd):/workdir -e ISSUER_API_TOKEN=$GITHUB_TOKEN docopslab/issuer
77
:append_or_impose: Prepend items with `+` to indicate they should be appended to existing labels. Items without `+` will only be used for issues with no `tags` designated.
88
ifdef::env-github[]
99
:icons: font
@@ -22,7 +22,7 @@ _Issuer_ lets you define all your work tickets in one place as YAML, apply defau
2222
* *Configurable defaults* and label application
2323
* *Environment variable support* for authentication
2424
* *Issue validation* with helpful error messages
25-
* *GitHub API integration* via Octokit
25+
* *GitHub API integration*
2626

2727
Future plans include extending this capability to *Jira*, *GitLab* Issues, GitHub *Projects*, and other services.
2828

@@ -57,15 +57,18 @@ With Docker installed and running...
5757
For actual issue creation, use something like:
5858

5959
[.prompt,subs=+attributes]
60-
{docker_base_command} your-issues.yml --dry
60+
{docker_base_command} your-issues.yml
6161

6262
The above command:
6363

6464
* mounts your local directory to be readable by the Docker container
65-
* passes your GitHub access token environment variable into the container (`$ISSUER_API_TOKEN` could be `$ISSER_GITHUB_TOKEN`, `$GITHUB_ACCESS_TOKEN`, or `$GITHUB_TOKEN`).
65+
* passes your GitHub access token environment variable into the container (`$ISSUER_API_TOKEN` could be `$ISSUER_GITHUB_TOKEN`, `$GITHUB_ACCESS_TOKEN`, or `$GITHUB_TOKEN`).
66+
* connects to GitHub and creates issue entries one at a time from `your-issues.yml`
6667

6768
Everything after `docopslab/issuer` accepts the standard arguments and options of the issuer CLI.
6869

70+
See <<usage>> for more.
71+
6972
[[docker-alias]]
7073
==== Alias the Docker Command
7174

@@ -82,7 +85,7 @@ Reload your shell configuration for the alias to take effect:
8285

8386
=== For Ruby Users
8487

85-
If you have Ruby on your workstation, there are two common ways to install thi gem.
88+
If you have Ruby on your workstation, there are two common ways to install this gem.
8689

8790
==== Global Installation
8891

@@ -91,7 +94,7 @@ If you have Ruby on your workstation, there are two common ways to install thi g
9194

9295
Then you can use the `issuer` command from anywhere in your system.
9396

94-
==== Local/Applicaition Installation
97+
==== Local/Application Installation
9598

9699
Add this line to your Gemfile:
97100

@@ -106,14 +109,14 @@ And then execute:
106109

107110
Now you can use `bundle exec issuer` to perform operations inside the project directory.
108111

109-
112+
[[usage]]
110113
== Usage
111114

112115
Once installed, you can start using `issuer` to create issues in GitHub.
113116

114117
=== Quickstart Overview
115118

116-
The following steps assume the gem is either installed globally or `issuer` is <<docker-alias,established as an alias>>.
119+
The following steps assume the gem is either installed globally or `issuer` is <<docker-alias,established as an alias>> (Docker method).
117120
For Ruby Bundler usage, prepend `bundle exec ` and for un-aliased Docker usage, prepend `{docker_base_command}`.
118121

119122
. Prepare your issue definitions in an IMYML file (see <<imyml-format,examples and docs>> below).
@@ -122,7 +125,7 @@ For Ruby Bundler usage, prepend `bundle exec ` and for un-aliased Docker usage,
122125
+
123126
issuer example.yml --dry
124127

125-
. Establish a Personal Access Token for GitHub (see <<authentication,Authentication>> below).
128+
. Establish a Personal Access Token for GitHub and store it as an environment variable (see <<authentication>> below).
126129

127130
. Post issues to GitHub:
128131
+
@@ -170,7 +173,7 @@ issues: # block for listing issues to post to cloud
170173
# This is the default text that will appear if an issue record is a _stub_ and no `body` field is designated.
171174
# ---
172175
# This issue was automatically generated by issuer.
173-
- summ: Documentaton issue
176+
- summ: Documentation issue
174177
tags: [-needs:docs] # skip the default needs:docs label
175178
----
176179

@@ -207,93 +210,95 @@ The IMYML format will be standardized and formally specified in a future release
207210
[[imyml-ref]]
208211
==== IMYML Properties Reference
209212

210-
`$meta`::
213+
$meta::
211214
Optional block for establishing operation-wide modes and settings.
212215

213-
`$meta.proj`:::
216+
$meta.proj:::
214217
(String)
215218
Designates the target project/repository.
216219

217-
`$meta.defaults`:::
218-
Designates the default values to use for any issue record that does not specify a value for a given property.
220+
$meta.defaults:::
221+
Properties in this block establish the default values to be used for any issue record that does not specify a value for the given property.
219222

220-
`$meta.defaults.vrsn`::::
223+
$meta.defaults.vrsn::::
221224
(String)
222225
Sets default version or milestone for all issues.
223226

224-
`$meta.defaults.user`::::
227+
$meta.defaults.user::::
225228
(String)
226229
Sets default assignee (GitHub username).
227230

228-
`$meta.defaults.type`::::
231+
$meta.defaults.type::::
229232
(String)
230233
Sets default issue type to apply to all issues when no `type` property is specified in the issue record.
231234

232-
`$meta.defaults.tags`::::
235+
$meta.defaults.tags::::
233236
(Array):
234237
Labels to append to issues (comma-separated).
235238
{append_or_impose}
236239

237-
`$meta.defaults.stub`::::
240+
$meta.defaults.stub::::
238241
(Boolean)
239242
Establishes the state whether to insert stub texts (`body` / `head` / `tail`).
240243

241-
`$meta.defaults.body`::::
244+
$meta.defaults.body::::
242245
(String)
243246
Sets default body text to apply to all issues when no `body` property is specified in the issue record.
244247

245-
`$meta.defaults.head`::::
248+
$meta.defaults.head::::
246249
(String)
247250
Sets default text to insert before the body of all issues for which `stub`.
248251

249-
`$meta.defaults.tail`::::
252+
$meta.defaults.tail::::
250253
(String)
251254
Sets default text to insert after the body of all issues for which `stub`.
252255

253-
`issues`::
254-
(Array) Tabular listing of issue records as Array itmes.
256+
issues::
257+
(Array)
258+
Tabular listing of *issue records* as Array items.
255259
If an item is Scalar (not a Map with named keys), the value must be a String and it will be treated as the `summ` (summary/title) property.
256260
+
257261
Otherwise, any `issues` Array items must be Map-formatted "`dictionaries`" with the following properties:
258262

259-
`summ`:::
263+
summ:::
260264
(String, *required*)
261265
A one-line title or summary of the issue.
262266

263-
`body`:::
267+
body:::
264268
(String)
265269
The main body or description text for the issue.
266270
Defaults to `$meta.defaults.body` if `stub == true` for the record, in which case, upon submission, will also incorporate any values for `$meta.defaults.head` and `$meta.defaults.tail`.
267271

268-
`vrsn`:::
272+
vrsn:::
269273
(String)
270274
The milestone associated with the issue.
271275
+
272276
Defaults to `$meta.defaults.vrsn` or else `null`.
273277

274-
`type`:::
278+
type:::
275279
(String)
276280
The type of issue, which must already be registered in the target project or repository.
277281
Defaults to `$meta.defaults.type` or else `null`.
278282

279-
`tags`:::
283+
tags:::
280284
(Array of Strings)
281285
A listing of specific labels to assign to the issue.
282286
+
283287
Supports special prefix notation for label management:
284288
+
285-
* Regular labels (e.g., `bug`, `priority:high`) are applied based on default tag logic
286-
* Append labels (e.g., `+urgent`) are always applied to all issues
287-
* Removal labels (e.g., `-needs:docs`) remove the specified label from the default/appended labels list
289+
* Regular labels (example: `bug`, `priority:high`) are applied based on default tag logic
290+
* Append labels (example: `+urgent`) are always applied to all issues
291+
* Removal labels (example: `-needs:docs`) remove the specified label from the default/appended labels list
288292
+
289293
Example: `tags: [documentation, +critical, -needs:review]` would add `documentation` and `critical` labels while removing any `needs:review` label from defaults.
290294

291-
`user`:::
295+
user:::
292296
(String)
293297
The system username of the person or bot to which the ticket is assigned.
294298

295-
`stub [true+++*+++|false]`:::
299+
stub:::
296300
(Boolean)
301+
Accepts `true` or `false`.
297302
Whether to treat the issue as a stub entry, meaning prepend any `$meta.defaults.head` text or append any `$meta.defaults.tail` text, and in case the ticket has no `body` property, insert the text of `$meta.defaults.body`.
298303

299304
[[cli-usage]]
@@ -326,21 +331,21 @@ IMYML file path (alternative to positional argument).
326331
The target project (org/repo or user/repo format for GitHub).
327332

328333
--vrsn _VERSION_::
329-
Argues default milestone for all issues.
334+
Sets default milestone for all issues.
330335

331336
--user _USERNAME_::
332-
Argues default assignee (GitHub username).
337+
Sets default assignee (GitHub username).
333338

334339
--tags _TAG_[,_TAG_]::
335-
Argues labels to impose or add issues (comma-separated).
340+
Sets labels to apply to issues (comma-separated).
336341
{append_or_impose}
337342

338343
--stub [_true_+++*+++|_false_]::
339344
Whether to treat all issues as stubs, meaning prepend any `$meta.defaults.head` text or append any `$meta.defaults.tail` text, and in case the ticket has no `body` property, insert the text of `$meta.defaults.body`.
340345

341346
==== Mode Options
342347

343-
--dry::
348+
--dry, --dry-run::
344349
Dry-run: print actions but do not post to GitHub.
345350

346351
--auto-versions, --auto-milestones::
@@ -352,7 +357,7 @@ Automatically create missing labels/tags without prompting for confirmation.
352357
--auto-metadata::
353358
Automatically create all missing metadata (milestones and labels) without prompting for confirmation. Equivalent to using both `--auto-versions` and `--auto-tags`.
354359

355-
--help::
360+
--help, -h::
356361
Prints the usage screen.
357362

358363
--version::
@@ -373,14 +378,21 @@ The application will check for environment variables in the following order:
373378
To *create and set a token*:
374379

375380
. In the GitHub Web interface, go to *Settings* (under your user icon) → *Developer Settings* (bottom of left menu) → *Personal Access Tokens* → *Fine-grained tokens*.
376-
. Generate a new token with access to *All repositoriess* or any *Select repositories* you wish to post to, and include read/write permissions GitHub Issues (under *Repository permissions*).
381+
. Generate a new token with access to *All repositories* or any *Select repositories* you wish to post to, and include read/write permissions GitHub Issues (under *Repository permissions*).
377382
. Copy the token and set it as an environment variable.
378383
+
379384
.Example
380385
export ISSUER_API_TOKEN=github_pat_xxxxxxxxxxxxxxxxxxxxxxxx
381386
+
382387
Where `github_pat_xxxxxxxxxxxxxxxxxxxxxxxx` is your actual token.
383388

389+
If your GitHub token is stored under *any other name*, you can alias it inline by prepending to your `issuer` command.
390+
For example:
391+
392+
ISSUER_API_TOKEN=$MY_GITHUB_API_KEY issuer my-issues.yml
393+
394+
When using Docker, you can pass any such key into the container this way, using the `-e` option: `-e ISSUER_API_TOKEN=$MY_GITHUB_API_KEY`.
395+
384396

385397
== Advanced Usage
386398

@@ -449,7 +461,7 @@ I will probably adapt the API to other systems in future releases, and I welcome
449461

450462
=== Methodology Confession
451463

452-
I should note up front that this is the closest I have come to "`vibe coding`" anything bigger than a local script, let alone a shippable production code.
464+
I should note up front that this is the closest I have come to "`vibe coding`" anything bigger than a local script, let alone shippable production code.
453465
Nevertheless, I intervened to make substantial and specific changes at least 100 times, and I rearranged major aspects of the codebase.
454466

455467
I designed the IMYML format and the CLI up front, then I let Claud 4 (via GH Copilot) draft most of the code.
@@ -504,10 +516,10 @@ bundle exec rspec --pattern "*ops*"
504516

505517
The `pr_test` task runs the exact same tests that GitHub Actions runs for pull requests:
506518

507-
* **RSpec Tests**: All unit tests (`bundle exec rake spec`)
508-
* **CLI Tests**: Command-line interface functionality tests
509-
* **YAML Validation**: Validates all example YAML files
510-
* **Documentation Quality**: Vale linting on all documentation files
519+
* *RSpec Tests*: All unit tests (`bundle exec rake spec`)
520+
* *CLI Tests*: Command-line interface functionality tests
521+
* *YAML Validation*: Validates all example YAML files
522+
* *Documentation Quality*: Vale linting on all documentation files
511523

512524
This ensures you can validate your changes locally before pushing to GitHub.
513525

@@ -553,6 +565,19 @@ The GitHub API test suite validates:
553565
* Automation flags (`--auto-metadata`, `--auto-versions`, etc.)
554566
* Error handling and edge cases
555567

568+
=== API Reference
569+
570+
For detailed API documentation, see the automatically generated documentation at https://gemdocs.org/gems/issuer/{this_prod_vrsn}[GemDocs].
571+
572+
The API reference includes:
573+
574+
* Complete class and method documentation
575+
* Method signatures and parameters
576+
* Return types and examples
577+
* Internal implementation details
578+
579+
This documentation is automatically updated with each gem release.
580+
556581
[[contributing]]
557582
=== Contributing
558583

issuer.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Gem::Specification.new do |spec|
1515
spec.metadata["homepage_uri"] = spec.homepage
1616
spec.metadata["source_code_uri"] = "https://github.com/DocOps/issuer"
1717
spec.metadata["changelog_uri"] = "https://github.com/DocOps/issuer/blob/main/CHANGELOG.md"
18+
spec.metadata["documentation_uri"] = "https://gemdocs.org/gems/issuer/#{Issuer::VERSION}"
1819

1920
# Specify which files should be added to the gem when it is released.
2021
spec.files = Dir['lib/**/*.rb'] +

lib/issuer/cli.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def self.exit_on_failure?
1515
class_option :proj, type: :string, desc: 'Override $meta.proj (org/repo)'
1616
class_option :vrsn, type: :string, desc: 'Default version for all issues'
1717
class_option :user, type: :string, desc: 'Default assignee (GitHub username)'
18-
class_option :tags, type: :string, desc: 'Comma-separated extra labels for all issues'
18+
class_option :tags, type: :string, desc: 'Comma-separated default or appended (+) labels for all issues'
1919
class_option :stub, type: :boolean, desc: 'Enable stub mode for all issues'
2020
class_option :dry, type: :boolean, default: false, aliases: ['--dry-run'], desc: 'Print issues, don\'t post'
2121
class_option :tokenv, type: :string, desc: 'Name of environment variable containing GitHub token'
@@ -167,7 +167,7 @@ def self.show_help
167167
Issue Default Options:
168168
--vrsn VERSION #{self.class_options[:vrsn].description}
169169
--user USERNAME #{self.class_options[:user].description}
170-
--tags tag1,tag2 #{self.class_options[:tags].description}
170+
--tags tag1,+tag2 #{self.class_options[:tags].description}
171171
--stub #{self.class_options[:stub].description}
172172
173173
Site Options:

0 commit comments

Comments
 (0)