Skip to content

feat(build): fetch Railpack releases and support latest version - #4070

Open
s24407-pj wants to merge 15 commits into
Dokploy:canaryfrom
s24407-pj:feat/dynamic-railpack-versions
Open

s24407-pj wants to merge 15 commits into
Dokploy:canaryfrom
s24407-pj:feat/dynamic-railpack-versions

Conversation

@s24407-pj

@s24407-pj s24407-pj commented Mar 25, 2026 •

Copy link
Copy Markdown

What is this PR about?

Railpack versions are hardcoded today, so new releases require a Dokploy update. This PR fetches the 20 most recent GitHub releases for the build selector and adds an explicit latest option that follows new releases when building.

  • Cache the release list and the resolved latest version on the server for 24 hours, deduplicate concurrent requests, and optionally authenticate with GITHUB_TOKEN.
  • Keep saved versions outside the recent list available through manual entry without changing their saved value.
  • Resolve latest to a concrete release before generating the build command so the installed CLI and frontend image use the same version, including installation through sudo.
  • Strip the v prefix from manual entries, reject empty Railpack versions, and handle loading and GitHub failures in the form. Preserve the existing optional build settings in the API.

Validation

  • 18 focused tests pass: release fetching, cache expiry, concurrent requests, latest resolution, build commands, and version validation.
  • Server typecheck, server build, and Biome checks on changed files pass.
  • Local development server is running and responds successfully.
  • Full app typecheck reports two existing Zod type incompatibilities in the unchanged network assignment and tag forms.
  • A full Docker deployment has not been exercised.

Checklist

  • Dedicated branch based on canary, updated with the latest upstream changes.
  • Read the contribution guidelines in CONTRIBUTING.md.
  • Tested locally as described above.

s24407-pj and others added 3 commits March 25, 2026 16:59
Replace the hardcoded RAILPACK_VERSIONS array with a tRPC query that
fetches releases from the GitHub API. Versions are cached for 24 hours
and only fetched when the Railpack build type is selected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ection

- Change Zod schema default from hardcoded "0.15.4" to null so Zod does
  not silently override the form field before the fetched versions arrive
- Set form value to latest fetched version when no version is selected
- Strip v prefix from manually entered versions before saving
- Fix form reset loop by splitting useEffect into separate concerns

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@s24407-pj
s24407-pj requested a review from Siumauricio as a code owner March 25, 2026 16:45
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Mar 25, 2026
@dosubot

dosubot Bot commented Mar 25, 2026

Copy link
Copy Markdown

Related Documentation

1 document(s) may need updating based on files changed in this PR:

Dokploy's Space

README /dokploy/blob/canary/apps/api/README.md
View Suggested Changes
@@ -113,6 +113,41 @@
   -F "zip=@/path/to/your/app.zip" \
   -F "dropBuildPath=optional/build/path"
 ```
+
+## Application Endpoints
+
+### application.getRailpackVersions
+
+Fetches available Railpack versions dynamically from the GitHub API.
+
+**Type:** Protected procedure query (requires authentication)
+
+**Parameters:** None
+
+**Response:**
+Returns an array of version strings (tag names from GitHub releases with the 'v' prefix stripped):
+```json
+[
+  "0.15.4",
+  "0.15.3",
+  "0.15.2"
+]
+```
+
+**Error Responses:**
+- `500` - INTERNAL_SERVER_ERROR: "Failed to fetch Railpack versions from GitHub" if the GitHub API request fails
+
+**Caching:**
+When calling from the client, use a `staleTime` of 24 hours (1000 * 60 * 60 * 24) to avoid hitting GitHub API rate limits.
+
+**Example:**
+```typescript
+const { data: railpackVersions } = api.application.getRailpackVersions.useQuery(undefined, {
+  staleTime: 1000 * 60 * 60 * 24, // 24 hours
+});
+```
+
+**Data Source:** https://api.github.com/repos/railwayapp/railpack/releases
 
 ## Search Endpoints
 

[Accept] [Decline]

Note: You must be authenticated to accept/decline updates.

How did I do? Any feedback?  Join Discord

@pompydev

pompydev commented Apr 8, 2026

Copy link
Copy Markdown

#4022 won't be necessary once this PR gets merged

s24407-pj and others added 3 commits April 15, 2026 17:45
Add validation to ensure that a railpack version is provided when the build type is set to railpack. Update the submission logic to normalize the railpack version and disable the submit button if the version is missing. This enhances user experience by preventing submission with invalid data.
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 15, 2026
@s24407-pj s24407-pj changed the title feat(build): fetch Railpack versions dynamically from GitHub releases feat(build): fetch Railpack releases and support latest version Oct 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants