Skip to content

[WIP] ci/openssl: Select the affected tests with query, not cquery - #49338

Draft
phlax wants to merge 1 commit into
envoyproxy:mainfrom
phlax:ci-openssl-affected-query
Draft

phlax wants to merge 1 commit into
envoyproxy:mainfrom
phlax:ci-openssl-affected-query

Conversation

@phlax

@phlax phlax commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Commit Message: ci/openssl: Select the affected tests with query, not cquery
Additional Description:

openssl.test_affected seeds a changed BUILD or .bzl file's whole package into kind(test, rdeps(U, set(...))). cquery analyses every target those patterns match, manual ones included, and the release signing targets in //distribution fail analysis without a key path, so any change that touches both compat/openssl and distribution/ fails the job:

in pgp_sign rule //distribution:signed_changes-x64-envoy-contrib-1.40-jammy:
No key path configured for @@//distribution:signed_changes-...

The tests are now selected with bazel query, which only loads packages, and cquery is used only to drop the incompatible tests from the selected labels. Query follows every select branch, so it can select a few more tests. Both queries are passed in a file, as the selection can be long.

Query sees the defaults of the //bazel:ssl///bazel:crypto label flags (BoringSSL), not the OpenSSL libraries --config=openssl sets them to, so a seed in the OpenSSL libraries' dependencies also seeds the flags, selecting the tests cquery reached through them.

Risk Level: low (CI test selection for openssl.test_affected)
Testing: CI
Docs Changes: n/a
Release Notes: n/a

@phlax
phlax requested a balanced review from Copilot November 16, 2026 21:47
@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #49338 was opened by phlax.

see: more, trace.

Copilot AI left a comment

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.

🟡 Changes recommended

The affected-test query follows BoringSSL defaults instead of OpenSSL overrides, allowing compatibility-source changes to omit affected Envoy TLS tests that the later cquery cannot recover.

1 open issue
What changed in this PR

Updates OpenSSL affected-test selection in CI to avoid analyzing unrelated release-signing targets that require credentials.

Changes:

  • Uses bazel query to discover affected tests, then cquery to filter incompatible targets.
  • Passes query expressions through temporary files to support long label lists.
  • Preserves query failure reporting and deduplicates selected test labels.
File Description
ci/​do_ci.sh Generalizes the query helper and separates test discovery from compatibility filtering.

Review effort: Balanced

Comment thread ci/do_ci.sh Resolved
`openssl.test_affected` seeds a changed `BUILD` or `.bzl` file's whole
package into `kind(test, rdeps(U, set(...)))`. cquery analyses every
target those patterns match, manual ones included, and the release
signing targets in //distribution fail analysis without a key path, so
any change that touches both `compat/openssl` and `distribution/` fails
the job:

  in pgp_sign rule //distribution:signed_changes-x64-envoy-contrib-1.40-jammy:
  No key path configured for @@//distribution:signed_changes-...

The tests are now selected with `bazel query`, which only loads
packages, and cquery is used only to drop the incompatible tests from
the selected labels. Query follows every `select` branch, so it can
select a few more tests. Both queries are passed in a file, as the
selection can be long.

Query sees the defaults of the `//bazel:ssl`/`//bazel:crypto` label
flags (BoringSSL), not the OpenSSL libraries `--config=openssl` sets
them to, so a seed in the OpenSSL libraries' dependencies also seeds
the flags, selecting the tests cquery reached through them.

Signed-off-by: Ryan Northey <[email protected]>
@phlax
phlax force-pushed the ci-openssl-affected-query branch from f6ecf9f to 6bd3713 Compare November 16, 2026 22:02
@phlax
phlax requested a balanced review from Copilot November 16, 2026 22:03

Copilot AI left a comment

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.

🟢 Approval recommended

No active review issues were identified for the OpenSSL affected-test selection changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants