Skip to content

[No QA] Add policy vendors Onyx collection type - #100240

Merged
francoisl merged 3 commits into
mainfrom
codex/650596-policy-vendors
Sep 4, 2026
Merged

francoisl merged 3 commits into
mainfrom
codex/650596-policy-vendors

Conversation

@Beamanator

@Beamanator Beamanator commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Problem: Phase 1A publishes a generic Auth-owned policyVendors_{policyID} collection, but App needs a typed Onyx prefix and collection shape before its parallel vendor UI work can safely consume it.

Implementation: add the policyVendors_ collection prefix and a PolicyVendors record keyed by external ID. Each entry has externalID, name, derived enabled, and optional origin; origin is restricted to the existing PolicyConnectionName union. Onyx-state exports preserve matching fields while masking vendor names.

Non-goals: no UI, actions, optimistic updates, connection-data reads, preference persistence, picker filtering, matching, violations, or lifecycle behavior. Those belong to the linked App/Phase 1B/Phase 2 work.

Related: Auth implementation PR #24216, tracker #678247, contract #678248, Phase 1A #650596, Phase 1B #670690, and Phase 2 #678249.

Fixed Issues

$ #98355
$ https://github.com/Expensify/Expensify/issues/650596

PROPOSAL: N/A — the agreed data contract is documented in https://github.com/Expensify/Expensify/issues/678248

Tests

  1. npm run fmt — passed.
  2. npm run typecheck — passed.
  3. npx jest tests/unit/ExportOnyxStateTest.ts --runInBand — passed (30 tests).
  4. npm run lint-changed — passed.
  5. npm run spell-changed — passed.
  6. Required App CI, including TypeScript, Jest, Oxfmt, Knip, export coverage, and the independent-approval gate — passed.

Manual verification

  1. With Auth PR [HOLD for payment 2023-08-28] [$1000] When deleting a file, there is a space between the username and the '[Deleted message]' #24216 deployed, inspect an App Onyx update containing policyVendors_{policyID}.
  2. Verify TypeScript resolves the collection as a record keyed by external ID whose entries expose externalID, name, enabled, and an optional valid policy-connection origin.
  3. Export Onyx state and verify vendor names are masked while externalID, enabled, and origin remain inspectable.
  4. Verify this change alone exposes no vendor UI or mutation action.

Offline tests

Not applicable: this PR only declares a typed server-projected collection key and makes no offline mutation.

QA Steps

Not applicable: this is a no-UI typed Onyx contract change. Follow the manual verification after Auth PR #24216 is deployed and verify there are no JavaScript console errors.

🤖 Posted by Codex, an AI coding agent acting for @Beamanator.

@Beamanator
Beamanator requested review from a team as code owners September 2, 2026 23:56
@melvin-bot
melvin-bot Bot requested review from ChavdaSachin and heyjennahay and removed request for a team September 2, 2026 23:56
@melvin-bot

melvin-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

@ChavdaSachin Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed the request for review from a team September 2, 2026 23:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-04T20:32:15.066659Z a201ec6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Beamanator

Copy link
Copy Markdown
Contributor Author

@codex review

Please independently review this Phase 1A-scoped change for correctness, contract compliance, regressions, and missing coverage. 🤖 Posted by Codex, an AI coding agent acting for @Beamanator.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 98f7f1192c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This comment was marked as duplicate.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: d1900a015b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Beamanator Beamanator changed the title Add policy vendors Onyx collection type [No QA] Add policy vendors Onyx collection type Sep 4, 2026
@Beamanator
Beamanator removed the request for review from ChavdaSachin September 4, 2026 20:00
@Beamanator

Copy link
Copy Markdown
Contributor Author

Sorry @ChavdaSachin i don't think we need a C+ on this one since it's pretty small

Comment thread src/types/onyx/PolicyVendor.ts Resolved
@Beamanator

Copy link
Copy Markdown
Contributor Author

@codex review

Review-fix update at a201ec6d632e8fb265f525aad75f2a380f288357: restricts policyVendors origin to the existing PolicyConnectionName union and corrects the adjacent policy-preference wording. The finding is addressed in its original review thread; npm run fmt and npm run typecheck pass.

🤖 Posted by Codex, an AI coding agent acting for @Beamanator.

@Beamanator
Beamanator requested a review from francoisl September 4, 2026 20:18
@francoisl

Copy link
Copy Markdown
Contributor

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
  • 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 proper code patterns were followed (see Reviewing the code)
    • 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 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)
  • 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)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • 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
    • 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 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.
  • 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

@francoisl
francoisl merged commit ef0ba1b into main Sep 4, 2026
43 of 45 checks passed
@francoisl
francoisl deleted the codex/650596-policy-vendors branch September 4, 2026 20:26
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🚧 francoisl has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

OSBotify commented Sep 4, 2026

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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: a201ec6d63

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@OSBotify

OSBotify commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/francoisl in version: 9.4.73-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 failure ❌

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Help site review: no changes required. No draft PR was created.

This PR adds a typed Onyx collection contract and nothing a customer can see. There is no feature, screen, tab, setting, or button to document, so no article under docs/articles needs to change.

Why I concluded this

What the diff does (all 5 files):

File Change
src/ONYXKEYS.ts:888 Adds the policyVendors_ collection prefix and maps it to OnyxTypes.PolicyVendors
src/types/onyx/PolicyVendor.ts New PolicyVendors type: a record keyed by externalID with externalID, name, enabled, and optional origin
src/types/onyx/index.ts:141 Re-exports the new type
src/libs/ExportOnyxState/common.ts:146-150 Adds an export rule that masks vendor name while keeping externalID, enabled, and origin
tests/unit/ExportOnyxStateTest.ts:214-237 Unit test for that masking rule

Why none of that is documentable:

  1. No user-facing surface. The PR body states the non-goals explicitly: no UI, actions, optimistic updates, connection-data reads, preference persistence, picker filtering, matching, violations, or lifecycle behavior. The PR is also labeled [No QA]. Help articles document what a customer does in the product — there is nothing to do here yet.
  2. The masking change is not a documented behavior. I searched docs/articles for any mention of Onyx state export and found zero results. The Onyx state export is an internal debugging tool, not a documented customer feature, so its allow/mask lists are not reflected in help content.
  3. No existing article describes vendors as a product concept. Searching docs/articles for "vendor" returns only unrelated usages — accounting-connection export fields in the Sage Intacct, NetSuite, and Rillet guides (which document the accounting system's own vendor records, unchanged by this PR), and one Data Processing Addendum line in Encryption and Data Security. None of those describe a vendor selection feature in Expensify.

When docs will be needed: once the vendor UI ships in the linked follow-up work — Phase 1B (Expensify/Expensify#670690) and Phase 2 (Expensify/Expensify#678249) — a customer-facing article or an update to the relevant accounting connection guides will be warranted. That is the right point to write it, because only then will there be real UI labels to verify against the live product. Documenting it now would mean inventing feature and button names that do not exist yet, which HELPSITE_NAMING_CONVENTIONS.md and HELP_AUTHORING_GUIDELINES.md both rule out.

@Beamanator, no help site PR exists to review because this change is not customer-visible. If you disagree — for example if you expect the vendor UI from Phase 1B to land soon enough that you want the article drafted ahead of it — reply with @MelvinBot and the article you want, and I'll draft it once there are real UI labels to verify against.

@OSBotify

OSBotify commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/mountiny in version: 9.4.73-3 🚀

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

Bundle Size Analysis (Sentry):

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