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
2 changes: 1 addition & 1 deletion .github/workflows/debug-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
fetch-depth: 1
persist-credentials: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mirror-to-gitlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Push to GitLab
run: |
git remote add gitlab https://oauth2:${{ secrets.GITLAB_PAT }}@gitlab.com/RajnishKMehta/DhwaniControl.git
git push gitlab main
git push gitlab main
12 changes: 11 additions & 1 deletion .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
fetch-depth: 0

Expand Down Expand Up @@ -141,6 +141,16 @@ jobs:
mkdir -p .keystore
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > .keystore/release.jks

# Download & convert author avatar
- name: Update author avatar
if: steps.tag_check.outputs.exists == 'false'
run: |
sudo apt-get update -y
sudo apt-get install -y webp

curl -sL "https://avatars.githubusercontent.com/u/172272341?s=460" -o /tmp/author.png
cwebp -q 95 /tmp/author.png -o app/src/main/res/drawable/author.webp
Comment on lines +151 to +152

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflow context =="
if [ -f .github/workflows/release-build.yml ]; then
  sed -n '1,210p' .github/workflows/release-build.yml | cat -n
else
  echo "workflow file missing"
  git ls files .github/workflows || true
fi

echo
echo "== curl docs/options installed =="
if command -v curl >/dev/null 2>&1; then
  curl --version | head -5
  curl --help short | rg -n "silent|fail|location|connect-timeout|max-time|retry|L \^S" || true
else
  echo "curl not installed"
fi

echo
echo "== behavioral probe: local curl options =="
if command -v curl >/dev/null 2>&1; then
  python3 - <<'PY'
import subprocess
urls = [
  ("ok", "data:text/plain,hello"),
  ("no_flag_404", "data:text/plain,not ok"),
  ("fail_flag_404", "data:text/plain,not ok"),
]
for name, url in urls:
    cmd = ["curl", "--silent", "--location", url, "-o", "/tmp/author_curl_probe.png"]
    if name.startswith("fail"):
        cmd.insert(1, "--fail")
    ret = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    body = open("/tmp/author_curl_probe.png","rb").read() if __import__("os").path.exists("/tmp/author_curl_probe.png") else b""
    print(f"{name}: returncode={ret.returncode} size={len(body)} error={ret.stderr.decode(errors='replace').strip()}")
    __import__("os").remove("/tmp/author_curl_probe.png")
PY
fi

echo
echo "== repository references to timeout in workflow =="
rg -n "timeout|retry|curl --|cwebp" .github/workflows/release-build.yml || true

Repository: RajnishKMehta/DhwaniControl

Length of output: 9267


🌐 Web query:

curl man page --silent --fail HTTP return code --max-time --connect-timeout --retry --location

💡 Result:

The following options are used in curl to control behavior, timeout, and failure handling: --silent (-s): Disables the progress meter and error messages. It prevents curl from showing any transfer progress or diagnostic information to standard error, effectively making it silent [1][2]. --fail (-f): Instructs curl to fail silently (with no output at all) on server errors, defined as HTTP response codes of 400 or greater [3][4]. When this occurs, curl exits with exit code 22 [3][5]. This is useful for scripts to detect failed HTTP requests, as by default, curl considers HTTP communication successful regardless of the status code [6][4]. This option is not fail-safe, as some non-successful codes (such as 401 and 407) may still be passed through depending on authentication scenarios [3]. --max-time (-m): Sets the maximum time in seconds that you allow the entire operation to take [7]. If the operation exceeds this duration, curl will exit [7]. It accepts decimal values [7]. --connect-timeout : Sets the maximum time in seconds allowed for the connection phase (DNS lookup, TCP/TLS/QUIC handshakes) [3][1]. If the connection is not established within this period, curl exits [3]. It accepts decimal values [3]. --retry : Specifies the number of times to retry the transfer if a transient error occurs. When enabled, curl will attempt the request again if it encounters issues like connection failures or HTTP 5xx errors. --location (-L): Instructs curl to follow HTTP redirects [1][7]. If the server responds with a 3xx status code indicating the page has moved, curl will automatically make a new request to the provided location [1]. HTTP Return Codes: By default, curl does not treat HTTP error codes (4xx or 5xx) as transfer errors [6][4]. To change this behavior so that curl returns an error code on HTTP failures, you must use --fail or --fail-with-body [6][4]. When using --fail, curl exits with exit code 22 for HTTP errors 400 and above [3][5]. The --fail-with-body option is similar but allows the response body (such as an error page) to be outputted before exiting with code 22 [1][4]. You can extract the specific HTTP response code received by using the --write-out option [6].

Citations:


Make the avatar download fail fast.

curl -sL follows redirects successfully even for HTTP 4xx/5xx responses and has no transfer timeout, so a bad or stalled avatar response can still keep the 120-minute release job active. Use --fail, retry/transient-error handling, connection/transfer timeouts, and check that /tmp/author.png exists and is non-empty before running cwebp.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release-build.yml around lines 151 - 152, Update the
avatar download step in the release workflow to make curl fail on HTTP errors,
retry transient failures, and enforce connection and transfer timeouts. Before
invoking cwebp, validate that /tmp/author.png exists and is non-empty, and stop
the step with an error if validation fails.

Source: MCP tools


# Build signed APK
- name: Build release APK
if: steps.tag_check.outputs.exists == 'false'
Expand Down