Skip to content
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

ci: remove use of pull_request_target (part 1) #3747

Merged
merged 6 commits into from
Jul 19, 2024
Merged

ci: remove use of pull_request_target (part 1) #3747

merged 6 commits into from
Jul 19, 2024

Conversation

grayside
Copy link
Collaborator

Description

This change is the start on removing pull_request_target from sample testing workflows.

  1. Templates are updated to add the labeled type to the pull_request trigger, and remove the pull_request_target.
  2. The ai-platform-snippets.yaml workflow is updated to match
  3. The reused remove-label.yaml workflow is converted to a no-op echo statement providing maintainer guidance
  4. CONTRIBUTING.md is updated to note this behavior around PR testing controls

Workshop the pattern and guidance here, then migrate remaining workflows to this trigger configuration in follow-up.

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

  • I have followed guidelines from CONTRIBUTING.MD and Samples Style Guide
  • Tests pass: npm test (see Testing)
  • Lint pass: npm run lint (see Style)
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • This pull request is from a branch created directly off of GoogleCloudPlatform/nodejs-docs-samples. Not a fork.
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new sample directory, and I created GitHub Actions workflow for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

@product-auto-label product-auto-label bot added samples Issues that are directly related to samples. api: workflows Issues related to the Workflows API. labels Jul 18, 2024
@grayside grayside marked this pull request as ready for review July 18, 2024 23:43
@grayside grayside requested review from a team as code owners July 18, 2024 23:43

When a Pull Request is opened, reopened, or has new commits pushed the tests will be run.

If the tests for a sample change do not run, they can be triggered by adding the `actions:force-run` label.
Copy link
Contributor

Choose a reason for hiding this comment

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

This only triggers a subset of tests right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this is for the sample tests, as distinguished from all validations/checks that are run.

Added a comment with a suggestion to clarify.

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
Copy link
Contributor

@iennae iennae left a comment

Choose a reason for hiding this comment

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

minor doc updates/subtle log message change, but I'm cool with this as is as an incremental improvement towards better and getting us to testing this and validating this approach.

CONTRIBUTING.md Outdated Show resolved Hide resolved
@grayside grayside assigned grayside and unassigned glasnt Jul 19, 2024
@grayside
Copy link
Collaborator Author

It appears there are multiple problems with the ai-platform-snippets, but fixing them is out of scope here. Going to swap them out for another test suite to make sure we have an end-to-end example of this approach working.

@grayside grayside added actions:force-run and removed api: workflows Issues related to the Workflows API. labels Jul 19, 2024
@grayside
Copy link
Collaborator Author

Added the actions:force-run label, and both the existing pull_request_target and the new pull_request triggers are activated. The former would be expected to remove the label, but it turns out most of the sample test workflows don't clean-up the label anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions:force-run samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants