configureCompilerFlags sets various compilation flags on the compiler
(compiler *workflow.Compiler, config CompileConfig)
| 121 | |
| 122 | // configureCompilerFlags sets various compilation flags on the compiler |
| 123 | func configureCompilerFlags(compiler *workflow.Compiler, config CompileConfig) { |
| 124 | compileCompilerSetupLog.Print("Configuring compiler flags") |
| 125 | |
| 126 | // Set validation based on the validate flag (false by default for compatibility) |
| 127 | compiler.SetSkipValidation(!config.Validate) |
| 128 | compileCompilerSetupLog.Printf("Validation enabled: %v", config.Validate) |
| 129 | |
| 130 | // Set noEmit flag to validate without generating lock files |
| 131 | compiler.SetNoEmit(config.NoEmit) |
| 132 | if config.NoEmit { |
| 133 | compileCompilerSetupLog.Print("No-emit mode enabled: validating without generating lock files") |
| 134 | } |
| 135 | |
| 136 | // Set strict mode if specified |
| 137 | compiler.SetStrictMode(config.Strict) |
| 138 | compiler.SetAllowActionRefs(config.AllowActionRefs) |
| 139 | compiler.SetForceStaged(config.Staged) |
| 140 | |
| 141 | // Set trial mode if specified |
| 142 | if config.TrialMode { |
| 143 | compileCompilerSetupLog.Printf("Enabling trial mode: repoSlug=%s", config.TrialLogicalRepoSlug) |
| 144 | compiler.SetTrialMode(true) |
| 145 | if config.TrialLogicalRepoSlug != "" { |
| 146 | compiler.SetTrialLogicalRepoSlug(config.TrialLogicalRepoSlug) |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | // Replace the agentic step with a deterministic samples replay driver when requested (hidden feature). |
| 151 | if config.UseSamples { |
| 152 | compileCompilerSetupLog.Print("Enabling --use-samples: agentic step will be replaced by a deterministic replay driver") |
| 153 | compiler.SetUseSamples(true) |
| 154 | } |
| 155 | |
| 156 | // Set refresh stop time flag |
| 157 | compiler.SetRefreshStopTime(config.RefreshStopTime) |
| 158 | if config.RefreshStopTime { |
| 159 | compileCompilerSetupLog.Print("Stop time refresh enabled: will regenerate stop-after times") |
| 160 | } |
| 161 | |
| 162 | // Set force refresh action pins flag |
| 163 | compiler.SetForceRefreshActionPins(config.ForceRefreshActionPins) |
| 164 | if config.ForceRefreshActionPins { |
| 165 | compileCompilerSetupLog.Print("Force refresh action pins enabled: will clear cache and resolve all actions from GitHub API") |
| 166 | } |
| 167 | |
| 168 | // Set safe update flag: when set via CLI it disables/skips safe update enforcement |
| 169 | // regardless of the workflow's strict mode setting. |
| 170 | compiler.SetApprove(config.Approve) |
| 171 | if config.Approve { |
| 172 | compileCompilerSetupLog.Print("Safe update changes approved via --approve flag: skipping safe update enforcement for new restricted secrets or unapproved action additions/removals") |
| 173 | } |
| 174 | |
| 175 | // Set require docker flag: when set, container image validation fails instead of |
| 176 | // silently skipping when Docker is not available. |
| 177 | compiler.SetRequireDocker(config.ValidateImages) |
| 178 | if config.ValidateImages { |
| 179 | compileCompilerSetupLog.Print("Container image validation requires Docker (--validate-images flag)") |
| 180 | } |
no test coverage detected