groundskeeper-bitcore 0.42.0 → 0.44.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.
- checksums.yaml +4 -4
- data/.github/copilot-instructions.md +26 -0
- data/Gemfile.lock +1 -1
- data/README.md +0 -8
- data/lib/groundskeeper/commands.rb +6 -24
- data/lib/groundskeeper/semantic_version.rb +3 -5
- data/lib/groundskeeper/version.rb +1 -1
- data/lib/groundskeeper.rb +0 -1
- metadata +3 -3
- data/lib/groundskeeper/slack.rb +0 -39
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c37ebd4da35bf6574411e1008e0e8c4d246ce35cede710bc6b8812d9188763b1
|
|
4
|
+
data.tar.gz: f2f211e627fd7a6281ac0aff976041ce2726cc80e41097674149d32dc1c067a3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff8eb49632a0b993392a4e950256f2e45227fe0467a51d06323dabb6d035b303cc9b2910083ba5d87ccb1fcc808852519c0017f10f12bb143893a17fa0bd4a06
|
|
7
|
+
data.tar.gz: 6e991c04dbdc52974b57a2d4a6dfdeea02bb4931e9d1b969452b2579bbf77259d0984bd3691443bad80aa05c434557d1460069e0b67d03be7c636ead0148e0a9
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Repository guidance
|
|
2
|
+
|
|
3
|
+
## Build, test, and lint
|
|
4
|
+
|
|
5
|
+
- Run `bin/setup` to install the development dependencies.
|
|
6
|
+
- Run `bundle exec rake` for the CI-equivalent default task: it runs the test suite and RuboCop.
|
|
7
|
+
- Run just the tests with `bundle exec rake test`.
|
|
8
|
+
- Run one test file with `bundle exec ruby -Itest test/groundskeeper/git_test.rb`; add `-n /test_name/` to run a single Minitest method, for example `-n /test_status/`.
|
|
9
|
+
- Run lint alone with `bundle exec rake rubocop` (or `bundle exec rubocop`).
|
|
10
|
+
- Build the gem with `bundle exec rake build`.
|
|
11
|
+
|
|
12
|
+
## Architecture
|
|
13
|
+
|
|
14
|
+
Groundskeeper is a Ruby gem that provides the `ground` Thor CLI for Rails release and deployment workflows. `lib/groundskeeper/application.rb` defines the CLI commands; `lib/groundskeeper/commands.rb` coordinates release/deploy steps and connects collaborators for Git, Rails version files, project metadata, and external services.
|
|
15
|
+
|
|
16
|
+
Most individual `lib/groundskeeper/*.rb` classes wrap one concern or integration. `lib/groundskeeper.rb` loads the library. `Commands.build` assembles the real collaborators; the commands object also accepts collaborators through its initializer so workflow behavior can be tested without making real service calls.
|
|
17
|
+
|
|
18
|
+
`RailsVersion` reads and updates the target Rails app's module version file. `Project` reads per-repository and server configuration from `~/.project_details/projects.yml` and `servers.yml`; deployment tasks live in `config/deploy.rb` and related config files and are run through Mina. The `stage` environment variable selects production; otherwise workflows default to staging.
|
|
19
|
+
|
|
20
|
+
## Repository conventions
|
|
21
|
+
|
|
22
|
+
- Keep external-service and command-line integration behind the existing focused wrappers (for example, `Git`, `Jira`, `Sentry`, and `Executable`); coordinate workflow sequencing in `Commands`.
|
|
23
|
+
- Follow the existing dependency-injection pattern: build real dependencies at the application boundary, and pass mocks or small test doubles into the classes under test.
|
|
24
|
+
- Tests use Minitest, are named `*_test.rb` under `test/`, and share `test/test_helper.rb`. SimpleCov enforces 100% coverage, so exercise new branches and methods in tests.
|
|
25
|
+
- Ruby files use frozen string literals and double-quoted strings. RuboCop settings and project-specific exclusions are in `.rubocop.yml`; the gem targets Ruby 3.0 or newer.
|
|
26
|
+
- `README.md` documents CLI usage, supported integrations, and their required environment configuration; consult it when changing release or deployment behavior.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -52,14 +52,6 @@ projects. Clone it as follows:
|
|
|
52
52
|
git clone git@github.com:NU-CBITS/project_details.git ~/.project_details
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
To integrate with Slack, set the following environment variables:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
SLACK_WORKSPACE
|
|
59
|
-
SLACK_CHANNEL
|
|
60
|
-
SLACK_TOKEN
|
|
61
|
-
```
|
|
62
|
-
|
|
63
55
|
## Usage
|
|
64
56
|
|
|
65
57
|
To display tag/release information about a Rails project, use the `info`
|
|
@@ -33,7 +33,6 @@ module Groundskeeper
|
|
|
33
33
|
project_name: project.sentry_project,
|
|
34
34
|
version_prefix: repository.name
|
|
35
35
|
)
|
|
36
|
-
slack = Slack.build
|
|
37
36
|
ssh = Ssh.build(SSH_USERNAME, project.full_dns(stage))
|
|
38
37
|
|
|
39
38
|
new(
|
|
@@ -45,7 +44,6 @@ module Groundskeeper
|
|
|
45
44
|
repository: repository,
|
|
46
45
|
rubygems: Rubygems,
|
|
47
46
|
sentry: sentry,
|
|
48
|
-
slack: slack,
|
|
49
47
|
ssh: ssh,
|
|
50
48
|
version_file: RailsVersion.build,
|
|
51
49
|
website: website
|
|
@@ -67,7 +65,6 @@ module Groundskeeper
|
|
|
67
65
|
repository: nil,
|
|
68
66
|
rubygems: nil,
|
|
69
67
|
sentry: nil,
|
|
70
|
-
slack: nil,
|
|
71
68
|
ssh: nil,
|
|
72
69
|
website: nil
|
|
73
70
|
)
|
|
@@ -79,7 +76,6 @@ module Groundskeeper
|
|
|
79
76
|
@repository = repository
|
|
80
77
|
@rubygems = rubygems
|
|
81
78
|
@sentry = sentry
|
|
82
|
-
@slack = slack
|
|
83
79
|
@ssh = ssh
|
|
84
80
|
@website = website
|
|
85
81
|
@version_file = version_file
|
|
@@ -153,7 +149,6 @@ module Groundskeeper
|
|
|
153
149
|
return unrecognized_tag unless tag_present_in_git?(ENV[TAG])
|
|
154
150
|
return missing_jira_credentials unless jira.credentials?
|
|
155
151
|
return missing_sentry_credentials unless sentry.credentials?
|
|
156
|
-
return missing_slack_credentials unless slack.credentials?
|
|
157
152
|
return groundskeeper_outdated unless check_groundskeeper_version
|
|
158
153
|
return unable_to_ssh unless ssh.can_connect?
|
|
159
154
|
|
|
@@ -174,7 +169,7 @@ module Groundskeeper
|
|
|
174
169
|
|
|
175
170
|
# collaborators
|
|
176
171
|
attr_reader :remote_version_control, :console, :git, :jira, :project,
|
|
177
|
-
:repository, :rubygems, :sentry, :
|
|
172
|
+
:repository, :rubygems, :sentry, :ssh, :version_file,
|
|
178
173
|
:website
|
|
179
174
|
# state
|
|
180
175
|
attr_reader :current_step, :did_push_to_remote, :next_version,
|
|
@@ -358,13 +353,6 @@ module Groundskeeper
|
|
|
358
353
|
)
|
|
359
354
|
end
|
|
360
355
|
|
|
361
|
-
def missing_slack_credentials
|
|
362
|
-
console.say(
|
|
363
|
-
"Please configure your Slack environment variables.",
|
|
364
|
-
:red
|
|
365
|
-
)
|
|
366
|
-
end
|
|
367
|
-
|
|
368
356
|
def unable_to_ssh
|
|
369
357
|
console.say(
|
|
370
358
|
"Unable to SSH to the server, are you signed into VPN?",
|
|
@@ -378,11 +366,12 @@ module Groundskeeper
|
|
|
378
366
|
|
|
379
367
|
def run_mina(arguments)
|
|
380
368
|
command = "mina #{arguments} -f #{RAKEFILE}"
|
|
381
|
-
Open3.
|
|
369
|
+
Open3.popen2e(command) do |_stdin, output, _thread|
|
|
382
370
|
# :nocov:
|
|
383
371
|
# rubocop:disable Lint/AssignmentInCondition
|
|
384
|
-
while line =
|
|
372
|
+
while line = output.gets
|
|
385
373
|
puts line
|
|
374
|
+
$stdout.flush
|
|
386
375
|
end
|
|
387
376
|
# rubocop:enable Lint/AssignmentInCondition
|
|
388
377
|
# :nocov:
|
|
@@ -398,14 +387,14 @@ module Groundskeeper
|
|
|
398
387
|
)
|
|
399
388
|
|
|
400
389
|
begin
|
|
401
|
-
|
|
390
|
+
deployed_version_name = website.version.strip
|
|
391
|
+
deployed_version = SemanticVersion.new(deployed_version_name)
|
|
402
392
|
current_version = SemanticVersion.new(version_file.current_version)
|
|
403
393
|
|
|
404
394
|
raise VersionError unless deployed_version.version == ENV[TAG]
|
|
405
395
|
|
|
406
396
|
console.say("# deployment successful", :green)
|
|
407
397
|
transition_remote_issues(deployed_version, current_version)
|
|
408
|
-
announce_in_slack deployed_version.version
|
|
409
398
|
rescue VersionError
|
|
410
399
|
tries += 1
|
|
411
400
|
sleep 5
|
|
@@ -452,13 +441,6 @@ module Groundskeeper
|
|
|
452
441
|
end
|
|
453
442
|
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
|
454
443
|
|
|
455
|
-
def announce_in_slack(deployed_version)
|
|
456
|
-
slack.send_message(
|
|
457
|
-
"#{project.project_name} version #{deployed_version} deployed to " +
|
|
458
|
-
self.class.stage
|
|
459
|
-
)
|
|
460
|
-
end
|
|
461
|
-
|
|
462
444
|
def announce_step(message)
|
|
463
445
|
console.say(">>>", :magenta)
|
|
464
446
|
console.say(">>> #{@current_step}. #{message}", :magenta)
|
|
@@ -9,7 +9,7 @@ module Groundskeeper
|
|
|
9
9
|
SEMANTIC_RELEASE_TYPE = { M: MAJOR, m: MINOR, p: PATCH }.freeze
|
|
10
10
|
WORD_NUMBER_PATTERN = /^([a-zA-Z]+)-(\d+)$/
|
|
11
11
|
|
|
12
|
-
attr_reader :major, :minor, :patch
|
|
12
|
+
attr_reader :major, :minor, :patch, :version
|
|
13
13
|
|
|
14
14
|
# :nocov:
|
|
15
15
|
def self.build(version)
|
|
@@ -20,6 +20,8 @@ module Groundskeeper
|
|
|
20
20
|
# :nocov:
|
|
21
21
|
|
|
22
22
|
def initialize(version)
|
|
23
|
+
@version = version
|
|
24
|
+
|
|
23
25
|
if version.match(WORD_NUMBER_PATTERN)
|
|
24
26
|
@word = ::Regexp.last_match(1)
|
|
25
27
|
@number = ::Regexp.last_match(2).to_i
|
|
@@ -59,9 +61,5 @@ module Groundskeeper
|
|
|
59
61
|
|
|
60
62
|
minor == other_minor && patch > other_version.patch
|
|
61
63
|
end
|
|
62
|
-
|
|
63
|
-
def version
|
|
64
|
-
"#{major}.#{minor}.#{patch}"
|
|
65
|
-
end
|
|
66
64
|
end
|
|
67
65
|
end
|
data/lib/groundskeeper.rb
CHANGED
|
@@ -18,7 +18,6 @@ require "groundskeeper/repository"
|
|
|
18
18
|
require "groundskeeper/rubygems"
|
|
19
19
|
require "groundskeeper/semantic_version"
|
|
20
20
|
require "groundskeeper/sentry"
|
|
21
|
-
require "groundskeeper/slack"
|
|
22
21
|
require "groundskeeper/ssh"
|
|
23
22
|
require "groundskeeper/string_utils"
|
|
24
23
|
require "groundskeeper/version"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: groundskeeper-bitcore
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.44.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- RADD
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jira-ruby
|
|
@@ -200,6 +200,7 @@ executables:
|
|
|
200
200
|
extensions: []
|
|
201
201
|
extra_rdoc_files: []
|
|
202
202
|
files:
|
|
203
|
+
- ".github/copilot-instructions.md"
|
|
203
204
|
- ".github/workflows/test_ci.yml"
|
|
204
205
|
- ".gitignore"
|
|
205
206
|
- ".rubocop.yml"
|
|
@@ -238,7 +239,6 @@ files:
|
|
|
238
239
|
- lib/groundskeeper/rubygems.rb
|
|
239
240
|
- lib/groundskeeper/semantic_version.rb
|
|
240
241
|
- lib/groundskeeper/sentry.rb
|
|
241
|
-
- lib/groundskeeper/slack.rb
|
|
242
242
|
- lib/groundskeeper/ssh.rb
|
|
243
243
|
- lib/groundskeeper/string_utils.rb
|
|
244
244
|
- lib/groundskeeper/version.rb
|
data/lib/groundskeeper/slack.rb
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Groundskeeper
|
|
4
|
-
# Posts to the RADD #general channel.
|
|
5
|
-
class Slack
|
|
6
|
-
COMMAND = "curl"
|
|
7
|
-
SLACK_WORKSPACE_KEY = "SLACK_WORKSPACE"
|
|
8
|
-
SLACK_CHANNEL_KEY = "SLACK_CHANNEL"
|
|
9
|
-
SLACK_TOKEN_KEY = "SLACK_TOKEN"
|
|
10
|
-
URL = "https://hooks.slack.com/services/" \
|
|
11
|
-
"%<workspace>s/%<channel>s/%<token>s"
|
|
12
|
-
SEND_MESSAGE = "-X POST -H 'Content-type: application/json' " \
|
|
13
|
-
"--data '{\"text\":\"%<message>s\"}' #{URL}".freeze
|
|
14
|
-
|
|
15
|
-
attr_reader :slack
|
|
16
|
-
|
|
17
|
-
def self.build
|
|
18
|
-
new Executable.new(COMMAND)
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def initialize(slack)
|
|
22
|
-
@slack = slack
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def send_message(message)
|
|
26
|
-
slack.execute(format(SEND_MESSAGE,
|
|
27
|
-
message: message,
|
|
28
|
-
workspace: ENV.fetch(SLACK_WORKSPACE_KEY, nil),
|
|
29
|
-
channel: ENV.fetch(SLACK_CHANNEL_KEY, nil),
|
|
30
|
-
token: ENV.fetch(SLACK_TOKEN_KEY, nil)))
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def credentials?
|
|
34
|
-
!ENV.fetch(SLACK_WORKSPACE_KEY, "").empty? &&
|
|
35
|
-
!ENV.fetch(SLACK_CHANNEL_KEY, "").empty? &&
|
|
36
|
-
!ENV.fetch(SLACK_TOKEN_KEY, "").empty?
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|