Skip to content

feat: new release workflow#66

Closed
AmaseCocoa wants to merge 25 commits intomainfrom
feat/new-release-workflow
Closed

feat: new release workflow#66
AmaseCocoa wants to merge 25 commits intomainfrom
feat/new-release-workflow

Conversation

@AmaseCocoa
Copy link
Copy Markdown
Member

No description provided.

AmaseCocoa and others added 25 commits February 9, 2026 19:20
@AmaseCocoa AmaseCocoa closed this Feb 17, 2026
@AmaseCocoa AmaseCocoa deleted the feat/new-release-workflow branch February 17, 2026 17:04
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @AmaseCocoa, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a major refactor of the ActivityPub client, moving to a unified design that simplifies synchronous and asynchronous request handling through context managers. It centralizes and enhances the request signing process, making it more flexible and secure. Additionally, the changes significantly improve WebFinger and Host-Meta document parsing by adding XML support and optional performance dependencies, alongside a new comprehensive guide for AI agents contributing to the project.

Highlights

  • Unified HTTP Client Refactor: The client architecture has been significantly refactored, consolidating separate asyncio and sync client implementations into a single, unified ActivityPubClient. This new client leverages context managers for requests and dynamically supports both httpx (synchronous) and aiohttp (asynchronous) under the hood, streamlining client usage and maintenance.
  • Enhanced Request Signing Logic: The internal request signing mechanism has been overhauled and centralized within a new BaseReqContextManagerImpl. This includes more robust header reconstruction, explicit handling of various HTTP signature methods (draft-cavage, RFC9421, rsa2017, fep8b32), and improved validation for exclusive signing methods, ensuring consistent and secure request signing.
  • Improved WebFinger and Host-Meta Parsing: The WebfingerResult model now supports parsing from and serializing to XML (XRD) format, in addition to JSON. A new HostMeta helper class has been introduced to handle host-meta documents, providing robust parsing and serialization for both JSON (JRD) and XML (XRD) formats, with optional lxml integration for performance.
  • New 'speed' Dependency Group: A new optional dependency group named 'speed' has been added to pyproject.toml. This group includes google-re2 for faster regular expressions and lxml for accelerated XML parsing, allowing users to opt-in for performance enhancements.
  • Agent Guidelines Document: A new AGENTS.md file has been added, providing comprehensive guidelines for AI agents interacting with the apkit codebase. This document covers project overview, build/test/lint commands, code style, naming conventions, error handling, testing, and project structure.
Changelog
  • .gitignore
    • Added 'data/' to the list of ignored files.
  • AGENTS.md
    • Added new file containing comprehensive guidelines for AI agents working on the apkit codebase.
  • FEDERATION.md
    • Updated the link for 'Http Signatures' to specify 'draft-cavage-http-signatures-12'.
    • Added a new reference to 'RFC 9421: HTTP Message Signatures'.
  • pyproject.toml
    • Added a new optional dependency group 'speed' including 'google-re2' and 'lxml'.
  • src/apkit/_version.py
    • Updated the project version string.
  • src/apkit/client/_common.py
    • Updated imports to include Callable, TypeVar, ParamSpec, Ed25519PrivateKey, RSAPrivateKey, and ActorKey.
    • Refactored reconstruct_headers logic for improved clarity and efficiency.
    • Removed build_webfinger_url, validate_webfinger_result, and _is_expected_content_type functions, which were moved or refactored into other modules.
    • Adjusted type hints for sign_request return type.
    • Updated private key type checks to use specific cryptography types.
    • Added a new delegate_target decorator.
  • src/apkit/client/asyncio/init.py
    • Removed the file as part of the client refactor.
  • src/apkit/client/asyncio/actor.py
    • Removed the file as part of the client refactor.
  • src/apkit/client/asyncio/client.py
    • Removed the file as part of the client refactor.
  • src/apkit/client/asyncio/types.py
    • Removed the file as part of the client refactor.
  • src/apkit/client/base/init.py
    • Added new file to export base request context manager components.
  • src/apkit/client/base/context.py
    • Added new file implementing BaseReqContextManagerImpl for unified request handling and signing logic.
    • Introduced SignMethod literal type and validation for signing methods.
    • Implemented _sign_request to handle various HTTP signature schemes (draft-cavage, RFC9421, rsa2017, fep8b32).
  • src/apkit/client/client.py
    • Added new unified ActivityPubClient class, supporting both synchronous (httpx) and asynchronous (aiohttp) requests.
    • Implemented get and post methods that return specialized context managers.
  • src/apkit/client/methods/get.py
    • Added new file implementing GetReqContextManager for handling GET requests using the new unified client architecture.
  • src/apkit/client/methods/post.py
    • Added new file implementing PostReqContextManager for handling POST requests using the new unified client architecture.
  • src/apkit/client/models.py
    • Refactored Resource, Link, and WebfingerResult classes from dataclass(frozen=True) to regular classes using __slots__ for memory efficiency and explicit property-based immutability.
    • Added optional re2 and lxml imports for potential performance gains in regex and XML parsing.
    • Implemented WebfingerResult.to_xml() and WebfingerResult.from_xml() for XML (XRD) parsing and serialization.
    • Updated Resource.parse logic for better handling of different resource string formats.
    • Improved WebfingerResult.get method by using an internal _type_map for efficient link lookup.
  • src/apkit/client/sync/actor.py
    • Removed the file as part of the client refactor.
  • src/apkit/client/sync/client.py
    • Removed the file as part of the client refactor.
  • src/apkit/client/sync/exceptions.py
    • Removed the file as part of the client refactor.
  • src/apkit/client/sync/types.py
    • Removed the file as part of the client refactor.
  • src/apkit/helper/host_meta.py
    • Added new file introducing HostMetaLink and HostMeta classes for parsing and generating host-meta documents.
    • Implemented from_json, from_xml, to_json, and to_xml methods for handling JRD and XRD formats, with lxml support.
    • Provided methods for finding and retrieving links by relation (rel).
  • src/apkit/helper/inbox.py
    • Updated import path for ActivityPubClient to reflect the new unified client structure.
  • src/apkit/server/types.py
    • Updated import path for ActivityPubClient to reflect the new unified client structure.
    • Simplified the send function by removing explicit private key extraction, now relying on the sign_as parameter of the new client.
  • src/apkit/types.py
    • Changed ActorKey from a regular dataclass to dataclass(frozen=True) for immutability.
  • tests/client/test_models.py
    • Added new pytest fixtures xrd_valid and xrd_invalid for XML testing.
    • Updated immutability tests for Resource, Link, and WebfingerResult to check for AttributeError due to __slots__ implementation.
    • Added new tests for WebfingerResult.from_xml and WebfingerResult.to_xml methods, including roundtrip and error handling.
    • Added test_full_roundtrip_integration to verify XML to JSON and back conversions.
  • tests/test_host_meta.py
    • Added new test file for the HostMeta helper, covering XML and JSON parsing, link retrieval, and roundtrip conversions.
  • uv.lock
    • Updated lock file to include new 'google-re2' and 'lxml' dependencies for the 'speed' extra.
Ignored Files
  • Ignored by pattern: .gemini/** (1)
    • .gemini/settings.json
  • Ignored by pattern: .github/workflows/** (4)
    • .github/workflows/deploy-rc.yml
    • .github/workflows/docs.yml
    • .github/workflows/publish.yml
    • .github/workflows/release.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

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.

1 participant