kentcdodds / kentcdodds/kody

Cleanup: remove package-share-grants feature flag after general availability

Open
#2,245 1 comment 0 reactions 0 assignees View on GitHub
improvement
Dominant language
TypeScript
Stars
635
Forks
63
Avg merge
1h 18m
Merged PRs (30d)
744

Description

## Leftover

The `package-share-grants` rollout kill switch:

- Registry entry in `packages/worker/universal/feature-flags/registry.ts` (`packageShareGrantsFlagKey`)
- Helper `packages/worker/src/package-registry/share-flag.ts`
- Fail-closed gates in `share-grants.ts`, HTTP handlers (`/account/shared`, package share API, approve-changes), MCP `featureFlag` on all `packageShare*` capabilities, and UI (`Shared` nav, settings Share, Accept banners)
- Test helpers `enablePackageShareGrantsForTests` / `disablePackageShareGrantsForTests` and hardcoded flag maps that include `package-share-grants`
- Docs that say sharing is behind the flag (`docs/guides/package-sharing.md`, `docs/contributing/architecture/feature-flags.md`)
- Per-user overrides and any global/rollout row for the key

Keep (not leftover): the share-grant product itself (table, RBAC, invite/accept/pin, UI, MCP). Only the flag and its gate sites go away.

## Why it waits

The flag is default-off so invite email cannot go live until an operator enables it. It stays until sharing is generally available (or is reverted) and there is no remaining need for a kill switch.

## Ready when

Pick one:

1. **Promote:** sharing is on globally for everyone who should have it, invite volume and abuse signals are acceptable, and the kill switch is unused. Delete the flag, helper, every gate site, and docs that mention it. Sharing stays the default product.
2. **Revert:** sharing should not ship. Delete the flag together with the share-grant product (separate decision); do not leave a dead flag.

A calendar date alone is not enough. Operator confirmation that the kill switch is no longer needed is the gate.

## How to verify

- `rg package-share-grants` is empty after promote (except historical ADRs / migration filename if those stay).
- Admin feature-flag list no longer shows the key (stale row deleted if any).
- Invite, accept, UI, MCP, and runtime still work without a flag check.
- `npm run validate`

## Introduced by

https://github.com/kentcdodds/kody/pull/2238

Contributor guide

Open the contributing guide

Research direction

First confirm the promote path and operator approval, then search for `package-share-grants` and inspect the registry, `packages/worker/src/package-registry/share-flag.ts`, the listed gate sites, test helpers, hardcoded flag maps, and docs. Remove only the flag and its checks while preserving sharing, then verify the key is absent, runtime paths still work, and run `npm run validate`.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend, documentation, frontend, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.