Commit 59f757c
authored
Fix automation (#2700)
* Fix various problems found through various trials of the new automation system
* Fix automation rules
Change to ensure the following:
- Save and exit: Only forced changes are applied. Non-forced proposals are
discarded — the user never accepted them.
- Save and continue: All changes are applied. Forced overrides get orange
highlighting + warning. Non-forced fills get yellow highlighting for user
review.
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
* Document final automation rules
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
* Revise automation
The automation revision was wider-reaching than I'd realized.
Fundamentally, having 2 badge sets (where someone might never
see the other set) made it vitally important to ensure that
only controlled sets were changes, and that all changes are
shown to users. The result is much better for everyone.
This documents the new rules, and tweaks the code to actually
follow those rules.
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
* Simplify automation code
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
* Highlight justification changes
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
* Add test for _justification-only change
External automations may change *only* justifications.
Test to ensure we highlight criteria in those cases too.
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
* Fix typo
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
* Use URL to highlight save and continue automation
In "Save and Continue" we re-run automation, filling in
changes. However, the highlights weren't shown because of
redirection. Add the info in the URL so the highlights
are shown.
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
* Don't use hidden fields for highlighting
Remove dead code. We can't use hidden fields in a redirect,
and it's too confusing to have 2 mechanisms for the same thing,
so just use URL query strings.
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
* Add license, implementation_languages, and CPE to all forms with automation
Resolves issue where license and implementation_languages fields were marked
for automation highlighting in baseline forms but weren't actually displayed,
causing user confusion and unnecessary database updates.
Changes:
- Moved license, implementation_languages, and CPE fields into the shared
_form_basics.html.erb partial so they appear in all badge level forms
(passing, silver, gold, baseline-1, baseline-2, baseline-3)
- Renamed 'Identification' subsection to 'General' with new translation key
'General_project_info' to reflect that it now contains general project
information shown across all badge levels
- Added automation highlighting support for all three fields (yellow
background when auto-filled by Chief detectives or external tools)
- Updated ALWAYS_AUTOMATABLE to include cpe field
- Updated PROJECT_BASE_FIELDS to include implementation_languages and cpe
so they're loaded for all badge levels
- Removed duplicate fields from _form_0.html.erb (passing form)
Benefits:
- Automation highlighting now works correctly for baseline forms
- No more hidden field updates - users see all fields that can be automated
- More consistent forms across all badge levels
- CPE field can now be automated by both built-in and external automation
- Collects useful project information (license, languages, CPE) for all
badge levels, enabling better project analysis
All tests pass (188 controller tests, 69 integration tests).
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
* Add general_comments to General subsection in all forms
Moves general_comments field from being only in the passing form to the
shared _form_basics.html.erb partial, making it available in all badge
level forms with automation highlighting support.
Changes:
- Added general_comments field to _form_basics.html.erb after CPE field
- Added general_comments to ALWAYS_AUTOMATABLE constant
- Added general_comments to PROJECT_BASE_FIELDS (loaded for all levels)
- Removed general_comments from _form_0.html.erb (now in shared partial)
- Removed LEVELS_WITH_EXTRA_METADATA constant (no longer needed)
- Removed conditional logic for extra metadata fields
Benefits:
- Consistent forms across all badge levels (passing, silver, gold, baseline-1/2/3)
- General comments can now be automated and highlighted when auto-filled
- Removes inconsistency between passing and baseline forms
- Simplifies controller code by eliminating special case logic
All tests pass (188 controller tests, 69 integration tests).
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
* Add visual cues that "Save and continue" runs automation
Makes it clearer to users that clicking "Save (and continue)" will run
automation to fill in unknown values.
Changes:
- Added robot emoji (🤖) to "Save (and continue)" button text
- Added tooltip on button hover: "Runs automation to fill unknown values"
- Added info icon (ℹ️) next to button with same tooltip
- Added new translation key: save_and_continue_tooltip
Implementation:
- Updated all "Save (and continue)" buttons across all forms:
* _form_0.html.erb (passing) - 6 buttons
* _form_1.html.erb (silver) - 7 buttons
* _form_2.html.erb (gold) - 6 buttons
* _form_baseline.html.erb (baseline-1/2/3) - 2 buttons
- Used internationalization (I18n.t) for all user-facing text
Benefits:
- Users immediately see the robot icon indicating automation
- Hover reveals detailed explanation of what happens
- Info icon provides additional visual cue for discoverability
- Consistent with existing automation highlighting (robot emoji on fields)
- All text is internationalized for translation
All tests pass (188 controller tests, 69 integration tests).
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
* Remove info icons from Save and continue buttons
The info icons were not adding value beyond the robot emoji and tooltip.
Keeping just the robot emoji in the button text and the tooltip on hover
provides sufficient visual cues without cluttering the interface.
Changes:
- Removed glyphicon-info-sign icons from all Save and continue buttons
- Kept robot emoji (🤖) in button text
- Kept tooltip on button hover
All tests pass (188 controller tests).
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
* Move robot emoji to follow Save and continue button text
The primary action is "Save (and continue)" so that should be read first.
The robot emoji now follows the text as a visual hint that automation runs.
Changes:
- Changed button text from: 🤖 Save (and continue)
- To: Save (and continue) 🤖
This improves readability by emphasizing the action (save) before the
indicator (automation).
All tests pass (188 controller tests).
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
---------
Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>1 parent 904bceb commit 59f757c
File tree
12 files changed
+876
-502
lines changed- app
- controllers
- lib
- views/projects
- config/locales
- docs
- test
- controllers
- integration
12 files changed
+876
-502
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | | - | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
26 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
27 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
28 | 42 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
34 | 46 | | |
35 | 47 | | |
36 | 48 | | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
| |||
43 | 40 | | |
44 | 41 | | |
45 | 42 | | |
46 | | - | |
| 43 | + | |
47 | 44 | | |
48 | 45 | | |
49 | 46 | | |
| |||
78 | 75 | | |
79 | 76 | | |
80 | 77 | | |
81 | | - | |
82 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
83 | 81 | | |
84 | 82 | | |
85 | 83 | | |
| |||
106 | 104 | | |
107 | 105 | | |
108 | 106 | | |
109 | | - | |
110 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
| |||
137 | 136 | | |
138 | 137 | | |
139 | 138 | | |
140 | | - | |
141 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
| |||
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
247 | | - | |
248 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
249 | 251 | | |
250 | 252 | | |
251 | 253 | | |
| |||
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
278 | | - | |
279 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
280 | 283 | | |
281 | 284 | | |
282 | 285 | | |
| |||
291 | 294 | | |
292 | 295 | | |
293 | 296 | | |
294 | | - | |
295 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
296 | 300 | | |
297 | 301 | | |
298 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
| |||
43 | 40 | | |
44 | 41 | | |
45 | 42 | | |
46 | | - | |
| 43 | + | |
47 | 44 | | |
48 | 45 | | |
49 | 46 | | |
| |||
67 | 64 | | |
68 | 65 | | |
69 | 66 | | |
70 | | - | |
71 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
72 | 70 | | |
73 | 71 | | |
74 | 72 | | |
| |||
95 | 93 | | |
96 | 94 | | |
97 | 95 | | |
98 | | - | |
99 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
| |||
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
130 | | - | |
131 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| |||
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
211 | | - | |
212 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
213 | 215 | | |
214 | 216 | | |
215 | 217 | | |
| |||
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
227 | | - | |
228 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
229 | 232 | | |
230 | 233 | | |
231 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
| |||
50 | 47 | | |
51 | 48 | | |
52 | 49 | | |
53 | | - | |
| 50 | + | |
54 | 51 | | |
55 | 52 | | |
56 | 53 | | |
| |||
64 | 61 | | |
65 | 62 | | |
66 | 63 | | |
67 | | - | |
68 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
69 | 67 | | |
70 | 68 | | |
71 | 69 | | |
| |||
105 | 103 | | |
106 | 104 | | |
107 | 105 | | |
108 | | - | |
109 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
110 | 109 | | |
111 | 110 | | |
112 | 111 | | |
| |||
0 commit comments