Skip to content

Fix/sb2tf notempty numeric - #4

Closed
Bschim wants to merge 32 commits into
OptionMetrics:mainfrom
Bschim:fix/sb2tf-notempty-numeric
Closed

Fix/sb2tf notempty numeric#4
Bschim wants to merge 32 commits into
OptionMetrics:mainfrom
Bschim:fix/sb2tf-notempty-numeric

Conversation

@Bschim

@Bschim Bschim commented Sep 4, 2026

Copy link
Copy Markdown

Description

Type of Change

  • Bug fix
  • New resource or data source
  • Enhancement to existing resource
  • Documentation
  • Other

Checklist

  • make test passes
  • make fmt has been run
  • Acceptance tests added/updated (if applicable)
  • Example configuration added in examples/ (if new resource)
  • make docs run after schema changes
  • CHANGELOG.md updated

Bschim and others added 30 commits August 31, 2026 13:16
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>
# Conflicts:
#	README.md
#	ROADMAP.md

Co-authored-by: Bschim <150930289+Bschim@users.noreply.github.com>
# 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>
…plate

# Conflicts:
#	README.md
#	ROADMAP.md
#	internal/provider/provider.go

Co-authored-by: Bschim <150930289+Bschim@users.noreply.github.com>
# Conflicts:
#	ROADMAP.md
#	internal/provider/provider.go

Co-authored-by: Bschim <150930289+Bschim@users.noreply.github.com>
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.
@Bschim Bschim closed this Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants