Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 48 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,56 @@ jobs:
with:
name: unraid-web
path: ./plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/unraid-components
- name: Download Node.js From Slackbuilds (skipped due to node.js issues)
if: false
Comment on lines +166 to +167
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Based on the git history, I can now generate the final response:

Improve documentation for skipped Node.js download step

The Node.js download step was recently disabled without proper documentation. The git history shows this was a working step that was explicitly disabled with if: false. To maintain code quality:

  • Add a detailed comment explaining the specific Node.js issues encountered
  • Include a reference to any related issue/PR that tracks this problem
  • Consider adding a TODO with an estimated timeline for re-enabling this step
  • If this is a permanent change, consider removing the step entirely instead of keeping it disabled
🔗 Analysis chain

Document Node.js download issues and resolution plan

The step is currently skipped with a vague comment. Please:

  1. Document the specific Node.js issues that led to skipping this step
  2. Create a tracking issue for resolution
  3. Add a link to the tracking issue in the comment

Let me check the workflow file to understand the context better.


Let me check the .nvmrc file to understand the Node.js version requirement.


Let me check if there are any recent changes or commits related to this Node.js download step.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if there are any existing issues about Node.js download problems
gh issue list --search "in:title node.js download" --json number,title,url

Length of output: 79


Script:

#!/bin/bash
# Check the workflow file for any comments or related steps around Node.js
rg -A 5 -B 5 "node\.js" .github/workflows/main.yml -i

Length of output: 576


Script:

#!/bin/bash
# Check for .nvmrc file and its content
fd -t f .nvmrc -x cat {}

Length of output: 28


Script:

#!/bin/bash
# Check git history for changes related to Node.js download step
git log -p -- .github/workflows/main.yml | grep -B 5 -A 5 "Download Node.js"

Length of output: 2434

id: download-nodejs
run: |
# Get latest node version (based on main_node_version) from slackware
main_node_version=$(sed 's/^v//' ../api/.nvmrc)
base_node_url="https://mirrors.slackware.com/slackware/slackware64-current/slackware64/l/"
latest_nodejs=$(wget -q -O- "${base_node_url}" | grep -o "nodejs-${main_node_version}\.[0-9.]*-x86_64-[0-9]*\.txz" | sort -V | tail -n 1)
if [[ -z "${latest_nodejs}" ]]; then
echo "Error: Failed to fetch the latest nodejs version."
exit 1
fi
node_download_url="${base_node_url}${latest_nodejs}"
if ! wget -q "${node_download_url}" -O "${{ github.workspace }}/plugin/archive/${latest_nodejs}"; then
echo "Error: Failed to download nodejs package."
exit 1
fi
node_sha256=$(sha256sum "${{ github.workspace }}/plugin/archive/${latest_nodejs}" | cut -f 1 -d ' ')
echo "NODEJS_FILENAME=${latest_nodejs}" >> $GITHUB_OUTPUT
echo "NODEJS_SHA256=${node_sha256}" >> $GITHUB_OUTPUT
- name: Download nghttp3
id: download-nghttp3
run: |
# Get latest nghttp3 version
base_nghttp3_url="https://mirrors.slackware.com/slackware/slackware64-current/slackware64/n/"
latest_nghttp3=$(wget -q -O- "${base_nghttp3_url}" | grep -o "nghttp3-[0-9.]*-x86_64-[0-9]*\.txz" | sort -V | tail -n 1)
nghttp3_download_url="${base_nghttp3_url}${latest_nghttp3}"
if ! wget -q "${nghttp3_download_url}" -O "${{ github.workspace }}/plugin/archive/${latest_nghttp3}"; then
echo "Error: Failed to download nghttp3 package."
exit 1
fi
nghttp3_sha256=$(sha256sum "${{ github.workspace }}/plugin/archive/${latest_nghttp3}" | cut -f 1 -d ' ')
echo "NGHTTP3_FILENAME=${latest_nghttp3}" >> $GITHUB_OUTPUT
echo "NGHTTP3_SHA256=${nghttp3_sha256}" >> $GITHUB_OUTPUT
Comment on lines +186 to +199
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Apply similar robustness improvements to nghttp3 download

