Commit e7704b3
RUN-4103: Release 1.1.2: Fix value_choices validation and node_filter_exclude_query (#220)
## Summary
This PR contains bug fixes for v1.1.2 release:
1. **Fix validation error with variable-based value_choices**
([#218](#218))
- Job options with `require_predefined_choice = true` and
`value_choices` set to a Terraform variable no longer fail validation
during plan phase.
2. **Fix node_filter_exclude_query not working** - The
`node_filter_exclude_query` field was not being sent to Rundeck API
correctly. Fixed by using the correct API field name `filterExclude`
instead of `excludeFilter`.
---
## Changes
### Bug Fix 1: value_choices from variables
([#218](#218))
- **resource_job_framework.go**: Modified validation logic to skip
unknown values instead of treating them as errors
- Skip validation when entire `value_choices` list is unknown
- Skip validation when any individual choice element is unknown
- Validation runs during apply phase when values are concrete
### Bug Fix 2: node_filter_exclude_query
- **resource_job_framework.go**: Fixed `jobNodeFilters` struct to use
correct Rundeck API field
- Changed from `excludeFilter` to `filterExclude` (correct Rundeck API
field name)
- Updated `planToJobJSON` to properly set `FilterExclude` field
- Updated `jobJSONAPIToState` and `jobJSONToState` to read
`filterExclude` from API response
### Test Coverage
- **resource_job_test.go**: Added
`TestAccJobOptions_value_choices_from_variable`
- Tests job option with `value_choices` set to a variable
- Verifies plan succeeds without validation error
- Confirms values are correctly applied
- **resource_job_test.go**: Added `TestAccJob_node_filter_exclude`
- Tests `node_filter_exclude_query` with include filter
- Tests both `node_filter_query` and `node_filter_exclude_query`
together
- Verifies `node_filter_exclude_precedence` works correctly
### Documentation
- **CHANGELOG.md**: Added v1.1.2 release notes with both bug fix
descriptions
---
## Test Plan
- [x] Code compiles successfully (`go build`)
- [x] Code formatted (`make fmt`)
- [x] No linting errors (`go vet`)
- [ ] Acceptance test passes:
`TestAccJobOptions_value_choices_from_variable`
- [ ] Acceptance test passes: `TestAccJob_node_filter_exclude`
- [ ] Existing tests still pass
- [x] Manual testing with user's exact scenario from Issue #218
- [x] Manual testing of `node_filter_exclude_query` against local
Rundeck instance
---
## Backward Compatibility
✅ Fully backward compatible
- Existing validation logic unchanged for concrete values
- Still validates empty strings and requires at least one non-empty
value
- Only skips validation when values are unknown (new behavior)
- `node_filter_exclude_query` now works as documented
---
## Related Issues
Fixes #218
---------
Co-authored-by: Luis Toledo <luis@variacode.com>1 parent ed50d1b commit e7704b3
File tree
4 files changed
+198
-11
lines changed- .github/workflows
- rundeck
4 files changed
+198
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
1 | 19 | | |
2 | 20 | | |
3 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
435 | 441 | | |
436 | 442 | | |
437 | 443 | | |
| |||
442 | 448 | | |
443 | 449 | | |
444 | 450 | | |
| 451 | + | |
445 | 452 | | |
446 | 453 | | |
447 | | - | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
448 | 460 | | |
449 | 461 | | |
450 | 462 | | |
| |||
456 | 468 | | |
457 | 469 | | |
458 | 470 | | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
459 | 476 | | |
460 | 477 | | |
461 | 478 | | |
| |||
948 | 965 | | |
949 | 966 | | |
950 | 967 | | |
| 968 | + | |
| 969 | + | |
951 | 970 | | |
952 | 971 | | |
953 | 972 | | |
| |||
956 | 975 | | |
957 | 976 | | |
958 | 977 | | |
959 | | - | |
960 | | - | |
| 978 | + | |
| 979 | + | |
961 | 980 | | |
962 | 981 | | |
963 | | - | |
964 | | - | |
| 982 | + | |
| 983 | + | |
965 | 984 | | |
966 | 985 | | |
967 | 986 | | |
| |||
1152 | 1171 | | |
1153 | 1172 | | |
1154 | 1173 | | |
| 1174 | + | |
1155 | 1175 | | |
1156 | 1176 | | |
1157 | 1177 | | |
1158 | 1178 | | |
1159 | | - | |
1160 | | - | |
| 1179 | + | |
| 1180 | + | |
1161 | 1181 | | |
1162 | 1182 | | |
1163 | 1183 | | |
| |||
1302 | 1322 | | |
1303 | 1323 | | |
1304 | 1324 | | |
| 1325 | + | |
1305 | 1326 | | |
1306 | 1327 | | |
1307 | 1328 | | |
1308 | 1329 | | |
1309 | | - | |
1310 | | - | |
| 1330 | + | |
| 1331 | + | |
1311 | 1332 | | |
1312 | 1333 | | |
1313 | 1334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
76 | 102 | | |
77 | 103 | | |
78 | 104 | | |
| |||
303 | 329 | | |
304 | 330 | | |
305 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
306 | 360 | | |
307 | 361 | | |
308 | 362 | | |
| |||
671 | 725 | | |
672 | 726 | | |
673 | 727 | | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
674 | 778 | | |
675 | 779 | | |
676 | 780 | | |
| |||
1049 | 1153 | | |
1050 | 1154 | | |
1051 | 1155 | | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
1052 | 1198 | | |
1053 | 1199 | | |
1054 | 1200 | | |
| |||
0 commit comments