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

🐛Fixes invalid invitation links #7057

Merged

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Jan 17, 2025

What do these changes do?

The issue arises in the latest Pydantic version, where HttpUrl automatically appends a trailing / to URLs that consist only of an origin (i.e., without a path).

Example:

>>> from pydantic import HttpUrl

>>> HttpUrl("http://origin")  # Without trailing `/`
HttpUrl('http://origin/')

>>> HttpUrl("http://origin/")  # With trailing `/`
HttpUrl('http://origin/')

However, when a path is included in the URL, Pydantic preserves the given format:

>>> HttpUrl("http://origin/path/")
HttpUrl('http://origin/path/')

>>> HttpUrl("http://origin/path")
HttpUrl('http://origin/path')

This behavior change affects cases where a strict distinction between "http://origin" and "http://origin/" is necessary.

Related issue/s

How to test

  • driving test
cd services/invitations
make install-dev
 make test-dev-unit
  • manual test @odeimaiz @YuryHrytsuk
    • login with a PO user
    • go to PO center and create an invitation link
    • make sure link generaged does not contain double // at the end.

Dev-ops

None

@pcrespov pcrespov added the a:invitations invitations service label Jan 17, 2025
@pcrespov pcrespov self-assigned this Jan 17, 2025
@pcrespov pcrespov added this to the Singularity milestone Jan 17, 2025
@pcrespov pcrespov enabled auto-merge (squash) January 17, 2025 18:12
Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

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

thanks!

@pcrespov pcrespov force-pushed the is7055/fix-invitation-double-slash branch from 7ed892e to a6c800e Compare January 17, 2025 22:17
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

second issue due to that change

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.06%. Comparing base (8909588) to head (52a2cfb).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7057      +/-   ##
==========================================
- Coverage   84.26%   82.06%   -2.21%     
==========================================
  Files        1633      700     -933     
  Lines       63691    33668   -30023     
  Branches     2050      262    -1788     
==========================================
- Hits        53670    27629   -26041     
+ Misses       9684     5979    -3705     
+ Partials      337       60     -277     
Flag Coverage Δ
integrationtests 63.68% <ø> (-0.04%) ⬇️
unittests 93.42% <100.00%> (+11.03%) ⬆️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library ∅ <ø> (∅)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration ∅ <ø> (∅)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 77.37% <ø> (-8.02%) ⬇️
agent ∅ <ø> (∅)
api_server ∅ <ø> (∅)
autoscaling ∅ <ø> (∅)
catalog ∅ <ø> (∅)
clusters_keeper ∅ <ø> (∅)
dask_sidecar ∅ <ø> (∅)
datcore_adapter ∅ <ø> (∅)
director ∅ <ø> (∅)
director_v2 78.68% <ø> (-12.58%) ⬇️
dynamic_scheduler ∅ <ø> (∅)
dynamic_sidecar 89.59% <ø> (-0.16%) ⬇️
efs_guardian ∅ <ø> (∅)
invitations 93.42% <100.00%> (-0.03%) ⬇️
osparc_gateway_server ∅ <ø> (∅)
payments ∅ <ø> (∅)
resource_usage_tracker ∅ <ø> (∅)
storage ∅ <ø> (∅)
webclient ∅ <ø> (∅)
webserver 82.25% <ø> (+7.38%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8909588...52a2cfb. Read the comment docs.

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

This happened also to me, such a pain to fix

@sanderegg sanderegg disabled auto-merge January 21, 2025 12:32
@sanderegg sanderegg merged commit a0f438e into ITISFoundation:master Jan 21, 2025
52 of 53 checks passed
matusdrobuliak66 pushed a commit that referenced this pull request Jan 21, 2025
@pcrespov pcrespov deleted the is7055/fix-invitation-double-slash branch January 22, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:invitations invitations service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

s4l-lite invitation links do not work
8 participants