Skip to content

docs: add Database Migration Documentation#864

Open
sokoliva wants to merge 6 commits intoa2aproject:1.0-devfrom
sokoliva:migration-documentation
Open

docs: add Database Migration Documentation#864
sokoliva wants to merge 6 commits intoa2aproject:1.0-devfrom
sokoliva:migration-documentation

Conversation

@sokoliva
Copy link
Member

@sokoliva sokoliva commented Mar 18, 2026

Description

Add documentation about database migrations for users.

Add current option to the a2a-db CLI command to see current version of the database.

  • Follow the CONTRIBUTING Guide.
  • Make your Pull Request title in the https://www.conventionalcommits.org/ specification.
    • Important Prefixes for release-please:
      • fix: which represents bug fixes, and correlates to a SemVer patch.
      • feat: represents a new feature, and correlates to a SemVer minor.
      • feat!:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a SemVer major.
  • Ensure the tests and linter pass (Run bash scripts/format.sh from the repository root to format)
  • Appropriate docs were updated (if necessary)

Fixes #715 🦕

@sokoliva sokoliva requested a review from a team as a code owner March 18, 2026 17:14
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 A2A SDK's documentation by providing comprehensive guides for migrating databases from version 0.3 to 1.0. It offers clear, step-by-step instructions for both simple and zero-downtime migration scenarios, ensuring data integrity and operational continuity. Additionally, the a2a-db CLI tool has been updated to include a new command for easily checking the current database revision, streamlining the migration verification process.

Highlights

  • New Database Migration Documentation: Comprehensive guides have been added for migrating the A2A SDK database from version 0.3 to 1.0, covering both simple and zero-downtime strategies.
  • Enhanced a2a-db CLI: The command-line interface now includes a new current command, allowing users to easily verify the applied database revision.
  • Detailed Migration Strategies: The documentation provides step-by-step instructions for two distinct migration paths: a 'Simple Migration' for applications that can tolerate brief downtime and a 'Zero Downtime Migration' for high-availability environments using an 'Expand, Migrate, Contract' pattern.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Mar 18, 2026

🧪 Code Coverage (vs 1.0-dev)

⬇️ Download Full Report

Base PR Delta
src/a2a/a2a_db_cli.py 97.22% 92.31% 🔴 -4.91%
Total 90.29% 90.24% 🔴 -0.04%

Generated by coverage-comment.yml

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds comprehensive documentation for database migrations from v0.3 to v1.0, including guides for both simple and zero-downtime strategies. It also enhances the a2a-db CLI tool by adding a current command to display the current database revision.

The documentation is well-structured and detailed. I've found a few minor inaccuracies and typos that could confuse users, and I've provided suggestions to correct them. I also have a couple of suggestions to improve the clarity of the CLI tool's usage and its documentation. Overall, this is a great addition to the project.

I am having trouble creating individual review comments. Click here to see my feedback.

docs/migrations/v0_3_to_v1_0/database/README.md (21)

medium

The documentation states that the last_updated column is added to both the tasks and push_notification_configs tables. However, based on the migration scripts, it is only added to the tasks table. Please update the documentation for accuracy.

docs/migrations/v0_3_to_v1_0/database/simple_migration.md (41)

medium

There's a typo in the version number. It should be v1.0 code, not v0.1.

> Protocol 1.0 is designed to be backward compatible by default. After this step, your new 1.0 code will be able to read existing 0.3 entries from the database using a built-in legacy parser.
References
  1. For consistency in link text for protocol versions, prefer the shorter major/minor format (e.g., '0.3') over the full version format (e.g., 'v0.3.0').

docs/migrations/v0_3_to_v1_0/database/zero_downtime.md (46)

medium

There's a typo in the version number. It should be v1.0 code, not v0.1.

> Protocol 1.0 is designed to be backward compatible by default. After this step, your new 1.0 code will be able to read existing 0.3 entries from the database using a built-in legacy parser.
References
  1. For consistency in link text for protocol versions, prefer the shorter major/minor format (e.g., '0.3') over the full version format (e.g., 'v0.3.0').

docs/migrations/v0_3_to_v1_0/database/README.md (33)

low

This line is quite long and contains a lot of information. For better readability, consider rephrasing it to be more concise.

- Inspect the `protocol_version` column in the `tasks` table. The value depends on when the entry was created: `NULL` (before migration), `0.3` (during zero-downtime migration), or `1.0` (after migration).
References
  1. Documentation should be concise, providing only necessary and exact steps, and avoiding superfluous information or commands that are not strictly required.

src/a2a/a2a_db_cli.py (100)

low

The current command doesn't use the --sql flag, but it's being added via _add_shared_args. This could be confusing for users as the flag will appear in the help message but have no effect. Consider adding only the relevant arguments for this command to avoid showing an unused flag.

src/a2a/migrations/README.md (105)

low

This note is a bit ambiguous because some flags can be passed but are ignored by the current command (e.g., --sql). To avoid confusion, it would be clearer to explicitly list the flags that are relevant to this command.

> The `current` command supports the `--database-url`, `--tasks-table`, `--push-notification-configs-table`, and `--verbose` (`-v`) flags.
References
  1. Documentation should be concise, providing only necessary and exact steps, and avoiding superfluous information or commands that are not strictly required.

@sokoliva sokoliva requested a review from guglielmo-san March 19, 2026 09:53
Comment on lines +20 to +21
The v1.0 database migration involves:
1. **Schema Updates**: Adding `protocol_version`, `owner`, and `last_updated` columns to the `tasks` and `push_notification_configs` tables.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the last_updated field added to both?

Copy link
Member Author

@sokoliva sokoliva Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but I felt like pointing that out would be an unnecessary overkill. I will make the distinction to avoid confusion.

@@ -0,0 +1,76 @@
# Simple Migration: v0.3 to v1.0

This guide is for users who can afford a short period of downtime (typically a few minutes) during the migration from A2A protocol v0.3 to v1.0. This is the recommended path for single-instance applications or non-critical services.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would not add the 'typically a few minutes' sentence, as it depends on each use case

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do v0_3_to_v1_0 -> 1.0 - the migration guide is always from the previous to current, if one needs to migrate from 0.3 to 2.0 they will have to follow them sequentially.

Comment on lines +65 to +68
1. **Revert Schema**: Use the `downgrade` command to step back to the v0.3 structure.
```bash
uv run a2a-db downgrade -1
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old SDK should work with the new schema, let's mention this here. In theory if something stopped working code rollback should be enough. We should also mention DB rollback but it's rather for the "unknown unknowns", we don't expect new columns to affect old SDKs.

> [!NOTE]
> All new columns are nullable or have default values. Your existing v0.3 code will continue to work normally after this step is completed.
>
> Protocol v1.0 is designed to be backward compatible by default. After this step, your new v1.0 code will be able to read existing v0.3 entries from the database using a built-in legacy parser.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: protocol itself is not compatible, it's rather DB backed stores implementations in the new SDK.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, thank you.

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.

3 participants