Skip to content

Harden Java PR CI: gate self-hosted (credentialed) jobs behind an approval environment - #4462

Closed
kyy8-L wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
kyy8-L:harden/self-hosted-fork-approval
Closed

kyy8-L wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
kyy8-L:harden/self-hosted-fork-approval

Conversation

@kyy8-L

@kyy8-L kyy8-L commented Oct 22, 2026

Copy link
Copy Markdown

What

The Java PR workflow runs java_build, java_unit_tests and the integration
(smoke / full) jobs on the self-hosted [self-hosted, it] runners. Those runners
hold Google Cloud credentials for the cloud-teleport-testing project — the IT
steps pass --it-project="cloud-teleport-testing" and there is no
google-github-actions/auth step, so the credentials come from the runner
itself. These jobs execute PR code (./cicd/run-build, run-unit-tests,
run-it-*), and nothing restricts fork pull requests, so a PR's code runs on the
credentialed runner.

Change

Add environment: fork-ci-approval to java_build. Every other self-hosted
it job transitively needs: java_build, so a single approval gate at the root
holds the whole chain until a maintainer approves the current commit.

To activate: in repo settings, add required reviewers to the
fork-ci-approval environment. Until that is configured the environment imposes
no gate, so merging this PR is behavior-neutral (safe to merge first, configure
after).

Notes

  • This mirrors the per-run approval pattern used elsewhere in the org (e.g.
    tflite-micro) for running fork code on privileged runners.
  • If you'd prefer to gate each self-hosted job individually, or to restrict these
    jobs to same-repository PRs instead, happy to adjust.

🤖 Generated with Claude Code

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@google-cla

google-cla Bot commented Oct 22, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@kyy8-L
kyy8-L force-pushed the harden/self-hosted-fork-approval branch 2 times, most recently from ce42389 to b6b893c Compare October 22, 2026 05:53
@kyy8-L

kyy8-L commented Oct 22, 2026

Copy link
Copy Markdown
Author

@googlebot I signed it!

1 similar comment
@kyy8-L

kyy8-L commented Oct 26, 2026

Copy link
Copy Markdown
Author

@googlebot I signed it!

…roval environment

The Java PR workflow runs java_build, java_unit_tests and the integration
(smoke/full) jobs on the self-hosted [self-hosted, it] runners, which hold Google
Cloud credentials for the cloud-teleport-testing project (the IT steps pass
--it-project=cloud-teleport-testing with no google-github-actions/auth step, so
the runner itself provides the credentials). These jobs run PR code
(./cicd/run-build, run-unit-tests, run-it-*) with no gate restricting fork PRs,
so a pull request's code executes on the credentialed runner.

Add `environment: fork-ci-approval` to java_build. Every other self-hosted `it`
job transitively `needs: java_build`, so one approval gate at the root holds the
whole chain until a maintainer approves the current commit. Configure required
reviewers on the fork-ci-approval environment to activate it; until then the
environment imposes no gate, so this change is behavior-neutral.
@kyy8-L
kyy8-L force-pushed the harden/self-hosted-fork-approval branch from b6b893c to 2fd49b9 Compare October 26, 2026 10:19
@kyy8-L
kyy8-L requested a review from a team as a code owner October 26, 2026 10:19
# required reviewers on the `fork-ci-approval` environment in repo settings
# to activate this (until then the environment imposes no gate, so merging
# this PR is behavior-neutral).
environment: fork-ci-approval

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not a valid way of defining this restriction since fork-ci-approval is not an environment that exists. But we already have this restriction enforced at the repo level (notice that your PR did not run CI checks)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

thanks, you're right. Since it's enforced at repo level, I'll close this.

@damccorm damccorm closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants