issuer 0.1.0 ā 0.1.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 +1 -1
- data/issuer.gemspec +5 -9
- data/lib/issuer/cli.rb +5 -5
- data/lib/issuer/issue.rb +26 -13
- data/lib/issuer/sites/base.rb +2 -1
- data/lib/issuer/sites/github.rb +29 -4
- metadata +2 -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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b9eef4a9d197d93d73741916ac3b33667eeedbd8f2bdc4bb7efc15a81bace2f
|
4
|
+
data.tar.gz: d638d611dfece68b9a9492be2a8355b14603aabf4f70e6d2212b9b73b3085775
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dd29f7a22ef465afa9888dd4342c46f838298598d79ef0008f0567103030ea45a4fb3882c47460730486a4d5da4794d321fd25db9fc588e4e0a64c023fd67c4
|
7
|
+
data.tar.gz: 1d47716be2e67809b08dee0e11a65ef32f87f8ba1a61291759b958c6f7ab9f357fbad8b80ea5a567cf643e9f6721527c9b57e6ee5bbc9f0c373dff306cc609ed
|
data/README.adoc
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
= Issuer: Bulk GitHub Issue Creator
|
2
2
|
:toc: macro
|
3
3
|
:toclevels: 3
|
4
|
-
:this_prod_vrsn: 0.1.
|
4
|
+
:this_prod_vrsn: 0.1.1
|
5
5
|
:next_prod_vrsn: 0.2.0
|
6
6
|
:docker_base_command: docker run -it --rm -v $(pwd):/workdir -e GITHUB_TOKEN=$ISSUER_API_TOKEN docopslab/issuer
|
7
7
|
: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.
|
data/issuer.gemspec
CHANGED
@@ -17,17 +17,13 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.metadata["changelog_uri"] = "https://github.com/DocOps/issuer/blob/main/CHANGELOG.md"
|
18
18
|
|
19
19
|
# Specify which files should be added to the gem when it is released.
|
20
|
-
spec.files = Dir
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
f.match?(/\.gem$/) ||
|
25
|
-
f.match?(/test_.*\.rb$/)
|
26
|
-
end
|
27
|
-
end
|
20
|
+
spec.files = Dir['lib/**/*.rb'] +
|
21
|
+
['exe/issuer'] +
|
22
|
+
['README.adoc', 'LICENSE', 'issuer.gemspec'] +
|
23
|
+
Dir['examples/*.yml']
|
28
24
|
|
29
25
|
spec.bindir = "exe"
|
30
|
-
spec.executables =
|
26
|
+
spec.executables = ["issuer"]
|
31
27
|
spec.require_paths = ["lib"]
|
32
28
|
|
33
29
|
# Runtime dependencies
|
data/lib/issuer/cli.rb
CHANGED
@@ -17,7 +17,7 @@ module Issuer
|
|
17
17
|
class_option :user, type: :string, desc: 'Default assignee (GitHub username)'
|
18
18
|
class_option :tags, type: :string, desc: 'Comma-separated extra labels for all issues'
|
19
19
|
class_option :stub, type: :boolean, desc: 'Enable stub mode for all issues'
|
20
|
-
class_option :dry, type: :boolean, default: false, desc: 'Print issues, don\'t post'
|
20
|
+
class_option :dry, type: :boolean, default: false, aliases: ['--dry-run'], desc: 'Print issues, don\'t post'
|
21
21
|
class_option :tokenv, type: :string, desc: 'Name of environment variable containing GitHub token'
|
22
22
|
|
23
23
|
# Resource automation options
|
@@ -127,8 +127,8 @@ module Issuer
|
|
127
127
|
site_options[:token_env_var] = options[:tokenv] if options[:tokenv]
|
128
128
|
site = Issuer::Sites::Factory.create('github', **site_options)
|
129
129
|
automation_options = {
|
130
|
-
auto_versions: options[:auto_versions] || options[:auto_metadata],
|
131
|
-
auto_tags: options[:auto_tags] || options[:auto_metadata]
|
130
|
+
auto_versions: !!options[:auto_versions] || !!options[:auto_metadata],
|
131
|
+
auto_tags: !!options[:auto_tags] || !!options[:auto_metadata]
|
132
132
|
}
|
133
133
|
|
134
134
|
# Start run tracking for live operations
|
@@ -175,7 +175,7 @@ module Issuer
|
|
175
175
|
--tokenv VAR_NAME #{self.class_options[:tokenv].description}
|
176
176
|
|
177
177
|
Mode Options:
|
178
|
-
--dry
|
178
|
+
--dry, --dry-run #{self.class_options[:dry].description}
|
179
179
|
--auto-versions #{self.class_options[:auto_versions].description}
|
180
180
|
--auto-milestones (alias for --auto-versions)
|
181
181
|
--auto-tags #{self.class_options[:auto_tags].description}
|
@@ -228,7 +228,7 @@ module Issuer
|
|
228
228
|
puts "Would process #{valid_count} issues, skip #{invalid_count}"
|
229
229
|
else
|
230
230
|
puts "\nā
Completed: #{valid_count} issues processed, #{invalid_count} skipped"
|
231
|
-
|
231
|
+
# Note: Run ID is already displayed in the main flow, no need to repeat it here
|
232
232
|
end
|
233
233
|
|
234
234
|
end
|
data/lib/issuer/issue.rb
CHANGED
@@ -61,14 +61,19 @@ module Issuer
|
|
61
61
|
#
|
62
62
|
def initialize issue_data, defaults={}
|
63
63
|
@raw_data = issue_data || {}
|
64
|
-
@
|
65
|
-
|
66
|
-
|
67
|
-
@
|
68
|
-
@
|
69
|
-
@user = @
|
70
|
-
@vrsn = @
|
71
|
-
@stub = @
|
64
|
+
@defaults = defaults
|
65
|
+
|
66
|
+
# For most fields, issue data overrides defaults
|
67
|
+
@summ = @raw_data['summ'] || defaults['summ']
|
68
|
+
@body = @raw_data['body'] || @raw_data['desc'] || defaults['body'] || defaults['desc'] || '' # Support both body and desc (legacy)
|
69
|
+
@user = @raw_data['user'] || defaults['user']
|
70
|
+
@vrsn = @raw_data['vrsn'] || defaults['vrsn']
|
71
|
+
@stub = @raw_data.key?('stub') ? @raw_data['stub'] : defaults['stub']
|
72
|
+
|
73
|
+
# For tags, we need special handling - combine defaults and issue tags for later processing
|
74
|
+
defaults_tags = Array(defaults['tags'])
|
75
|
+
issue_tags = Array(@raw_data['tags'])
|
76
|
+
@tags = defaults_tags + issue_tags
|
72
77
|
end
|
73
78
|
|
74
79
|
##
|
@@ -182,14 +187,22 @@ module Issuer
|
|
182
187
|
end
|
183
188
|
end
|
184
189
|
|
185
|
-
# Start with append tags (always applied)
|
186
|
-
|
190
|
+
# Start with append tags from both defaults and CLI (always applied)
|
191
|
+
defaults_append_tags = Array(@defaults['tags']).select { |tag| tag.to_s.start_with?('+') }.map { |tag| tag[1..] }
|
192
|
+
final_tags = append_tags + defaults_append_tags + cli_append_tags
|
193
|
+
|
194
|
+
# For regular tags, add issue's own tags, otherwise use default tags
|
195
|
+
issue_regular_tags = Array(@raw_data['tags']).reject { |tag| tag.to_s.start_with?('+') }
|
187
196
|
|
188
|
-
|
189
|
-
|
190
|
-
final_tags.concat(
|
197
|
+
if !issue_regular_tags.empty?
|
198
|
+
# Issue has its own regular tags, use them
|
199
|
+
final_tags.concat(issue_regular_tags)
|
191
200
|
else
|
201
|
+
# Issue has no regular tags, use defaults from CLI
|
192
202
|
final_tags.concat(cli_default_tags)
|
203
|
+
# Also add non-append defaults tags
|
204
|
+
defaults_regular_tags = Array(@defaults['tags']).reject { |tag| tag.to_s.start_with?('+') }
|
205
|
+
final_tags.concat(defaults_regular_tags)
|
193
206
|
end
|
194
207
|
|
195
208
|
# Set the final tags (removing duplicates)
|
data/lib/issuer/sites/base.rb
CHANGED
@@ -67,7 +67,8 @@ module Issuer
|
|
67
67
|
issues.each do |issue|
|
68
68
|
begin
|
69
69
|
# Convert IMYML issue to site-specific parameters
|
70
|
-
|
70
|
+
# Pass run_id to enable post-validation milestone lookup
|
71
|
+
site_params = convert_issue_to_site_params(issue, proj, dry_run: false, post_validation: true)
|
71
72
|
result = create_issue(proj, site_params)
|
72
73
|
|
73
74
|
# Extract the created issue object (for backwards compatibility)
|
data/lib/issuer/sites/github.rb
CHANGED
@@ -8,6 +8,8 @@ module Issuer
|
|
8
8
|
class GitHub < Base
|
9
9
|
def initialize token: nil, token_env_var: nil
|
10
10
|
@token = token || self.class.detect_github_token(custom_env_var: token_env_var)
|
11
|
+
@milestone_cache = {} # Cache for milestones by project
|
12
|
+
@label_cache = {} # Cache for labels by project
|
11
13
|
|
12
14
|
# Skip authentication validation for dry-run mode
|
13
15
|
if @token == 'dry-run-token'
|
@@ -71,8 +73,14 @@ module Issuer
|
|
71
73
|
|
72
74
|
# Handle milestone - only if milestone exists
|
73
75
|
if issue_params[:milestone]
|
74
|
-
milestone
|
75
|
-
|
76
|
+
# If milestone is already a number (from convert_issue_to_site_params), use it directly
|
77
|
+
if issue_params[:milestone].is_a?(Integer)
|
78
|
+
params[:milestone] = issue_params[:milestone]
|
79
|
+
else
|
80
|
+
# If it's a string name, look it up
|
81
|
+
milestone = find_milestone(proj, issue_params[:milestone])
|
82
|
+
params[:milestone] = milestone.number if milestone
|
83
|
+
end
|
76
84
|
end
|
77
85
|
|
78
86
|
created_issue = @client.create_issue(proj, params[:title], params[:body], params)
|
@@ -110,6 +118,10 @@ module Issuer
|
|
110
118
|
# Call create_milestone with proper parameters
|
111
119
|
created_milestone = @client.create_milestone(proj, version_name, description: description)
|
112
120
|
|
121
|
+
# Add the newly created milestone to our cache for immediate availability
|
122
|
+
@milestone_cache[proj] ||= []
|
123
|
+
@milestone_cache[proj] << created_milestone
|
124
|
+
|
113
125
|
# Return tracking data
|
114
126
|
{
|
115
127
|
object: created_milestone,
|
@@ -179,7 +191,7 @@ module Issuer
|
|
179
191
|
end
|
180
192
|
|
181
193
|
# Convert IMYML issue to GitHub-specific parameters
|
182
|
-
def convert_issue_to_site_params issue, proj, dry_run: false
|
194
|
+
def convert_issue_to_site_params issue, proj, dry_run: false, post_validation: false
|
183
195
|
params = {
|
184
196
|
title: issue.summ,
|
185
197
|
body: issue.body || ''
|
@@ -203,7 +215,13 @@ module Issuer
|
|
203
215
|
else
|
204
216
|
# In normal mode, resolve milestone name to number
|
205
217
|
milestone = find_milestone(proj, issue.vrsn)
|
206
|
-
|
218
|
+
if milestone
|
219
|
+
params[:milestone] = milestone.number
|
220
|
+
elsif post_validation
|
221
|
+
# If we're in post-validation mode and milestone still not found,
|
222
|
+
# this indicates a serious problem with the validation flow
|
223
|
+
puts "ā ļø Warning: Milestone '#{issue.vrsn}' not found even after validation for issue '#{issue.summ}'"
|
224
|
+
end
|
207
225
|
end
|
208
226
|
end
|
209
227
|
|
@@ -240,6 +258,13 @@ module Issuer
|
|
240
258
|
end
|
241
259
|
|
242
260
|
def find_milestone proj, milestone_name
|
261
|
+
# First check newly created milestones in cache
|
262
|
+
if @milestone_cache[proj]
|
263
|
+
cached_milestone = @milestone_cache[proj].find { |m| m.title == milestone_name.to_s }
|
264
|
+
return cached_milestone if cached_milestone
|
265
|
+
end
|
266
|
+
|
267
|
+
# Fall back to API lookup for existing milestones
|
243
268
|
milestones = get_versions(proj)
|
244
269
|
milestones.find { |m| m.title == milestone_name.to_s }
|
245
270
|
end
|
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.1.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-07-
|
11
|
+
date: 2025-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
@@ -118,18 +118,8 @@ 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
|
@@ -147,30 +137,6 @@ files:
|
|
147
137
|
- lib/issuer/sites/factory.rb
|
148
138
|
- lib/issuer/sites/github.rb
|
149
139
|
- 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
140
|
homepage: https://github.com/DocOps/issuer
|
175
141
|
licenses:
|
176
142
|
- MIT
|
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"
|