MCPcopy Create free account
hub / github.com/github/gh-aw / createAndConfigureCompiler

Function createAndConfigureCompiler

pkg/cli/compile_compiler_setup.go:84–120  ·  view source on GitHub ↗

createAndConfigureCompiler creates a new compiler instance and configures it based on the provided configuration

(config CompileConfig)

Source from the content-addressed store, hash-verified

82// createAndConfigureCompiler creates a new compiler instance and configures it
83// based on the provided configuration
84func createAndConfigureCompiler(config CompileConfig) *workflow.Compiler {
85 compileCompilerSetupLog.Printf("Creating compiler with config: verbose=%v, validate=%v, strict=%v, trialMode=%v",
86 config.Verbose, config.Validate, config.Strict, config.TrialMode)
87
88 // Handle force refresh action pins - reset the source action_pins.json file
89 if config.ForceRefreshActionPins {
90 if err := resetActionPinsFile(); err != nil {
91 compileCompilerSetupLog.Printf("Warning: failed to reset action_pins.json: %v", err)
92 }
93 }
94
95 // Create compiler with auto-detected version and action mode
96 // Git root is now auto-detected in NewCompiler() for all compiler instances
97 compiler := workflow.NewCompiler(
98 workflow.WithVerbose(config.Verbose),
99 workflow.WithEngineOverride(config.EngineOverride),
100 workflow.WithFailFast(config.FailFast),
101 )
102 compileCompilerSetupLog.Print("Created compiler instance")
103
104 // Configure compiler flags
105 configureCompilerFlags(compiler, config)
106
107 // Set up action mode
108 setupActionMode(compiler, config.ActionMode, config.ActionTag)
109
110 // Set up actions repository override if specified
111 if config.ActionsRepo != "" {
112 compiler.SetActionsRepo(config.ActionsRepo)
113 compileCompilerSetupLog.Printf("Actions repository overridden: %s (default: %s)", config.ActionsRepo, workflow.GitHubActionsOrgRepo)
114 }
115
116 // Set up repository context
117 setupRepositoryContext(compiler, config)
118
119 return compiler
120}
121
122// configureCompilerFlags sets various compilation flags on the compiler
123func configureCompilerFlags(compiler *workflow.Compiler, config CompileConfig) {

Callers 2

runUpgradeCommandFunction · 0.85
CompileWorkflowsFunction · 0.85

Calls 11

SetActionsRepoMethod · 0.95
NewCompilerFunction · 0.92
WithVerboseFunction · 0.92
WithEngineOverrideFunction · 0.92
WithFailFastFunction · 0.92
resetActionPinsFileFunction · 0.85
configureCompilerFlagsFunction · 0.85
setupActionModeFunction · 0.85
setupRepositoryContextFunction · 0.85
PrintMethod · 0.80
PrintfMethod · 0.45

Tested by

no test coverage detected