Remove/cleanup extrude implementations

Open
#1,248 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
rust
Domain
backend

Research direction

Start by locating the extrude functions and existing FromRequest implementations across the codebase, then inspect which middleware paths still depend on them. The work is done when obsolete extruders are removed or replaced with extraction from HttpRequest, including simplified path handling where applicable.

Written by the indexing model from the issue text.

Description

Extractors (i.e. implementations of the FromRequest trait) operate on HttpRequests. Middlewares take ServiceRequests, which are a higher-level abstraction over HTTP requests. We used to do a lot of work in middlewares, and building extractor-like abstractions to improve modularity and readability was desirable. These abstractions took the form of extrude functions defined in numerous places across the codebase and were responsible for extracting information from ServiceRequests (or its constituent parts, like RequestHead).

Now that we do a lot less in middleware (the db transaction handling and precondition checks are no longer middleware), we don't need as many extrude functions. Instead, we should explore writing new extractors or adding to existing extractors to retrieve the information we need from HttpRequest instead of ServiceRequest, simplifying some of their implementations (e.g. the _from_path methods wouldn't need extract path elements as manually as they currently do, requiring them to urldecode).

https://github.com/mozilla-services/syncstorage-rs/issues/833

┆Issue is synchronized with this Jira Task

Dominant language
Rust
Stars
1.8k
Forks
86
Avg merge
2d 17h
Merged PRs (30d)
21

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mozilla-services/syncstorage-rs

All issues in mozilla-services/syncstorage-rs

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.