geordi 12.1.1 → 12.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04313c8ce7c7ad6e748f4b75a35deb5e888c66bbbc1070e1213677b610c971f1
4
- data.tar.gz: 210726dbce934e3d0db120b4f7a5aa2eba7bbb4d4056868e8e083eadcbec02c2
3
+ metadata.gz: d9e766c4baaefc4065662e1efa4004110d2ba16eb4da7021cffbf1bea8b83b77
4
+ data.tar.gz: e131a2fccc5ba9db7b992c58fe42b402fcc59651d7c52935cb8a2f6b543d0c85
5
5
  SHA512:
6
- metadata.gz: a52a0c665afd173e9371cad4fa64a65dc3fea587f9c415f376aa3706799b222e55917a8e47ad0e4a8d71b78e35c0ed2b5115cc0f0ef95a9c720e1de25b51d809
7
- data.tar.gz: 00c8b800c1ea5b89e63e178c26448a93db8de1cb566ddf324facfb99ede4df107e19100eeee0bf42fac1c4db5d8e7c6d43a919bd4e6015d5481ecfdb22587c5d
6
+ metadata.gz: 2f9b6cb8eb4446380a744db6abb19f15a040ab6a2d0bbca5d54454d46ec308d687d2e4a11ddabc51c37bccbe0033cbf43882dcb69fedc4e9398cd09071df88a3
7
+ data.tar.gz: c36974d65e12a0b4020cf1dfe5e9303dc8bba71aa3082ff675a002fb6d68469af7da4e5774d67c233414755cb8a068fb8f7dd46d2d3ac8069ec963c515d9bb3d
data/CHANGELOG.md CHANGED
@@ -6,11 +6,23 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
6
6
  ## Unreleased
7
7
 
8
8
  ### Compatible changes
9
- * `geordi commit` will now auto-suggest a matching issue based on the current branch
10
9
 
11
10
  ### Breaking changes
12
11
 
13
12
 
13
+ ## 12.2.0 2025-07-03
14
+
15
+ ### Compatible changes
16
+ * `geordi deploy` will now respect the configured deploy branch from teh Capistrano config. Previously, it would choose "production" for a deploy to the production stage, and master/main else.
17
+
18
+
19
+ ## 12.1.0 2025-05-03
20
+
21
+ ### Compatible changes
22
+ * `geordi commit` will now auto-suggest a matching issue based on the current branch
23
+ * Some improvements and fixes
24
+
25
+
14
26
  ## 12.0.0 2025-02-25
15
27
 
16
28
  ### Compatible changes
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ gemspec
6
6
  gem 'aruba', '< 1' # Drops support for Ruby 2.2-
7
7
  gem 'rake', '< 13' # Drops support for Ruby 2.1
8
8
  gem 'rspec'
9
+ gem 'abbrev' # Dependency of Highline
9
10
  gem 'highline'
10
11
  gem 'parallel_tests'
11
12
  gem 'launchy'
data/Gemfile.lock CHANGED
@@ -1,12 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- geordi (12.1.1)
4
+ geordi (12.2.0)
5
5
  thor (~> 1)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
+ abbrev (0.1.2)
10
11
  addressable (2.7.0)
11
12
  public_suffix (>= 2.0.2, < 5.0)
12
13
  aruba (0.14.14)
@@ -88,6 +89,7 @@ PLATFORMS
88
89
  ruby
89
90
 
90
91
  DEPENDENCIES
92
+ abbrev
91
93
  aruba (< 1)
92
94
  cucumber (~> 9)
93
95
  geordi!
data/README.md CHANGED
@@ -48,7 +48,7 @@ On the first execution we ask for your Linear API token. It will be
48
48
  stored in `~/.config/geordi/global.yml`.
49
49
 
50
50
  **Options**
51
- - `-m, --from-main, [--from-master], [--no-from-master]`: Branch from master instead of the current branch
51
+ - `-m, --from-main, --from-master`: Branch from master instead of the current branch
52
52
 
53
53
 
54
54
  ### `geordi capistrano COMMAND`
@@ -98,7 +98,7 @@ servers. When passed a number, directly connects to the selected server.
98
98
  IRB flags can be given as `irb_flags: '...'` in the global Geordi config file (`~/.config/geordi/global.yml`).
99
99
 
100
100
  **Options**
101
- - `-s, [--select-server=[SERVER_NUMBER]]`: Select a server to connect to
101
+ - `-s, --select-server=[SERVER_NUMBER]`: Select a server to connect to
102
102
 
103
103
 
104
104
  ### `geordi cucumber [FILES and OPTIONS]`
@@ -117,11 +117,11 @@ In order to limit processes in a parallel run, you can set an environment
117
117
  variable like this: `PARALLEL_TEST_PROCESSORS=6 geordi cucumber`
118
118
 
119
119
  **Options**
120
- - `-m, [--modified], [--no-modified]`: Run all modified features
121
- - `-c, [--containing=STRING]`: Run all features that contain STRING
122
- - `-v, [--verbose], [--no-verbose]`: Show the test run command
123
- - `-d, [--debug], [--no-debug]`: Run Cucumber with `-f pretty -b`, which helps hunting down bugs
124
- - `-r, [--rerun=N]`: Rerun features up to N times while failing
120
+ - `-m, --modified`: Run all modified features
121
+ - `-c, --containing=STRING`: Run all features that contain STRING
122
+ - `-v, --verbose`: Show the test run command
123
+ - `-d, --debug`: Run Cucumber with `-f pretty -b`, which helps hunting down bugs
124
+ - `-r, --rerun=N`: Rerun features up to N times while failing
125
125
 
126
126
 
127
127
  ### `geordi delete-dumps [DIRECTORY]`
@@ -170,8 +170,8 @@ instead of `cap deploy:migrations`. You can force using `deploy` by passing the
170
170
  -M option: `geordi deploy -M staging`.
171
171
 
172
172
  **Options**
173
- - `-M, [--no-migrations], [--no-no-migrations]`: Run cap deploy instead of cap deploy:migrations
174
- - `-c, [--current-branch], [--no-current-branch]`: Set DEPLOY_BRANCH to the current branch during deploy
173
+ - `-M, --no-migrations`: Run cap deploy instead of cap deploy:migrations
174
+ - `-c, --current-branch`: Set DEPLOY_BRANCH to the current branch during deploy
175
175
 
176
176
 
177
177
  ### `geordi drop-databases`
@@ -191,11 +191,11 @@ Geordi will ask for confirmation before actually dropping databases and will
191
191
  offer to edit the whitelist instead.
192
192
 
193
193
  **Options**
194
- - `-P, [--postgres-only], [--no-postgres-only]`: Only clean PostgreSQL
195
- - `-M, [--mysql-only], [--no-mysql-only]`: Only clean MySQL/MariaDB
196
- - `[--postgres=PORT_OR_SOCKET]`: Use PostgreSQL port or socket
197
- - `[--mysql=PORT_OR_SOCKET]`: Use MySQL/MariaDB port or socket
198
- - `-S, [--sudo], [--no-sudo]`: Access databases as root
194
+ - `-P, --postgres-only`: Only clean PostgreSQL
195
+ - `-M, --mysql-only`: Only clean MySQL/MariaDB
196
+ - `--postgres=PORT_OR_SOCKET`: Use PostgreSQL port or socket
197
+ - `--mysql=PORT_OR_SOCKET`: Use MySQL/MariaDB port or socket
198
+ - `-S, --sudo`: Access databases as root
199
199
 
200
200
 
201
201
  ### `geordi dump [TARGET]`
@@ -225,8 +225,8 @@ not match, please issue separate commands for dumping (`dump -d`) and sourcing
225
225
  (`dump -l -d`).
226
226
 
227
227
  **Options**
228
- - `-l, [--load=[DUMP_FILE]]`: Load a dump
229
- - `-d, [--database=NAME]`: Target database, if there are multiple databases
228
+ - `-l, --load=[DUMP_FILE]`: Load a dump
229
+ - `-d, --database=NAME`: Target database, if there are multiple databases
230
230
 
231
231
 
232
232
  ### `geordi help [COMMAND]`
@@ -288,25 +288,15 @@ and pulls, and will tell each step before performing it.
288
288
 
289
289
  Part two after performing the update: `geordi security-update finish`. Switches
290
290
  branches, pulls, pushes and deploys as required by our workflow. This as well
