fix: report auth errors instead of silently proceeding unauthenticated#446
fix: report auth errors instead of silently proceeding unauthenticated#446anshul-garg27 wants to merge 1 commit intogoogleworkspace:mainfrom
Conversation
Six helpers (chat, drive, sheets, docs, calendar, script) silently swallowed auth failures and proceeded with AuthMethod::None, causing confusing 401 API errors downstream. Now they return a clear GwsError::Auth message, with an exception for --dry-run mode where auth is not needed. Consistent with the pattern already used in gmail helpers.
🦋 Changeset detectedLatest commit: 7dfd190 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the user experience by enhancing error reporting for authentication failures across several helper commands. Instead of silently proceeding unauthenticated and leading to obscure API errors, these commands now provide clear and actionable Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request fixes an issue where authentication failures were silently ignored in several helper commands by making them report auth errors. This change improves user experience by providing clear feedback. The implementation also correctly preserves existing --dry-run functionality. My review includes one suggestion to improve maintainability by refactoring the new, duplicated error handling logic into a shared function.
Summary
AuthMethod::None, causing confusing 401 API errors downstreamGwsError::Authmessage with the underlying error--dry-runmode still works without auth (consistent with gmail helper pattern)Affected helpers
src/helpers/chat.rs+sendsrc/helpers/drive.rs+uploadsrc/helpers/sheets.rs+append,+readsrc/helpers/docs.rs+writesrc/helpers/calendar.rs+insertsrc/helpers/script.rs+pushRoot cause
These helpers used a silent fallback pattern:
The gmail helper already uses the correct pattern:
Test plan
--dry-runexception preserved for all helpers