description = "Interactive form for editing CI/CD configuration"
display_mode = "complete"
name = "CI Configuration Editor"

# =============================================================================
# PROJECT INFORMATION
# =============================================================================

[[elements]]
border_bottom = true
border_top = true
name = "project_header"
title = "📦 Project Information"
type = "section_header"

[[elements]]
default = "my-rust-project"
name = "project_name"
nickel_path = ["project", "name"]
prompt = "Project Name"
required = true
type = "text"

[[elements]]
default = "A Rust project with CI/CD"
name = "project_description"
nickel_path = ["project", "description"]
prompt = "Project Description"
required = true
type = "text"

[[elements]]
default = "https://github.com/example/my-rust-project"
name = "project_repository"
nickel_path = ["project", "repository"]
prompt = "Repository URL"
required = true
type = "text"

# =============================================================================
# GITHUB ACTIONS CONFIGURATION
# =============================================================================

[[elements]]
border_bottom = true
border_top = true
name = "github_header"
title = "🚀 GitHub Actions Configuration"
type = "section_header"

[[elements]]
default = true
name = "enable_github_actions"
nickel_path = ["ci", "github_actions", "enabled"]
prompt = "Enable GitHub Actions CI?"
type = "confirm"

[[elements]]
default = "4"
help = "Number of parallel CI jobs (1-20)"
name = "parallel_jobs"
nickel_path = ["ci", "github_actions", "parallel_jobs"]
prompt = "Parallel Jobs"
type = "text"
when = "enable_github_actions == true"

[[elements]]
default = "60"
help = "Maximum duration for each job"
name = "timeout_minutes"
nickel_path = ["ci", "github_actions", "timeout_minutes"]
prompt = "Job Timeout (minutes)"
type = "text"
when = "enable_github_actions == true"

# =============================================================================
# RUST CONFIGURATION
# =============================================================================

[[elements]]
border_bottom = true
border_top = true
name = "rust_header"
title = "🦀 Rust Configuration"
type = "section_header"
when = "enable_github_actions == true"

[[elements]]
default = "stable"
name = "rust_version"
nickel_path = ["ci", "github_actions", "rust", "version"]
options = [
  { value = "stable", label = "Stable - Latest stable release" },
  { value = "nightly", label = "Nightly - Cutting edge features" },
  { value = "1.70.0", label = "1.70.0 - Specific version" },
]
prompt = "Rust Version"
type = "select"
when = "enable_github_actions == true"

# =============================================================================
# CACHING
# =============================================================================

[[elements]]
border_bottom = true
border_top = true
name = "cache_header"
title = "💾 Build Cache"
type = "section_header"
when = "enable_github_actions == true"

[[elements]]
default = false
help = "Cache Cargo dependencies to speed up builds"
name = "enable_cache"
nickel_path = ["ci", "github_actions", "cache", "enabled"]
prompt = "Enable dependency caching?"
type = "confirm"
when = "enable_github_actions == true"

# =============================================================================
# TOOLS CONFIGURATION
# =============================================================================

[[elements]]
border_bottom = true
border_top = true
name = "tools_header"
title = "🔧 CI Tools"
type = "section_header"
when = "enable_github_actions == true"

[[elements]]
default = true
help = "Run Rust linter on code"
name = "enable_clippy"
nickel_path = ["ci", "github_actions", "tools", "clippy", "enabled"]
prompt = "Enable cargo clippy (linter)?"
type = "confirm"
when = "enable_github_actions == true"

[[elements]]
default = "-D warnings"
help = "Command-line arguments for clippy"
name = "clippy_args"
nickel_path = ["ci", "github_actions", "tools", "clippy", "args"]
prompt = "Clippy Arguments"
type = "text"
when = "enable_github_actions == true && enable_clippy == true"

[[elements]]
default = true
help = "Check code formatting"
name = "enable_rustfmt"
nickel_path = ["ci", "github_actions", "tools", "rustfmt", "enabled"]
prompt = "Enable rustfmt (formatter)?"
type = "confirm"
when = "enable_github_actions == true"

[[elements]]
default = "2021"
name = "rustfmt_edition"
nickel_path = ["ci", "github_actions", "tools", "rustfmt", "edition"]
options = [
  { value = "2015", label = "2015" },
  { value = "2018", label = "2018" },
  { value = "2021", label = "2021" },
]
prompt = "Rust Edition for rustfmt"
type = "select"
when = "enable_github_actions == true && enable_rustfmt == true"

[[elements]]
default = false
help = "Scan for security vulnerabilities"
name = "enable_cargo_audit"
nickel_path = ["ci", "github_actions", "tools", "cargo_audit", "enabled"]
prompt = "Enable cargo-audit (security)?"
type = "confirm"
when = "enable_github_actions == true"

# =============================================================================
# DEPLOYMENT
# =============================================================================

[[elements]]
border_bottom = true
border_top = true
name = "deployment_header"
title = "🚢 Deployment"
type = "section_header"

[[elements]]
default = false
help = "Automatically deploy on successful builds"
name = "enable_deployment"
nickel_path = ["deployment", "enabled"]
prompt = "Enable deployment?"
type = "confirm"

[[elements]]
default = "production"
name = "deployment_environment"
nickel_path = ["deployment", "environment"]
options = [
  { value = "development", label = "Development" },
  { value = "staging", label = "Staging" },
  { value = "production", label = "Production" },
]
prompt = "Deployment Environment"
type = "select"
when = "enable_deployment == true"

[[elements]]
default = false
help = "Automatically deploy when main branch is updated"
name = "auto_deploy"
nickel_path = ["deployment", "auto_deploy"]
prompt = "Auto-deploy on main branch?"
type = "confirm"
when = "enable_deployment == true"

# =============================================================================
# SUMMARY
# =============================================================================

[[elements]]
border_top = true
name = "summary_header"
title = "✅ Review & Save"
type = "section_header"

[[elements]]
content = "Review your configuration above. Click Submit to save and see what changed."
name = "summary"
type = "section"
