-
Notifications
You must be signed in to change notification settings - Fork 4
Add tests and renovate configuration for renovate demo #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Install Jest v29.7.0 with TypeScript support - Create comprehensive test suite using deprecated Jest v29 matcher syntax - Add utility functions for movie data processing and validation - Add catalog service with database operations - All tests pass on Jest v29 but will break when upgraded to v30 - Demonstrates the gap that ONA fills in Renovate workflows Breaking matchers included: - toBeCalled → toHaveBeenCalled - toBeCalledTimes → toHaveBeenCalledTimes - toBeCalledWith → toHaveBeenCalledWith - lastCalledWith → toHaveBeenLastCalledWith - nthCalledWith → toHaveBeenNthCalledWith - toReturn → toHaveReturned - toReturnTimes → toHaveReturnedTimes - toReturnWith → toHaveReturnedWith - lastReturnedWith → toHaveLastReturnedWith - nthReturnedWith → toHaveNthReturnedWith - toThrowError → toThrow Co-authored-by: ona-agent <[email protected]> Co-authored-by: Ona <[email protected]>
- Add renovate.json configuration with Jest-focused settings - Add npm run renovate script with --filter=<package> support - Configure proper GitHub token usage via GH_CLI_TOKEN - Add renovate debug files to .gitignore - Enable dependency scanning for demo Step 2 completion
- Add ghcr.io/devcontainers-extra/features/renovate-cli:2 to devcontainer.json - Ensures Renovate CLI is available in every environment startup - Removes need for manual npm install -g renovate
- Add npm run renovate:jest command for creating Jest v30 PR only - Merge main branch with renovate configuration - Resolve renovate.json conflicts
- npm run renovate:jest now successfully creates Jest v30 PR - Uses targeted config to only update Jest and @types/jest - Removes rate limits for demo purposes - Successfully created PR #57 for Jest v29→v30 upgrade
loujaybee
commented
Jul 14, 2025
loujaybee
commented
Jul 14, 2025
backend/catalog/package.json
Outdated
"setup": "./scripts/setup.sh" | ||
"setup": "./scripts/setup.sh", | ||
"renovate": "if [ \"$npm_config_live\" ]; then DRY_RUN_FLAG=\"\"; echo 'LIVE MODE: Will create actual pull requests'; else DRY_RUN_FLAG=\"--dry-run=full\"; echo 'DRY RUN MODE: No pull requests will be created (use --live to create PRs)'; fi && RENOVATE_TOKEN=$GH_CLI_TOKEN LOG_LEVEL=debug renovate --platform=github $DRY_RUN_FLAG gitpod-samples/gitpodflix-demo > renovate_debug.txt 2>&1 && echo 'Renovate scan complete! Check renovate_debug.txt for full output' && if [ \"$npm_config_filter\" ]; then echo 'Filtering results for:' $npm_config_filter && grep -i -A 20 -B 5 \"$npm_config_filter\" renovate_debug.txt; else echo 'Use --filter=<package> to filter results for specific dependency'; fi", | ||
"renovate:jest": "echo 'Creating Jest v30 pull request...' && echo '{\"extends\":[],\"enabledManagers\":[\"npm\"],\"includePaths\":[\"backend/catalog/package.json\"],\"packageRules\":[{\"matchPackageNames\":[\"jest\",\"@types/jest\"],\"enabled\":true}],\"prConcurrentLimit\":0,\"prHourlyLimit\":0,\"branchConcurrentLimit\":0}' > renovate-jest-only.json && RENOVATE_TOKEN=$GH_CLI_TOKEN RENOVATE_CONFIG_FILE=renovate-jest-only.json renovate --platform=github gitpod-samples/gitpodflix-demo && rm renovate-jest-only.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move commands to actual configuration file
- Remove regular renovate command, keep only renovate:jest - Update renovate:jest to use static renovate.json configuration - Update renovate.json to target Jest dependencies specifically - Add demos/fixing-renovate-dependencies.md with sales engineer instructions - Remove code comments from unit test files - Clean up debug files and update .gitignore
- Remove renovate:jest npm script from package.json - Update demo documentation to be more general about renovate CLI usage - Include example command with GitHub token setup - Make documentation less specific to Jest, more broadly applicable
- Runs on pull requests and main branch pushes - Only triggers when catalog service files change - Runs npm install and npm test for the catalog service - Will show failing checks if unit tests fail
- Remove trailing comma after setup script - This was causing npm install to fail in GitHub Actions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Renovate Jest Demo Setup
This PR sets up a comprehensive demo environment for showcasing how to use Renovate with AI assistance to resolve dependency upgrade breaking changes, specifically targeting Jest v29 to v30 migration.
🎯 Demo Purpose
Demonstrates the workflow of:
📁 New Files Added
Demo Documentation
demos/fixing-renovate-dependencies.md
- Complete sales engineer guide with step-by-step instructions for replicating the demoTest Infrastructure
backend/catalog/jest.config.js
- Jest configuration for the catalog servicebackend/catalog/src/__tests__/utils.test.ts
- Standard utility function testsbackend/catalog/src/__tests__/deprecated-matchers.test.ts
- Tests using Jest v29 deprecated matchers that will break in v30Supporting Code
backend/catalog/src/utils/movieUtils.ts
- Movie utility functions for testingbackend/catalog/src/utils/dataProcessor.ts
- Data processing utilitiesbackend/catalog/src/services/catalogService.ts
- Catalog service implementationCI/CD
.github/workflows/catalog-tests.yml
- GitHub Action that runs tests on PRs and main branch pushes⚙️ Configuration Updates
Renovate Configuration
renovate.json
- Configured to target Jest dependencies specifically with automatic PR recreationrecreateClosed: true
for demo repeatabilityDevelopment Environment
.devcontainer/devcontainer.json
- Added Renovate CLI feature for easy access.gitignore
- Added entries for debug files (jest_debug.txt, renovate_debug.txt, etc.)🚀 How to Use This Demo
For Sales Engineers:
Run Renovate CLI to create Jest upgrade PR:
Observe failing tests in the created PR due to deprecated Jest matchers
Use AI assistance to resolve breaking changes by:
Validate fixes through the GitHub Action that automatically runs tests
🧪 Test Strategy
The demo includes intentionally problematic tests using deprecated Jest matchers:
.toBeCalled()
→ should be.toHaveBeenCalled()
.toBeCalledWith()
→ should be.toHaveBeenCalledWith()
.toReturn()
→ should be.toHaveReturned()
.toThrowError()
→ should be.toThrow()
These will fail when Jest is upgraded to v30, providing realistic breaking changes for the demo.
📊 Expected Demo Flow
🎬 Demo Value Proposition
This setup provides a complete, realistic demonstration of modern development workflows combining automated dependency management with AI-powered problem solving.