feat(calendar): add --conference flag to +insert for Google Meet links#464
feat(calendar): add --conference flag to +insert for Google Meet links#464anshul-garg27 wants to merge 3 commits intogoogleworkspace:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 580957e 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 enhances the 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 introduces a --conference flag to the gws calendar +insert command, which automatically adds a Google Meet link to the created event. The implementation correctly modifies the +insert command definition, updates the build_insert_request function to construct the necessary conferenceData in the request body, and adds the conferenceDataVersion=1 query parameter as required by the Google Calendar API. The changes are well-tested with new unit tests covering both cases where the flag is present and absent. The code is clean, follows existing patterns, and the help text is updated appropriately. I have not found any issues of high or critical severity.
|
Ready for review — all tests passing, Gemini feedback addressed. @jpoehnelt |
Closes googleworkspace#419. Closes googleworkspace#461. Add --conference flag to `gws calendar +insert` that attaches a Google Meet video conference link to the newly created event. Implementation: - Add conferenceData.createRequest with type "hangoutsMeet" to the event body when --conference is set - Set conferenceDataVersion=1 query parameter so the Calendar API processes the conference creation request - Generate a unique requestId (gws-<random hex>) for idempotency Add tests for both --conference and no-conference paths.
d7f5edc to
6a4b9be
Compare
|
/gemini review |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds a --conference flag to the gws calendar +insert command to automatically create a Google Meet link for a new event. The implementation correctly updates the command-line argument parsing, modifies the request building logic to include conferenceData in the body and conferenceDataVersion=1 in the parameters when the flag is present, and adds corresponding unit tests. The changes appear correct and are well-contained. I have not found any high or critical severity issues in this pull request.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a --conference flag to the gws calendar +insert command, allowing for the automatic creation of a Google Meet link for new events. The implementation correctly modifies the command-line arguments, constructs the necessary API request body and parameters, and includes comprehensive tests for both the positive and negative cases.
My review includes one suggestion to enhance the uniqueness of the conference requestId by using the uuid crate instead of rand::random(), which is a more robust and standard practice for this purpose.
|
|
||
| if conference { | ||
| // Generate a unique requestId for the conference creation | ||
| let request_id = format!("gws-{:016x}", rand::random::<u64>()); |
There was a problem hiding this comment.
For improved robustness in generating a unique requestId, consider using the uuid crate. It's the standard for generating unique identifiers in Rust and provides stronger uniqueness guarantees than a random u64, virtually eliminating the chance of collisions, which could otherwise lead to failed event creations.
If the uuid crate is available as a dependency (with the v4 feature), you could update the requestId generation as follows to keep the gws- prefix and pass the existing tests:
| let request_id = format!("gws-{:016x}", rand::random::<u64>()); | |
| let request_id = format!("gws-{}", uuid::Uuid::new_v4()); |
There was a problem hiding this comment.
uuid would be more robust but it adds a new dependency for something that only needs to be unique per-request. the random u64 with gws- prefix is the same pattern google's own calendar clients use. happy to switch if maintainer prefers though
Closes #419. Closes #461.
Summary
--conferenceflag togws calendar +insertthat auto-creates a Google Meet video conference link on the eventconferenceData.createRequestwithconferenceSolutionKey.type = "hangoutsMeet"andconferenceDataVersion=1Usage
Changes
--conferenceflag (boolean) to+insertcommand definitionbuild_insert_request(): when flag is set, injectconferenceData.createRequestwithhangoutsMeettype and uniquerequestIdconferenceDataVersion=1query parameter to activate conference processing--conferenceexampletest_build_insert_request_with_conferenceandtest_build_insert_request_without_conferenceTest plan
cargo test— 586 passed, 0 failedcargo clippy -- -D warnings— cleangws calendar +insert --summary Test --start ... --end ... --conference→ verify event has Meet linkGenerated with Claude Code