-
Notifications
You must be signed in to change notification settings - Fork 296
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
chore: run renovate with github actions #6361
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request introduces significant changes to the repository's Renovate configuration and associated scripts. The primary focus is on streamlining the dependency update process by replacing the existing shell-based version update script with a TypeScript-based solution. The changes include adding a new TypeScript script for app configuration updates, removing legacy workflows and configuration files, and updating the Renovate configuration to use more recommended settings and a more flexible dependency management approach. Changes
Sequence DiagramsequenceDiagram
participant Renovate as Renovate Bot
participant Script as renovate-app-update.ts
participant ConfigFile as config.json
Renovate->>Script: Execute with package file and new version
Script->>ConfigFile: Read existing configuration
Script->>ConfigFile: Update version and timestamp
Script->>ConfigFile: Write updated configuration
Possibly related PRs
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 4
🧹 Nitpick comments (2)
.github/workflows/renovate.yml (2)
33-34
: Consider pinning renovate versionInstalling renovate globally without version pinning could lead to unexpected behavior if a breaking change is released.
Consider pinning the version:
- - name: Install Renovate - run: bun install -g renovate re2 + - name: Install Renovate + run: bun install -g [email protected] [email protected]
16-16
: Consider more frequent scheduleRunning renovate only once per day at midnight might delay important security updates.
Consider running more frequently, e.g., every 6 hours:
- - cron: 0 0 * * * + - cron: 0 */6 * * *
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
.github/scripts/renovate-app-update.ts
(1 hunks).github/scripts/renovate-app-version.sh
(0 hunks).github/workflows/auto-merge.yml
(0 hunks).github/workflows/ci.yml
(1 hunks).github/workflows/renovate-ci.yml
(0 hunks).github/workflows/renovate.yml
(1 hunks)config.js
(1 hunks)renovate.js
(0 hunks)renovate.json
(1 hunks)
💤 Files with no reviewable changes (4)
- .github/scripts/renovate-app-version.sh
- renovate.js
- .github/workflows/renovate-ci.yml
- .github/workflows/auto-merge.yml
✅ Files skipped from review due to trivial changes (1)
- config.js
🔇 Additional comments (2)
renovate.json (1)
33-37
: Verify post-upgrade task configurationThe post-upgrade task configuration looks correct, but ensure that the file paths and command execution are properly tested.
Let's verify the configuration:
✅ Verification successful
Post-upgrade task configuration is correctly implemented ✅
The script properly handles the parameters, includes error handling, and correctly updates the configuration files. The Renovate configuration is well-structured and follows best practices.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if the script exists and is executable if [ -f ".github/scripts/renovate-app-update.ts" ]; then echo "Script exists" # Check if bun is available in the environment if command -v bun &> /dev/null; then echo "Bun is available" else echo "Warning: Bun is not available" fi else echo "Warning: Script not found" fiLength of output: 174
Script:
#!/bin/bash # Check the content of the script cat .github/scripts/renovate-app-update.ts # Search for similar patterns in the codebase echo "=== Similar patterns ===" rg "renovate-app-update" -lLength of output: 1059
.github/workflows/ci.yml (1)
10-10
: LGTM! Improved conditional syntaxThe change to use proper GitHub Actions expression syntax is correct and more maintainable.
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/scripts/renovate-app-update.ts (1)
18-19
: Consider adding JSON schema validation.While the TypeScript type provides compile-time safety, adding runtime JSON schema validation would help catch malformed config files early.
Example implementation:
import Ajv from 'ajv'; const schema = { type: 'object', properties: { tipi_version: { type: 'number' }, version: { type: 'string' }, updated_at: { type: 'number' } }, required: ['tipi_version', 'version', 'updated_at'] }; const validate = new Ajv().compile(schema); const configParsed = JSON.parse(config); if (!validate(configParsed)) { throw new Error(`Invalid config.json schema: ${validate.errors?.map(e => e.message).join(', ')}`); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/scripts/renovate-app-update.ts
(1 hunks)
🧰 Additional context used
📓 Learnings (1)
.github/scripts/renovate-app-update.ts (4)
Learnt from: steveiliop56
PR: runtipi/runtipi-appstore#6361
File: .github/scripts/renovate-app-update.ts:4-5
Timestamp: 2025-01-13T17:07:23.988Z
Learning: The script `.github/scripts/renovate-app-update.ts` is designed to be run only by Renovate bot during post-upgrade tasks and not meant for general use, making input validation unnecessary.
Learnt from: steveiliop56
PR: runtipi/runtipi-appstore#6361
File: .github/scripts/renovate-app-update.ts:21-21
Timestamp: 2025-01-13T17:07:16.399Z
Learning: In runtipi-appstore, the `tipi_version` field in app config.json files is a number, not a string, and should be typed as `number` in TypeScript definitions.
Learnt from: steveiliop56
PR: runtipi/runtipi-appstore#6361
File: .github/scripts/renovate-app-update.ts:21-21
Timestamp: 2025-01-13T17:07:16.399Z
Learning: In runtipi-appstore, the `tipi_version` field in app config.json files is always a number, despite being typed as string in the TypeScript definition.
Learnt from: steveiliop56
PR: runtipi/runtipi-appstore#6361
File: .github/scripts/renovate-app-update.ts:26-28
Timestamp: 2025-01-13T17:07:07.112Z
Learning: In Renovate scripts that process multiple apps, errors should be logged but shouldn't cause the script to exit, allowing other apps to be processed.
🔇 Additional comments (4)
.github/scripts/renovate-app-update.ts (4)
1-5
: LGTM! Good use of node: protocol imports.The imports are correctly using the node: protocol prefix, which is a Node.js best practice for better performance and clarity.
7-11
: LGTM! Well-defined type structure.The AppConfig type correctly defines the structure with appropriate types, particularly noting that tipi_version is properly typed as number.
13-29
: LGTM! Well-structured async implementation.The function correctly handles paths, file operations, and error handling. The error handling approach appropriately logs errors without exiting, allowing processing of other apps to continue.
31-31
: LGTM! Simple and clear invocation.The function invocation is straightforward and uses the command-line arguments appropriately.
Summary by CodeRabbit
New Features
Workflow Changes
Configuration Updates
Removed Components