-
Notifications
You must be signed in to change notification settings - Fork 19
Refactor CI trigger configuration in Github Build Definition module #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughRefactors the Azure DevOps build definition's CI trigger: adds a boolean Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
modules/azuredevops/GitHub-Build-Definition/variables.tf (1)
77-89:ci_trigger_overridesstructure is well-defined; consider optional naming refinement.The variable type is correctly specified with clear field semantics. One optional improvement: the
_exclude_listand_include_listsuffixes are slightly verbose. Consider shortening to_excludeand_includefor brevity, provided the list type is clear from the object schema.Optional refinement for consistency:
type = list(object({ batch = bool max_concurrent_builds_per_branch = number polling_interval = number - branch_filter_exclude_list = list(string) - branch_filter_include_list = list(string) - path_filter_exclude_list = list(string) - path_filter_include_list = list(string) + branch_filter_exclude = list(string) + branch_filter_include = list(string) + path_filter_exclude = list(string) + path_filter_include = list(string) }))If you apply this refactoring, update the corresponding field references in
github_build_definition.tflines 36–41 to match.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
modules/azuredevops/GitHub-Build-Definition/github_build_definition.tf(1 hunks)modules/azuredevops/GitHub-Build-Definition/variables.tf(1 hunks)
🔇 Additional comments (1)
modules/azuredevops/GitHub-Build-Definition/variables.tf (1)
71-75: Variable definitions look good.The
ci_trigger_use_yamlflag and descriptive comment align well with the intended behavior, and the default oftruemaintains backward compatibility.
modules/azuredevops/GitHub-Build-Definition/github_build_definition.tf
Outdated
Show resolved
Hide resolved
11a8720 to
4b5d7ed
Compare
modules/azuredevops/GitHub-Build-Definition/github_build_definition.tf
Outdated
Show resolved
Hide resolved
modules/azuredevops/GitHub-Build-Definition/github_build_definition.tf
Outdated
Show resolved
Hide resolved
SazniMohamed
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address comments
SazniMohamed
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added few comments
Purpose
This pull request adds more flexibility to how CI triggers are configured in the Azure DevOps build definition module. It introduces new variables that allow you to choose between using YAML-based triggers or specifying custom override settings directly in Terraform. The main changes are grouped below:
CI Trigger Configuration Enhancements:
ci_trigger_use_yamlto control whether CI triggers are configured using YAML or custom overrides.ci_trigger_overridesto allow specifying detailed override options for CI triggers, such as batch settings, concurrency limits, polling intervals, and branch/path filters. These overrides are only used when YAML is not selected.Terraform Resource Logic Updates:
ci_triggerblock ingithub_build_definition.tfto use dynamic blocks. Ifci_trigger_use_yamlis true, a simple YAML-based trigger is used; if false, the trigger is built from the provided overrides, supporting multiple custom configurations.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.