-
Notifications
You must be signed in to change notification settings - Fork 420
[dead-code] chore: remove dead functions — 5 functions removed #38640
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,26 +46,6 @@ const ( | |
| DefaultModelCodex = "GH_AW_DEFAULT_MODEL_CODEX" | ||
| ) | ||
|
|
||
| // ResolveDefaultMaxDailyAICredits returns the resolved daily AI Credits guardrail | ||
| // default, checking the enterprise env var GH_AW_DEFAULT_MAX_DAILY_AI_CREDITS. | ||
| // Falls back to fallback (built-in default) when the env var is unset or invalid. | ||
| // | ||
| // A value of -1 is preserved to allow explicitly disabling the guardrail. | ||
| func ResolveDefaultMaxDailyAICredits(fallback string) string { | ||
| if raw := strings.TrimSpace(os.Getenv(DefaultMaxDailyAICredits)); raw != "" { | ||
| if raw == "-1" { | ||
| managerLog.Printf("Applying enterprise override %s=%q (fallback was %q)", DefaultMaxDailyAICredits, raw, fallback) | ||
| return "-1" | ||
| } | ||
| if normalized, ok := typeutil.NormalizeInt64KMSuffix(raw); ok { | ||
| managerLog.Printf("Applying enterprise override %s=%q (fallback was %q)", DefaultMaxDailyAICredits, normalized, fallback) | ||
| return normalized | ||
| } | ||
| managerLog.Printf("Invalid %s=%q, using fallback=%q", DefaultMaxDailyAICredits, raw, fallback) | ||
| } | ||
| return fallback | ||
| } | ||
|
|
||
| // ResolveDefaultMaxAICredits returns the resolved max AI credits default, checking | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [/zoom-out] Stale spec comment in a companion file needs a follow-up cleanup.
Now that 💡 Suggested comment update in spec_test.go// TestSpec_DailyAICreditsGuardrail_RuntimeNotCompileTime validates AIC spec §9.3 (2):
// GH_AW_DEFAULT_MAX_DAILY_AI_CREDITS MUST be resolved at action runtime, not at
// compiler process environment lookup. BuildDefaultMaxDailyAICreditsExpression is
// the sole conforming API for this path; the compile-time resolver
// ResolveDefaultMaxDailyAICredits has been removed as dead code.
//
// T-AIC-DG-006: The compiler produces an expression, not a pre-resolved value. |
||
| // the enterprise env var GH_AW_DEFAULT_MAX_AI_CREDITS. | ||
| // Falls back to fallback (built-in default) when the env var is unset or invalid. | ||
|
|
||
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.
Test coverage regression: the
withNonInteractiveCIEnvappend-fallback path (return append(env, "CI=1")) is no longer exercised by any test case.💡 Why this matters / suggested fix
Before this PR,
setNonInteractiveCIEnvwrappedwithNonInteractiveCIEnv, and its now-deleted"adds CI when missing"sub-test indirectly covered the branch inwithNonInteractiveCIEnvthat appendsCI=1when noCI=entry is present in the slice.The remaining sub-test only covers the replacement branch (input already contains
CI=false). After this removal, theappend(env, "CI=1")line inwithNonInteractiveCIEnvhas no direct test.Consider adding a sub-test to maintain coverage: