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

Use tostr on prop/form names to avoid attribute errors (SYN-6657) #3584

Merged
merged 8 commits into from Feb 29, 2024

Conversation

Cisphyx
Copy link
Contributor

@Cisphyx Cisphyx commented Feb 26, 2024

No description provided.

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.56%. Comparing base (5a60657) to head (e6ea001).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3584      +/-   ##
==========================================
- Coverage   97.66%   97.56%   -0.11%     
==========================================
  Files         234      234              
  Lines       49737    49755      +18     
==========================================
- Hits        48574    48541      -33     
- Misses       1163     1214      +51     
Flag Coverage Δ
linux 97.56% <100.00%> (-0.01%) ⬇️
linux_replay ?

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.

@vEpiphyte vEpiphyte added bug reqChangelog requires changelog labels Feb 26, 2024
@vEpiphyte vEpiphyte added this to the v2.16x.x milestone Feb 26, 2024
vEpiphyte
vEpiphyte previously approved these changes Feb 27, 2024
synapse/lib/ast.py Outdated Show resolved Hide resolved

ispiv = name.find('::') != -1
if not ispiv:

prop = path.node.form.props.get(name)
if prop is None:
if not isinstance(propname, str):
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we functionalize this block to minimize copy/pasta?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a typeerr function to stormtypes, open to other naming suggestions

Copy link
Contributor

Choose a reason for hiding this comment

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

I think typeerr is fine, but I could also see it being something like reqType since it will raise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I initially had it as reqtype, but it doesn't raise the exception itself, it returns it so we can add the relevant AST info here.

@invisig0th invisig0th merged commit c337491 into master Feb 29, 2024
5 checks passed
@invisig0th invisig0th deleted the tostr-names branch February 29, 2024 16:53
@vEpiphyte vEpiphyte removed the reqChangelog requires changelog label Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants