Skip to content

[NO QA] Fix 62656 lint changed#62993

Merged
rafecolton merged 35 commits into
Expensify:mainfrom
MacroLens:fix_62656_lint_changed
Jun 6, 2025
Merged

[NO QA] Fix 62656 lint changed#62993
rafecolton merged 35 commits into
Expensify:mainfrom
MacroLens:fix_62656_lint_changed

Conversation

@MacroLens

@MacroLens MacroLens commented May 28, 2025

Copy link
Copy Markdown
Contributor

Explanation of Change

Changes the lint-changed workflow and Node script to use git merge-base to determine
where to do git diff when computing changed files for use in linter.

Fixed Issues

$ #62656
PROPOSAL: #62656 (comment)

Tests

  1. Checkout 18af2cf of this branch.
  2. Setup node by running nvm install && npm install.
  3. Run npm run lint-changed, note that there is more than 1 error.
  4. Switch back to the head of this branch.
  5. Run npm run lint-changed, note that there is now only 1 error.

This test will show on step 5 show no errors after 18af2cf is reverted.

  • Verify that no errors appear in the JS console

Offline tests

N/A no changes in app.

QA Steps

N/A GitHub actions and development scripts.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. ⚠️

@MacroLens

MacroLens commented May 28, 2025

Copy link
Copy Markdown
Contributor Author

@rafecolton see my comment #62656 (comment). If you don't want to proceed that way then this issue is ready for review.

[Edit: issue on remote version of the fix merge-base does not return anything]

@MacroLens

Copy link
Copy Markdown
Contributor Author

Ok I have made the proper changes so that the lint error shows up now. I needed to add a fetch-depth which is default to 1 on the checkout action, and then keep the fetch in the lint-changed job.

Comment thread .github/workflows/lint-changed.yml Outdated
Comment thread .github/workflows/lint-changed.yml Outdated
Comment thread scripts/lintChanged.sh Outdated
Comment thread scripts/lintChanged.sh Outdated
Comment thread scripts/lintChanged.sh Outdated
Comment thread scripts/lintChanged.sh Outdated
Comment thread scripts/lintChanged.sh Outdated
Comment thread scripts/lintChanged.sh Outdated
Comment thread scripts/lintChanged.sh Outdated
@MacroLens

Copy link
Copy Markdown
Contributor Author

Currently working on creating the API call for merge-base.

@MacroLens

Copy link
Copy Markdown
Contributor Author

@rafecolton I made the necessary changes but I am getting an issue with the validate github actions workflow. I believe there is an error? Apply the following patch:

diff --git .github/scripts/validateActionsAndWorkflows.sh .github/scripts/validateActionsAndWorkflows.sh
index fadb39c88e4..ae4e6197a05 100755
--- .github/scripts/validateActionsAndWorkflows.sh
+++ .github/scripts/validateActionsAndWorkflows.sh
@@ -86,7 +86,7 @@ else
 fi
 
 info 'Linting workflows...'
-./actionlint -color || EXIT_CODE=1
+./actionlint -color -verbose || EXIT_CODE=1
 if [[ "$EXIT_CODE" == 0 ]]; then
   success 'Workflows passed actionlint!'
 fi

The verbose output shows no errors output on the actionlint, but it still returns 1:

...
verbose: Found total 0 errors in 404 ms for workflows/testBuildHybrid.yml
verbose: Found total 0 errors in 409 ms for workflows/deploy.yml
verbose: Found 0 errors in 46 files

It looks like there was another similar failed job here:
https://github.com/Expensify/App/actions/runs/15330503271/job/43135846315
But it was working fine until https://github.com/Expensify/App/actions/runs/15327479225/job/43125586685

@MacroLens

Copy link
Copy Markdown
Contributor Author

Otherwise I have implemented new logic for checking out the main repo with a calculated depth in 2389b62c0d9c5afcc938fc826542693fdd827a92. Let me know what you think.

@rafecolton

Copy link
Copy Markdown
Member

It looks like you are still pushing changes, so I'm going to unsubscribe. Please @ me when you are ready for me to review again and I will review all at once 👍

@MacroLens MacroLens force-pushed the fix_62656_lint_changed branch from 2686b95 to 78b68a0 Compare May 29, 2025 21:35
@MacroLens

Copy link
Copy Markdown
Contributor Author

I accidentally merged and messed up the files changed, so I cherrypicked the commits around the merge and merge revert.

@MacroLens

Copy link
Copy Markdown
Contributor Author

@rafecolton Due to me messing with the history I can no longer reproduce the test situation where we had multiple lint errors when checking out c1b62b3a72e57806ccd9eb727fc139de09a7b0be.

Changes still work and can be reviewed but to test this we may want to rebase changes on a commit that has errors again? Let me know if you have any good ideas.

I won't be making further changes to the code, until after you review.

@rafecolton

Copy link
Copy Markdown
Member

You should be able to rebase and force push, or create a new branch, cherry pick your changes, and force push. If you are not comfortable force pushing or at all uncertain, I recommend creating a new branch instead. You are welcome to close this PR and open a new one if needed, you can @ me and I will assign myself as a reviewer

@MacroLens MacroLens force-pushed the fix_62656_lint_changed branch 2 times, most recently from d8963ac to 862c7e7 Compare May 30, 2025 03:31
MacroLens added 15 commits May 30, 2025 00:17
For testing purposes this commit introduces a useOnyx
lint error by removing a canBeMissing error.
Add a script for error handling of git merge-base and
git diff for checking for changes between the common ancestor
of origin/main and the current branch HEAD.

Updates npm run to use this script.
Change the depth of the fetch so that we pull
enough commits to run git merge-base and see the
common ancestor.
Remove the fetch origin main from the ESLint deprecation warning.
Add the fetch-depth param to checkout.
Fix style and add additional bash safety to variable
assignments.
Add new rerun in NPM context checks.
Combine error cases for merge-base.
Unify style on curly braces and semicolons. Remove
the no-pager option from the diff output
Move the NPM checking logic to top of script.
Add CI variable checks to detect if local or on CI.
Clean some comments.

This commit is a stopgap using depth=30000 until a better
solution is implemented.
Add logic to the lint-changed workflow to query for
a merge-base, then calculate the number of commits
from the base to the HEAD, and perform a checkout with
minimal depth needed.

Updated lintChanged.sh script to remove CI specific code,
and use the same logic.
This reverts commit 8e8d27075d3e5d00b42d200d264d5980747a5758.
Bug was introduced
When count is zero, we still want to fetch.
Also we want to do shallow fetch, zero fetch-depth
is all history
Use ternary logic to replace the max operation for github
actions
@MacroLens MacroLens force-pushed the fix_62656_lint_changed branch from 606c95f to f3be8ab Compare May 30, 2025 04:19
This reverts commit 6f37361.
Unnecessary cspell changes.
@MacroLens MacroLens requested a review from rafecolton June 4, 2025 21:16
Comment thread .github/workflows/lint-changed.yml Outdated
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
steps:
- name: Fetch merge base SHA from API

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clever! It's annoying that git doesn't have this kind of thing built-in to a command like ls-remote or whatever

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This action doesn't actually do anything 🙈 it just returns the same value as ${{ github.event.pull_request.base.sha }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🙈 This is what I get for reading two year old github community posts.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll test and simplify as needed. @rafecolton thanks for pointing that out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

db58cf1 removed this.

Comment thread .github/workflows/lint-changed.yml Outdated
- name: Fetch merge base SHA from API
id: merge_base
run: |
MERGE_BASE_SHA="$(gh api "repos/$REPO/compare/${PR_BASE_SHA}...${PR_HEAD_SHA}" | jq -r '.merge_base_commit.sha')"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NAB because I don't feel strongly, but elsewhere we use the --jq flag built-in to the gh cli, and I slightly prefer that over | jq .... It just feels cleaner to me to do it in one command rather than a pipeline 🤷🏼

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also NAB, but I don't think the local variable is affording us any additional readability here. I'd do it all in one command:

run: echo "MERGE_BASE_SHA=$(gh api "repos/$REPO/compare/${PR_BASE_SHA}...${PR_HEAD_SHA}" --jq '.merge_base_commit.sha')" >> "$GITHUB_OUTPUT"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

NAB because I don't feel strongly, but elsewhere we use the --jq flag built-in to the gh cli, and I slightly prefer that over | jq .... It just feels cleaner to me to do it in one command rather than a pipeline 🤷🏼

You and @rafecolton should have a debate lol. I actually put in a different suggestion from Rafe to use the pipe here instead of option.

To the local variable, sure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

db58cf1 removed this.

