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

feat: detect stardoc output change #75

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
9 changes: 8 additions & 1 deletion features.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Defines all the features this module supports detecting."""

load("@bazel_features_globals//:globals.bzl", "globals")
load("//private:util.bzl", "ge", "ge_same_major", "lt")
load("//private:util.bzl", "ge", "ge_same_major", "gt", "lt")

_cc = struct(
# Whether @bazel_tools//tools/cpp:optional_current_cc_toolchain and the `mandatory` parameter
Expand Down Expand Up @@ -33,6 +33,12 @@ _cc = struct(
protobuf_on_allowlist = ge("8.0.0"),
)

_docs = struct(
# The stardoc output changed in https://github.com/bazelbuild/bazel/commit/bd1c3af2ea14e81268e940d2b8ba5ad00c3f08d7
# This may be required for "diff tests" that assert on the generated API docs.
Copy link
Member

Choose a reason for hiding this comment

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

I don't want to make it too difficult to get a new feature in, but I wonder to what extent Stardoc guarantees output stability over time and how that aligns with major/minor releases of Bazel.

Would it make sense to only run diff tests on a single pinned Bazel version so that this kind of feature detection isn't needed? Happy to merge this if you still consider it useful.

kwargs_name_with_double_star = ge("8.0.0-pre.20240603.2"),
)

_external_deps = struct(
# Whether --enable_bzlmod is set, and thus, whether str(Label(...)) produces canonical label
# literals (i.e., "@@repo//pkg:file").
Expand Down Expand Up @@ -98,6 +104,7 @@ _toolchains = struct(

bazel_features = struct(
cc = _cc,
docs = _docs,
external_deps = _external_deps,
flags = _flags,
globals = globals,
Expand Down