Fix/sb2tf notempty numeric - #4
Closed
Bschim wants to merge 32 commits into
Closed
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add stonebranch_virtual_resource
# Conflicts: # README.md # ROADMAP.md Co-authored-by: Bschim <150930289+Bschim@users.noreply.github.com>
Add stonebranch_custom_day
# Conflicts: # README.md # ROADMAP.md Co-authored-by: Bschim <150930289+Bschim@users.noreply.github.com>
Co-authored-by: Bschim <150930289+Bschim@users.noreply.github.com>
Add stonebranch_email_template
…plate # Conflicts: # README.md # ROADMAP.md # internal/provider/provider.go Co-authored-by: Bschim <150930289+Bschim@users.noreply.github.com>
Add stonebranch_universal_template
# Conflicts: # ROADMAP.md # internal/provider/provider.go Co-authored-by: Bschim <150930289+Bschim@users.noreply.github.com>
Add stonebranch_task_recurring
Adds hold_resources, exclusive_tasks, and virtual_resources (consumption) to all 12 task resource types, and run_criteria, step_actions, and step_conditions to task_workflow, closing the remaining orchestration- behavior schema gaps identified in the provider extension plan. Also fixes a task_workflow Update bug where run_criteria/step_actions/ step_conditions references were rejected by the API because it validates those task references against the workflowVertices array in the same request payload rather than persisted state; the resource now fetches and echoes back current vertices when needed.
Add task resource-management and workflow run-criteria fields
Adds a `condition` nested attribute modeling the three shapes UAC uses for workflow edge branching (Status, Exit Code, Variable comparison), with ValidateConfig enforcing the correct field group per condition type. Verified live against a sandbox UAC instance (create/read/update, all three condition shapes, and a no-diff plan after apply).
Add branch condition support to workflow_edge
Models the calendar->custom_day linkage seen in the UAC export (calendar.customDays[]) as a simple list of custom_day names, matching the name-reference pattern used elsewhere in this provider. Verified live against a sandbox UAC instance (create/read, no-diff plan after apply).
Add custom_days support to stonebranch_calendar
…ions, setVariable) Wires the UAC actions object (Launch Task system operations, email notifications, abort actions, set-variable actions, SNMP notifications) into every task resource type, closing a major orchestration-behavior gap in the provider's schema. Adds a new shared task_actions.go with schema/conversion helpers reused across all 12 task resources, an acceptance test exercising system_operations and email_notifications end-to-end, and regenerated docs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add task actions schema (systemOperations, notifications, setVariable)
- sb2tf: add LocalDataSource so export/list can read from a local JSON
export directory (--source-dir/-s) instead of hitting the live API,
and add stonebranch_task_universal resource conversion support
- sb2tf: add --with-imports flag to `sb2tf export` that emits paired
import {} blocks in imports.tf for every exported resource (except
workflow_vertex/workflow_edge, which have no standalone import ID)
- fix: stonebranch_script name attribute rendered empty because the
template read JSON field "name" instead of "scriptName"
- fix: stonebranch_task_email was missing email_connection/template
because the generator looked up JSON field "emailConnection" instead
of "connection"; also add the missing template_var mapping
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add the sleepAmount API field as sleep_amount to the schema, wired into
Create/Update/Read, plus a ValidateConfig that fails terraform plan
with a clear error when sleep_type is "Seconds" and sleep_amount is
unset, instead of letting it fail at apply time with a confusing UAC
API 400 ("Timer Duration In Seconds: Field is required").
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sb2tf: local dataset import, --with-imports, field-mapping fixes
…elds
- notEmpty() only handled string/[]interface{}/bool, so every numeric
field gated by notEmpty (stable_seconds, retry_maximum, smtp_port,
limit_amount, etc. across 14 fields) was silently dropped from
exports since JSON numbers decode as float64. Add numeric cases.
- taskFileMonitorTemplate never referenced agent_var/agent_cluster_var,
so exported file monitor tasks configured with a variable-based
agent cluster lost that setting. Add both fields to the template.
- Also export sleep_amount on task_timer, which was missing from the
taskTimerTemplate even though the schema attribute already existed.
Every task template supports a shared `actions` attribute (system operations, email notifications, abort actions, set-variable actions, SNMP notifications), but none of the 13 task templates referenced .actions, so it was silently dropped from every export. This has real impact: a file-monitor task with a configured email notification for failure alerting would have that notification silently removed from its Terraform config, causing terraform apply to delete it from the live task on first run. Adds a hasActions() null-collapsing helper and shared actions_block Go template defines (reused across all 13 templates via registerTemplate), matching TaskActionsSchema() field-for-field. Co-Authored-By: Claude <noreply@anthropic.com>
Replace a real customer email-connection name that leaked into this dev-notes doc's schema-mapping analysis with a generic placeholder. Co-Authored-By: Claude <noreply@anthropic.com>
The top-level "variables" attribute (distinct from actions.set_variable_actions - same JSON key, different scope) was never referenced by any of the 18 task/trigger templates in cmd/sb2tf/generator/templates.go, so it was silently dropped from every generated .tf file regardless of the underlying UAC task/trigger having variables configured. Adds a shared task_variables_block template and wires it into all 18 affected templates, following the same pattern used for the actions block fix.
Covers the numeric notEmpty/missing-fields fix and dropped actions block (merged in #12) plus the dropped variables attribute fix in this PR, none of which had a changelog entry yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Type of Change
Checklist
make testpassesmake fmthas been runexamples/(if new resource)make docsrun after schema changes