issuer 0.1.0 ā 0.2.1
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.
- checksums.yaml +4 -4
- data/README.adoc +150 -53
- data/examples/basic-example.yml +3 -0
- data/examples/new-project-issues.yml +3 -0
- data/examples/tag-removal-example.yml +41 -0
- data/examples/validation-test.yml +2 -0
- data/issuer.gemspec +6 -9
- data/lib/issuer/apis/github/client.rb +183 -3
- data/lib/issuer/cache.rb +13 -13
- data/lib/issuer/cli.rb +8 -10
- data/lib/issuer/issue.rb +119 -34
- data/lib/issuer/sites/base.rb +2 -1
- data/lib/issuer/sites/github.rb +56 -15
- data/lib/issuer.rb +6 -6
- metadata +4 -36
- data/.rspec +0 -3
- data/.vale/config/vocabularies/issuer/accept.txt +0 -63
- data/.vale/config/vocabularies/issuer/reject.txt +0 -21
- data/.vale.ini +0 -42
- data/Dockerfile +0 -43
- data/Rakefile +0 -70
- data/bin/console +0 -0
- data/bin/issuer +0 -13
- data/bin/setup +0 -0
- data/examples/README.adoc +0 -56
- data/scripts/build.sh +0 -40
- data/scripts/lint-docs.sh +0 -64
- data/scripts/manage-runs.rb +0 -175
- data/scripts/pre-commit-template.sh +0 -54
- data/scripts/publish.sh +0 -92
- data/scripts/setup-vale.sh +0 -59
- data/specs/tests/README.adoc +0 -451
- data/specs/tests/check-github-connectivity.sh +0 -130
- data/specs/tests/cleanup-github-tests.sh +0 -374
- data/specs/tests/github-api/01-auth-connection.yml +0 -21
- data/specs/tests/github-api/02-basic-issues.yml +0 -90
- data/specs/tests/github-api/03-milestone-tests.yml +0 -58
- data/specs/tests/github-api/04-label-tests.yml +0 -98
- data/specs/tests/github-api/05-assignment-tests.yml +0 -55
- data/specs/tests/github-api/06-automation-tests.yml +0 -102
- data/specs/tests/github-api/07-error-tests.yml +0 -29
- data/specs/tests/github-api/08-complex-tests.yml +0 -197
- data/specs/tests/github-api/config.yml.example +0 -17
- data/specs/tests/rspec/cli_spec.rb +0 -127
- data/specs/tests/rspec/issue_spec.rb +0 -184
- data/specs/tests/rspec/issuer_spec.rb +0 -5
- data/specs/tests/rspec/ops_spec.rb +0 -124
- data/specs/tests/rspec/spec_helper.rb +0 -54
- data/specs/tests/run-github-api-tests.sh +0 -424
data/lib/issuer/sites/github.rb
CHANGED
@@ -2,16 +2,20 @@
|
|
2
2
|
|
3
3
|
require 'octokit'
|
4
4
|
require_relative 'base'
|
5
|
+
require_relative '../apis/github/client'
|
5
6
|
|
6
7
|
module Issuer
|
7
8
|
module Sites
|
8
9
|
class GitHub < Base
|
9
10
|
def initialize token: nil, token_env_var: nil
|
10
11
|
@token = token || self.class.detect_github_token(custom_env_var: token_env_var)
|
12
|
+
@milestone_cache = {} # Cache for milestones by project
|
13
|
+
@label_cache = {} # Cache for labels by project
|
11
14
|
|
12
15
|
# Skip authentication validation for dry-run mode
|
13
16
|
if @token == 'dry-run-token'
|
14
17
|
@client = nil
|
18
|
+
@octokit_client = nil
|
15
19
|
return
|
16
20
|
end
|
17
21
|
|
@@ -20,8 +24,11 @@ module Issuer
|
|
20
24
|
raise Issuer::Error, "GitHub token not found. Set #{env_vars.join(', ')} environment variable."
|
21
25
|
end
|
22
26
|
|
23
|
-
|
24
|
-
@client
|
27
|
+
# Create our enhanced API client that supports GraphQL
|
28
|
+
@client = Issuer::APIs::GitHub::Client.new(token: @token)
|
29
|
+
# Keep the Octokit client for non-issue operations
|
30
|
+
@octokit_client = Octokit::Client.new(access_token: @token)
|
31
|
+
@octokit_client.auto_paginate = true
|
25
32
|
end
|
26
33
|
|
27
34
|
def site_name
|
@@ -39,6 +46,7 @@ module Issuer
|
|
39
46
|
milestone: 'milestone', # site_params[:milestone] displays as "milestone:"
|
40
47
|
labels: 'labels', # site_params[:labels] displays as "labels:"
|
41
48
|
assignee: 'assignee', # site_params[:assignee] displays as "assignee:"
|
49
|
+
type: 'type', # site_params[:type] displays as "type:"
|
42
50
|
project_name: 'repo' # For summary messages: "repo: owner/name"
|
43
51
|
}
|
44
52
|
end
|
@@ -71,11 +79,22 @@ module Issuer
|
|
71
79
|
|
72
80
|
# Handle milestone - only if milestone exists
|
73
81
|
if issue_params[:milestone]
|
74
|
-
milestone
|
75
|
-
|
82
|
+
# If milestone is already a number (from convert_issue_to_site_params), use it directly
|
83
|
+
if issue_params[:milestone].is_a?(Integer)
|
84
|
+
params[:milestone] = issue_params[:milestone]
|
85
|
+
else
|
86
|
+
# If it's a string name, look it up
|
87
|
+
milestone = find_milestone(proj, issue_params[:milestone])
|
88
|
+
params[:milestone] = milestone.number if milestone
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# Handle type
|
93
|
+
if issue_params[:type]
|
94
|
+
params[:type] = issue_params[:type]
|
76
95
|
end
|
77
96
|
|
78
|
-
created_issue = @client.create_issue(proj, params
|
97
|
+
created_issue = @client.create_issue(proj, params)
|
79
98
|
|
80
99
|
# Extract relevant data for potential cleanup tracking
|
81
100
|
issue_data = {
|
@@ -93,13 +112,13 @@ module Issuer
|
|
93
112
|
end
|
94
113
|
|
95
114
|
def get_versions proj
|
96
|
-
@
|
115
|
+
@octokit_client.milestones(proj, state: 'all')
|
97
116
|
rescue Octokit::Error => e
|
98
117
|
raise Issuer::Error, "Failed to fetch milestones: #{e.message}"
|
99
118
|
end
|
100
119
|
|
101
120
|
def get_tags proj
|
102
|
-
@
|
121
|
+
@octokit_client.labels(proj)
|
103
122
|
rescue Octokit::Error => e
|
104
123
|
raise Issuer::Error, "Failed to fetch labels: #{e.message}"
|
105
124
|
end
|
@@ -108,7 +127,11 @@ module Issuer
|
|
108
127
|
description = options[:description] || "Created by issuer CLI"
|
109
128
|
|
110
129
|
# Call create_milestone with proper parameters
|
111
|
-
created_milestone = @
|
130
|
+
created_milestone = @octokit_client.create_milestone(proj, version_name, description: description)
|
131
|
+
|
132
|
+
# Add the newly created milestone to our cache for immediate availability
|
133
|
+
@milestone_cache[proj] ||= []
|
134
|
+
@milestone_cache[proj] << created_milestone
|
112
135
|
|
113
136
|
# Return tracking data
|
114
137
|
{
|
@@ -130,7 +153,7 @@ module Issuer
|
|
130
153
|
description = options[:description]
|
131
154
|
|
132
155
|
# Call add_label with proper parameters
|
133
|
-
created_label = @
|
156
|
+
created_label = @octokit_client.add_label(proj, tag_name, color, description: description)
|
134
157
|
|
135
158
|
# Return tracking data
|
136
159
|
{
|
@@ -149,26 +172,26 @@ module Issuer
|
|
149
172
|
|
150
173
|
# Cleanup methods
|
151
174
|
def close_issue proj, issue_number
|
152
|
-
@
|
175
|
+
@octokit_client.close_issue(proj, issue_number)
|
153
176
|
rescue Octokit::Error => e
|
154
177
|
raise Issuer::Error, "Failed to close issue ##{issue_number}: #{e.message}"
|
155
178
|
end
|
156
179
|
|
157
180
|
def delete_milestone proj, milestone_number
|
158
|
-
@
|
181
|
+
@octokit_client.delete_milestone(proj, milestone_number)
|
159
182
|
rescue Octokit::Error => e
|
160
183
|
raise Issuer::Error, "Failed to delete milestone ##{milestone_number}: #{e.message}"
|
161
184
|
end
|
162
185
|
|
163
186
|
def delete_label proj, label_name
|
164
|
-
@
|
187
|
+
@octokit_client.delete_label!(proj, label_name)
|
165
188
|
rescue Octokit::Error => e
|
166
189
|
raise Issuer::Error, "Failed to delete label '#{label_name}': #{e.message}"
|
167
190
|
end
|
168
191
|
|
169
192
|
def validate_configuration
|
170
193
|
# Test API access
|
171
|
-
@
|
194
|
+
@octokit_client.user
|
172
195
|
true
|
173
196
|
rescue Octokit::Error => e
|
174
197
|
raise Issuer::Error, "GitHub authentication failed: #{e.message}"
|
@@ -179,7 +202,7 @@ module Issuer
|
|
179
202
|
end
|
180
203
|
|
181
204
|
# Convert IMYML issue to GitHub-specific parameters
|
182
|
-
def convert_issue_to_site_params issue, proj, dry_run: false
|
205
|
+
def convert_issue_to_site_params issue, proj, dry_run: false, post_validation: false
|
183
206
|
params = {
|
184
207
|
title: issue.summ,
|
185
208
|
body: issue.body || ''
|
@@ -203,10 +226,21 @@ module Issuer
|
|
203
226
|
else
|
204
227
|
# In normal mode, resolve milestone name to number
|
205
228
|
milestone = find_milestone(proj, issue.vrsn)
|
206
|
-
|
229
|
+
if milestone
|
230
|
+
params[:milestone] = milestone.number
|
231
|
+
elsif post_validation
|
232
|
+
# If we're in post-validation mode and milestone still not found,
|
233
|
+
# this indicates a serious problem with the validation flow
|
234
|
+
puts "ā ļø Warning: Milestone '#{issue.vrsn}' not found even after validation for issue '#{issue.summ}'"
|
235
|
+
end
|
207
236
|
end
|
208
237
|
end
|
209
238
|
|
239
|
+
# Handle type
|
240
|
+
if issue.type && !issue.type.strip.empty?
|
241
|
+
params[:type] = issue.type.strip
|
242
|
+
end
|
243
|
+
|
210
244
|
params
|
211
245
|
end
|
212
246
|
|
@@ -240,6 +274,13 @@ module Issuer
|
|
240
274
|
end
|
241
275
|
|
242
276
|
def find_milestone proj, milestone_name
|
277
|
+
# First check newly created milestones in cache
|
278
|
+
if @milestone_cache[proj]
|
279
|
+
cached_milestone = @milestone_cache[proj].find { |m| m.title == milestone_name.to_s }
|
280
|
+
return cached_milestone if cached_milestone
|
281
|
+
end
|
282
|
+
|
283
|
+
# Fall back to API lookup for existing milestones
|
243
284
|
milestones = get_versions(proj)
|
244
285
|
milestones.find { |m| m.title == milestone_name.to_s }
|
245
286
|
end
|
data/lib/issuer.rb
CHANGED
@@ -25,7 +25,7 @@ require_relative "issuer/cli"
|
|
25
25
|
# * Configurable defaults and label application logic
|
26
26
|
# * Environment variable support for authentication
|
27
27
|
# * Issue validation with helpful error messages
|
28
|
-
# * Extensible architecture for multiple platforms (GitHub,
|
28
|
+
# * Extensible architecture for multiple platforms (GitHub, Jira, GitLab, etc.)
|
29
29
|
# * Run logging and artifact tracking for cleanup operations
|
30
30
|
#
|
31
31
|
# == Quick Start
|
@@ -81,7 +81,7 @@ module Issuer
|
|
81
81
|
# @param site [Issuer::Sites::Base, nil] Custom site adapter. If nil, will auto-detect.
|
82
82
|
# @param cache [Boolean] Whether to enable run tracking and caching (default: true)
|
83
83
|
#
|
84
|
-
def initialize
|
84
|
+
def initialize site: nil, cache: true
|
85
85
|
@site = site
|
86
86
|
@cache_enabled = cache
|
87
87
|
end
|
@@ -107,7 +107,7 @@ module Issuer
|
|
107
107
|
# automation_options: { auto_metadata: true })
|
108
108
|
# puts "Created #{results[:issues_created]} issues"
|
109
109
|
#
|
110
|
-
def process_file
|
110
|
+
def process_file file_path, proj: nil, dry_run: false, automation_options: {}
|
111
111
|
require 'yaml'
|
112
112
|
|
113
113
|
unless File.exist?(file_path)
|
@@ -134,7 +134,7 @@ module Issuer
|
|
134
134
|
# @return [Hash] Results including created issues, milestones, labels, and run metadata
|
135
135
|
# @raise [Issuer::Error] If data is invalid or processing fails
|
136
136
|
#
|
137
|
-
def process_data
|
137
|
+
def process_data data, proj: nil, dry_run: false, automation_options: {}
|
138
138
|
# Extract metadata and issues
|
139
139
|
meta = data['$meta'] || {}
|
140
140
|
issues_data = data['issues'] || data
|
@@ -176,7 +176,7 @@ module Issuer
|
|
176
176
|
@site ||= Sites::Factory.create(Sites::Factory.default_site)
|
177
177
|
end
|
178
178
|
|
179
|
-
def perform_dry_run
|
179
|
+
def perform_dry_run issues, repo
|
180
180
|
site = Sites::Factory.create('github', token: 'dry-run-token')
|
181
181
|
|
182
182
|
puts "š§Ŗ DRY RUN - No issues will be created"
|
@@ -201,7 +201,7 @@ module Issuer
|
|
201
201
|
}
|
202
202
|
end
|
203
203
|
|
204
|
-
def perform_live_run
|
204
|
+
def perform_live_run issues, repo, automation_options
|
205
205
|
site = get_site
|
206
206
|
|
207
207
|
# Start run tracking if caching enabled
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: issuer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DocOps Lab
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
@@ -118,22 +118,13 @@ executables:
|
|
118
118
|
extensions: []
|
119
119
|
extra_rdoc_files: []
|
120
120
|
files:
|
121
|
-
- ".rspec"
|
122
|
-
- ".vale.ini"
|
123
|
-
- ".vale/config/vocabularies/issuer/accept.txt"
|
124
|
-
- ".vale/config/vocabularies/issuer/reject.txt"
|
125
|
-
- Dockerfile
|
126
121
|
- LICENSE
|
127
122
|
- README.adoc
|
128
|
-
- Rakefile
|
129
|
-
- bin/console
|
130
|
-
- bin/issuer
|
131
|
-
- bin/setup
|
132
|
-
- examples/README.adoc
|
133
123
|
- examples/advanced-stub-example.yml
|
134
124
|
- examples/basic-example.yml
|
135
125
|
- examples/minimal-example.yml
|
136
126
|
- examples/new-project-issues.yml
|
127
|
+
- examples/tag-removal-example.yml
|
137
128
|
- examples/validation-test.yml
|
138
129
|
- exe/issuer
|
139
130
|
- issuer.gemspec
|
@@ -147,30 +138,6 @@ files:
|
|
147
138
|
- lib/issuer/sites/factory.rb
|
148
139
|
- lib/issuer/sites/github.rb
|
149
140
|
- lib/issuer/version.rb
|
150
|
-
- scripts/build.sh
|
151
|
-
- scripts/lint-docs.sh
|
152
|
-
- scripts/manage-runs.rb
|
153
|
-
- scripts/pre-commit-template.sh
|
154
|
-
- scripts/publish.sh
|
155
|
-
- scripts/setup-vale.sh
|
156
|
-
- specs/tests/README.adoc
|
157
|
-
- specs/tests/check-github-connectivity.sh
|
158
|
-
- specs/tests/cleanup-github-tests.sh
|
159
|
-
- specs/tests/github-api/01-auth-connection.yml
|
160
|
-
- specs/tests/github-api/02-basic-issues.yml
|
161
|
-
- specs/tests/github-api/03-milestone-tests.yml
|
162
|
-
- specs/tests/github-api/04-label-tests.yml
|
163
|
-
- specs/tests/github-api/05-assignment-tests.yml
|
164
|
-
- specs/tests/github-api/06-automation-tests.yml
|
165
|
-
- specs/tests/github-api/07-error-tests.yml
|
166
|
-
- specs/tests/github-api/08-complex-tests.yml
|
167
|
-
- specs/tests/github-api/config.yml.example
|
168
|
-
- specs/tests/rspec/cli_spec.rb
|
169
|
-
- specs/tests/rspec/issue_spec.rb
|
170
|
-
- specs/tests/rspec/issuer_spec.rb
|
171
|
-
- specs/tests/rspec/ops_spec.rb
|
172
|
-
- specs/tests/rspec/spec_helper.rb
|
173
|
-
- specs/tests/run-github-api-tests.sh
|
174
141
|
homepage: https://github.com/DocOps/issuer
|
175
142
|
licenses:
|
176
143
|
- MIT
|
@@ -178,6 +145,7 @@ metadata:
|
|
178
145
|
homepage_uri: https://github.com/DocOps/issuer
|
179
146
|
source_code_uri: https://github.com/DocOps/issuer
|
180
147
|
changelog_uri: https://github.com/DocOps/issuer/blob/main/CHANGELOG.md
|
148
|
+
documentation_uri: https://gemdocs.org/gems/issuer/0.2.1
|
181
149
|
post_install_message:
|
182
150
|
rdoc_options: []
|
183
151
|
require_paths:
|
data/.rspec
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
# Project-specific vocabulary for issuer
|
2
|
-
# These terms are accepted and won't be flagged by spell checkers
|
3
|
-
|
4
|
-
# Project name and variations
|
5
|
-
issuer
|
6
|
-
Issuer
|
7
|
-
IMYML
|
8
|
-
imyml
|
9
|
-
|
10
|
-
# Technical terms
|
11
|
-
GitHub
|
12
|
-
GitLab
|
13
|
-
Octokit
|
14
|
-
AsciiDoc
|
15
|
-
asciidoc
|
16
|
-
YAML
|
17
|
-
JSON
|
18
|
-
APIs
|
19
|
-
API
|
20
|
-
CLI
|
21
|
-
summ
|
22
|
-
vrsn
|
23
|
-
proj
|
24
|
-
metadata
|
25
|
-
milestones
|
26
|
-
assignee
|
27
|
-
repos
|
28
|
-
repo
|
29
|
-
|
30
|
-
# Common tech abbreviations
|
31
|
-
dev
|
32
|
-
config
|
33
|
-
async
|
34
|
-
auth
|
35
|
-
env
|
36
|
-
vars
|
37
|
-
bool
|
38
|
-
bool
|
39
|
-
bool
|
40
|
-
timestamp
|
41
|
-
username
|
42
|
-
workflow
|
43
|
-
workflows
|
44
|
-
|
45
|
-
# Ruby/gem specific
|
46
|
-
Gemfile
|
47
|
-
gemspec
|
48
|
-
rspec
|
49
|
-
RSpec
|
50
|
-
bundler
|
51
|
-
Bundler
|
52
|
-
|
53
|
-
# Docker terms
|
54
|
-
dockerfile
|
55
|
-
Dockerfile
|
56
|
-
DocOps
|
57
|
-
docopslab
|
58
|
-
|
59
|
-
# Proper nouns
|
60
|
-
JIRA
|
61
|
-
OAuth
|
62
|
-
README
|
63
|
-
roadmap
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# Terms to reject/flag in the issuer project
|
2
|
-
# These will always be flagged as errors
|
3
|
-
|
4
|
-
# Common misspellings in tech docs
|
5
|
-
seperately
|
6
|
-
seperate
|
7
|
-
recieve
|
8
|
-
definately
|
9
|
-
occured
|
10
|
-
teh
|
11
|
-
hte
|
12
|
-
thier
|
13
|
-
there own
|
14
|
-
there job
|
15
|
-
|
16
|
-
# Discouraged terms
|
17
|
-
simply
|
18
|
-
just
|
19
|
-
obviously
|
20
|
-
clearly
|
21
|
-
easily
|
data/.vale.ini
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
# Vale configuration for issuer project
|
2
|
-
StylesPath = .vale/styles
|
3
|
-
|
4
|
-
# Minimum alert level (suggestion, warning, error)
|
5
|
-
MinAlertLevel = suggestion
|
6
|
-
|
7
|
-
# Packages to install
|
8
|
-
Packages = Microsoft, proselint, write-good
|
9
|
-
|
10
|
-
# Global settings
|
11
|
-
IgnoredScopes = code, tt, script.go, script.python
|
12
|
-
SkippedScopes = script, style, pre, figure
|
13
|
-
WordTemplate = \b(?:%s)\b
|
14
|
-
|
15
|
-
# File type associations - All documentation files
|
16
|
-
[*.{md,adoc,asciidoc,txt}]
|
17
|
-
BasedOnStyles = Microsoft, proselint, write-good
|
18
|
-
# Disable rules per user preferences
|
19
|
-
Microsoft.Headings = NO
|
20
|
-
Microsoft.Contractions = NO
|
21
|
-
Microsoft.FirstPerson = NO
|
22
|
-
Microsoft.Acronyms = NO
|
23
|
-
Microsoft.Auto = NO
|
24
|
-
Microsoft.Vocab = NO
|
25
|
-
Microsoft.We = NO
|
26
|
-
Microsoft.Dashes = NO
|
27
|
-
write-good.E-Prime = NO
|
28
|
-
write-good.Passive = NO
|
29
|
-
write-good.TooWordy = NO
|
30
|
-
write-good.Weasel = NO
|
31
|
-
# Global ignores for all markup files
|
32
|
-
TokenIgnores = (\$[A-Z_]+), (`[^`]+`), (:[a-z-]+:), (\{[^}]+\}), (https?://[^\s]+), \bJIRA\b
|
33
|
-
|
34
|
-
# Ruby files for comments
|
35
|
-
[*.rb]
|
36
|
-
BasedOnStyles = Microsoft, write-good
|
37
|
-
TokenIgnores = (`[^`]+`), (\$[A-Z_]+), (:[a-z_]+), \bJIRA\b
|
38
|
-
|
39
|
-
# YAML files
|
40
|
-
[*.{yml,yaml}]
|
41
|
-
BasedOnStyles = Microsoft, write-good
|
42
|
-
TokenIgnores = (`[^`]+`), (\$[A-Z_]+), (:[a-z_]+:), \bJIRA\b
|
data/Dockerfile
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
FROM ruby:3.2-slim
|
2
|
-
|
3
|
-
ARG ISSUER_VERSION
|
4
|
-
ARG ISSUER_SOURCE=repo
|
5
|
-
LABEL org.opencontainers.image.version=$ISSUER_VERSION
|
6
|
-
|
7
|
-
# Install necessary build tools and dependencies (minimal footprint)
|
8
|
-
RUN apt-get update -qq && \
|
9
|
-
apt-get upgrade -y && \
|
10
|
-
apt-get install -y --no-install-recommends \
|
11
|
-
build-essential \
|
12
|
-
git && \
|
13
|
-
rm -rf /var/lib/apt/lists/*
|
14
|
-
|
15
|
-
# Install issuer gem based on ISSUER_SOURCE
|
16
|
-
RUN if [ "$ISSUER_SOURCE" = "published" ]; then \
|
17
|
-
echo "Installing issuer from RubyGems..." && \
|
18
|
-
gem install issuer; \
|
19
|
-
else \
|
20
|
-
echo "Will install issuer from repository source..."; \
|
21
|
-
fi
|
22
|
-
|
23
|
-
# Set app directory for build context (only needed for repo builds)
|
24
|
-
WORKDIR /app
|
25
|
-
|
26
|
-
# Copy repository source and build gem (only when ISSUER_SOURCE=repo)
|
27
|
-
COPY . .
|
28
|
-
RUN if [ "$ISSUER_SOURCE" = "repo" ]; then \
|
29
|
-
gem install rake && \
|
30
|
-
gem build issuer.gemspec && \
|
31
|
-
gem install issuer-*.gem && \
|
32
|
-
rm -rf /app/*; \
|
33
|
-
fi
|
34
|
-
|
35
|
-
# Ensure gem executables are in PATH
|
36
|
-
ENV PATH="/usr/local/bundle/bin:$PATH"
|
37
|
-
|
38
|
-
# Set runtime working dir to isolated mount point
|
39
|
-
WORKDIR /workdir
|
40
|
-
|
41
|
-
# Default entrypoint and fallback command
|
42
|
-
ENTRYPOINT ["issuer"]
|
43
|
-
CMD ["help"]
|
data/Rakefile
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
require "rspec/core/rake_task"
|
3
|
-
require "yaml"
|
4
|
-
|
5
|
-
RSpec::Core::RakeTask.new(:spec) do |t|
|
6
|
-
t.pattern = 'specs/tests/rspec/**/*_spec.rb'
|
7
|
-
end
|
8
|
-
|
9
|
-
task :default => :spec
|
10
|
-
|
11
|
-
desc "Setup Vale styles"
|
12
|
-
task :vale_setup do
|
13
|
-
sh "vale sync"
|
14
|
-
end
|
15
|
-
|
16
|
-
desc "Run documentation quality checks"
|
17
|
-
task :quality => :vale_setup do
|
18
|
-
sh "vale --no-exit --output=line *.adoc examples/*.adoc specs/tests/*.adoc || true"
|
19
|
-
end
|
20
|
-
|
21
|
-
desc "Run CLI tests"
|
22
|
-
task :cli_test do
|
23
|
-
puts "Testing CLI functionality..."
|
24
|
-
sh "ruby -Ilib exe/issuer --version"
|
25
|
-
sh "ruby -Ilib exe/issuer --help"
|
26
|
-
sh "ruby -Ilib exe/issuer examples/minimal-example.yml --dry"
|
27
|
-
end
|
28
|
-
|
29
|
-
desc "Validate YAML examples"
|
30
|
-
task :yaml_test do
|
31
|
-
puts "Validating YAML examples..."
|
32
|
-
Dir.glob("examples/*.yml").each do |file|
|
33
|
-
puts "Validating #{file}"
|
34
|
-
begin
|
35
|
-
YAML.load_file(file)
|
36
|
-
puts "ā #{file} is valid"
|
37
|
-
rescue => e
|
38
|
-
puts "ā #{file} failed: #{e.message}"
|
39
|
-
exit 1
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
desc "Run bundle install"
|
45
|
-
task :install do
|
46
|
-
sh "bundle install"
|
47
|
-
end
|
48
|
-
|
49
|
-
desc "Run all PR tests locally (same as GitHub Actions)"
|
50
|
-
task :pr_test do
|
51
|
-
puts "š Running all PR tests locally..."
|
52
|
-
puts "\n=== RSpec Tests ==="
|
53
|
-
Rake::Task[:spec].invoke
|
54
|
-
|
55
|
-
puts "\n=== CLI Tests ==="
|
56
|
-
Rake::Task[:cli_test].invoke
|
57
|
-
|
58
|
-
puts "\n=== YAML Validation ==="
|
59
|
-
Rake::Task[:yaml_test].invoke
|
60
|
-
|
61
|
-
puts "\n=== Documentation Quality ==="
|
62
|
-
Rake::Task[:quality].invoke
|
63
|
-
|
64
|
-
puts "\nā
All PR tests passed!"
|
65
|
-
end
|
66
|
-
|
67
|
-
desc "Build and install gem locally"
|
68
|
-
task :install_local => :build do
|
69
|
-
sh "gem install pkg/issuer-*.gem"
|
70
|
-
end
|
data/bin/console
DELETED
File without changes
|
data/bin/issuer
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# Development setup script for issuer gem
|
4
|
-
# This script helps set up the development environment
|
5
|
-
|
6
|
-
require 'bundler/setup'
|
7
|
-
require_relative '../lib/issuer'
|
8
|
-
|
9
|
-
# Add the lib directory to the load path for development
|
10
|
-
$LOAD_PATH.unshift File.join(__dir__, '..', 'lib')
|
11
|
-
|
12
|
-
# Run the CLI
|
13
|
-
Issuer::CLI.start(ARGV)
|
data/bin/setup
DELETED
File without changes
|
data/examples/README.adoc
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
= IMYML Examples
|
2
|
-
|
3
|
-
This directory contains example IMYML (Issue YAML) files demonstrating various features of the issuer CLI tool.
|
4
|
-
|
5
|
-
== Files
|
6
|
-
|
7
|
-
=== `basic-example.yml`
|
8
|
-
Demonstrates core IMYML features:
|
9
|
-
|
10
|
-
* Basic meta configuration
|
11
|
-
* Issue properties (summ, body, tags, user, vrsn)
|
12
|
-
* Default values and overrides
|
13
|
-
|
14
|
-
=== `advanced-stub-example.yml`
|
15
|
-
Shows advanced features:
|
16
|
-
|
17
|
-
* Stub functionality with head/tail/body composition
|
18
|
-
* Tag logic with `+` prefix for append-to-all behavior
|
19
|
-
* Mixed scalar string and structured issues
|
20
|
-
* Conditional stub application
|
21
|
-
|
22
|
-
=== `minimal-example.yml`
|
23
|
-
Minimal example for quick testing:
|
24
|
-
|
25
|
-
* Minimal meta configuration
|
26
|
-
* Mix of structured and string issues
|
27
|
-
|
28
|
-
=== `validation-test.yml`
|
29
|
-
For testing milestone and label validation:
|
30
|
-
|
31
|
-
* Issues with non-existent milestones
|
32
|
-
* Issues with non-existent labels
|
33
|
-
* Triggers interactive validation prompts
|
34
|
-
|
35
|
-
=== `new-project-issues.yml`
|
36
|
-
Comprehensive bootstrap issues for new software projects:
|
37
|
-
|
38
|
-
* Repository and infrastructure setup tasks
|
39
|
-
* Development environment configuration
|
40
|
-
* Testing and security framework setup
|
41
|
-
* Common project management tasks
|
42
|
-
* Mix of detailed and simple issue definitions
|
43
|
-
|
44
|
-
== Usage
|
45
|
-
|
46
|
-
Test any example with a dry run:
|
47
|
-
|
48
|
-
issuer examples/basic-example.yml --dry
|
49
|
-
|
50
|
-
Or with the Docker image:
|
51
|
-
|
52
|
-
docker run -it --rm -v $(pwd):/workdir docopslab/issuer issuer examples/basic-example.yml --dry
|
53
|
-
|
54
|
-
== Creating Your Own
|
55
|
-
|
56
|
-
Copy and modify any of these examples as a starting point for your own project's issue definitions.
|
data/scripts/build.sh
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
# Release automation script for Ruby gem projects
|
3
|
-
|
4
|
-
set -e
|
5
|
-
|
6
|
-
# Load common build functions
|
7
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
8
|
-
source "$SCRIPT_DIR/lib/build-common.sh"
|
9
|
-
|
10
|
-
# Project-specific configuration
|
11
|
-
PROJECT_NAME="issuer"
|
12
|
-
DOCKER_ORG="docopslab"
|
13
|
-
|
14
|
-
echo -e "${GREEN}š ${PROJECT_NAME} Release Build Script${NC}"
|
15
|
-
echo "=================================="
|
16
|
-
|
17
|
-
# Validation
|
18
|
-
check_project_root
|
19
|
-
check_git_clean
|
20
|
-
check_main_branch
|
21
|
-
check_bundle_installed
|
22
|
-
|
23
|
-
# Run tests
|
24
|
-
run_rspec_tests
|
25
|
-
test_cli_functionality
|
26
|
-
|
27
|
-
# Get current version
|
28
|
-
current_version=$(get_current_version)
|
29
|
-
echo -e "${GREEN}š Current version: $current_version${NC}"
|
30
|
-
|
31
|
-
# Build and test gem
|
32
|
-
build_gem
|
33
|
-
gem_file=$(test_built_gem)
|
34
|
-
|
35
|
-
# Build Docker image using the docker-specific script
|
36
|
-
echo -e "${YELLOW}š³ Building Docker image...${NC}"
|
37
|
-
"$SCRIPT_DIR/build-docker.sh" 2>&1 | grep -E "(Building|Testing|successfully|Docker image:)" || true
|
38
|
-
|
39
|
-
# Show final success message
|
40
|
-
show_build_success "$current_version" "$gem_file"
|