291
- will tell each step before performing it. In detail:
292
-
293
- 1. Ask user if tests are green
294
- 2. Push production
295
- 3. Check out master and pull
296
- 4. Merge production and push in master
297
- 5. Deploy staging, if there is a staging environment
298
- 6. Ask user if deployment log is okay and staging application is still running
299
- 7. Deploy other stages
300
- 8. Ask user if deployment log is okay and application is still running on all stages
301
- 9. Inform user about the next (manual) steps
291
+ will tell each step before performing it.
302
292
 
303
293
 
304
294
  ### `geordi server [PORT]`
305
295
  Start a development server.
306
296
 
307
297
  **Options**
308
- - `-p, [--port=PORT]`: Choose a port
309
- - `-P, [--public], [--no-public]`: Make the server accessible from the local network
298
+ - `-p, --port=PORT`: Choose a port
299
+ - `-P, --public`: Make the server accessible from the local network
310
300
 
311
301
 
312
302
  ### `geordi setup`
@@ -322,8 +312,8 @@ If a local bin/setup file is found, Geordi skips its routine and runs bin/setup
322
312
  instead.
323
313
 
324
314
  **Options**
325
- - `-d, [--dump=TARGET]`: After setup, dump the TARGET db and source it into the development db
326
- - `-t, [--test], [--no-test]`: After setup, run tests
315
+ - `-d, --dump=TARGET`: After setup, dump the TARGET db and source it into the development db
316
+ - `-t, --test`: After setup, run tests
327
317
 
328
318
 
329
319
  ### `geordi shell TARGET`
@@ -335,7 +325,7 @@ Selecting the server: `geordi shell staging -s` shows a menu with all available
335
325
  servers. When passed a number, directly connects to the selected server.
336
326
 
337
327
  **Options**
338
- - `-s, [--select-server=[SERVER_NUMBER]]`: Select a server to connect to
328
+ - `-s, --select-server=[SERVER_NUMBER]`: Select a server to connect to
339
329
 
340
330
 
341
331
  ### `geordi tests [FILES]`
@@ -365,8 +355,8 @@ Example: `geordi update`
365
355
  Performs: `git pull`, `bundle install` (if necessary) and migrates (if applicable).
366
356
 
367
357
  **Options**
368
- - `-d, [--dump=TARGET]`: After updating, dump the TARGET db and source it into the development db
369
- - `-t, [--test], [--no-test]`: After updating, run tests
358
+ - `-d, --dump=TARGET`: After updating, dump the TARGET db and source it into the development db
359
+ - `-t, --test`: After updating, run tests
370
360
 
371
361
 
372
362
  ### `geordi version`
data/Rakefile CHANGED
@@ -1,6 +1,11 @@
1
+ require_relative 'lib/geordi/interaction'
2
+
1
3
  require 'bundler'
2
4
  Bundler::GemHelper.install_tasks
3
5
 
6
+ # Run this before releasing
7
+ Rake::Task['release:guard_clean'].enhance [:check]
8
+
4
9
  desc 'Default: Run all tests'
5
10
  task default: [:rspec, :features]
6
11
 
@@ -12,6 +17,12 @@ task :rspec do
12
17
  system 'bundle exec rspec'
13
18
  end
14
19
 
20
+ task :check do
21
+ Geordi::Interaction.prompt('Are all specs & features green?', 'y', /y|yes/) || Geordi::Interaction.fail('Please run all tests with `rake`.')
22
+ Geordi::Interaction.prompt('Have you updated the README?', 'y', /y|yes/) || Geordi::Interaction.fail('Please update the README with `rake readme`.')
23
+ Geordi::Interaction.prompt('Have you updated the CHANGELOG', 'y', /y|yes/) || Geordi::Interaction.fail('Please update the CHANGELOG with the latest changes.')
24
+ end
25
+
15
26
  task :readme do
16
27
  require File.expand_path('lib/geordi/cli', __dir__)
17
28
 
@@ -53,7 +64,11 @@ You can always run `geordi help <command>` to quickly look up command help.
53
64
  if visible_options.any?
54
65
  geordi_section << "**Options**\n"
55
66
  visible_options.values.each do |option|
56
- geordi_section << "- `#{option.usage}`"
67
+ usage = option.usage
68
+ .gsub(/\[(--.*?)\]/, '\1')
69
+ .sub(/, --no-[\w-]+, --skip-[\w-]+$/, '')
70
+
71
+ geordi_section << "- `#{usage}`"
57
72
  geordi_section << ": #{option.description}" if option.description
