fix(ci): accept SDK 0.9.0+ hyphenated package name in pre-check version detection#2463
Merged
crazywoola merged 1 commit intoMay 27, 2026
Conversation
…in version detection
13 tasks
crazywoola
approved these changes
May 27, 2026
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
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.
Summary
The
pre-check-pluginworkflow'sdify_pluginversion detection step misses SDK 0.9.0+, silently routing it to the unsupportedINSTALL_METHOD=aws_lambdabranch and failing the entire pre-check with an unrelated pydanticValidationError. This patch fixes the detection without regressing SDK ≤ 0.7.4.Root cause
.github/workflows/pre-check-plugin.yamldetects the installed SDK with:dify_version=$(pip list | grep -o 'dify_plugin\s\+[0-9.]\+' | awk '{print $2}' || echo "not_found")Two latent bugs combine:
Naming: SDK ≤ 0.7.4 appears in
pip listasdify_plugin(underscore), but SDK 0.9.0 normalizes todify-plugin(hyphen). The underscore-only regex matches nothing for 0.9.0+.Empty fall-through:
grep -o | awkexits 0 with empty output on a miss. The|| echo "not_found"never fires;dify_versionbecomes the empty string. Theif "$dify_version" = "not_found"check is skipped, andVersion('') > Version('0.0.1b64')raisespackaging.version.InvalidVersion, sending the script toINSTALL_METHOD=aws_lambda. SDK 0.9.0'sDifyPluginEnv.INSTALL_METHODenum only acceptslocal | remote | serverless, so pydantic raises:Fix
dify[-_]pluginso both naming forms are accepted.-oto-oEso the alternation works as ERE.not_found.Verification
I extracted the workflow's bash block verbatim into a local script and ran it against two clean venvs (
python3.12 -m venv), one withdify_plugin==0.9.0and one withdify_plugin==0.7.4, both before and after the patch:pip listrowdify-plugin 0.9.0(hyphen)Found dify_plugin version:→Version('')→InvalidVersion→aws_lambdaFound dify_plugin version: 0.9.0→serverless✅dify_plugin 0.7.4(underscore)Found dify_plugin version: 0.7.4→serverless✅Found dify_plugin version: 0.7.4→serverless✅ (no regression)The OLD-script + SDK 0.9.0 row matches exactly what is observed in PR #2447 CI run 26268160995:
Found dify_plugin version:(empty) followed bypydantic_core._pydantic_core.ValidationError.Related