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

fix: Default height/width to 100% if either doesn't exist #733

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

ajay-sentry
Copy link
Contributor

@ajay-sentry ajay-sentry commented Aug 5, 2024

Purpose/Motivation

Fixes sentry issue: https://codecov.sentry.io/issues/2768942613/?environment=epic&environment=dd&environment=enova&environment=mailchimp&environment=production&environment=roblox&environment=snowflake&environment=prodvana&project=5514400&project=5215654&query=is%3Aunresolved+issue.priority%3A%5Bhigh%2C+medium%5D&referrer=issue-stream&statsPeriod=7d&stream_index=9

We just want to default a numerical value in the event both the .get() and the default from the get are non-integer values.

The sentry issue is complaining that the default value is '', and if you do '' or 100 (like in the PR), we will use 100

These eventually bubble up to here:

def _make_svg(width, height, elements, viewPortWidth=None, viewPortHeight=None):
return (
'<svg baseProfile="full" width="{0}" height="{1}" viewBox="0 0 {4} {5}" version="1.1"\n'
'xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events"\n'
'xmlns:xlink="http://www.w3.org/1999/xlink">\n'
"{2}\n"
"{3}\n"
"</svg>".format(
width,
height,
style_n_defs,
"\n".join(elements),
viewPortWidth or width,
viewPortHeight or height,
)
)

Links to relevant tickets

Closes codecov/engineering-team#2204

Notes to Reviewer

Anything to note to the team? Any tips on how to review, or where to start?

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@ajay-sentry ajay-sentry changed the title fix: Default height/width to 100px if either doesn't exist fix: Default height/width to 100% if either doesn't exist Aug 5, 2024
@codecov-notifications
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented Aug 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.02%. Comparing base (e245d32) to head (8a027e6).

Changes have been made to critical files, which contain lines commonly executed in production. Learn more

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##               main       #733   +/-   ##
===========================================
  Coverage   96.02000   96.02000           
===========================================
  Files           814        814           
  Lines         18428      18428           
===========================================
  Hits          17695      17695           
  Misses          733        733           
Flag Coverage Δ
unit 91.73% <ø> (ø)
unit-latest-uploader 91.73% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ajay-sentry ajay-sentry added this pull request to the merge queue Aug 6, 2024
Merged via the queue into main with commit 24c8d91 Aug 6, 2024
17 of 18 checks passed
@ajay-sentry ajay-sentry deleted the Ajay/fix-unhandled-val-error branch August 6, 2024 18:05
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.

Fix for ValueError when fetching tree graph
2 participants