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

INTL-1677: Exclude Pendo ID pattern in codemod #255

Merged
merged 3 commits into from
Oct 24, 2023
Merged

Conversation

alanknight-wk
Copy link
Contributor

@alanknight-wk alanknight-wk commented Oct 23, 2023

Motivation

Exclude Pendo IDs, or similar from conversion. Those are of the form Period.Separated.Uppercase.Words

Changes

  • It turns out that our existing check for CamelCaseWords wasn't actually working. Or at least it was checking for quoted strings, meaning e.g. var foo = "'stuff'". Which are extremely rare. I didn't think this made any sense at all, so I just dropped the "quoted" requirement and allowed periods within the word. It also had no tests, so it's hard to know what the intent was. Added some tests.
  • We also weren't using the checks for strings to exclude in the constant string migrator, so I started including them.
  • We used strings that we expected to be converted in test cases, which met the camel case requirement (if we didn't have quotes), specifically 'testString1', 'testString2'. I turned those into 'test String 1' and 2.
  • There were a number of regular expressions used in utils.dart which were being recreated every time through the method. Regular expressions are relatively expensive to initialize, so I pulled them out into variables.
  • The camel case check is done via a very large RegExp. I considered rewriting it, but the logic is fairly complicated, so I settled for writing an extensive comment.

Release Notes

Review

See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.

Please review:

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed

Merge Checklist

While we perform many automated checks before auto-merging, some manual checks are needed:

  • A Frontend Frameworks Design member has reviewed these changes
  • There are no unaddressed comments - this check can be automated if reviewers use the "Request Changes" feature
  • For release PRs - Version metadata in Rosie comment is correct

@aviary3-wk
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@alanknight-wk alanknight-wk changed the title Pendo ids INTL-1677: Exclude Pendo ID pattern in codemod Oct 23, 2023
@alanknight-wk
Copy link
Contributor Author

@Workiva/release-management-p

Copy link

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

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

+1 from RM

@rmconsole2-wf rmconsole2-wf merged commit 5f78bc6 into master Oct 24, 2023
4 checks passed
@rmconsole2-wf rmconsole2-wf deleted the pendo_ids branch October 24, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants