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

Review Docs: Writing Custom Filters for API changes #373

Closed
markmandel opened this issue Aug 25, 2021 · 6 comments · Fixed by #395
Closed

Review Docs: Writing Custom Filters for API changes #373

markmandel opened this issue Aug 25, 2021 · 6 comments · Fixed by #395
Labels
kind/cleanup Refactoring code, fixing up documentation, etc kind/documentation Improvements or additions to documentation
Milestone

Comments

@markmandel
Copy link
Contributor

When I last looked at https://googleforgames.github.io/quilkin/main/book/filters/writing_custom_filters.html

I noticed that there were a few broken links (#367 should totally be a thing), (it looks like we're missing going one level too deep on some of the links).

The main part I saw was that we've improved the experience on "Working with Filter Configuration", and I'm not sure if the current documentation matches what we have via our current API surface.

@markmandel markmandel added kind/documentation Improvements or additions to documentation kind/cleanup Refactoring code, fixing up documentation, etc labels Aug 25, 2021
@markmandel markmandel added this to the 0.2.0 milestone Aug 25, 2021
@markmandel
Copy link
Contributor Author

I'm going to fixup the 404's, @iffyio would love to double check with you on my comments on "Working with Filter Configuration" is accurate? (i.e. we could streamline that)

@iffyio
Copy link
Collaborator

iffyio commented Aug 25, 2021

The main part I saw was that we've improved the experience on "Working with Filter Configuration", and I'm not sure if the current documentation matches what we have via our current API surface.

Is there anything in particular that's missing, from what I can tell it looks up to date, not sure of any related filter api changes that would need updating?

@markmandel
Copy link
Contributor Author

Just doing a quick check through as I fix up some 404s... so I can be more clear!

Looks like the current approach will work, but the new https://googleforgames.github.io/quilkin/main/api/quilkin/config/enum.ConfigType.html#method.deserialize method definitely makes things easier, and we might want to push people in that direction.

That being said, the current approach works, so not sure if we want to block on this for the release? How do you feel?

@markmandel
Copy link
Contributor Author

To add an extra example, here is what the LoadBalancerFactory looks like now

impl FilterFactory for LoadBalancerFilterFactory {
    fn name(&self) -> &'static str {
        NAME
    }

    fn create_filter(&self, args: CreateFilterArgs) -> Result<Box<dyn Filter>, Error> {
        let config: Config = self
            .require_config(args.config)?
            .deserialize::<Config, ProtoConfig>(self.name())?;

        Ok(Box::new(LoadBalancer {
            endpoint_chooser: config.policy.as_endpoint_chooser(),
        }))
    }
}

That deserialize is sooo nice 😄

markmandel added a commit to markmandel/quilkin that referenced this issue Aug 25, 2021
This should give me impetus to complete googleforgames#367 since I just checked all
the links by hand.

Noticed that on local `make docs` you can go extra levels deep on `../`
relative links, and they still work locally, but not online.

Anyway, fixed all that up now, so the links aren't 404'd.

Work on googleforgames#373
@iffyio
Copy link
Collaborator

iffyio commented Aug 25, 2021

Ah I see what you mean, for this particular case the deserialize isn't exactly identical vs doing it manually only because it requires you have a mapping from config to proto but yeah it definitely makes sense to include it in the doc

markmandel added a commit that referenced this issue Aug 25, 2021
This should give me impetus to complete #367 since I just checked all
the links by hand.

Noticed that on local `make docs` you can go extra levels deep on `../`
relative links, and they still work locally, but not online.

Anyway, fixed all that up now, so the links aren't 404'd.

Work on #373
@markmandel
Copy link
Contributor Author

Started updating the example with the new API. Will PR when ready. Haven't touched Rust in a while! 😄

markmandel added a commit to markmandel/quilkin that referenced this issue Sep 2, 2021
Update the custom filter example to the new API surface, and also setup
CI so that it ensures that it always compiles against dev Quilkin, and
therefore will stay in sync going forward.

Next I want to block out pieces of code and inject them into our docs
via mdbook when updating
https://googleforgames.github.io/quilkin/main/book/filters/writing_custom_filters.html
as well, rather than have them copy pasted.

Work on googleforgames#373
markmandel added a commit to markmandel/quilkin that referenced this issue Sep 2, 2021
Update the custom filter example to the new API surface, and also setup
CI so that it ensures that it always compiles against dev Quilkin, and
therefore will stay in sync going forward.

Next I want to block out pieces of code and inject them into our docs
via mdbook when updating
https://googleforgames.github.io/quilkin/main/book/filters/writing_custom_filters.html
as well, rather than have them copy pasted.

Work on googleforgames#373
markmandel added a commit to markmandel/quilkin that referenced this issue Sep 2, 2021
Update the custom filter example to the new API surface, and also setup
CI so that it ensures that it always compiles against dev Quilkin, and
therefore will stay in sync going forward.

Next I want to block out pieces of code and inject them into our docs
via mdbook when updating
https://googleforgames.github.io/quilkin/main/book/filters/writing_custom_filters.html
as well, rather than have them copy pasted.

Work on googleforgames#373
markmandel added a commit that referenced this issue Sep 8, 2021
* Update custom filter example and add CI

Update the custom filter example to the new API surface, and also setup
CI so that it ensures that it always compiles against dev Quilkin, and
therefore will stay in sync going forward.

Next I want to block out pieces of code and inject them into our docs
via mdbook when updating
https://googleforgames.github.io/quilkin/main/book/filters/writing_custom_filters.html
as well, rather than have them copy pasted.

Work on #373

* Review updates.
markmandel added a commit to markmandel/quilkin that referenced this issue Sep 14, 2021
Updates the custom filter documentation to the latest API changes.

This also includes using mdbook's `include` preprocessor to inject the
example code into the documentation.

Note: Because of the use of `include` preprocessor I had to remove the
Markdown lists, as they wouldn't format correctly
(See: rust-lang/mdBook#1564).

Closes googleforgames#373
markmandel added a commit that referenced this issue Sep 16, 2021
* Docs: Updated Custom Filters

Updates the custom filter documentation to the latest API changes.

This also includes using mdbook's `include` preprocessor to inject the
example code into the documentation.

Note: Because of the use of `include` preprocessor I had to remove the
Markdown lists, as they wouldn't format correctly
(See: rust-lang/mdBook#1564).

Closes #373

* Fix CI build
* Review Updates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Refactoring code, fixing up documentation, etc kind/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants