Skip to content

debt: Consolidate FUNDS_GRANTS_MANAGEMENT + RECEIVE_GRANTS - #12071

Merged
Betree merged 2 commits into
mainfrom
debt/consolidate-receive-grants
Jul 8, 2026
Merged

Betree merged 2 commits into
mainfrom
debt/consolidate-receive-grants

Conversation

@Betree

@Betree Betree commented Apr 13, 2026 •

Copy link
Copy Markdown
Member

@Betree Betree self-assigned this Apr 13, 2026
@vercel

vercel Bot commented Apr 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
opencollective-frontend Ready Ready Preview, Comment Jul 8, 2026 9:17am

Request Review

@coderabbitai

coderabbitai Bot commented May 18, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 556b7e5a-e0eb-433b-a6a4-0b921bbf8424

📥 Commits

Reviewing files that changed from the base of the PR and between ae3eb0b and c4fb5b6.

⛔ Files ignored due to path filters (2)
  • lib/graphql/types/v2/gql.ts is excluded by !lib/graphql/types/**
  • lib/graphql/types/v2/graphql.ts is excluded by !lib/graphql/types/**
📒 Files selected for processing (12)
  • components/collective-navbar/fragments.ts
  • components/collective-navbar/index.js
  • components/collective-page/graphql/fragments.js
  • components/dashboard/sections/platform-subscription/fragments.ts
  • components/dashboard/sections/subscriptions/common.tsx
  • components/dashboard/sections/subscriptions/queries.ts
  • components/edit-collective/sections/Webhooks.tsx
  • lib/allowed-features.ts
  • lib/collective-sections.ts
  • lib/graphql/schema.graphql
  • lib/graphql/schemaV2.graphql
  • pages/create-expense.js
💤 Files with no reviewable changes (3)
  • components/dashboard/sections/platform-subscription/fragments.ts
  • lib/allowed-features.ts
  • components/dashboard/sections/subscriptions/queries.ts
🚧 Files skipped from review as they are similar to previous changes (8)
  • components/collective-page/graphql/fragments.js
  • components/collective-navbar/fragments.ts
  • pages/create-expense.js
  • components/edit-collective/sections/Webhooks.tsx
  • components/collective-navbar/index.js
  • lib/collective-sections.ts
  • components/dashboard/sections/subscriptions/common.tsx
  • lib/graphql/schema.graphql

📝 Walkthrough

Walkthrough

This PR updates frontend feature-flag checks from RECEIVE_GRANTS to FUNDS_GRANTS_MANAGEMENT in navbar, webhooks, section filtering, and the create-expense page. It also replaces RECEIVE_GRANTS with UPDATES, RECEIVE_FINANCIAL_CONTRIBUTIONS, and RECEIVE_EXPENSES in subscription feature fragments and validation code. The GraphQL schemas remove RECEIVE_GRANTS, add Platform, adjust several account and activity types, and introduce payment-intent queries and types.

Estimated code review effort: 4 (Complex) | ~60 minutes

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • Now that RECEIVE_GRANTS is consolidated into FUNDS_GRANTS_MANAGEMENT, consider introducing a small helper (e.g., canSubmitExpensesOrGrants(collective)) instead of repeating combined feature checks in multiple places (webhooks, create-expense, CTA logic) to keep the behavior centralized and less error-prone.
  • The GraphQL schema changes remove RECEIVE_GRANTS from several feature types but do not introduce FUNDS_GRANTS_MANAGEMENT in the corresponding platform subscription feature inputs; double-check that the intended feature can still be configured through the subscription APIs and update the input types if necessary.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Now that `RECEIVE_GRANTS` is consolidated into `FUNDS_GRANTS_MANAGEMENT`, consider introducing a small helper (e.g., `canSubmitExpensesOrGrants(collective)`) instead of repeating combined feature checks in multiple places (webhooks, create-expense, CTA logic) to keep the behavior centralized and less error-prone.
- The GraphQL schema changes remove `RECEIVE_GRANTS` from several feature types but do not introduce `FUNDS_GRANTS_MANAGEMENT` in the corresponding platform subscription feature inputs; double-check that the intended feature can still be configured through the subscription APIs and update the input types if necessary.

## Individual Comments

### Comment 1
<location path="lib/graphql/schema.graphql" line_range="1098" />
<code_context>
   PROJECTS: CollectiveFeatureStatus
   USE_EXPENSES: CollectiveFeatureStatus
   RECEIVE_EXPENSES: CollectiveFeatureStatus
-  RECEIVE_GRANTS: CollectiveFeatureStatus
   MULTI_CURRENCY_EXPENSES: CollectiveFeatureStatus
   COLLECTIVE_GOALS: CollectiveFeatureStatus
</code_context>
<issue_to_address>
**issue (bug_risk):** New FUNDS_GRANTS_MANAGEMENT feature is queried in v1 fragments but not exposed on CollectiveFeatures here.

`features { FUNDS_GRANTS_MANAGEMENT }` is now requested in several v1 queries (e.g., `editCollectiveWebhooksQuery` and `collectiveNavbarFieldsFragment`), but `CollectiveFeatures` in `schema.graphql` no longer exposes `RECEIVE_GRANTS` and does not define `FUNDS_GRANTS_MANAGEMENT` here. Unless this enum value is added to `CollectiveFeatures` (and any related input types) in the v1 schema, these queries will fail at runtime. Please ensure the enum is defined and exposed consistently with the new feature usage.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

PROJECTS: CollectiveFeatureStatus
USE_EXPENSES: CollectiveFeatureStatus
RECEIVE_EXPENSES: CollectiveFeatureStatus
RECEIVE_GRANTS: CollectiveFeatureStatus

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): New FUNDS_GRANTS_MANAGEMENT feature is queried in v1 fragments but not exposed on CollectiveFeatures here.

features { FUNDS_GRANTS_MANAGEMENT } is now requested in several v1 queries (e.g., editCollectiveWebhooksQuery and collectiveNavbarFieldsFragment), but CollectiveFeatures in schema.graphql no longer exposes RECEIVE_GRANTS and does not define FUNDS_GRANTS_MANAGEMENT here. Unless this enum value is added to CollectiveFeatures (and any related input types) in the v1 schema, these queries will fail at runtime. Please ensure the enum is defined and exposed consistently with the new feature usage.

@Betree
Betree force-pushed the debt/consolidate-receive-grants branch from ae3eb0b to c4fb5b6 Compare July 8, 2026 09:12
@Betree
Betree merged commit f5497da into main Jul 8, 2026
18 checks passed
@Betree
Betree deleted the debt/consolidate-receive-grants branch July 8, 2026 09:51

This branch was successfully deployed

1 active deployment
Preview — c4fb5b6f Deployed Jul 8, 2026 by vercel[bot]
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.

1 participant