Skip to content

fix: Report billing attachment errors#120

Draft
saraford wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
saraford:billing-error-report
Draft

fix: Report billing attachment errors#120
saraford wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
saraford:billing-error-report

Conversation

@saraford
Copy link
Collaborator

The create_project tool previously returned a generic success message even if attaching the billing account failed.

This change modifies the tool to return the detailed billing message from the underlying function, ensuring the user is correctly informed of the full status of the project creation.

Here's what the interaction with the agent looks like:

╭──────────────────────────────────────────────────────╮
│  > create a new project called saraford-deleteme-52  │
╰──────────────────────────────────────────────────────╯

 ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
 │ ✔  create_project (cloud-run MCP Server) create_project (cloud-run MCP Server)                                                                                                     │
 │                                                                                                                                                                                    │
 │    Project saraford-deleteme-52 created. No billing accounts found. Please link billing manually: https://console.cloud.google.com/billing/linkedaccount?project=${projectId}      │
 ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

✦ I've created the project saraford-deleteme-52 for you. Please note that no billing accounts were found, so you'll need to link one manually using the provided URL.

The create_project tool previously returned a generic success message even if attaching the billing account failed.

This change modifies the tool to return the detailed billing message from the underlying function, ensuring the user is correctly informed of the full status of the project creation.
Updates the local unit tests and the GCP integration test to correctly handle and verify the new conditional logic for reporting billing attachment status.

- The local unit test now has distinct cases for success and warning messages.
- The GCP integration test now asserts that the billing warning is correctly received.
@saraford
Copy link
Collaborator Author

I was only able to manually test for a project that didn't get billing enabled. We'll need to verify this fix also works with the happy path where a project is created with billing enabled.

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.

1 participant