The nghttp3 download step would benefit from the same improvements as the Node.js step:

 - name: Download nghttp3
   id: download-nghttp3
   run: |
+    # Set timeout for downloads
+    WGET_OPTS="--timeout=30 --tries=3"
     # Get latest nghttp3 version
     base_nghttp3_url="https://mirrors.slackware.com/slackware/slackware64-current/slackware64/n/"
+    fallback_url="https://slackware.uk/slackware/slackware64-current/slackware64/n/"
     latest_nghttp3=$(wget -q -O- "${base_nghttp3_url}" | grep -o "nghttp3-[0-9.]*-x86_64-[0-9]*\.txz" | sort -V | tail -n 1)
+    if [[ -z "${latest_nghttp3}" ]]; then
+      echo "Warning: Failed to fetch from primary mirror, trying fallback..."
+      latest_nghttp3=$(wget -q -O- "${fallback_url}" | grep -o "nghttp3-[0-9.]*-x86_64-[0-9]*\.txz" | sort -V | tail -n 1)
+      if [[ -z "${latest_nghttp3}" ]]; then
+        echo "Error: Failed to fetch the latest nghttp3 version from all mirrors."
+        exit 1
+      fi
+      base_nghttp3_url="${fallback_url}"
+    fi
     nghttp3_download_url="${base_nghttp3_url}${latest_nghttp3}"
-    if ! wget -q "${nghttp3_download_url}" -O "${{ github.workspace }}/plugin/archive/${latest_nghttp3}"; then
+    if ! wget ${WGET_OPTS} -q "${nghttp3_download_url}" -O "${GITHUB_WORKSPACE}/plugin/archive/${latest_nghttp3}"; then
       echo "Error: Failed to download nghttp3 package."
       exit 1
     fi
-    nghttp3_sha256=$(sha256sum "${{ github.workspace }}/plugin/archive/${latest_nghttp3}" | cut -f 1 -d ' ')
+    nghttp3_sha256=$(sha256sum "${GITHUB_WORKSPACE}/plugin/archive/${latest_nghttp3}" | cut -f 1 -d ' ')
     echo "NGHTTP3_FILENAME=${latest_nghttp3}" >> $GITHUB_OUTPUT
     echo "NGHTTP3_SHA256=${nghttp3_sha256}" >> $GITHUB_OUTPUT
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Download nghttp3
id: download-nghttp3
run: |
# Get latest nghttp3 version
base_nghttp3_url="https://mirrors.slackware.com/slackware/slackware64-current/slackware64/n/"
latest_nghttp3=$(wget -q -O- "${base_nghttp3_url}" | grep -o "nghttp3-[0-9.]*-x86_64-[0-9]*\.txz" | sort -V | tail -n 1)
nghttp3_download_url="${base_nghttp3_url}${latest_nghttp3}"
if ! wget -q "${nghttp3_download_url}" -O "${{ github.workspace }}/plugin/archive/${latest_nghttp3}"; then
echo "Error: Failed to download nghttp3 package."
exit 1
fi
nghttp3_sha256=$(sha256sum "${{ github.workspace }}/plugin/archive/${latest_nghttp3}" | cut -f 1 -d ' ')
echo "NGHTTP3_FILENAME=${latest_nghttp3}" >> $GITHUB_OUTPUT
echo "NGHTTP3_SHA256=${nghttp3_sha256}" >> $GITHUB_OUTPUT
- name: Download nghttp3
id: download-nghttp3
run: |
# Set timeout for downloads
WGET_OPTS="--timeout=30 --tries=3"
# Get latest nghttp3 version
base_nghttp3_url="https://mirrors.slackware.com/slackware/slackware64-current/slackware64/n/"
fallback_url="https://slackware.uk/slackware/slackware64-current/slackware64/n/"
latest_nghttp3=$(wget -q -O- "${base_nghttp3_url}" | grep -o "nghttp3-[0-9.]*-x86_64-[0-9]*\.txz" | sort -V | tail -n 1)
if [[ -z "${latest_nghttp3}" ]]; then
echo "Warning: Failed to fetch from primary mirror, trying fallback..."
latest_nghttp3=$(wget -q -O- "${fallback_url}" | grep -o "nghttp3-[0-9.]*-x86_64-[0-9]*\.txz" | sort -V | tail -n 1)
if [[ -z "${latest_nghttp3}" ]]; then
echo "Error: Failed to fetch the latest nghttp3 version from all mirrors."
exit 1
fi
base_nghttp3_url="${fallback_url}"
fi
nghttp3_download_url="${base_nghttp3_url}${latest_nghttp3}"
if ! wget ${WGET_OPTS} -q "${nghttp3_download_url}" -O "${GITHUB_WORKSPACE}/plugin/archive/${latest_nghttp3}"; then
echo "Error: Failed to download nghttp3 package."
exit 1
fi
nghttp3_sha256=$(sha256sum "${GITHUB_WORKSPACE}/plugin/archive/${latest_nghttp3}" | cut -f 1 -d ' ')
echo "NGHTTP3_FILENAME=${latest_nghttp3}" >> $GITHUB_OUTPUT
echo "NGHTTP3_SHA256=${nghttp3_sha256}" >> $GITHUB_OUTPUT
🧰 Tools
🪛 actionlint

187-187: shellcheck reported issue in this script: SC2086:info:10:46: Double quote to prevent globbing and word splitting

(shellcheck)


187-187: shellcheck reported issue in this script: SC2086:info:11:44: Double quote to prevent globbing and word splitting

(shellcheck)

- name: Build Plugin
run: |
cd source/dynamix.unraid.net
export API_VERSION=${{needs.build-test-api.outputs.API_VERSION}}
export API_MD5=${{needs.build-test-api.outputs.API_MD5}}
export API_SHA256=${{needs.build-test-api.outputs.API_SHA256}}
export NGHTTP3_FILENAME=${{ steps.download-nghttp3.outputs.NGHTTP3_FILENAME }}
export NGHTTP3_SHA256=${{ steps.download-nghttp3.outputs.NGHTTP3_SHA256 }}
if [ -z "${API_VERSION}" ] ||
[ -z "${API_MD5}" ] ||
[ -z "${API_SHA256}" ] ||
[ -z "${NGHTTP3_FILENAME}" ] ||
[ -z "${NGHTTP3_SHA256}" ]; then
echo "Error: One or more required variables are not set."
exit 1
fi

bash ./pkg_build.sh s ${{github.event.pull_request.number}}
bash ./pkg_build.sh p
Expand Down Expand Up @@ -222,7 +266,7 @@ jobs:

- name: Copy other release files to pr-release
run: |
cp archive/dynamix.unraid.net.staging-*.txz pr-release/
cp archive/*.txz pr-release/
cp plugins/dynamix.unraid.net.staging.plg pr-release/

- name: Upload to Cloudflare
Expand Down Expand Up @@ -275,9 +319,9 @@ jobs:
removeMarkdown: false
filePath: "./api/CHANGELOG.md"

- name: Run LS in unraid-api folder
- name: Copy Files for Staging Release
run: |
cp archive/dynamix.unraid.net.staging-*.txz staging-release/
cp archive/*.txz staging-release/
cp plugins/dynamix.unraid.net.staging.plg staging-release/
ls -al staging-release

Expand Down Expand Up @@ -331,6 +375,6 @@ jobs:
files: |
unraid-api-*.tgz
plugins/dynamix.unraid.net*
archive/dynamix.unraid.net*
archive/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading