Skip to content

Conversation

@talissoncosta
Copy link

Summary

This PR adds a GitHub Pages deployment for showcasing the Flagsmith Backstage plugin with mock data.

Features

  • Static demo build using Vite for standalone deployment
  • MSW mock handlers intercept API calls and return realistic mock data
  • Demo banner clearly indicates mock data is being used
  • GitHub Actions workflow auto-deploys to Pages on merge to main
  • Tab navigation between Feature Flags, Overview Card, and Usage Card views

Demo URL

After merging: https://flagsmith.github.io/flagsmith-backstage-plugin/

Files Added

  • vite.config.demo.ts - Vite build configuration
  • demo/ directory with App, DemoBanner, main entry point
  • .github/workflows/deploy-demo.yml - Deployment workflow
  • .eslintignore - Exclude demo from linting

Scripts Added

  • yarn build:demo - Build static demo
  • yarn preview:demo - Preview demo locally

Test Plan

  • yarn lint passes
  • yarn build passes
  • yarn build:demo produces static files in dist-demo/
  • After merge, verify demo deploys to GitHub Pages
  • Enable GitHub Pages in repo settings (Source: GitHub Actions)

Screenshots

Demo can be previewed locally with yarn build:demo && yarn preview:demo

🤖 Generated with Claude Code

talissoncosta and others added 2 commits December 23, 2025 11:29
Add static demo deployment for showcasing the plugin:
- Vite config for standalone demo build
- Demo app with MSW mock handlers
- Demo banner indicating mock data usage
- GitHub Actions workflow for auto-deploy to Pages
- Build script: yarn build:demo

Demo URL: https://flagsmith.github.io/flagsmith-backstage-plugin/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add interactive demo configuration:
- Initial setup screen with mock/live mode selection
- Live mode: connect to real Flagsmith with API key
- Mock mode: use MSW for sample data
- Configuration persisted in localStorage
- Reconfigure button in demo banner

Add PR preview deployments:
- Each PR deploys to /pr-{number}/ on GitHub Pages
- Bot comments on PR with preview URL
- Automatic cleanup when PR is closed/merged
- Dynamic base path via VITE_BASE_PATH env variable

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@talissoncosta talissoncosta changed the base branch from main to feat/6424-add-tests December 23, 2025 15:17
- Check if gh-pages branch exists before checkout
- Create orphan gh-pages branch if it doesn't exist
- Update cleanup job to handle missing branch gracefully

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Demo Preview

Preview URL: https://Flagsmith.github.io/flagsmith-backstage-plugin/pr-4/

This preview will be automatically cleaned up when the PR is closed.

github-actions bot added a commit that referenced this pull request Dec 23, 2025
@talissoncosta talissoncosta marked this pull request as draft December 23, 2025 17:32
talissoncosta and others added 2 commits December 23, 2025 22:40
- Sort mock URL patterns by length to match more specific patterns first
- Fix dashboard link test to use 'link' role instead of 'button'
- Remove unused mockEntity import

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The FlagsmithClient appends /flagsmith to the base URL from discovery API.
MSW handlers expect patterns like */proxy/flagsmith/..., so the discovery
API must return /api/proxy (not /api) for mock mode to work correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
github-actions bot added a commit that referenced this pull request Dec 24, 2025
FlagsmithClient appends /flagsmith to all URLs (designed for Backstage
proxy routing). In live mode, we hit the Flagsmith API directly, so
strip /flagsmith from the path to get correct API URLs.

Before: https://api.flagsmith.com/api/v1/flagsmith/projects/123/
After:  https://api.flagsmith.com/api/v1/projects/123/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
github-actions bot added a commit that referenced this pull request Dec 24, 2025
talissoncosta and others added 5 commits December 24, 2025 11:41
Convert all inline styles to Material-UI makeStyles for consistency:
- FlagsTab: add errorHint, header classes
- ExpandableRow: add collapseCell, loadingContainer classes
- EnvironmentTable: add envName class
- FeatureDetailsGrid: add tagsContainer, serverKeyChip classes
- SegmentOverridesSection: add statusLabel class
- FlagStatusIndicator: add size variant classes (dotSmall/dotMedium)
- LoadingState: add container, message classes
- FlagsmithUsageCard: add errorHint class
- UsageTooltip: add container, title, content classes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace inline styles with makeStyles in demo App LoadingScreen
for consistency with the rest of the codebase.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove required validation for projectId and orgId fields
- Auto-fetch first available org/project when not provided
- Update helper text to clarify optional fields
- Clarify API Key is Master API Key from Organisation Settings

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add console logs for MSW service worker initialization
to help debug mock mode issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add mockServiceWorker.js generated by MSW for intercepting
API requests in mock mode demo.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
github-actions bot added a commit that referenced this pull request Dec 24, 2025
talissoncosta and others added 3 commits December 24, 2025 11:47
Add a theme toggle button in the toolbar that allows users to switch
between light and dark modes. Theme state is managed in the App
component and passed to all child components.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace hardcoded dark background with color="default" on AppBar
- Add conditional text color for title based on theme mode
- Make Tabs background adapt to light/dark mode

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add key prop to ThemeProvider to force remount on theme change
- Apply background.default to main content area for proper theming
- Use explicit background/text colors on AppBar for consistent styling
- Adjust Tabs background opacity for better visual balance

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
github-actions bot added a commit that referenced this pull request Dec 24, 2025
The artifact was being lost when switching branches because git checkout
replaces the working directory. Move artifact to /tmp before checkout.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
github-actions bot added a commit that referenced this pull request Dec 24, 2025
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