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

refactor(aggregator): better url sanitization process by using a value object #2241

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

Alenar
Copy link
Collaborator

@Alenar Alenar commented Jan 22, 2025

Content

This PR introduce a SanitizedUrlWithTrailingSlash struct to avoid redundant call to the url sanitizer as it guarantee that the url that it hold is already sanitized.

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link

github-actions bot commented Jan 22, 2025

Test Results

    4 files  ±0     52 suites  ±0   10m 17s ⏱️ -9s
1 545 tests +2  1 545 ✅ +2  0 💤 ±0  0 ❌ ±0 
1 801 runs  +2  1 801 ✅ +2  0 💤 ±0  0 ❌ ±0 

Results for commit d65c60a. ± Comparison against base commit d1dc173.

♻️ This comment has been updated with latest results.

@Alenar Alenar temporarily deployed to testing-preview January 22, 2025 15:54 — with GitHub Actions Inactive
@Alenar Alenar temporarily deployed to testing-sanchonet January 22, 2025 15:54 — with GitHub Actions Inactive
Copy link
Collaborator

@sfauvel sfauvel left a comment

Choose a reason for hiding this comment

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

LGTM
It's a good thing to have a typed Url but the name should be improve

internal_url: Url,
}

impl SanitizedUrl {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This structure represent a Uri that is not a resource.
We may named it to reflect that.
SanitizedUrl doesn't mean much. This gives the impression of having a valid Url

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We share this concern but could not find a name that would fit that description.

Since we could not find anything better we renamed it to SanitizedUrlWithTrailingSlash with hope we found a better name in the future.

@Alenar Alenar force-pushed the ensemble/2234/incremental-db-artifact-production-optimizations branch from b630878 to 0db35ae Compare January 22, 2025 16:47
Base automatically changed from ensemble/2234/incremental-db-artifact-production-optimizations to main January 22, 2025 16:59
@Alenar Alenar force-pushed the ensemble/aggregator/refactor_url_sanitizer branch from 33f7afc to 9db66d8 Compare January 22, 2025 17:01
@Alenar Alenar temporarily deployed to testing-preview January 22, 2025 17:10 — with GitHub Actions Inactive
@Alenar Alenar temporarily deployed to testing-sanchonet January 22, 2025 17:10 — with GitHub Actions Inactive
@Alenar Alenar force-pushed the ensemble/aggregator/refactor_url_sanitizer branch from 9db66d8 to 18e7535 Compare January 23, 2025 10:06
Alenar and others added 2 commits January 23, 2025 11:11
…e object

This `SanitizedUrlWithTrailingSlash` struct allow to avoid redundant call to the url
sanitizer as it guarantee that the url that it hold is already sanitized.

Co-authored-by: Damien Lachaume <[email protected]>
* mithril-aggregator from `0.6.18` to `0.6.19`
@Alenar Alenar force-pushed the ensemble/aggregator/refactor_url_sanitizer branch from 18e7535 to d65c60a Compare January 23, 2025 10:11
@Alenar Alenar temporarily deployed to testing-preview January 23, 2025 10:39 — with GitHub Actions Inactive
@Alenar Alenar temporarily deployed to testing-sanchonet January 23, 2025 10:39 — with GitHub Actions Inactive
@Alenar Alenar merged commit 693d95a into main Jan 23, 2025
43 of 44 checks passed
@Alenar Alenar deleted the ensemble/aggregator/refactor_url_sanitizer branch January 23, 2025 10:50
@Alenar Alenar mentioned this pull request Jan 24, 2025
8 tasks
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.

4 participants