Skip to content

Publish percent-encoding-iri and optional IRI percent-encoding#1

Open
fernandolins wants to merge 10 commits intomainfrom
percent-encoding-iri-release
Open

Publish percent-encoding-iri and optional IRI percent-encoding#1
fernandolins wants to merge 10 commits intomainfrom
percent-encoding-iri-release

Conversation

@fernandolins
Copy link
Copy Markdown

@fernandolins fernandolins commented Apr 22, 2026

Summary

  • Adds an optional iri feature to the percent-encoding stack: when enabled, AsciiSet::should_percent_encode only encodes ASCII bytes in the set; non-ASCII UTF-8 octets are left literal (IRI-style). Default behaviour stays WHATWG-style for the rest of the workspace.
  • Publishes this logic on crates.io under the package name percent-encoding-iri, with [lib] name = "percent_encoding" so url / form_urlencoded keep use percent_encoding::… via package = "percent-encoding-iri".
  • CI runs cargo test -p percent-encoding-iri --features iri on main CI; 1.63 lockfile is updated for the new package name.
  • Adds a manual GitHub Actions workflow to run tests + cargo publish --dry-run by default, and optional real publish to crates.io (restricted to main, optional crates-io environment for approvals).

Motivation

Matches the use case described for consumers that need Unicode path segments to stay readable in contexts such as file: / local media (see servo/rust-url#871 for background) while keeping default behaviour for existing url + WHATWG test expectations.

Publishing

  • First percent-encoding-iri release: version in percent_encoding/Cargo.toml (e.g. 2.3.2).
  • Configure GitHub secret CARGO_REGISTRY_TOKEN and optionally Environment crates-io with required reviewers; run Publish percent-encoding-iri with dry_run to validate only, or with dry_run off to upload.

@fernandolins fernandolins changed the title Percent encoding iri release Publish percent-encoding-iri and optional IRI percent-encoding Apr 22, 2026
Transitive ICU deps pull in zerovec 0.11.6, which requires rustc 1.83+.
@fernandolins fernandolins marked this pull request as ready for review April 24, 2026 14:58
if: ${{ !inputs.dry_run }}
runs-on: ubuntu-latest
timeout-minutes: 15
environment: crates-io
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Need to confirm with @andrewsanchez if the release environment should be used instead.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yeah, probably it is!
However, it should be released separately from Anki. Because this library needs to exist, be updated in Anki, and then Anki needs to be published.


- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can't we use Trusted Publishing instead? https://crates.io/docs/trusted-publishing

Copy link
Copy Markdown
Author

@fernandolins fernandolins Apr 24, 2026

Choose a reason for hiding this comment

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

Yes, we can do it, but we have to set it up on crates.io

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry if I'm forgetting discussion about this, but do we really need to publish to crates.io? Why not something like this?

some-crate = { git = "https://github.com/your-username/forked-crate", rev = "a1b2c3d4" }

- name: Cache Cargo registry + git deps
  uses: actions/cache@v3
  with:
    path: |
      ~/.cargo/registry
      ~/.cargo/git        # <-- this caches your git dependencies
      target/
    key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Since our main goal is to publish Anki, then yes, we will need to publish this fork that is used as a dependency in Anki project.

See more: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#local-paths-in-published-crates

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.

3 participants