feat: support google meet video conferencing in calendar +insert#506
feat: support google meet video conferencing in calendar +insert#506dumko2001 wants to merge 7 commits intogoogleworkspace:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 22f54c3 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 introduces a new feature to the calendar helper, allowing users to easily create Google Calendar events with integrated Google Meet video conferencing. By adding a simple "--meet" flag to the "+insert" command, the application will automatically configure the event to include a unique Google Meet link. This enhancement streamlines the process of scheduling virtual meetings directly from the command line. Alongside this new functionality, the project's dependencies have been thoroughly reviewed and updated, ensuring a more streamlined and efficient build process. 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 adds a useful --meet flag to the calendar +insert command, allowing users to easily create Google Meet links for new events. The implementation is straightforward and includes a corresponding test case.
My main feedback is regarding the ratatui dependency downgrade from 0.30.0 to 0.29.0. This change, along with the extensive modifications to Cargo.lock, seems unrelated to the feature being added and should be moved to a separate pull request to avoid scope creep and potential unintended side effects.
I also have a suggestion to improve the clarity of the help text for the new flag.
Overall, a good feature addition with minor points to address.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for creating Google Meet links when inserting a calendar event. The implementation correctly adds the --meet flag and constructs the conferenceData in the request body. I have one suggestion to make the new test more robust by parsing the JSON output and asserting on the values directly, rather than using string contains checks.
src/helpers/calendar.rs
Outdated
| assert!(params.contains("\"conferenceDataVersion\":1")); | ||
| assert!(body.contains("\"conferenceSolutionKey\":{\"type\":\"hangoutsMeet\"}")); | ||
| assert!(body.contains("\"requestId\":")); |
There was a problem hiding this comment.
These assertions using contains are a bit weak and could pass even with malformed JSON or incorrect values. Parsing the JSON strings and asserting on the structured data would make the test more robust and prevent future regressions. For example, you could verify that requestId is a valid UUID.
| assert!(params.contains("\"conferenceDataVersion\":1")); | |
| assert!(body.contains("\"conferenceSolutionKey\":{\"type\":\"hangoutsMeet\"}")); | |
| assert!(body.contains("\"requestId\":")); | |
| let params_json: serde_json::Value = serde_json::from_str(¶ms).unwrap(); | |
| assert_eq!(params_json["conferenceDataVersion"], 1); | |
| let body_json: serde_json::Value = serde_json::from_str(&body).unwrap(); | |
| let create_req = &body_json["conferenceData"]["createRequest"]; | |
| assert_eq!(create_req["conferenceSolutionKey"]["type"], "hangoutsMeet"); | |
| assert!(uuid::Uuid::parse_str(create_req["requestId"].as_str().unwrap()).is_ok()); |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds a useful --meet flag to the calendar +insert helper for creating Google Meet links. The implementation is straightforward and includes a good test case. My main feedback is regarding a potential idempotency issue with the conference creation request. While important, I've suggested deferring this improvement to a follow-up PR to maintain focus and avoid scope creep in this initial implementation.
| if matches.get_flag("meet") { | ||
| body["conferenceData"] = json!({ | ||
| "createRequest": { | ||
| "requestId": uuid::Uuid::new_v4().to_string(), | ||
| "conferenceSolutionKey": { "type": "hangoutsMeet" } | ||
| } | ||
| }); | ||
| params["conferenceDataVersion"] = json!(1); | ||
| } |
There was a problem hiding this comment.
While this PR successfully adds the --meet flag, I've identified a potential idempotency issue. Using a random v4 UUID for the requestId means that if a user retries a failed command, a new Meet link might be generated, potentially leading to duplicate calendar events with different conference links.
To make this operation idempotent, generating a deterministic v5 UUID based on the event's details would be ideal. This ensures that running the same command multiple times will result in the same requestId, preventing duplicate conference data.
However, to avoid introducing changes outside the primary goal of this pull request and prevent scope creep, I recommend addressing this idempotency improvement in a separate, follow-up PR. This would involve updating the uuid crate features in Cargo.toml to include v5 and macro-diagnostics and implementing the deterministic UUID generation.
References
- Avoid introducing changes that are outside the primary goal of a pull request to prevent scope creep.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for creating Google Meet links when inserting a calendar event. The implementation looks good, with a new --meet flag and tests for the new functionality. However, there are two main points of feedback: several dependencies in Cargo.lock have been unexpectedly downgraded, which is a potential risk, and the idempotency key for the Google Meet conference request could be made more robust by including all relevant event details in its seed.
| version = "0.20.10" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" |
There was a problem hiding this comment.
This change downgrades several dependencies, including darling (e.g., from 0.20.11 to 0.20.10), instability (from 0.3.11 to 0.3.10), and unicode-width (from 0.2.2 to 0.2.0). Downgrading dependencies can re-introduce previously fixed bugs and should generally be avoided unless there is a strong reason. It's recommended to run cargo update to use the latest compatible versions.
|
|
||
| if matches.get_flag("meet") { | ||
| let namespace = uuid::Uuid::NAMESPACE_DNS; | ||
| let seed_data = format!("{}:{}:{}", summary, start, end); |
There was a problem hiding this comment.
The seed for the idempotent requestId only includes summary, start, and end. This means that two different events with the same summary and time but different attendees, description, or location will generate the same requestId. To ensure true idempotency and avoid potential collisions, it's better to include all relevant event details in the seed. I recommend including location, description, and a sorted list of attendees in the seed_data if they are provided.
Description
This PR adds support for generating Google Meet video conferencing links when creating a calendar event via the
+inserthelper. By passing the--meetflag, aconferenceDatacreate request is automatically added to the event body, and theconferenceDataVersion=1parameter is appended to the request.Dry Run Output:
{ "body": { "conferenceData": { "createRequest": { "conferenceSolutionKey": { "type": "hangoutsMeet" }, "requestId": "375507ec-2e48-4550-8cc8-704ffdc89e70" } }, "end": { "dateTime": "2026-06-17T09:30:00Z" }, "start": { "dateTime": "2026-06-17T09:00:00Z" }, "summary": "Test Meet" }, "dry_run": true, "is_multipart_upload": false, "method": "POST", "query_params": [ [ "conferenceDataVersion", "1" ] ], "url": "https://www.googleapis.com/calendar/v3/calendars/primary/events" }Checklist:
AGENTS.mdguidelines (no generatedgoogle-*crates).cargo fmt --allto format the code perfectly.cargo clippy -- -D warningsand resolved all warnings.pnpx changeset) to document my changes.