Class Settings

java.lang.Object
com.example.adktriaging.Settings

public final class Settings extends Object
Configuration read from environment variables. Mirrors settings.py in the Python ADK issue triaging agent.

Values are exposed as accessor methods (read lazily on each call) rather than static final fields. This keeps the class loadable in unit tests and agent loaders without a GITHUB_TOKEN present — only githubToken() throws when the token is actually required (i.e. right before a network call).

Required variables:

  • GITHUB_TOKEN — GitHub Personal Access Token with issues:write permission. Required for both interactive and workflow modes.
  • GOOGLE_API_KEY — Gemini API key. Required for both modes (or set up Vertex AI credentials and GOOGLE_GENAI_USE_VERTEXAI=TRUE).

Optional variables:

  • OWNER — defaults to google.
  • REPO — defaults to adk-java.
  • MODEL — Gemini model used for triaging. Defaults to gemini-2.5-pro; a Pro model favors classification quality over latency, which suits this low-volume, accuracy-sensitive task. Overridable without a code change.
  • INTERACTIVE1/true for interactive mode (asks for confirmation before applying labels), 0/false for unattended workflow mode. Defaults to interactive when unset.
  • DRY_RUN1/true to log intended label/assignment changes without calling the GitHub mutation endpoints. Lets you verify the full pipeline (incl. Gemini) without modifying any real issue. Defaults to off.
  • EVENT_NAME — the GitHub event that triggered the workflow (issues, schedule, etc.). Drives single-issue vs. batch behavior in AdkTriagingAgentRun.
  • ISSUE_NUMBER, ISSUE_TITLE, ISSUE_BODY — populated by the GitHub Actions workflow when the trigger is an issue event.
  • ISSUE_COUNT_TO_PROCESS — how many untriaged issues to process per scheduled run. Defaults to 3.
  • GTECH_ASSIGNEES — comma-separated list of GitHub handles to round-robin assign issues to. When unset, owner assignment is disabled (the agent reports that no triagers are configured). adk-java has no public CODEOWNERS, so real handles are supplied here rather than hard-coded in source.
  • Method Details

    • githubToken

      public static String githubToken()
      Returns the GitHub token, throwing a clear error if it is not configured.
    • hasGithubToken

      public static boolean hasGithubToken()
      Returns true if a GITHUB_TOKEN is configured, without throwing.
    • owner

      public static String owner()
    • repo

      public static String repo()
    • model

      public static String model()
      Returns the Gemini model used for triaging. Defaults to gemini-pro-latest (a Pro model favors classification quality over latency for this low-volume, accuracy-sensitive task) and is overridable via the MODEL environment variable, so it can be changed without editing source.
    • eventName

      public static @Nullable String eventName()
    • issueNumber

      public static @Nullable String issueNumber()
    • issueTitle

      public static @Nullable String issueTitle()
    • issueBody

      public static @Nullable String issueBody()
    • issueCountToProcess

      public static @Nullable String issueCountToProcess()
    • gtechAssignees

      public static @Nullable String gtechAssignees()
    • isInteractive

      public static boolean isInteractive()
    • isDryRun

      public static boolean isDryRun()
    • parseNumberString

      public static int parseNumberString(@Nullable String value, int defaultValue)
      Parses a number from a string, falling back to defaultValue on null/blank/invalid input. Mirrors parse_number_string in the Python utils.