Skip to content

Improve bumpUpstream: semver sort and Docker registry-based version format resolution#475

Open
hcastc00 wants to merge 2 commits intomasterfrom
fix/bump-upstream-semver-sort
Open

Improve bumpUpstream: semver sort and Docker registry-based version format resolution#475
hcastc00 wants to merge 2 commits intomasterfrom
fix/bump-upstream-semver-sort

Conversation

@hcastc00
Copy link

@hcastc00 hcastc00 commented Mar 6, 2026

Summary

Improves the bump-upstream GitHub Action to correctly handle upstream repos that use non-standard version tag formats (e.g., n8n@2.10.3, v1.2.3) and ensures the version written to the manifest and docker-compose matches what the Docker image registry actually expects.

Changes

  • Semver-based release sorting: Instead of relying on GitHub API ordering (releases[0]), releases are now filtered (no drafts, prereleases, or RCs) and sorted by semver to always pick the highest valid version.
  • Tag prefix handling for validation: isValidRelease now strips prefixes before semver validation, so tags like n8n@2.10.3 are correctly recognized as valid releases instead of triggering false warnings.
  • Docker registry version format resolution (resolveVersionFormat.ts): New helper that determines the correct version format by:
    1. Parsing the package's Dockerfile to find which Docker image uses the build arg
    2. Checking the Docker registry (Docker Hub, ghcr.io, gcr.io) to see if the stripped version exists as a tag
    3. Returning the format that matches the registry (e.g., v1.17.1 for geth, 0.17.7 for ollama, 2.10.3 for n8n)
  • Increased per_page to 100 for GitHub releases API to ensure we don't miss the latest valid release.
  • DX improvements: Added VSCode debug launch config docs and cli/start npm scripts.

Problem

Different upstream projects use different conventions:

GitHub release tag Docker image tag Action needed
v1.17.1 (geth) v1.17.1 Keep as-is
v0.17.7 (ollama) 0.17.7 Strip v
n8n@2.10.3 (n8n) 2.10.3 Strip n8n@

Previously, the raw GitHub tag was always used, which could cause mismatches with Docker image tags, or the sort order could pick the wrong release.

Test plan

  • Verify version resolution with geth (v prefix kept — Docker tag uses v)
  • Verify version resolution with ollama (v prefix stripped — Docker tag has no v)
  • Verify version resolution with n8n (n8n@ prefix stripped — Docker tag is bare semver)
  • Verify semver sorting picks highest version when releases are out of order
  • Verify isValidRelease no longer warns for n8n@X.Y.Z style tags
  • Verify fallback behavior when Docker registry is unreachable (keeps original tag)

@hcastc00 hcastc00 requested a review from a team as a code owner March 6, 2026 10:27
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

Dappnode bot has built and pinned the built packages to an IPFS node, for commit: 34066e3

This is a development version and should only be installed for testing purposes.

  1. Package dappnodesdk.public.dappnode.eth

Install link

Hash: /ipfs/QmPyqgztKwgKqGApFNnuVtTrJ6KLHy9n8R7vfPqJf3aL4A

(by dappnodebot/build-action)

return release.data.id;
}

async uploadReleaseAssets({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check warning

owner: this.owner,
repo: this.repo,
release_id: releaseId,
data: fs.createReadStream(filepath) as any,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check warning

Comment on lines +15 to +17
"pre-commit": "npm run lint && npm run test",
"cli": "node dist/dappnodesdk.js",
"start": "yarn cli"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are these changes for? are you sure these are needed?

Comment on lines +134 to +174
## VSCode debugging

The DappNode SDK can be run and debugged in VSCode.
This run configurations can be configured via de `.vscode/launch.json`

Example `launh.json`
```json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run dappnodesdk",
"runtimeExecutable": "yarn",
"runtimeArgs": [
"start",
"github-action",
"bump-upstream",
"--dir",
"${workspaceFolder}/../dummy", // Path to the DappNode package
"--skip_build"
],
"cwd": "${workspaceFolder}",
"env": {
"GITHUB_TOKEN": "ghp_XXX", // Your github API key
"SKIP_COMMIT": "true"
},
"skipFiles": [
"<node_internals>/**"
],
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"console": "integratedTerminal"
}
]
}
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think this should go into this PR

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.

3 participants