ci: Ignore OAuth scopes in endpoint check#6245
Open
h-tsuboi918 wants to merge 1 commit into
Open
Conversation
The googleapis.com endpoint compliance check treated OAuth scope URLs as service endpoints and required an mTLS counterpart. Exclude https://www.googleapis.com/auth/ URLs before checking for mTLS endpoint variants. Fixes google#6238
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
2. Or, if no issue exists, describe the change:
Problem:
The
File Content ComplianceCI check treats any changed Python file containing agoogleapis.comURL as a file with a hardcoded service endpoint. This causes false positives for OAuth scope URLs such ashttps://www.googleapis.com/auth/cloud-platform, which are not service endpoints and do not have.mtls.googleapis.comcounterparts.Solution:
Update the CI check to classify matches at the URL level before building
FILES_WITH_ENDPOINTS. The check now excludes OAuth scopes underhttps://www.googleapis.com/auth/, while still checking non-scopegoogleapis.comURLs for an mTLS counterpart.Testing Plan
Unit Tests:
No Python unit tests were added because this change only updates a GitHub Actions shell check.
Local shell verification:
https://www.googleapis.com/auth/cloud-platformis not included inFILES_WITH_ENDPOINTS.https://example.googleapis.com/v1/projectsis included inFILES_WITH_ENDPOINTS.https://example.googleapis.com/v1/projectswithout.mtls.googleapis.comis reported inFILES_MISSING_MTLS.https://example.googleapis.com/v1/projectsandhttps://example.mtls.googleapis.com/v1/projectsis not reported inFILES_MISSING_MTLS.Test fixtures used locally:
Command:
Output:
Manual End-to-End (E2E) Tests:
Not run. This change affects a GitHub Actions workflow check, and local shell verification was used to validate the changed matching behavior.
Checklist
Additional context
This was observed while investigating PR #6201, where the CI check flagged
src/google/adk/tools/mcp_tool/mcp_session_manager.pybecause it contains the OAuth scopehttps://www.googleapis.com/auth/cloud-platform.Related prior PR: #5931 attempted to fix the same false positive in the older
.github/workflows/check-file-contents.ymlworkflow, but it was closed without being merged. The check now lives in.github/workflows/continuous-integration.yml.