Comment thread .github/workflows/lint-changed.yml Outdated
Comment thread scripts/lintChanged.sh
Comment thread .github/workflows/lint-changed.yml Outdated
Comment thread .github/workflows/lint-changed.yml Outdated
if: ${{ github.actor != 'OSBotify' || github.event_name == 'workflow_call' }}
runs-on: ubuntu-latest
steps:
- name: Fetch merge base SHA from API

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This action doesn't actually do anything 🙈 it just returns the same value as ${{ github.event.pull_request.base.sha }}

Comment thread .github/workflows/lint-changed.yml
Comment thread scripts/lintChanged.sh
@MacroLens

MacroLens commented Jun 5, 2025

Copy link
Copy Markdown
Contributor Author

I will address two things: Why +2 for fetch-depth and what does it do? Why are we fetching again in the lintChanged.sh?

+2 For Fetching.

Suppose your history looks like this where you haven't merged main into your dev branch yet:

                    o---o---o---B - development
                   /
           ---o---1---C---o---o---A - main

where 1 is the merge-base. When we count the commits between 1...A we will get 4, including one of the end-points. If we fetched only 4 commits we would only get the history of main from C...A, so we need to add 1. "So why +2?": because GitHub does something funny on a PR. When using the Checkout action all of development is merged onto main with a single PR merge commit:

NOT WHAT IS HAPPENING
                                    o---o---o---B - development
                                   /
           ---o---1---C---o---o---A - main
________________________________________________
WHAT ACTUALLY HAPPENS
           ---o---1---C---o---o---A---M - main

So now when we fetch with depth 5 we only get the commit history from C...A. In order to include M's merge-base we need to add one more. Hence the +2 is what we use.
This guarantees we have enough to actually do the diff to get changed files.
As to why M has a merge-base of 1 and not A? This I am not completely clear on, I believe the merge commit retains some history.

In the case of your history looking like you just merged main to your dev branch:

What you have locally
                                    o---o---o---B - development
                                   /
           ---o---1---C---o---o---A - main
________________________________________________
What Checkout Action lintChanged.sh sees
           ---o---1---C---o---o---A---M - main

Here your merge-base has moved to A so a fetch-depth=2 is expected and correct.

Why fetch in the script?

From @roryabraham

oh, I see - this is for the main branch.

One trick we could do to fetch "just the right amount" of history here would be to pass the depth from the workflow as an option CLI arg to lintChanged.sh, right? Then do git fetch origin main with a --depth flag? would that work?

This is unnecessary, because we already did the fetch with a fetch-depth in the action, this fetch is just really only associating origin/main with the history we checked out.

As an example you can run the following commands in your terminal:

git clone git@github.com:torvalds/linux.git --depth=1
cd linux/
git rev-list --count HEAD
git remote -v
git fetch origin/master --no-tags
git rev-list --count HEAD

We checked out linux-kernel with depth=1, running rev-list returns just 1 commit. We then fetch the master branch we are on with no-tags, similar to how we are here. And we show that the fetch does not add anymore commits to the history by running rev-list again.

"So why have the command if it does nothing?": We have the fetch command here because we need to accommodate the workflow of local development AND in the case of the PR Checkout workflow because git doesn't recognize the object name origin/main before we fetch it. This is because when the Checkout workflow creates the merge commit it initializes an empty repository and sets the PR merge commit as the master branch. By fetching origin/main it associates the history in our current branch with origin/main. So this acts like how it would on local development.

Making some modifications to see on the lintChanged.sh script and running it within the action on a up-to-date branch that has merged in main.

set +e
set -x
# Fetch the commit history to include the merge-base commit
info "Fetching origin/main"
git rev-list --count origin/main
git fetch origin main --no-tags
git rev-list --count origin/main

On the workflow when we run lintChanged.sh with these additional steps for logging, the first rev-list will error as

fatal: ambiguous argument 'origin/main': unknown revision or path not in the working tree.

But after we fetch it we just get: 1 on an up-to date commit history. Why 1 and not 2? Because the merge commit is not a part of the origin/main history. Here's a test I ran from my fork that shows this happening. In this case my branch on the fork here is up-to-date with the fork main.

Bonus

From @rafecolton

I was thinking that too, though now I'm questioning if fetching a specific depth of the current branch is really working how we are expecting.

From @roryabraham

Yeah I'm unsure if depth is really a linear number of commits. It would be in a linear history, but really each commit points at a parent. In the case of rebases and merges I'm not sure if the depth always means "X commits back in the current branch"

