Skip to content

feat: Database forward compatibility: make owner field optional#812

Merged
sokoliva merged 7 commits intoa2aproject:1.0-devfrom
sokoliva:owner-optional
Mar 12, 2026
Merged

feat: Database forward compatibility: make owner field optional#812
sokoliva merged 7 commits intoa2aproject:1.0-devfrom
sokoliva:owner-optional

Conversation

@sokoliva
Copy link
Contributor

@sokoliva sokoliva commented Mar 11, 2026

Description

Old version is not able to write in databases which are 1.0 compatible because the new owner field is mandatory. This change makes the owner field optional to maintain forward compatibility.

Tested

Before change (owner field mandatory)

I created a database with tables tasks and push_notification_configs using 1.0 spec. I then tested it against 0.3 spec by trying to write in it. It failed returning an error: NOT NULL constraint failed: tasks.owner.

Also, I created a database with 0.3 spec Task and PushNotificationConfigs entries but then made it 1.0 compatible via migration CLI command uv run a2a-db. Reading such data using 0.3 spec worked, but writing failed for the same reason as before.

After change (owner field optional)

I repeated the testing from before. Now writing in 1.0 compatible databases worked.

Notes

Writing in database which was created using 1.0 spec without running the migration a2a-db CLI command, created entries which have owner=NULL values, contrary to databases that underwent the migration using a2a-db which have owner field populated with the default value. In my case with legacy_v03_no_user_info since I didn't use the --add_columns_owner_last_updated-default-owner flag to pass my own custom default value.

Contributing Guide

  • 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 #811 🦕

@sokoliva sokoliva requested a review from a team as a code owner March 11, 2026 13:19
@sokoliva sokoliva merged commit cc29d1f into a2aproject:1.0-dev Mar 12, 2026
6 checks passed
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.

2 participants