fix(dre): parse plaintext output for blessed replica versions#227
Open
pietrodimarco-dfinity wants to merge 1 commit into
Open
fix(dre): parse plaintext output for blessed replica versions#227pietrodimarco-dfinity wants to merge 1 commit into
pietrodimarco-dfinity wants to merge 1 commit into
Conversation
ic-admin's get-blessed-replica-versions (alias of get-elected-guestos-versions) ignores --json and prints one Git revision per line. The previous code passed --json and ran json.loads(...)["value"]["blessed_version_ids"], which crashed with "JSONDecodeError: Extra data: line 1 column 7 (char 6)" because the first hash's leading digits parsed as an integer. Drop --json and parse newline-separated revisions, mirroring the existing get_elected_hostos_versions. This unblocks the wait_for_revision_to_be_elected sensor in the mainnet GuestOS rollout DAG.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wait_for_revision_to_be_electedsensor in the mainnet GuestOS rollout DAG was failing withJSONDecodeError: Extra data: line 1 column 7 (char 6).DRE.get_blessed_replica_versions()randre get blessed-replica-versions --json, which forwards toic-admin get-blessed-replica-versions. That subcommand is now an alias ofGetElectedGuestosVersions, whose handler ignores--jsonand prints one Git revision per line.json.loadsthen parsed the first hash's leading digits as an integer and choked on the 7th character.--jsonand parse newline-separated revisions with the same hex-validation already used byget_elected_hostos_versions().Test plan
wait_for_revision_to_be_electedmapped task inrollout_ic_os_to_mainnet_subnetsafter deploy; it should read the elected versions and proceed.python3 -c "import ast; ast.parse(...)"syntax check passes.