Skip to content

✨ [FFL-2857] Feature Flags tab — team filtering + token revocation (stacked PR 4 of 4) - #4932

Open
kellyw1806 wants to merge 1 commit into
mainfrom
kelly.wang/ffl-2857
Open

✨ [FFL-2857] Feature Flags tab — team filtering + token revocation (stacked PR 4 of 4)#4932
kellyw1806 wants to merge 1 commit into
mainfrom
kelly.wang/ffl-2857

Conversation

@kellyw1806

@kellyw1806 kellyw1806 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Motivation

Stacked on #4912 (flag overrides). Adds team/creator filtering + per-flag descriptions to the Feature Flags tab, plus production OAuth support and token revocation on disconnect.

Stack (review bottom-up)

PR Base What it adds Status
1 of 4 #4913 · FFL-2597 main OAuth sign-in ✅ merged
2 of 4 #4916 · FFL-2858 ffl-2597 catalog browsing ✅ merged
3 of 4 #4912 · FFL-2596 main flag overrides in review
4 of 4 this · FFL-2857 ffl-2596 team filter + token revocation draft

⚠️ Base is kelly.wang/ffl-2596 (#4912) — merge that first. Kept as a draft until #4912 lands; this then retargets to main and gets a quick rebase.

Changes

  • Team & creator filters (server-side): "My feature flags" → created_by=<uuid>; "My teams" → tags=team:<handle>. Identity (user UUID + team handles) comes from /api/v2/current_user + /api/v2/team?filter[me]=true. "My teams" is a checkbox dropdown showing an "N selected" summary.
  • Per-flag description in each row (catalog description attribute), with a "Show more" expander that only appears when the text is actually clamped.
  • Production OAuth: per-site client id (getClientId — staging vs prod); site picker trimmed to US1 + Staging.
  • Token revocation on disconnect (RFC 7009 /oauth2/v1/revoke — revokes the refresh token, clears local tokens either way).
  • Scope-retry: falls back to the required scopes if the OAuth client isn't granted the optional teams_read (via invalid_scope redirect or an authorize page-load failure).

DEMO

Note, we can now choose between datadoghq.com and staging. There are also filters for My Feature Flags and My Teams. Descriptions are fetched as well.

Screen.Recording.2026-08-10.at.1.26.56.PM.mov

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change
  • Added e2e/integration tests for this change
  • Updated documentation and/or relevant AGENTS.md file

@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Aug 6, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 81.13%
Overall Coverage: 77.25% (+0.04%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 850a642 | Docs | Datadog PR Page | Give us feedback!

@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2596 branch 5 times, most recently from c88291e to 2a98437 Compare August 7, 2026 16:44
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2857 branch from 4c49f6e to 16b1216 Compare August 7, 2026 16:58
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 7, 2026

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 180.44 KiB 180.44 KiB 0 B 0.00%
Rum Profiler 8.43 KiB 8.43 KiB 0 B 0.00%
Rum Recorder 21.12 KiB 21.12 KiB 0 B 0.00%
Logs 57.04 KiB 57.04 KiB 0 B 0.00%
Rum Salesforce N/A 138.47 KiB N/A N/A N/A
Rum Slim 138.47 KiB 138.47 KiB 0 B 0.00%
Worker 22.96 KiB 22.96 KiB 0 B 0.00%
Rum Shopify N/A 200.02 KiB N/A N/A N/A
Rum-shopify Profiler N/A 8.43 KiB N/A N/A N/A
Rum-shopify Recorder N/A 3.72 KiB N/A N/A N/A

@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2596 branch from 2a98437 to da1a176 Compare August 7, 2026 17:26
Base automatically changed from kelly.wang/ffl-2596 to main August 7, 2026 19:14
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2857 branch 2 times, most recently from e4698ab to c960f4a Compare August 10, 2026 17:25
@kellyw1806
kellyw1806 marked this pull request as ready for review August 10, 2026 17:29
@kellyw1806
kellyw1806 requested a review from a team as a code owner August 10, 2026 17:29

@BeltranBulbarellaDD BeltranBulbarellaDD left a comment

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.

Overall looks good! Left some comments.

Comment on lines +69 to +73
function MyFlagsSwitch({ view, identity }: { view: FlagCatalogView; identity: FlagIdentityState }) {
// Without the signed-in user's UUID there's nothing to compare a flag's creator against, so the
// filter could only ever match nothing. Disable it and say why, rather than offering a toggle whose
// only effect is to empty the list.
const unavailable = !identity.loading && !identity.userId

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.

I wonder, there is no way to see this component without being authenticated right? If we weren't authenticated the tab would fail before. I think we can remove these kinds of checks from the lower level components and in the root layout we check the auth, if not auth we show login screen, else all components are authenticated?

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.

Or in the context.

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.

Oh, this was not an auth check, but more of a UX guard. The "My Feature Flags" filter needs the user's id to work. If we don't know it yet (identity is still loading or failed), the toggle would do nothing when clicked, so i thought it would be better to just disable it and show a tooltip explaining why. what do you think?

@BeltranBulbarellaDD BeltranBulbarellaDD Aug 12, 2026

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.

But could we be logged in here but no user id?. Even still, if we were to check this in the context for example we could use the same check right? So we wouldn't have to check it in the component but just get it from the context? That way we can re use it? Just sharing some thoughts, you are free to discard it 🙂

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.

I now understand that catalog and identity are separate requests. I wonder the above, how possible would it be to save it in the context and re use them.

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.

hmm, the identity is already shared through the context (both the filter bar and catalog view read it from there), and the only thing left in the component is a one-line "do we have a user id yet" check used by a single toggle. so i think we might not need to try to find more places for context reuse here?

Comment thread developer-extension/src/panel/components/tabs/flagsTab/oauth.ts
Comment thread developer-extension/src/panel/components/tabs/flagsTab/oauth.ts Outdated
Comment thread developer-extension/src/panel/components/tabs/flagsTab/useFlagCatalogView.ts Outdated
Comment thread developer-extension/src/panel/components/tabs/flagsTab/useFlagIdentity.ts Outdated
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2857 branch from c960f4a to 439df75 Compare August 12, 2026 06:39
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Filter the flag catalog by owning team (teams_read scope + flag identity),
and revoke the OAuth grant at Datadog on disconnect rather than only clearing
local tokens.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2857 branch from 439df75 to 850a642 Compare August 12, 2026 15:28
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.

2 participants