Skip to content

test: failing reproducer - snap developer-id not asserted - #948

Draft
lengau wants to merge 3 commits into
mainfrom
fix/issue-445-snap-developer-id-not-asserted
Draft

test: failing reproducer - snap developer-id not asserted#948
lengau wants to merge 3 commits into
mainfrom
fix/issue-445-snap-developer-id-not-asserted

Conversation

@lengau

@lengau lengau commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

Reproducer for #445

When a snap changes ownership (e.g. transferred from a personal account to an org), the snap-revision assertion contains a developer-id that differs from the current publisher. The current code only asserts the publisher's account, not the developer's, causing snap ack to fail with:

error: cannot assert: assert failed: cannot resolve prerequisite assertion: account (<developer-id>)

Root cause

_get_assertions_file() in snap_installer.py always queries account-id=<publisher_id> but never reads the developer-id field from the snap-revision assertion bytes to also fetch account-id=<developer-id>.

Fix

Parse the snap-revision assertion to extract developer-id. If it differs from the publisher-id, also fetch ["account", "account-id=<developer-id>"] and include it in the assertion file.

Closes #445

@lengau

lengau commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot create a fix that causes the test to pass and fixes #445

Copilot AI commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

@copilot create a fix that causes the test to pass and fixes #445

Fixed in 5df1922. The change modifies _get_assertions_file() in snap_installer.py to:

  1. Fetch the snap-revision assertion first and parse its developer-id field
  2. If developer-id differs from the publisher-id, also fetch an account assertion for the developer

A helper _get_developer_id_from_snap_revision() handles the byte parsing with safe UnicodeDecodeError handling. All 37 unit tests for snap_installer pass.

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.

developer-id of the snap-revision is not asserted

2 participants