Skip to content

Better git hub runners#1409

Open
AustinBenoit wants to merge 6 commits intomainfrom
Better-git-hub-runners
Open

Better git hub runners#1409
AustinBenoit wants to merge 6 commits intomainfrom
Better-git-hub-runners

Conversation

@AustinBenoit
Copy link
Contributor

Description

Provide details of the change, and generalize the change in the PR title above.


Testing

Describe how you've tested these changes.


Type of Change

Place an x the applicable box:

  • Bug fix. Add the issue # below if applicable.
  • New feature. A non-breaking change which adds functionality.
  • Other, such as a build process or documentation change.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the GitHub Actions workflow by introducing more granular control over test execution and improving failure analysis. It allows for more precise selection of test applications, dynamic generation of test matrices based on APIs, and focused parsing of test results. Furthermore, it integrates automated reporting of failed jobs to an external analysis tool and refines the job retry mechanism, contributing to a more robust and efficient CI/CD pipeline.

Highlights

  • Enhanced Test App Filtering: The desktop_tester.py and test_simulator.py scripts now support more flexible filtering of test applications using an api_filter derived from the testapp_name, allowing for API-specific test execution.
  • Dynamic Test Matrix Generation: The print_matrix_configuration.py script was updated to allow an optional apis argument, enabling the generation of test matrices with API-specific entries for more targeted testing configurations.
  • FTL Test Result Filtering: The read_ftl_test_result.py script gained a new testapp_name flag, allowing it to filter and parse FTL test results only for applications whose paths contain the specified name.
  • Automated Failure Reporting to Jules: A new script, report_to_jules.py, was introduced to automatically report failed GitHub Actions jobs to the Jules API, including log filtering capabilities, to assist with root cause analysis.
  • Improved Job Retry Logic: The retry_test_failures.py script was refined to better identify and retry failed build and test jobs, and now outputs a max_retries_exhausted flag if a job fails after exceeding its retry limit.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • scripts/gha/desktop_tester.py
    • Updated test app discovery logic to use a target_file_name and an api_filter derived from testapp_name.
    • Modified logging to include the api_filter during the search.
  • scripts/gha/print_matrix_configuration.py
    • Modified get_testapp_test_matrix function signature to accept an optional apis parameter.
    • Added an api field to the generated matrix entries when apis are provided.
    • Updated the main function to parse and pass the new apis argument.
    • Added a new command-line argument -apis for specifying APIs.
  • scripts/gha/read_ftl_test_result.py
    • Added a testapp_name flag to filter FTL test results based on the test app's path.
    • Implemented logic to skip parsing results for apps that do not match the testapp_name filter.
  • scripts/gha/report_to_jules.py
    • Added a new script to report failed GitHub Actions jobs to the Jules API.
    • Implemented functions to filter log content by step pattern.
    • Included logic for creating Jules sessions and sending log messages.
    • Defined command-line flags for GitHub token, Jules token, run ID, and filtering options.
  • scripts/gha/retry_test_failures.py
    • Imported the os module.
    • Updated job name matching for build and test jobs to use in instead of startswith.
    • Added logic to check if MAX_RETRIES have been exhausted for failed jobs and set a max_retries_exhausted output.
  • scripts/gha/test_simulator.py
    • Added a testapp_name flag to filter test applications for simulator tests.
    • Modified the test app discovery loop to apply the api_filter (derived from testapp_name) to .app and .apk files.
Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/build_and_test_platform.yml
    • .github/workflows/integration_tests.yml
    • .github/workflows/retry-test-failures.yml
Activity
  • The pull request was created by AustinBenoit with a title indicating improvements to GitHub runners.
  • The description contains placeholder sections for 'Description' and 'Testing', suggesting that detailed information about the changes and testing efforts has not yet been provided by the author.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces a new API filtering mechanism across several testing scripts (desktop_tester.py, print_matrix_configuration.py, test_simulator.py, read_ftl_test_result.py), enhancing the ability to target specific test applications. It also adds a new utility script, report_to_jules.py, for automated root cause analysis of failed GitHub Actions jobs, and improves retry_test_failures.py with more flexible job name matching and retry reporting. However, the new report_to_jules.py script contains potential security vulnerabilities related to Regular Expression Denial of Service (ReDoS) and Prompt Injection, which should be addressed to ensure the reliability and integrity of the automated reporting system.

match = group_start_re.match(line)
if match:
step_name = match.group(1).strip()
if re.search(pattern, step_name):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

The script uses user-provided regex patterns (include_step_pattern and include_job_pattern) in re.search against untrusted input (step names and job names). A malicious regex can cause catastrophic backtracking, leading to a Regular Expression Denial of Service (ReDoS) of the CI job. Consider sanitizing the user-provided regex patterns or using a regex engine that is not vulnerable to backtracking, such as google/re2.


message = f"Logs for Test: {job['name']}\n{'-'*40}\n{truncated_log}\n"

send_message(FLAGS.jules_token, session_id, message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

Untrusted log content is directly concatenated into the prompt sent to the Jules LLM. An attacker who can control the logs (e.g., by causing a test failure with a specific error message) can inject instructions to manipulate the LLM's behavior and output, potentially leading to misleading root cause analysis reports. This is a classic Prompt Injection vulnerability. To mitigate this, use clear delimiters (e.g., XML-like tags) to separate the untrusted log content from the system instructions and explicitly instruct the LLM to ignore any instructions contained within the log content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant