Skip to content
Closed
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
5 changes: 5 additions & 0 deletions .gcb/scripts/per-client-features.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ for feature in "${features[@]}"; do
cargo check --profile=ci -p google-cloud-aiplatform-v1 --no-default-features --features "${feature}"
done

echo "==== google-cloud-compute-v1 ===="
cargo build -p google-cloud-compute-v1 --no-default-features
# (Optional) We could test all features of compute-v1 here, but there are ~110 of them.
# The main issue #6220 is that --no-default-features fails to build.

echo "==== DONE ===="

/workspace/.bin/sccache --show-stats
130 changes: 130 additions & 0 deletions src/generated/cloud/compute/v1/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,136 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![cfg(any(
feature = "accelerator-types",
feature = "addresses",
feature = "advice",
feature = "autoscalers",
feature = "backend-buckets",
Comment on lines +15 to +20

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.

This list would need to change every time the generator creates a new feature that enables LROs. That happens automatically, several times a year. We don't want to have to manually edit these files each time.

Ideally, we change the code generator to emit a hidden feature that represents "we need the operation types" and the generator enables that feature when any feature that needs it is enabled. Then this code can be changed once.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this makes sense long term. I looked into the generator and it already tracks which types are used for long-running
operations, so adding a hidden feature that other features can depend
on looks doable without too much trouble, and it would help the other crates with the same pattern too.

since that change lives in the generator repo, would it be okay to merge this as the immediate fix for the critical build breakage, while open an issue there for the hidden-feature. once that's implemented, I'll follow up here to switch the fix over.

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.

this makes sense long term. I looked into the generator and it already tracks which types are used for long-running operations, so adding a hidden feature that other features can depend on looks doable without too much trouble, and it would help the other crates with the same pattern too.

Thanks.

since that change lives in the generator repo, would it be okay to merge this as the immediate fix for the critical build breakage,

Hmm... I see this was labeled "critical", but I don't understand why. @dbolduc

while open an issue there for the hidden-feature. once that's implemented, I'll follow up here to switch the fix over.

Frankly I would rather not put this fix in. It creates a maintenance headache, and the workaround for anybody affected by the bug is to enable any feature (say zone-operations) that fixes the build.

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.

I agree that we should not hard code this list (even temporarily). I added a comment to the bug and this also affects builds of certain feature flags (like accelerator-types) which would need to be excluded from these lists.

It is possible we are able to do this feature gating for the whole module instead and can then just put it in the generated code and avoid the hidden feature part of this entirely.

feature = "backend-services",
feature = "cross-site-networks",
feature = "disk-types",
feature = "disks",
feature = "external-vpn-gateways",
feature = "firewall-policies",
feature = "firewalls",
feature = "forwarding-rules",
feature = "future-reservations",
feature = "global-addresses",
feature = "global-forwarding-rules",
feature = "global-network-endpoint-groups",
feature = "global-operations",
feature = "global-organization-operations",
feature = "global-public-delegated-prefixes",
feature = "global-vm-extension-policies",
feature = "health-checks",
feature = "hosts",
feature = "http-health-checks",
feature = "https-health-checks",
feature = "image-family-views",
feature = "images",
feature = "instance-group-manager-resize-requests",
feature = "instance-group-managers",
feature = "instance-groups",
feature = "instance-settings",
feature = "instance-templates",
feature = "instances",
feature = "instant-snapshot-groups",
feature = "instant-snapshots",
feature = "interconnect-attachment-groups",
feature = "interconnect-attachments",
feature = "interconnect-groups",
feature = "interconnect-locations",
feature = "interconnect-remote-locations",
feature = "interconnects",
feature = "license-codes",
feature = "licenses",
feature = "machine-images",
feature = "machine-types",
feature = "network-attachments",
feature = "network-edge-security-services",
feature = "network-endpoint-groups",
feature = "network-firewall-policies",
feature = "network-profiles",
feature = "networks",
feature = "node-groups",
feature = "node-templates",
feature = "node-types",
feature = "organization-security-policies",
feature = "packet-mirrorings",
feature = "preview-features",
feature = "projects",
feature = "public-advertised-prefixes",
feature = "public-delegated-prefixes",
feature = "region-autoscalers",
feature = "region-backend-buckets",
feature = "region-backend-services",
feature = "region-commitments",
feature = "region-composite-health-checks",
feature = "region-disk-types",
feature = "region-disks",
feature = "region-health-aggregation-policies",
feature = "region-health-check-services",
feature = "region-health-checks",
feature = "region-health-sources",
feature = "region-instance-group-manager-resize-requests",
feature = "region-instance-group-managers",
feature = "region-instance-groups",
feature = "region-instance-templates",
feature = "region-instances",
feature = "region-instant-snapshot-groups",
feature = "region-instant-snapshots",
feature = "region-network-endpoint-groups",
feature = "region-network-firewall-policies",
feature = "region-notification-endpoints",
feature = "region-operations",
feature = "region-security-policies",
feature = "region-snapshot-settings",
feature = "region-snapshots",
feature = "region-ssl-certificates",
feature = "region-ssl-policies",
feature = "region-target-http-proxies",
feature = "region-target-https-proxies",
feature = "region-target-tcp-proxies",
feature = "region-url-maps",
feature = "region-zones",
feature = "regions",
feature = "reliability-risks",
feature = "reservation-blocks",
feature = "reservation-slots",
feature = "reservation-sub-blocks",
feature = "reservations",
feature = "resource-policies",
feature = "rollout-plans",
feature = "rollouts",
feature = "routers",
feature = "routes",
feature = "security-policies",
feature = "service-attachments",
feature = "snapshot-settings",
feature = "snapshots",
feature = "ssl-certificates",
feature = "ssl-policies",
feature = "storage-pool-types",
feature = "storage-pools",
feature = "subnetworks",
feature = "target-grpc-proxies",
feature = "target-http-proxies",
feature = "target-https-proxies",
feature = "target-instances",
feature = "target-pools",
feature = "target-ssl-proxies",
feature = "target-tcp-proxies",
feature = "target-vpn-gateways",
feature = "url-maps",
feature = "vpn-gateways",
feature = "vpn-tunnels",
feature = "wire-groups",
feature = "zone-operations",
feature = "zone-vm-extension-policies",
feature = "zones",
))]
Comment thread
raushan728 marked this conversation as resolved.

use crate::model::{
InstancesBulkInsertOperationMetadata, SetCommonInstanceMetadataOperationMetadata,
};
Expand Down
130 changes: 130 additions & 0 deletions src/generated/cloud/compute/v1/src/operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,136 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![cfg(any(
feature = "accelerator-types",
feature = "addresses",
feature = "advice",
feature = "autoscalers",
feature = "backend-buckets",
feature = "backend-services",
feature = "cross-site-networks",
feature = "disk-types",
feature = "disks",
feature = "external-vpn-gateways",
feature = "firewall-policies",
feature = "firewalls",
feature = "forwarding-rules",
feature = "future-reservations",
feature = "global-addresses",
feature = "global-forwarding-rules",
feature = "global-network-endpoint-groups",
feature = "global-operations",
feature = "global-organization-operations",
feature = "global-public-delegated-prefixes",
feature = "global-vm-extension-policies",
feature = "health-checks",
feature = "hosts",
feature = "http-health-checks",
feature = "https-health-checks",
feature = "image-family-views",
feature = "images",
feature = "instance-group-manager-resize-requests",
feature = "instance-group-managers",
feature = "instance-groups",
feature = "instance-settings",
feature = "instance-templates",
feature = "instances",
feature = "instant-snapshot-groups",
feature = "instant-snapshots",
feature = "interconnect-attachment-groups",
feature = "interconnect-attachments",
feature = "interconnect-groups",
feature = "interconnect-locations",
feature = "interconnect-remote-locations",
feature = "interconnects",
feature = "license-codes",
feature = "licenses",
feature = "machine-images",
feature = "machine-types",
feature = "network-attachments",
feature = "network-edge-security-services",
feature = "network-endpoint-groups",
feature = "network-firewall-policies",
feature = "network-profiles",
feature = "networks",
feature = "node-groups",
feature = "node-templates",
feature = "node-types",
feature = "organization-security-policies",
feature = "packet-mirrorings",
feature = "preview-features",
feature = "projects",
feature = "public-advertised-prefixes",
feature = "public-delegated-prefixes",
feature = "region-autoscalers",
feature = "region-backend-buckets",
feature = "region-backend-services",
feature = "region-commitments",
feature = "region-composite-health-checks",
feature = "region-disk-types",
feature = "region-disks",
feature = "region-health-aggregation-policies",
feature = "region-health-check-services",
feature = "region-health-checks",
feature = "region-health-sources",
feature = "region-instance-group-manager-resize-requests",
feature = "region-instance-group-managers",
feature = "region-instance-groups",
feature = "region-instance-templates",
feature = "region-instances",
feature = "region-instant-snapshot-groups",
feature = "region-instant-snapshots",
feature = "region-network-endpoint-groups",
feature = "region-network-firewall-policies",
feature = "region-notification-endpoints",
feature = "region-operations",
feature = "region-security-policies",
feature = "region-snapshot-settings",
feature = "region-snapshots",
feature = "region-ssl-certificates",
feature = "region-ssl-policies",
feature = "region-target-http-proxies",
feature = "region-target-https-proxies",
feature = "region-target-tcp-proxies",
feature = "region-url-maps",
feature = "region-zones",
feature = "regions",
feature = "reliability-risks",
feature = "reservation-blocks",
feature = "reservation-slots",
feature = "reservation-sub-blocks",
feature = "reservations",
feature = "resource-policies",
feature = "rollout-plans",
feature = "rollouts",
feature = "routers",
feature = "routes",
feature = "security-policies",
feature = "service-attachments",
feature = "snapshot-settings",
feature = "snapshots",
feature = "ssl-certificates",
feature = "ssl-policies",
feature = "storage-pool-types",
feature = "storage-pools",
feature = "subnetworks",
feature = "target-grpc-proxies",
feature = "target-http-proxies",
feature = "target-https-proxies",
feature = "target-instances",
feature = "target-pools",
feature = "target-ssl-proxies",
feature = "target-tcp-proxies",
feature = "target-vpn-gateways",
feature = "url-maps",
feature = "vpn-gateways",
feature = "vpn-tunnels",
feature = "wire-groups",
feature = "zone-operations",
feature = "zone-vm-extension-policies",
feature = "zones",
))]
Comment thread
raushan728 marked this conversation as resolved.

use crate::model::Operation;
use google_cloud_gax::error::rpc::{Code, Status};

Expand Down
Loading