-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[PRIME-17] fix: enable github api to fetch latest version information #7548
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
Conversation
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThe changes update the instance registration command to dynamically determine both the current and latest application versions, including remote checks via the GitHub API. The previous static method for reading the version from Changes
Sequence Diagram(s)sequenceDiagram
participant Command
participant Env
participant FileSystem
participant GitHubAPI
participant Instance
Command->>Env: Check APP_VERSION
alt APP_VERSION exists
Env-->>Command: Return APP_VERSION
else
Command->>FileSystem: Read package.json for version
alt package.json found
FileSystem-->>Command: Return version
else
FileSystem-->>Command: Return "v0.1.0"
end
end
Command->>GitHubAPI: Query for latest release tag
alt API success
GitHubAPI-->>Command: Return latest version
else
GitHubAPI-->>Command: Fallback to current version
end
Command->>Instance: Register/Update with current and latest version
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Pull Request Linked with Plane Work Items Comment Automatically Generated by Plane |
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: 2
🧹 Nitpick comments (1)
apps/api/plane/license/management/commands/register_instance.py (1)
38-40
: Consider rate limiting and authentication for GitHub API.The GitHub API has rate limits (60 requests/hour for unauthenticated requests). For production usage, consider:
- Adding authentication token to increase rate limits
- Implementing caching to reduce API calls
- Adding retry logic with exponential backoff
For better reliability, consider caching the latest version check results or using GitHub webhooks to notify of new releases rather than polling the API on every instance registration.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/api/plane/license/management/commands/register_instance.py
(3 hunks)apps/api/plane/settings/common.py
(0 hunks)
💤 Files with no reviewable changes (1)
- apps/api/plane/settings/common.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Analyze (python)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
apps/api/plane/license/management/commands/register_instance.py (4)
52-53
: LGTM! Version retrieval integration looks good.The integration of version checking into the handle method is clean and follows good separation of concerns.
65-66
: LGTM! Instance creation with version fields.The addition of current and latest version fields to instance creation is correctly implemented.
78-79
: LGTM! Instance update with version fields.The version field updates in the existing instance path are correctly implemented.
5-5
: Ensurerequests
is declared in your dependency manifestI didn’t locate any standard Python dependency files in the repo (requirements.txt, requirements-.txt, pyproject.toml, setup.cfg, setup.py, Pipfile, or poetry.lock). Please confirm how your project manages dependencies and add
requests
to the appropriate manifest so it’s installed in all environments.
apps/api/plane/license/management/commands/register_instance.py
Outdated
Show resolved
Hide resolved
apps/api/plane/license/management/commands/register_instance.py
Outdated
Show resolved
Hide resolved
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.
Pull Request Overview
This PR enables the system to check for the latest Plane version from GitHub's API and saves the current version as part of instance details during registration or updates.
- Adds GitHub API integration to fetch the latest release version from the makeplane/plane repository
- Updates version detection to use environment variables or package.json as fallback
- Removes unused INSTANCE_KEY environment variable configuration
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
apps/api/plane/settings/common.py | Removes unused INSTANCE_KEY environment variable configuration |
apps/api/plane/license/management/commands/register_instance.py | Adds GitHub API integration for version checking and refactors version detection logic |
Description
Type of Change
Summary by CodeRabbit
New Features
Chores