Skip to content

[modelarmor] Expose Template filter version selector (filterVersionSelector) in the Java client #14546

Closed

Description

@bxie-box

Issue Details

The Model Armor documentation describes pinning a template's filter version by setting
templateMetadata.filterVersionSelector (for example, alias FILTER_VERSION_ALIAS_STABLE):
https://docs.cloud.google.com/model-armor/set-filter-version

The Java client library doesn't expose this field, so there's no typed way to set or update the
filter version selector when creating (CreateTemplate) or updating (UpdateTemplate) a template.

What I checked in google-cloud-modelarmor 0.39.0 (latest on Maven Central as of this filing):

  • proto-google-cloud-modelarmor-v1 and proto-google-cloud-modelarmor-v1beta contain no
    FilterVersionSelector message and no FILTER_VERSION_ALIAS_* enum.
  • Template.TemplateMetadata.Builder has no filter version getter or setter in either v1 or
    v1beta.
  • The field is also missing from the published protos in googleapis/googleapis
    (google/cloud/modelarmor/v1/service.proto and v1beta/service.proto), so the gap appears to be
    in the upstream API definition rather than in client generation.

I opened a Google Cloud support case first, and support directed me to file an issue here.

Requested change: expose the filter version selector in the Model Armor protos and Java client
so it can be set on template create and update, including through an update_mask path such as
template_metadata.filter_version_selector.

Environment

  • OS Type and Version: macOS 26 (development)
  • Java Version and JDK Vendor: Java 25 (Azul Zulu 25.0.3+9-LTS)
  • (If using GraalVM) GraalVM Version: N/A, not using GraalVM

GCP deployment details: N/A. This is a missing API field in the client library, not an
environment-specific runtime failure.

Dependencies

Provide the versions of the relevant libraries:

  • Libraries-Bom: not used
    • Client Libraries: com.google.cloud:google-cloud-modelarmor:0.39.0
      (proto-google-cloud-modelarmor-v1:0.39.0, proto-google-cloud-modelarmor-v1beta:0.39.0)
  • Gax (gax / gax-grpc / gax-httpjson): 2.86.0
  • Auth (google-auth-library-oauth2-http / google-auth-library-credentials): 1.53.0
  • Any other relevant Java SDK dependencies:
    • Google-Http-Java-Client: 2.2.0
    • protobuf-java: 4.33.6
    • grpc-api: 1.83.0

Reproducer

Steps to reproduce:

  1. Add com.google.cloud:google-cloud-modelarmor:0.39.0 to a Java project.
  2. Try to set a filter version selector on a template's metadata, as described in the
    documentation linked above.
  3. There's no corresponding type or builder method to call, so the code doesn't compile.

Code snippet showing what I'd expect to be able to write (these types and methods don't exist in
0.39.0):

Template template =
    Template.newBuilder()
        .setFilterConfig(filterConfig)
        .setTemplateMetadata(
            Template.TemplateMetadata.newBuilder()
                // Not available in v1 or v1beta as of 0.39.0:
                .setFilterVersionSelector(
                    FilterVersionSelector.newBuilder()
                        .setAlias(FilterVersionAlias.FILTER_VERSION_ALIAS_STABLE)))
        .build();

try (ModelArmorClient client = ModelArmorClient.create()) {
  client.createTemplate(
      CreateTemplateRequest.newBuilder()
          .setParent(LocationName.of(projectId, location).toString())
          .setTemplateId(templateId)
          .setTemplate(template)
          .build());
}

To confirm the field is absent from the generated classes:

javap -cp proto-google-cloud-modelarmor-v1-0.39.0.jar \
  'com.google.cloud.modelarmor.v1.Template$TemplateMetadata$Builder' | grep -i filterversion
# (no output)

Logs and Stack Trace

N/A.

Behavior

  • When did the issue begin? The field has been missing in every version
  • Is this behavior flaky? No, it's consistent: the API surface isn't there.
  • Is this behavior related to the volume of data? No.

No workaround to setting this for us since we cannot call REST API directly in the deployed system

Activity

  1. saloni-eng commented on Oct 2, 2026

    @saloni-eng

    Hey,
    I'd like to look into this, could you pls assign this to me or confirm no one else is working on the same?
    Thanks!

  2. jinseopkim0 commented on Oct 2, 2026

    @jinseopkim0
    Contributor

    If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response. We try to review GitHub issues on a regular basis, however we cannot guarantee an SLO.

  3. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    priority: p3Desirable enhancement or fix. May not be included in next release.
    on Oct 2, 2026
  4. bxie-box commented on Oct 2, 2026

    @bxie-box
    Author

    Hi Jin,
    I created a Google Support Case actually, but was redirected here to create an issue instead. I will add this Github Issue back to the case.

  5. lqiu96 commented on Oct 20, 2026

    @lqiu96
    Member

    Taking a look at this. FilterVersionSelector looks to be field on the protos. These libraries are generated from upstream protos so any changes in the library will be overwritten on the next generation.

    Let me ask around to help get this field propagated to the library. Looks like there may have been a link missing here. I don't think this exists in any of the other languages, so this may just have been something that went wrong upstream.

  6. lqiu96 commented on Oct 21, 2026

    @lqiu96
    Member

    Update: Talked to internal team and changes were accidentally left out. We are fixing this and the upstream changes are making their to the repo. We should be able to generate again with the proper changes soon.

    Apologies for the issue and thanks for your patience :)

  7. lqiu96 commented on Oct 21, 2026

    @lqiu96
    Member

    This should be generated in #14717. Marking this as closed and this should be part of the next release coming out this week. Will be updated in the next version of modelarmor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions