Skip to content

Add recovery coverage for changed code IDs#7986

Open
Copilot wants to merge 10 commits into
mainfrom
copilot/add-recovery-test-with-different-code-id
Open

Add recovery coverage for changed code IDs#7986
Copilot wants to merge 10 commits into
mainfrom
copilot/add-recovery-test-with-different-code-id

Conversation

Copilot AI commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Recovering a ledger should not require the new service to use the same code ID recorded in the defunct ledger. This adds suite-level coverage for recovering with a different app package.

  • Recovery scenario

    • Adds recovery_with_new_code_id.
    • Starts a service with samples/apps/logging/logging.
    • Recovers the ledger with js_generic.
  • Code ID checks

    • Verifies the original join policy contains the initial package code ID.
    • Verifies the replacement package code ID is absent from the defunct service policy before recovery.
    • Verifies the recovered service trusts the replacement package code ID.
recovery_args = copy.copy(args)
recovery_args.package = "js_generic"

recovered_network.start_in_recovery(
    recovery_args,
    ledger_dir=current_ledger_dir,
    committed_ledger_dirs=committed_ledger_dirs,
)
recovered_network.recover(recovery_args)

Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Copilot AI changed the title [WIP] Add recovery test using a code id that differs from that in the table Add recovery coverage for changed code IDs Jun 25, 2026
Copilot AI requested a review from achamayou June 25, 2026 13:58
Copilot AI and others added 2 commits June 25, 2026 18:37
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Copilot AI and others added 2 commits June 25, 2026 20:33
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
@achamayou achamayou marked this pull request as ready for review June 26, 2026 07:00
@achamayou achamayou requested a review from a team as a code owner June 26, 2026 07:00
Copilot AI review requested due to automatic review settings June 26, 2026 07:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an end-to-end recovery test to ensure a ledger can be recovered even when the recovering service uses a different application package (and therefore a different code ID / hostData) than the defunct service recorded in its join policy.

Changes:

  • Add test_recover_service_with_different_code_id to recover a ledger using a different package and validate join-policy hostData before/after recovery.
  • Add a new suite entry (recovery_with_new_code_id) that starts with the C++ logging app and recovers with js_generic, then installs the JS logging app and verifies post-recovery writes.

Custom instructions used:

  • .github/copilot-instructions.md
  • .github/instructions/reviewing.instructions.md

Comment thread tests/recovery.py Outdated
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Copilot AI requested a review from achamayou June 26, 2026 08:21
@achamayou

Copy link
Copy Markdown
Member

@copilot fix code format

Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix code format

Fixed in 0faa162.

Copilot AI requested a review from achamayou June 26, 2026 17:35
@achamayou achamayou requested a review from eddyashton June 26, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants