diff --git a/build/dockerfiles/Dockerfile b/build/dockerfiles/Dockerfile index 85e9dd1abe..c9678ca979 100644 --- a/build/dockerfiles/Dockerfile +++ b/build/dockerfiles/Dockerfile @@ -12,7 +12,7 @@ # # OpenVSX -FROM ghcr.io/eclipse/openvsx-server:8fbf749 AS openvsx-server +FROM ghcr.io/eclipse/openvsx-server:d7fba39 AS openvsx-server # UBI Builder # https://registry.access.redhat.com/ubi8/ubi diff --git a/build/dockerfiles/import-vsix.sh b/build/dockerfiles/import-vsix.sh index 996958e450..c255f72473 100755 --- a/build/dockerfiles/import-vsix.sh +++ b/build/dockerfiles/import-vsix.sh @@ -26,24 +26,32 @@ export OVSX_PAT=eclipse_che_token containsElement () { for e in "${@:2}"; do [[ "$e" = "$1" ]] && return 0; done; return 1; } -vsixMetadata="" #now global so it can be set/checked via function -getMetadata(){ +function getOpenVSXData(){ vsixName=$1 key=$2 + parameters=$3 + + # build the request url + if [[ -n "$parameters" ]]; then + url="https://open-vsx.org/api/${vsixName}/${key}?${parameters}" + else + url="https://open-vsx.org/api/${vsixName}/${key}" + fi # check there is no error field in the metadata and retry if there is for j in 1 2 3 4 5 do - vsixMetadata=$(curl -sLS "https://open-vsx.org/api/${vsixName}/${key}") - if [[ $(echo "${vsixMetadata}" | jq -r ".error") != null ]]; then - echo "Attempt $j/5: Error while getting metadata for ${vsixName} version ${key}" + result=$(curl -sLS "${url}") + if [[ $(echo "${result}" | jq -r ".error") != null ]]; then + echo "Attempt $j/5: Error while getting metadata for ${vsixFullName} version ${key}" if [[ $j -eq 5 ]]; then - echo "[ERROR] Maximum of 5 attempts reached - must exit!" + echo "[ERROR] Maximum of 5 attempts reached - must exit with failure!" exit 1 fi continue else + echo "$result" break fi done @@ -90,17 +98,22 @@ for i in $(seq 0 "$((numberOfExtensions - 1))"); do # grab metadata for the vsix file # if version wasn't set, use latest if [[ $vsixVersion == null ]]; then - getMetadata "${vsixName}" "latest" + vsixMetadata=$(getOpenVSXData "${vsixName}" "latest") + versionsPage=$(getOpenVSXData "${vsixName}" "versions" "size=200") # if version wasn't set in json, grab it from metadata and add it into the file # get all versions of the extension - allVersions=$(echo "${vsixMetadata}" | jq -r '.allVersions') + allVersions=$(echo "${versionsPage}" | jq -r '.versions') + if [[ "$allVersions" == "{}" ]]; then + echo "No versions found for ${vsixName}" + exit 1 + fi key_value_pairs=$(echo "$allVersions" | jq -r 'to_entries[] | [ .key, .value ] | @tsv') # go through all versions of the extension to find the latest stable version that is compatible with the VS Code version resultedVersion=null while IFS=$'\t' read -r key value; do # get metadata for the version - getMetadata "${vsixName}" "${key}" + vsixMetadata=$(getOpenVSXData "${vsixName}" "${key}") # check if the version is pre-release preRelease=$(echo "${vsixMetadata}" | jq -r '.preRelease') @@ -136,7 +149,7 @@ for i in $(seq 0 "$((numberOfExtensions - 1))"); do vsixVersion=$resultedVersion fi else - getMetadata "${vsixName}" "${vsixVersion}" + vsixMetadata=$(getOpenVSXData "${vsixName}" "${vsixVersion}") fi # extract the download link from the json metadata diff --git a/openvsx-sync.json b/openvsx-sync.json index 40e518acd3..8af1531028 100644 --- a/openvsx-sync.json +++ b/openvsx-sync.json @@ -6,13 +6,13 @@ "id": "vscode.github-authentication" }, { - "id": "github.vscode-pull-request-github" + "id": "GitHub.vscode-pull-request-github" }, { "id": "vscode.typescript-language-features" }, { - "id": "bazelbuild.vscode-bazel" + "id": "BazelBuild.vscode-bazel" }, { "id": "octref.vetur" @@ -42,13 +42,13 @@ "id": "eamodio.gitlens" }, { - "id": "golang.go" + "id": "golang.Go" }, { - "id": "dart-code.dart-code" + "id": "Dart-Code.dart-code" }, { - "id": "dart-code.flutter" + "id": "Dart-Code.flutter" }, { "id": "redhat.vscode-yaml" @@ -123,7 +123,7 @@ "id": "scalameta.metals" }, { - "id": "sonarsource.sonarlint-vscode" + "id": "SonarSource.sonarlint-vscode" }, { "id": "vscode.git-base" @@ -135,19 +135,19 @@ "id": "atlassian.atlascode" }, { - "id": "broadcommfd.cobol-language-support" + "id": "BroadcomMFD.cobol-language-support" }, { - "id": "broadcommfd.debugger-for-mainframe" + "id": "BroadcomMFD.debugger-for-mainframe" }, { - "id": "broadcommfd.hlasm-language-support" + "id": "BroadcomMFD.hlasm-language-support" }, { - "id": "zowe.vscode-extension-for-zowe" + "id": "Zowe.vscode-extension-for-zowe" }, { - "id": "broadcommfd.explorer-for-endevor" + "id": "BroadcomMFD.explorer-for-endevor" }, { "id": "zxh404.vscode-proto3" @@ -183,13 +183,13 @@ "id": "redhat.vscode-commons" }, { - "id": "broadcommfd.ccf" + "id": "BroadcomMFD.ccf" }, { "id": "4ops.terraform" }, { - "id": "randomchance.logstash" + "id": "RandomChance.logstash" }, { "id": "fbaligand.vscode-logstash-editor"