Skip to content

Migrate CCF governance API calls to versioned API 2024-07-01#368

Merged
achamayou merged 7 commits intomainfrom
copilot/update-governance-api-calls
Feb 26, 2026
Merged

Migrate CCF governance API calls to versioned API 2024-07-01#368
achamayou merged 7 commits intomainfrom
copilot/update-governance-api-calls

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

  • Update pyscitt/pyscitt/governance.py - Migrate all governance API calls to new versioned endpoints:
    • POST /gov/proposalsPOST /gov/members/proposals:create?api-version=2024-07-01
    • POST /gov/proposals/{id}/ballotsPOST /gov/members/proposals/{id}/ballots/{memberId}:submit?api-version=2024-07-01
    • GET /gov/recovery_shareGET /gov/recovery/encrypted-shares/{memberId}?api-version=2024-07-01
    • POST /gov/recovery_sharePOST /gov/recovery/members/{memberId}:recover?api-version=2024-07-01
    • POST /gov/ack/update_state_digestPOST /gov/members/state-digests/{memberId}:update?api-version=2024-07-01
    • POST /gov/ackPOST /gov/members/state-digests/{memberId}:ack?api-version=2024-07-01
    • Update response field names from snake_case to camelCase (proposal_idproposalId, stateproposalState, encrypted_shareencryptedShare)
    • Add member_id property and _gov_params() helper to GovernanceClient
  • Update pyscitt/pyscitt/client.py:
    • GET /gov/kv/constitutionGET /gov/service/constitution?api-version=2024-07-01 (response changes from JSON to raw text)
    • Update cose_protected_headers() URL pattern matching for new endpoint paths
    • Import CCF_GOV_API_VERSION from governance.py (single source of truth)
  • Code review feedback addressed
  • Security check passed (CodeQL: 0 alerts)
  • Fix mypy type error: assert member_auth is not None in member_id property
  • All ci-checks.sh checks pass (mypy, isort, black, copyright, release notes)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 23, 2026 21:37
Update all Python code using legacy /gov/ endpoints to the new versioned
governance API:

- POST /gov/proposals → POST /gov/members/proposals:create
- POST /gov/proposals/{id}/ballots → POST /gov/members/proposals/{id}/ballots/{memberId}:submit
- GET /gov/recovery_share → GET /gov/recovery/encrypted-shares/{memberId}
- POST /gov/recovery_share → POST /gov/recovery/members/{memberId}:recover
- POST /gov/ack/update_state_digest → POST /gov/members/state-digests/{memberId}:update
- POST /gov/ack → POST /gov/members/state-digests/{memberId}:ack
- GET /gov/kv/constitution → GET /gov/service/constitution

All calls include api-version=2024-07-01 query parameter.
Response field names updated from snake_case to camelCase.
cose_protected_headers() updated for new URL patterns.

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

Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Copilot AI changed the title [WIP] Update legacy CCF governance API calls to latest version Migrate CCF governance API calls to versioned API 2024-07-01 Feb 23, 2026
Copilot AI requested a review from achamayou February 23, 2026 21:40
@achamayou
Copy link
Member

@copilot run ./scripts/ci-checks.sh to check for Python type safety issues and attempt to fix them if you can.

…cert

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

Copilot AI commented Feb 25, 2026

@copilot run ./scripts/ci-checks.sh to check for Python type safety issues and attempt to fix them if you can.

Ran ./scripts/ci-checks.sh — it found one mypy error: member_auth is Optional[MemberAuthenticationMethod] so accessing .cert directly wasn't type-safe. Fixed by adding assert self.client.member_auth is not None in the member_id property. All checks now pass (mypy, isort, black, copyright, release notes). See 302d3e2.

@achamayou achamayou marked this pull request as ready for review February 26, 2026 11:08
@achamayou achamayou requested a review from a team as a code owner February 26, 2026 11:08
@achamayou achamayou enabled auto-merge (squash) February 26, 2026 16:27
@achamayou achamayou merged commit 46862d5 into main Feb 26, 2026
9 checks passed
@achamayou achamayou deleted the copilot/update-governance-api-calls branch February 26, 2026 17:11
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.

4 participants