fix: prevent premature caching of API enablement status#10740
Conversation
…Enabled.ts` When initiating API enablement, the status was cached immediately before actually verifying the long-running operation completed. This commit removes the `cacheEnabledAPI` call from the `enable` method, relying on the `check` method to correctly cache the status once polling succeeds. Tests have been updated accordingly. Co-authored-by: fredzqm <9068391+fredzqm@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request removes the call to cacheEnabledAPI(projectId, apiName) when enabling an API in src/ensureApiEnabled.ts, and removes the corresponding mock assertion from the unit tests in src/ensureApiEnabled.spec.ts. I have no feedback to provide as there are no review comments.
joehan
left a comment
There was a problem hiding this comment.
So, we added this caching in order to avoid overloading our shared quota. Does this disable it entirely, or is there a later spot where the chaching gets triggered?
…Enabled.ts` When initiating API enablement, the status was cached immediately before actually verifying the long-running operation completed. This commit removes the `cacheEnabledAPI` call from the `enable` method, relying on the `check` method to correctly cache the status once polling succeeds. Tests have been updated accordingly. Co-authored-by: fredzqm <9068391+fredzqm@users.noreply.github.com>
Fixes a race condition where the CLI prematurely caches Google Cloud APIs as enabled immediately upon initiating the enablement process, leading to false positives during polling.
PR created automatically by Jules for task 14193484741930371072 started by @fredzqm