58
73
  geordi_section << "\n"
59
74
  end
@@ -18,6 +18,20 @@ module Geordi
18
18
  deploy_info.scan(/^\s*server\s*['"](.*?)['"]/).flatten
19
19
  end
20
20
 
21
+ def branch
22
+ deploy_info[/
23
+ # Marker
24
+ ^\s*set.:branch,
25
+
26
+ # Might be followed by ENV['DEPLOY_BRANCH']
27
+ .*
28
+
29
+ # Assume the last word in quotes will be the right branch
30
+ # (\1 matches the opening quote character)
31
+ (['"])(\w+)\1\s*$
32
+ /x, 2]
33
+ end
34
+
21
35
  def primary_server
22
36
  # Actually, servers may have a :primary property. From Capistrano 3, the
23
37
  # first listed server is the primary one by default, which is a good-
@@ -43,14 +57,10 @@ module Geordi
43
57
 
44
58
  def load_deploy_info
45
59
  lines = []
46
- self.deploy_info = ''
47
-
48
- if stage
49
- lines += File.readlines(File.join(root, "config/deploy/#{stage}.rb"))
50
- end
51
-
60
+ lines += File.readlines(File.join(root, "config/deploy/#{stage}.rb")).push("\n") if stage
52
61
  lines += File.readlines(File.join(root, 'config/deploy.rb'))
53
62
 
63
+ self.deploy_info = ''
54
64
  lines.each do |line|
55
65
  next if line =~ /^\s*#/ # Omit comment lines
56
66
  line.chomp! if line =~ /[\\,]\s*$/ # Join wrapped lines
@@ -1,3 +1,5 @@
1
+ require_relative '../capistrano_config'
2
+
1
3
  desc 'deploy [STAGE]', 'Guided deployment across branches'
2
4
  long_desc <<-LONGDESC
3
5
  Example: `geordi deploy` or `geordi deploy p[roduction]` or `geordi deploy --current-branch`
@@ -47,6 +49,8 @@ def deploy(target_stage = nil)
47
49
 
48
50
  # Ask for required information
49
51
  target_stage ||= Interaction.prompt 'Deployment stage:', branch_stage_map.fetch(Util.current_branch, 'staging')
52
+ capistrano_config = CapistranoConfig.new(target_stage)
53
+
50
54
  if options.current_branch
51
55
  stage_file = "config/deploy/#{target_stage}.rb"
52
56
  Util.file_containing?(stage_file, 'DEPLOY_BRANCH') || Interaction.fail(<<~ERROR)
@@ -57,10 +61,10 @@ def deploy(target_stage = nil)
57
61
  ERROR
58
62
 
59
63
  source_branch = target_branch = Util.current_branch
60
- else
64
+ else # Normal deploy
61
65
  source_branch = Interaction.prompt 'Source branch:', Util.current_branch
62
66
 
63
- deploy_branch = 'production' if target_stage == 'production'
67
+ deploy_branch = capistrano_config.branch
64
68
  deploy_branch ||= Util.git_default_branch
65
69
  target_branch = Interaction.prompt 'Deploy branch:', deploy_branch
66
70
  end
@@ -1,4 +1,5 @@
1
1
  require 'rubygems'
2
+ require 'abbrev' # Dependency of Highline
2
3
  require 'highline'
3
4
  require 'geordi/interaction'
4
5
  require 'geordi/util'
@@ -1,3 +1,4 @@
1
+ require 'abbrev' # Dependency of Highline
1
2
  require 'highline'
2
3
  require 'net/http'
3
4
  require 'json'
data/lib/geordi/remote.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'geordi/capistrano_config'
2
2
  require 'geordi/interaction'
3
3
  require 'geordi/util'
4
+ require 'abbrev' # Dependency of Highline
4
5
  require 'highline/import'
5
6
  require 'pathname'
6
7
  require 'fileutils'
@@ -1,3 +1,3 @@
1
1
  module Geordi
2
- VERSION = '12.1.1'.freeze
2
+ VERSION = '12.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geordi
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.1.1
4
+ version: 12.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-05-30 00:00:00.000000000 Z
11
+ date: 2025-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor