Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 46 additions & 2 deletions .github/workflows/import-profiler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ jobs:
import-profile:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3, 4, 5, 6, 7] # 8 parallel shards
name: import-profile (Shard ${{ matrix.shard }})
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 2
fetch-depth: 0 # Fetch git history to find changed packages
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
Expand All @@ -36,5 +41,44 @@ jobs:
PY_VERSION: "3.15"
# Workaround: Allows libcst to compile on Python 3.15+ while PyO3 catches up
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"
SHARD_INDEX: ${{ matrix.shard }}
TOTAL_SHARDS: 8
run: |
ci/run_conditional_tests.sh
TARGET_BRANCH=${TARGET_BRANCH:-main}
git fetch origin "${TARGET_BRANCH}" --deepen=200 || true

# Get unique list of modified packages under packages/
modified_packages=$(git diff --name-only origin/"${TARGET_BRANCH}"... | grep '^packages/' | cut -d/ -f1,2 | sort -u)

# Filter packages assigned to this specific shard index
idx=0
packages_to_test=""
for pkg in $modified_packages; do
if [ -d "$pkg" ]; then
if [ $((idx % TOTAL_SHARDS)) -eq SHARD_INDEX ]; then
packages_to_test="$packages_to_test $pkg"
fi
idx=$((idx + 1))
fi
done

# Run tests on the assigned packages
if [ -n "$packages_to_test" ]; then
echo "Shard ${{ matrix.shard }} running packages: $packages_to_test"
PACKAGE_LIST="$packages_to_test" ci/run_conditional_tests.sh
else
echo "No packages assigned to Shard ${{ matrix.shard }}."
fi

all-import-profiles:
needs: import-profile
if: always()
runs-on: ubuntu-latest
steps:
- name: Check import profile results
run: |
if [[ "${{ needs.import-profile.result }}" != "success" && "${{ needs.import-profile.result }}" != "skipped" ]]; then
echo "Import profiles failed"
exit 1
fi
echo "All import profiles passed or were skipped"
6 changes: 2 additions & 4 deletions ci/run_single_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,11 @@ case ${TEST_TYPE} in
echo "Could not find baseline commit for ${TARGET_BRANCH:-main}. Skipping baseline generation."
fi
fi

pip install -e .

if [ -f "${BASELINE_CSV}" ]; then
python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000 --diff-baseline "${BASELINE_CSV}" --diff-threshold 100
python "${PROFILER_SCRIPT}" --package "${PACKAGE_NAME}" --iterations 11 --fail-threshold 120000 --diff-baseline "${BASELINE_CSV}" --diff-threshold 100
else
python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000
python "${PROFILER_SCRIPT}" --package "${PACKAGE_NAME}" --iterations 11 --fail-threshold 120000
Comment on lines +141 to +143

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.

medium

The --fail-threshold has been significantly increased from 5000 to 120000 (a 24x increase). While this might be necessary for a demo or a specific slow test environment, such a high threshold could prevent the profiler from detecting actual performance regressions in production. Please verify if this threshold can be lowered or if it should be parameterized.

fi
retval=$?
deactivate
Expand Down
9 changes: 8 additions & 1 deletion packages/google-auth/google/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@
__version__ = google_auth_version.__version__


__all__ = ["default", "load_credentials_from_file", "load_credentials_from_dict"]
__all__ = [
"default",
"load_credentials_from_file",
"load_credentials_from_dict",
]


# Set default logging handler to avoid "No handler found" warnings.
logging.getLogger(__name__).addHandler(logging.NullHandler())


# demo
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,6 @@ def load_ipython_extension(ipython):
ipython.register_magic_function(
_cell_magic, magic_kind="cell", magic_name="bigquery"
)


# demo
Original file line number Diff line number Diff line change
Expand Up @@ -4473,3 +4473,6 @@
"ZoneSetNestedPolicyRequest",
"ZoneSetPolicyRequest",
)


# demo
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,6 @@
"WriteBatch",
"WriteOption",
]


# demo
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,6 @@
"Token",
"EncodingType",
)


# demo
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ class SchemaServiceClient(schema_service.client.SchemaServiceClient):


__all__ = ("types", "PublisherClient", "SubscriberClient", "SchemaServiceClient")


# demo
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,6 @@
"BatchTransactionId",
"DefaultTransactionOptions",
)


# demo
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@
from google.cloud.storage.client import Client

__all__ = ["__version__", "Batch", "Blob", "Bucket", "Client"]


# demo
Loading