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

Bug 1943581 - Extend Glean's RLB PingType impl to support retrieving metadata #3055

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

AdamBrouwersHarries
Copy link
Contributor

No description provided.

@AdamBrouwersHarries AdamBrouwersHarries requested a review from a team as a code owner January 24, 2025 14:30
@AdamBrouwersHarries AdamBrouwersHarries requested review from travis79 and removed request for a team January 24, 2025 14:30
@AdamBrouwersHarries
Copy link
Contributor Author

I've deliberately not added tests, as I'm a) not certain that this is the right API, and b) I don't know if it's something that would be acceptable to Glean devs. I'd rather not waste too much time writing tests for an API that gets rejected!

Copy link
Member

@travis79 travis79 left a comment

Choose a reason for hiding this comment

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

This looks okay to me, I'm not sure if you need all of this metadata or if you are just exposing everything that's available, but it would be nice to minimize this to just what you need, if possible. Aside from a couple of comments about comments (nits, all of them), I have no issue with moving forward with opening these up. Let's get a @badboy opinion on this too, before we land anything.

@@ -94,6 +94,63 @@ impl PingType {
self.inner.submit(reason.map(|s| s.to_string()))
}

/// Get the name of this Ping
/// Wrapper around glean::PingType::name
Copy link
Member

Choose a reason for hiding this comment

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

Since these would end up in rustdocs, I'd prefer that these function comments stand alone and not mention struct members from a separate crate.

&self.0.name
}

pub(crate) fn include_client_id(&self) -> bool {
/// Whether the client ID will be included in the assembled ping.
/// See PingType::new for further details.
Copy link
Member

Choose a reason for hiding this comment

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

Since there aren't any additional details, you can omit the cross linking back to PingType::new, I think.

@travis79 travis79 requested review from badboy and removed request for badboy January 24, 2025 15:30
@travis79
Copy link
Member

Just chatted with @badboy, no additional comments/concerns from him so if you don't mind making the comment changes and ensuring that the comment formats align with the rustdoc formatting, I'd be happy to approve and land this.

Thanks!

@travis79
Copy link
Member

I don't really see a need for tests, the underlying Ping/PingType tests should cover this and these are just getters, so not really much to test unless there's some logic going on inside of the functions.

@AdamBrouwersHarries
Copy link
Contributor Author

Thanks for the feedback @travis79 ! I'll fix up the comments and re-push.

@AdamBrouwersHarries
Copy link
Contributor Author

Ah, I've just re-read the initial comment, and

but it would be nice to minimize this to just what you need, if possible

I'm not entirely sure what we'll need. We want to be able to write a Gecko profiler marker when we submit a ping, but I'm not too certain what fields would be valuable. I've defaulted to everything "just in case", as I can't think of anything that we might not want.

@AdamBrouwersHarries AdamBrouwersHarries changed the title Bug 1943581 - Extend Glean's RLB impl to support retrieving metadata Bug 1943581 - Extend Glean's RLB PingType impl to support retrieving metadata Jan 24, 2025
@travis79 travis79 merged commit 346d3ad into mozilla:main Jan 27, 2025
29 of 30 checks passed
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.

2 participants