-
Notifications
You must be signed in to change notification settings - Fork 2k
feat: support testing on forked repos #4057
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
Conversation
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.
Hello @davidcavazos, 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!
Summary of Changes
This pull request adds support for running tests on forked repositories after a reviewer's approval. It introduces workflow_run files for both production and development environments, ensuring that check statuses are reported back to the pull request.
Highlights
- Fork Support: Enables testing on forked repositories, enhancing collaboration and contribution workflows.
- Workflow Automation: Implements workflow_run files for production and development to automatically report check statuses to the pull request.
Changelog
- .github/workflows/dev.yml
- Added workflow file to run tests on development environment for forked repos and report check status to the PR.
- .github/workflows/prod.yml
- Added workflow file to run tests on production environment for forked repos and report check status to the PR.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
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 issue 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 is currently in preview and 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 to provide feedback.
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.
A fork in the road,
Tests now run, code bestowed,
Checks pass with grace,
PR's warm embrace,
Bugs vanish, neatly stowed.
Footnotes
-
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. ↩
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.
Code Review
The pull request introduces workflow runs for forked repositories, enhancing the testing process. The changes seem well-structured, but I have a few suggestions to improve clarity and maintainability.
Merge Readiness
The changes look good overall. I recommend addressing the identified issues before merging. I am unable to directly approve the pull request, and others should review and approve this code before merging.
bd3f06c
to
b0cd84d
Compare
b0cd84d
to
578dc66
Compare
…ples into support-forks
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.
LGTM, with caveat that I still don't understand Actions well enough for a deep review, comments mostly about comments/communication.
timeout-minutes: 5 | ||
steps: | ||
- name: Check in_progress | ||
uses: GoogleCloudPlatform/cloud-samples-tools/actions/steps/[email protected] |
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.
I think we may get an immediate renovate PR to bump all these versions to 0.2.4, but that might be a good follow up test for running tests from forks?
description: Branch, tag, or commit SHA to run tests on | ||
type: string | ||
default: main | ||
# schedule: |
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.
Will we ever want to schedule tests on forked runs? If not we could remove this comment.
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 schedule runs from main always, not from forks. This would basically enable nightly tests. I haven't tested it yet so that's why it's commented out, but we eventually want to enable schedule for nightlies. There would be a special case handling on affected to run on everything if it's a schedule (rather than diffs).
- main | ||
workflow_run: | ||
workflows: | ||
- Custard CI # .github/workflows/custard-ci.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.
Apologies, I don't understand this comment. Is it referencing that this workflow is related to the main ones. Or is it something that could be updated or just removed?
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.
No, the workflow_run references workflows by name, not by filename. That comment is just the filename that contains that job name. For our own discoverability.
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.
Ah! I misunderstood. In that case... are the dev and prod versions of -run both running the same workflow by name then?
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.
Yes, both are triggered by the same pull_request workflow.
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: (experimental) Custard run |
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.
Is there a way to add a note or description (that would surface in the GH UI) or at least a code comment to let folks know that the purpose of the -run workflows are to "support to run tests on forked repos (after reviewer's approval)"?
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.
I'll add a bit more context around this.
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 "Custard run" workflows are never visible from a PR, they're basically an implementation detail. That's why we're manually creating checks to reflect back on the PR. I added some comments on the purpose of every event trigger.
* feat: support testing on forked repos * add pull_request to test on PR * remove prod suffix * decode json on matrix paths * add experimental to check names * add experimental to job names * run test only if paths is not empty * test explicitly against empty array * move experimental as a prefix * success check if no paths are found * always set check to done * remove pull_request trigger * rearrange if check * add more comments
* feat: support testing on forked repos * add pull_request to test on PR * remove prod suffix * decode json on matrix paths * add experimental to check names * add experimental to job names * run test only if paths is not empty * test explicitly against empty array * move experimental as a prefix * success check if no paths are found * always set check to done * remove pull_request trigger * rearrange if check * add more comments
* feat: support testing on forked repos * add pull_request to test on PR * remove prod suffix * decode json on matrix paths * add experimental to check names * add experimental to job names * run test only if paths is not empty * test explicitly against empty array * move experimental as a prefix * success check if no paths are found * always set check to done * remove pull_request trigger * rearrange if check * add more comments
* feat: support testing on forked repos * add pull_request to test on PR * remove prod suffix * decode json on matrix paths * add experimental to check names * add experimental to job names * run test only if paths is not empty * test explicitly against empty array * move experimental as a prefix * success check if no paths are found * always set check to done * remove pull_request trigger * rearrange if check * add more comments
* feat: support testing on forked repos * add pull_request to test on PR * remove prod suffix * decode json on matrix paths * add experimental to check names * add experimental to job names * run test only if paths is not empty * test explicitly against empty array * move experimental as a prefix * success check if no paths are found * always set check to done * remove pull_request trigger * rearrange if check * add more comments
Description
Adds support to run tests on forked repos (after reviewer's approval).
This adds a workflow_run file for both prod and dev. They all report back their check status to the PR.
Checklist
npm test
(see Testing)npm run lint
(see Style)GoogleCloudPlatform/nodejs-docs-samples
. Not a fork.