Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Generate implementation for Name trait #931

Merged
merged 3 commits into from Nov 13, 2023

Conversation

tinrab
Copy link
Contributor

@tinrab tinrab commented Oct 11, 2023

Adds an option to implement the Name trait (added in #896) for message types.

Domains names for type URLs can be set with type_name_domains.
It's possible that this doesn't have to be a PathMap, but a single value for the entire config. Or something completely different.

Resolves #926.

@getong
Copy link

getong commented Oct 20, 2023

I test your code, it works. Thanks for your time.

@getong
Copy link

getong commented Nov 10, 2023

@tinrab
I think you can update ci.yaml version from 1.64 to 1.65, which might test ok.
You can see my test here : getong#2

@getong
Copy link

getong commented Nov 10, 2023

@LucioFranco
The test is ok now, would you take a look at this pr and push a new version to crates.io?

Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

Nice! Thanks!

@LucioFranco LucioFranco merged commit 3ce212f into tokio-rs:master Nov 13, 2023
11 checks passed
@tinrab
Copy link
Contributor Author

tinrab commented Nov 16, 2023

@LucioFranco @getong Turns out, this doesn't work. Declaring PACKAGE on module-level causes name collision.

renovate bot added a commit to smartive/zitadel-rust that referenced this pull request May 2, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [prost](https://togithub.com/tokio-rs/prost) | dependencies | patch |
`0.12` -> `0.12.4` |
| [prost-types](https://togithub.com/tokio-rs/prost) | dependencies |
patch | `0.12` -> `0.12.4` |

---

### Release Notes

<details>
<summary>tokio-rs/prost (prost)</summary>

###
[`v0.12.4`](https://togithub.com/tokio-rs/prost/releases/tag/v0.12.4)

[Compare
Source](https://togithub.com/tokio-rs/prost/compare/v0.12.3...v0.12.4)

*PROST!* is a [Protocol
Buffers](https://developers.google.com/protocol-buffers/) implementation
for the [Rust Language](https://www.rust-lang.org/). `prost` generates
simple, idiomatic Rust code from `proto2` and `proto3` files.

This patch update brings new features and fixes:

-   Bump MSRV to 1.70 (minimum supported Rust version)
- Rename cargo feature `prost-derive` to `derive`
([#&#8203;992](https://togithub.com/tokio-rs/prost/issues/992))
- Add [@&#8203;generated](https://togithub.com/generated) comment on top
of generated files
([#&#8203;935](https://togithub.com/tokio-rs/prost/issues/935))
- Optimize implementation of prost::Name when generated by prost-build
([#&#8203;956](https://togithub.com/tokio-rs/prost/issues/956))

##### Dependencies

- build(deps): Allow itertools 0.12
([#&#8203;948](https://togithub.com/tokio-rs/prost/issues/948))
- build(deps): Allow heck 0.5
([#&#8203;1012](https://togithub.com/tokio-rs/prost/issues/1012))
- build(deps): Allow multimap 0.10
([#&#8203;1013](https://togithub.com/tokio-rs/prost/issues/1013))

##### Documentation

- Improve protoc not found error message
([#&#8203;937](https://togithub.com/tokio-rs/prost/issues/937))
- build: Add development container config
([#&#8203;949](https://togithub.com/tokio-rs/prost/issues/949))
- docs: Fixed README typos
([#&#8203;952](https://togithub.com/tokio-rs/prost/issues/952) /
[#&#8203;967](https://togithub.com/tokio-rs/prost/issues/967) /
[#&#8203;970](https://togithub.com/tokio-rs/prost/issues/970))

##### Internal

- chore: Fix minimal versions
([#&#8203;920](https://togithub.com/tokio-rs/prost/issues/920))
- fix: fq_message_name should begin with one dot
([#&#8203;981](https://togithub.com/tokio-rs/prost/issues/981))
- improve encode_varint performance by bounding its loop
([#&#8203;940](https://togithub.com/tokio-rs/prost/issues/940))
- style: Remove duplicate function call
([#&#8203;989](https://togithub.com/tokio-rs/prost/issues/989))
- test: Improve test decode_varint_slow
([#&#8203;977](https://togithub.com/tokio-rs/prost/issues/977))
- chore: Add dep: prefix to feature dependencies
([#&#8203;919](https://togithub.com/tokio-rs/prost/issues/919))
- Minor clippy lint fixes.
([#&#8203;1006](https://togithub.com/tokio-rs/prost/issues/1006))
- chore: Use taiki-e/install-action to setup cargo-machete
([#&#8203;909](https://togithub.com/tokio-rs/prost/issues/909))
- chore: Remove which dependency.
([#&#8203;962](https://togithub.com/tokio-rs/prost/issues/962))
- chore: Update to actions/checkout@v4
([#&#8203;910](https://togithub.com/tokio-rs/prost/issues/910))

###
[`v0.12.3`](https://togithub.com/tokio-rs/prost/releases/tag/v0.12.3)

[Compare
Source](https://togithub.com/tokio-rs/prost/compare/v0.12.2...v0.12.3)

*PROST!* is a [Protocol
Buffers](https://developers.google.com/protocol-buffers/) implementation
for the [Rust Language](https://www.rust-lang.org/). `prost` generates
simple, idiomatic Rust code from `proto2` and `proto3` files.

This patch updates brings a few new fixes:

- [Fix code generation for Name trait
(](https://togithub.com/tokio-rs/prost/commit/acc1df83f73cda03c10722fbb739c7920b6b9048)[https://github.com/tokio-rs/prost/pull/944](https://togithub.com/tokio-rs/prost/pull/944)[)](https://togithub.com/tokio-rs/prost/commit/acc1df83f73cda03c10722fbb739c7920b6b9048)

###
[`v0.12.2`](https://togithub.com/tokio-rs/prost/releases/tag/v0.12.2)

[Compare
Source](https://togithub.com/tokio-rs/prost/compare/v0.12.1...v0.12.2)

*PROST!* is a [Protocol
Buffers](https://developers.google.com/protocol-buffers/) implementation
for the [Rust Language](https://www.rust-lang.org/). `prost` generates
simple, idiomatic Rust code from `proto2` and `proto3` files.

This patch updates brings a few new features and fixes:

- feat: Generate implementation for Name trait
([tokio-rs/prost#931)
- fix: generate Name::full_name properly
([tokio-rs/prost#923)

###
[`v0.12.1`](https://togithub.com/tokio-rs/prost/compare/v0.12.0...v0.12.1)

[Compare
Source](https://togithub.com/tokio-rs/prost/compare/v0.12.0...v0.12.1)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 9pm,before 6am" in timezone
Europe/Zurich, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/smartive/zitadel-rust).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMzEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjMzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

Follow up, implement Name trait implementation via prost-build
3 participants