-
Notifications
You must be signed in to change notification settings - Fork 383
[WIP] Fix failing GitHub Actions workflow build #22780
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -513,4 +513,16 @@ func TestGenerateGeminiSettingsStep(t *testing.T) { | |||||||||||||||||||||||||||||||||||||
| assert.Contains(t, content, "write_file", "Should include write_file for edit tool") | ||||||||||||||||||||||||||||||||||||||
| assert.Contains(t, content, "replace", "Should include replace for edit tool") | ||||||||||||||||||||||||||||||||||||||
| }) | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| t.Run("GH_AW_GEMINI_BASE_CONFIG env var is single-quoted for valid YAML", func(t *testing.T) { | ||||||||||||||||||||||||||||||||||||||
| workflowData := &WorkflowData{ | ||||||||||||||||||||||||||||||||||||||
| Name: "test-workflow", | ||||||||||||||||||||||||||||||||||||||
| Tools: map[string]any{}, | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| step := engine.generateGeminiSettingsStep(workflowData) | ||||||||||||||||||||||||||||||||||||||
| content := strings.Join(step, "\n") | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| // The JSON value must be single-quoted so YAML doesn't treat it as an object | ||||||||||||||||||||||||||||||||||||||
| assert.Contains(t, content, "GH_AW_GEMINI_BASE_CONFIG: '", "JSON env var value must be single-quoted for valid YAML") | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+525
to
+526
|
||||||||||||||||||||||||||||||||||||||
| // The JSON value must be single-quoted so YAML doesn't treat it as an object | |
| assert.Contains(t, content, "GH_AW_GEMINI_BASE_CONFIG: '", "JSON env var value must be single-quoted for valid YAML") | |
| // The JSON value must be single-quoted so YAML doesn't treat it as an object. | |
| // Find the specific line and verify the entire value is enclosed in single quotes. | |
| var envLine string | |
| for _, line := range strings.Split(content, "\n") { | |
| if strings.Contains(line, "GH_AW_GEMINI_BASE_CONFIG:") { | |
| envLine = line | |
| break | |
| } | |
| } | |
| require.NotEmpty(t, envLine, "GH_AW_GEMINI_BASE_CONFIG line should be present in step") | |
| trimmed := strings.TrimSpace(envLine) | |
| assert.True(t, strings.HasPrefix(trimmed, "GH_AW_GEMINI_BASE_CONFIG: '"), | |
| "JSON env var value must start with a single quote for valid YAML") | |
| assert.True(t, strings.HasSuffix(trimmed, "'"), | |
| "JSON env var value must end with a single quote for valid YAML") |
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.
The docstring is inaccurate/confusing: it says values may be misinterpreted due to “other characters”, but the implementation only quotes when the first byte is '{' or '['. It also describes escaping single quotes as "(' becomes ”)", which is incorrect (YAML single-quote escaping is done by doubling the single quote: ''), and the current text uses a curly quote character.