Skip to content

Conversation

@notJoon
Copy link
Contributor

@notJoon notJoon commented Nov 1, 2025

Summary

restored PR #421

Related Issue

partially resolve #418

Checklist

  • Did you add a changelog entry to the CHANGES.md?
  • Did you write some relevant docs about this change (if it's a new feature)?
  • Did you write a regression test to reproduce the bug (if it's a bug fix)?
  • Did you write some tests for this change (if it's a new feature)?
  • Did you run deno task test-all on your machine?

@notJoon notJoon changed the base branch from main to next November 1, 2025 03:09
@notJoon notJoon changed the title feat: uri template feat: RFC 6570 Compatible @fedify/uri-template Package Nov 1, 2025
@issues-auto-labeler issues-auto-labeler bot added component/federation Federation object related examples Example code related good first issue Good for newcomers labels Nov 1, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @notJoon, 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 URI template support, restores a previous implementation, and includes significant updates to the Fedify ecosystem. These changes involve restructuring packages, updating dependencies, enhancing CLI tooling, and modifying default configurations to improve modularity, developer experience, and compliance with ActivityPub standards.

Highlights

  • Feature Restoration: This PR restores the URI template functionality from the previous PR feat: @fedify/uri-template #421, addressing issue Implement symmetric RFC 6570 expansion and pattern matching #418.
  • Documentation Updates: The AGENTS.md file has been updated to reflect the relocation of src/codegen/ and src/runtime/ directories, as well as the addition of the src/utils/ directory.
  • Dependency Updates: The deno.json file has been modified to include new packages (@fedify/uri-template, @fedify/vocab-runtime, @fedify/relay, @fedify/vocab-tools) and update existing dependencies.
  • CLI Tooling: The Fedify CLI has been updated to run natively on Node.js and Bun, and a new fedify generate-vocab command has been added.
  • Package Restructuring: The @fedify/fedify package has been restructured, with modules related to ActivityPub vocabulary generation extracted into the new @fedify/vocab-runtime package.
  • Idempotency Strategy: The default activity idempotency strategy has been changed from "per-origin" to "per-inbox" to align with standard ActivityPub behavior.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/build.yaml
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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new, RFC 6570-compliant URI template package, @fedify/uri-template. The implementation is thorough, covering expansion and symmetric matching with different encoding policies. The code is well-structured and comes with comprehensive documentation and tests. However, I've identified a critical issue in the matching logic that needs to be addressed, along with several medium to high severity issues related to package configuration, documentation, and examples that impact usability and maintainability.

Comment on lines +147 to +150
if (spec.first) {
// Operators starting with a distinct char must appear in URL
if (!readLiteral(spec.first)) return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The matching logic incorrectly handles expressions that can be empty. It unconditionally consumes the operator's first character (e.g., ., /, ;), which is incorrect for expressions that can resolve to an empty string, where the first character should not be present. For example, a template X{.foo}Y should match the URL XY when foo is undefined, but the current logic will fail because it expects a . before Y. This is a critical bug that breaks matching for many valid cases. The logic needs to be updated to handle the optionality of the first character based on whether the expression's variables produce any output.

Co-authored-by: Hong Minhee (洪 民憙) <[email protected]>
Copy link
Member

@dahlia dahlia left a comment

Choose a reason for hiding this comment

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

Could you add packages/uri-template to the packages list in the pnpm-workspace.yaml file?

@notJoon
Copy link
Contributor Author

notJoon commented Nov 4, 2025

Could you add packages/uri-template to the packages list in the pnpm-workspace.yaml file?

@dahlia I'll add it right away. also, I haven't updated CHANGES.md yet, would it be better to add it to version 1.10.0 or to version 2.0.0?

@dahlia
Copy link
Member

dahlia commented Nov 4, 2025

You should add it to version 2.0.0!

@notJoon
Copy link
Contributor Author

notJoon commented Nov 4, 2025

You should add it to version 2.0.0!

got it! now I updated pnpm-workspace.yaml, pnpm-lock.yaml and CHANGES.md files. 7dbe61c

@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

❌ Patch coverage is 63.52459% with 178 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/uri-template/src/match.ts 57.14% 74 Missing and 1 partial ⚠️
packages/uri-template/src/expand.ts 42.35% 49 Missing ⚠️
packages/uri-template/src/parser.ts 72.50% 22 Missing ⚠️
packages/uri-template/src/spec.ts 83.47% 19 Missing and 1 partial ⚠️
packages/uri-template/src/error.ts 16.66% 10 Missing ⚠️
packages/uri-template/src/compile.ts 86.66% 2 Missing ⚠️
Files with missing lines Coverage Δ
packages/uri-template/src/compile.ts 86.66% <86.66%> (ø)
packages/uri-template/src/error.ts 16.66% <16.66%> (ø)
packages/uri-template/src/spec.ts 83.47% <83.47%> (ø)
packages/uri-template/src/parser.ts 72.50% <72.50%> (ø)
packages/uri-template/src/expand.ts 42.35% <42.35%> (ø)
packages/uri-template/src/match.ts 57.14% <57.14%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/federation Federation object related examples Example code related good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement symmetric RFC 6570 expansion and pattern matching

2 participants