Skip to content

[Due for payment 2026-03-23] Investigate workflow job failing on main: test / test (job 2) #84930

Closed

Description

@github-actions

🚨 Failure Summary 🚨:

⚠️ Action Required ⚠️:

🛠️ A recent merge appears to have caused a failure in the job named test / test (job 2).
🔍 This issue has been automatically created and labeled with Workflow Failure for investigation.

👀 Please look into the following:

  1. Why the PR caused the job to fail?
  2. Address any underlying issues.

🐛 We appreciate your help in squashing this bug!

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. dangrous commented on Mar 11, 2026

    @dangrous
    Contributor

    @MelvinBot please look into this issue, as well as #84929 and #84928. Some of these problems may be general, fixed on main and this could just be leftover from not merging recently. If not, please determine a fix

  2. MelvinBot commented on Mar 11, 2026

    @MelvinBot
    Contributor

    🔍 Issue Analysis

    Summary: All three workflow failures (#84928 typecheck, #84929 ESLint, #84930 test) share the same root cause: PR #83424 introduced a reference to an undeclared variable allReportsViolations in ReportUtils.ts. This is NOT fixed on main — it is the current HEAD.

    Root Cause: The hasVisibleReportFieldViolations function added in PR #83424 references allReportsViolations on line 13076 of ReportUtils.ts, but this variable was never declared or connected to Onyx. The author likely intended to either add a module-level Onyx subscription (like the existing allReports pattern) or accept it as a function parameter, but neither was done.

    Cascading effect:

    Recommended Fix: Add reportViolations as a parameter to hasVisibleReportFieldViolations and pipe the data through from the Onyx derived config:

    1. src/libs/ReportUtils.ts — Change the function signature to accept report violations and remove the undeclared variable reference:

      // Line 13067: Add parameter
      function hasVisibleReportFieldViolations(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>, reportViolations?: OnyxEntry<ReportViolations>): boolean {
      
      // Line 13076: Remove this line entirely (the parameter replaces it)
      // const reportViolations = allReportsViolations?.[`${ONYXKEYS.COLLECTION.REPORT_VIOLATIONS}${report.reportID}`];
    2. src/libs/actions/OnyxDerived/configs/reportAttributes.ts — Add the Onyx dependency and pass violations to the function:

      // Add to dependencies array (after ONYXKEYS.COLLECTION.REPORT_METADATA):
      ONYXKEYS.COLLECTION.REPORT_VIOLATIONS,
      
      // Add to destructured compute parameters:
      [reports, preferredLocale, transactionViolations, reportActions, reportNameValuePairs, transactions, personalDetails, session, policies, policyTags, reportViolations],
      
      // Line 206: Pass violations to the function
      const hasFieldViolations = hasVisibleReportFieldViolations(report, policy, reportViolations?.[`${ONYXKEYS.COLLECTION.REPORT_VIOLATIONS}${report.reportID}`]);
    Detailed Investigation

    Root Cause Analysis

    PR #83424 ("fix: GBR appears when there is report field error") added a new function hasVisibleReportFieldViolations at src/libs/ReportUtils.ts:13067. This function checks whether a report has any visible report field violations that should trigger a red brick road indicator.

    On line 13076, the function tries to access report violations data:

    const reportViolations = allReportsViolations?.[`${ONYXKEYS.COLLECTION.REPORT_VIOLATIONS}${report.reportID}`];

    However, allReportsViolations is never declared anywhere in the file. Similar variables like allReports (line 1098) and allReportsDraft (line 1073) are declared as module-level variables with Onyx connections, but no such declaration exists for allReportsViolations.

    Evidence Chain

    1. reportAttributes.ts:206 calls hasVisibleReportFieldViolations(report, policy) — no violations data passed
    2. ReportUtils.ts:13076 tries to access allReportsViolations — variable doesn't exist
    3. TypeScript error → ESLint cascading errors → test compilation failure

    Relevant Code

    • src/libs/ReportUtils.ts:13067-13091 — The broken function
    • src/libs/actions/OnyxDerived/configs/reportAttributes.ts:63-75 — Dependencies missing REPORT_VIOLATIONS
    • src/libs/actions/OnyxDerived/configs/reportAttributes.ts:206 — The call site

    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  3. dangrous commented on Mar 11, 2026

    @dangrous
    Contributor

    please implement @MelvinBot

  4. MelvinBot commented on Mar 11, 2026

    @MelvinBot
    Contributor

    🤖 Draft PR created: #84952
    Please mark it as "Ready for review" when it is ready for review.

  5. ShridharGoel commented on Mar 11, 2026

    @ShridharGoel
    Contributor

    @dangrous Can you assign me here since I'm reviewing the PR based on auto-assignment?

  6. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Mar 16, 2026
  7. changed the title [-]Investigate workflow job failing on main: test / test (job 2)[/-] [+][Due for payment 2026-03-23] Investigate workflow job failing on main: test / test (job 2)[/+] on Mar 16, 2026
  8. melvin-bot commented on Mar 16, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  9. 1 remaining item

  10. melvin-bot commented on Mar 16, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.37-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-03-23. 🎊

    For reference, here are some details about the assignees on this issue:

  11. melvin-bot commented on Mar 16, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  12. dangrous commented on Mar 18, 2026

    @dangrous
    Contributor

    Does this need payment here? I think we can handle on the other issue, right?

  13. ShridharGoel commented on Mar 18, 2026

    @ShridharGoel
    Contributor

    @dangrous Payment for C+ review of #84952 would be handled here, right?

  14. dangrous commented on Mar 19, 2026

    @dangrous
    Contributor

    Oh yep, I think that's right. We ended up reverting and reissuing the original PR, but only after that PR update.

  15. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  16. mallenexpensify commented on Mar 23, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @ShridharGoel due $125 via NewDot

    @ShridharGoel didn't see any tests so made $125. Commented if ya disagree

  17. JmillsExpensify commented on Apr 6, 2026

    @JmillsExpensify
    Contributor

    $125 approved for @ShridharGoel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions