gotsha 0.3 → 1.0.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/CHANGELOG.md +8 -0
- data/lib/gotsha/actions/commit.rb +1 -1
- data/lib/gotsha/actions/configure.rb +1 -1
- data/lib/gotsha/actions/help.rb +49 -10
- data/lib/gotsha/actions/show.rb +1 -1
- data/lib/gotsha/actions/status.rb +1 -1
- data/lib/gotsha/templates/config.toml +9 -3
- data/lib/gotsha/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7411287a2f974c217e4cafc5adbb2181d9524ca115e447467d1b9e0ca4731c5
|
4
|
+
data.tar.gz: 848bb1ebec319ef7f118ce40ee975273546b2f69f3d1496dd584645381fc68af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83705285475022d4e72b80fa6c55e2344674a4f2112a09848a83d5ddcb5961870b16e822982e25fcf48d8ed8af9c475a8de48feaf815c1a97e6996bad1cda177
|
7
|
+
data.tar.gz: 379693d2f2bbbaf7614101207f4ad0dc2199c02c69d668091a2f6d786c793fa75fd93b85f9780efbbfb0f31040871eb1c9cd7f2824844a31e106c15cd87b62a3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [1.0.0] - 2025-10-19
|
2
|
+
|
3
|
+
- Polish the readme.
|
4
|
+
|
5
|
+
## [0.3.1] - 2025-10-18
|
6
|
+
|
7
|
+
- Add some non-Ruby test command examples to autogenerated config file. Gotsha is language-agnostic :-).
|
8
|
+
|
1
9
|
## [0.3] - 2025-10-18
|
2
10
|
|
3
11
|
- Add guide for case when `gotsha config` fails due to missing `ENV['EDITOR']`
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Gotsha
|
4
4
|
module Actions
|
5
5
|
class Commit
|
6
|
-
DESCRIPTION = "
|
6
|
+
DESCRIPTION = "runs tests on a dummy commit for manual sign-off"
|
7
7
|
|
8
8
|
def call
|
9
9
|
BashCommand.silent_run!('git -c core.hooksPath=/dev/null commit --allow-empty -m "Run Gotsha"')
|
data/lib/gotsha/actions/help.rb
CHANGED
@@ -6,20 +6,36 @@ module Gotsha
|
|
6
6
|
DESCRIPTION = "shows available commands and some tips (has optional <COMMAND> argument)"
|
7
7
|
INTERNAL_ACTIONS = %i[fetch push test].freeze
|
8
8
|
|
9
|
+
INTERNAL_COMMAND_WARNING =
|
10
|
+
"[WARNING] This is an internal command; if everything works as intended, you should not need to run it"
|
11
|
+
|
9
12
|
def call(action_name = nil)
|
10
13
|
@action_name = action_name
|
11
14
|
|
12
15
|
[
|
13
16
|
"help",
|
14
17
|
commands,
|
18
|
+
general_description,
|
19
|
+
internal_command_warning,
|
15
20
|
action_description,
|
21
|
+
workflows_example,
|
16
22
|
config_file,
|
17
23
|
contact
|
18
|
-
].compact.join("\n\n")
|
24
|
+
].compact.join("\n\n\n")
|
19
25
|
end
|
20
26
|
|
21
27
|
private
|
22
28
|
|
29
|
+
def general_description
|
30
|
+
return if @action_name
|
31
|
+
|
32
|
+
"About:\n" \
|
33
|
+
"Gotsha is a tiny local CI tool — it runs your tests locally, automatically stores the " \
|
34
|
+
"results as Git notes, and shows them right in your GitHub PR. You don’t need " \
|
35
|
+
"to change your workflow: just use `git commit` and `git push` as usual; Gotsha takes care of the rest.\n" \
|
36
|
+
"https://www.gotsha.org/"
|
37
|
+
end
|
38
|
+
|
23
39
|
def commands
|
24
40
|
return if @action_name
|
25
41
|
|
@@ -33,7 +49,7 @@ module Gotsha
|
|
33
49
|
"gotsha #{name} # #{description}"
|
34
50
|
end.compact.sort.join("\n")
|
35
51
|
|
36
|
-
"Available commands
|
52
|
+
"Available commands:\n#{commands}"
|
37
53
|
end
|
38
54
|
|
39
55
|
def action_description
|
@@ -46,17 +62,40 @@ module Gotsha
|
|
46
62
|
raise Errors::HardFail, "unknown command `#{@action_name}`"
|
47
63
|
end
|
48
64
|
|
65
|
+
def internal_command_warning
|
66
|
+
return unless @action_name
|
67
|
+
return unless INTERNAL_ACTIONS.include?(@action_name.to_sym)
|
68
|
+
|
69
|
+
INTERNAL_COMMAND_WARNING
|
70
|
+
end
|
71
|
+
|
72
|
+
def workflows_example
|
73
|
+
return if @action_name
|
74
|
+
|
75
|
+
[
|
76
|
+
"Typical workflows (and their setting in config file):",
|
77
|
+
"1. Super-fast tests (few seconds): run them automatically on every commit and push",
|
78
|
+
"- `post_commit_tests = true`",
|
79
|
+
"- `pre_push_tests = true`\n",
|
80
|
+
"2. Slower but still fast (tens of seconds): run them automatically on every push, but not on each commit",
|
81
|
+
"- `post_commit_tests = false`",
|
82
|
+
"- `pre_push_tests = true`\n",
|
83
|
+
"3. Even slower (or just annoying) tests: run them manually with `gotsha commit` command, right before " \
|
84
|
+
" asking for review. Don’t allow any autorun",
|
85
|
+
"- `post_commit_tests = false`",
|
86
|
+
"- `pre_push_tests = false`\n"
|
87
|
+
].join("\n")
|
88
|
+
end
|
89
|
+
|
49
90
|
def config_file
|
50
91
|
return if @action_name
|
51
92
|
|
52
93
|
[
|
53
|
-
"
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"
|
57
|
-
|
58
|
-
"https://github.com/melounvitek/gotsha/blob/master/lib/gotsha/templates/config.toml\n"
|
59
|
-
].join("\n\n")
|
94
|
+
"Original config file:",
|
95
|
+
"If you deleted the explaining comments config file was " \
|
96
|
+
"generated with and something is not clear now, see the original version here: " \
|
97
|
+
"https://github.com/melounvitek/gotsha/blob/master/lib/gotsha/templates/config.toml"
|
98
|
+
].join("\n")
|
60
99
|
end
|
61
100
|
|
62
101
|
def contact
|
@@ -66,7 +105,7 @@ module Gotsha
|
|
66
105
|
"Contact:",
|
67
106
|
"Is something not clear? Did you find a bug? Would you use new feature? Let's talk! \n" \
|
68
107
|
"Freel free to email me (vitek@meloun.info), or create an issue (https://github.com/melounvitek/gotsha/issues/)"
|
69
|
-
]
|
108
|
+
].join("\n")
|
70
109
|
end
|
71
110
|
end
|
72
111
|
end
|
data/lib/gotsha/actions/show.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module Gotsha
|
4
4
|
module Actions
|
5
5
|
class Status
|
6
|
-
DESCRIPTION = "
|
6
|
+
DESCRIPTION = "returns latest commit tests status (passed / failed / not verified)"
|
7
7
|
|
8
8
|
def call
|
9
9
|
last_commit_sha = BashCommand.run!("git --no-pager rev-parse HEAD").text_output
|
@@ -1,9 +1,14 @@
|
|
1
1
|
#
|
2
2
|
# Gotsha
|
3
3
|
#
|
4
|
+
# Original template this file is generated from (in case you deleted some option in your
|
5
|
+
# and want to check what it originally looked like):
|
6
|
+
# https://github.com/melounvitek/gotsha/blob/master/lib/gotsha/templates/config.toml
|
7
|
+
#
|
4
8
|
# Start by removing the `autogenerated` line below. While doing that,
|
5
9
|
# please, check the rest of this file to configure Gotsha as you need
|
6
10
|
#
|
11
|
+
#
|
7
12
|
autogenerated = true # Remove this line to start using Gotsha
|
8
13
|
|
9
14
|
#
|
@@ -17,10 +22,11 @@ commands = [
|
|
17
22
|
# Your first test command goes into the parentheses!
|
18
23
|
"",
|
19
24
|
# See some examples:
|
20
|
-
# "bundle exec rspec --order rand",
|
21
25
|
# "bin/rails t",
|
22
|
-
# "
|
23
|
-
# "
|
26
|
+
# "docker-compose exec great_app rspec"
|
27
|
+
# "npm test"
|
28
|
+
# "npx jest --ci"
|
29
|
+
# "pytest -q"
|
24
30
|
]
|
25
31
|
|
26
32
|
# Git hooks config
|
data/lib/gotsha/version.rb
CHANGED