If we look at the man git fetch page:

       --depth=<depth>
           Limit fetching to the specified number of commits from the tip of each remote branch history. If fetching to a shallow repository created by git clone with
           --depth=<depth> option (see git-clone(1)), deepen or shorten the history to the specified number of commits. Tags for the deepened commits are not fetched.

It states the number of commits in the history. If you rebase or merge, the count of commits in the history could change unexpectedly, but the count we get from the API and we use in the fetch-depth still reflects the accurate number of commits between two points in the history.
I believe this is still accurate on main even if the history may not be "linear".

If you ran that linux test again but with depth=10:

git clone git@github.com:torvalds/linux.git --depth=10
cd linux/
git rev-list --count HEAD
git remote -v
git fetch origin/master --no-tags
git rev-list --count HEAD

You would actually see a rev-list count of 79. So the history itself is longer than the number of commits we fetched. This is OK, the depth we get in the total_commits of the gh API still covers the merge-base commit we care about.

A more accurate test would be to look at the the commits including merge commits in Linux.
Here we see that the 2nd merge commit is torvalds/linux@6498044. If we use the curl command for the API to count the commits that commit and master:

curl -s "https://api.github.com/repos/torvalds/linux/compare/64980441...master" | jq -r '.total_commits'

we get 83. Fetching with 83 and running the rev-list again we get 64008 🤯 . This is again OK, if we look in the log we can still find torvalds/linux@6498044 there, so we got the commit we wanted.
At worst we are overshooting OR getting the merge commits just involves a bit more history.

Conclusion

I hope this addresses your questions. @roryabraham and @rafecolton please give me more feedback on this if you don't believe me or the tests I ran on my fork.

If you want more detailed testing and you can come up with a procedure I can do that on the fork and link here, just send me what you think is off.

Edit: In the bonus section I mistakenly used depth=83 instead of 84 when fetching.
When running it with depth=84 we still get the same rev-list count of 64008 surprisingly.

MacroLens and others added 2 commits June 5, 2025 10:16
Use github.token instead of secrets.

Co-authored-by: Rory Abraham <47436092+roryabraham@users.noreply.github.com>
Remove unnecessary call to the GH api for getting
merge-base.
@MacroLens

Copy link
Copy Markdown
Contributor Author

Heads up that the latest failure on the validate github actions has to do with an outage at GitHub in relation to workflows and actions and needs to be rerun. See the status page.

@rafecolton

Copy link
Copy Markdown
Member

Schema validation issue has been fixed in #63608, please pull main

@rafecolton

Copy link
Copy Markdown
Member

Just waiting on the inline comment now to explain the +2 😊

@MacroLens

Copy link
Copy Markdown
Contributor Author

Schema validation issue has been fixed in #63608, please pull main

Nice work!

@MacroLens

Copy link
Copy Markdown
Contributor Author

@rafecolton just pushed the inline comment, is this enough?

@rafecolton

Copy link
Copy Markdown
Member

Not really, somebody who looks at it after the fact is not going to know what it means. I was hoping to see something more like what you wrote in the +2 For Fetching section in #62993 (comment) - ascii diagrams and all 😄

@MacroLens

MacroLens commented Jun 5, 2025 via email

Copy link
Copy Markdown
Contributor Author

@rafecolton

rafecolton commented Jun 5, 2025

Copy link
Copy Markdown
Member

I don't have a maximum in mind, we don't pay by the byte 😉 It should be however long it needs to be so somebody with no prior context can understand why it's there without needing to read through the comments on this PR.

@rafecolton

rafecolton commented Jun 6, 2025

Copy link
Copy Markdown
Member

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified there are no new alerts related to the canBeMissing param for useOnyx
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop

@rafecolton

Copy link
Copy Markdown
Member

recheck

@MacroLens

Copy link
Copy Markdown
Contributor Author

I don't have a maximum in mind, we don't pay by the byte 😉 It should be however long it needs to be so somebody with no prior context can understand why it's there without needing to read through the comments on this PR.

I will gladly draw you some ASCII art for per byte pay 💵.

@rafecolton

Copy link
Copy Markdown
Member

Thank you for all your hard work here!

@rafecolton rafecolton merged commit df3cd38 into Expensify:main Jun 6, 2025
26 checks passed
@OSBotify

OSBotify commented Jun 6, 2025

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

github-actions Bot commented Jun 9, 2025

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/rafecolton in version: 9.1.63-0 🚀

platform result
🖥 desktop 🖥 success ✅
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Julesssss in version: 9.1.63-6 🚀

platform result
🖥 desktop 🖥 success ✅
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

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