Skip to content

Add service update paused case for swarm deployment log parsing#456

Merged
samdark merged 4 commits intomasterfrom
copilot/add-swarm-log-parsing-case
Mar 19, 2026
Merged

Add service update paused case for swarm deployment log parsing#456
samdark merged 4 commits intomasterfrom
copilot/add-swarm-log-parsing-case

Conversation

Copy link
Contributor

Copilot AI commented Mar 18, 2026

The swarm deployment failure detection only matched rollback: and update rolled back patterns, missing the service update paused failure case.

Changes

  • Makefile (prod-deploy): Added service update paused to the grep failure-detection pattern and updated error messages from "rolled back; failing job" to "failed" to accurately cover all matched cases:
if grep -qiE 'rollback:|update rolled back|service update paused' deploy.log then \
    ...
    echo "Docker Swarm update failed. Failed task ID: ${FAILED_TASK_ID}" \
    ...
    echo 'Docker Swarm update failed. Failed task ID: not found in deploy output.' \
Original prompt

This section details on the original issue you should resolve

<issue_title>Add another case for swarm deployment log parsing</issue_title>
<issue_description>### Description

if grep -qiE 'rollback:|update rolled back|service update paused' deploy.log; then
  FAILED_TASK_ID="$(grep -oiE 'task[[:space:]]+[a-z0-9]+' deploy.log | head -n 1 | awk '{print $2}')"
  if [ -n "${FAILED_TASK_ID}" ]; then
    echo "Docker Swarm update failed. Failed task ID: ${FAILED_TASK_ID}"
    echo "--- docker service logs (${FAILED_TASK_ID}) ---"
    docker service logs --timestamps --tail 500 "${FAILED_TASK_ID}" || true
  else
    echo 'Docker Swarm update failed. Failed task ID: not found in deploy output.'
  fi
  exit 1
fi

Package version

No response

PHP version

No response</issue_description>

<agent_instructions>Add that to https://github.com/yiisoft/app/blob/master/Makefile#L127</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
Copilot AI changed the title [WIP] Add another case for swarm deployment log parsing Add service update paused case for swarm deployment log parsing Mar 18, 2026
Copilot AI requested a review from samdark March 18, 2026 21:10
@samdark
Copy link
Member

samdark commented Mar 19, 2026

@copilot add a line for CHANGELOG: Fix #456: Add "service update paused" case for swarm deployment log parsing (@samdark).

Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 19, 2026

@copilot add a line for CHANGELOG: Fix #456: Add "service update paused" case for swarm deployment log parsing (@samdark).

Added in commit 83c11bc.

Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
@samdark samdark marked this pull request as ready for review March 19, 2026 20:19
Copilot AI review requested due to automatic review settings March 19, 2026 20:19
@samdark samdark merged commit 3475423 into master Mar 19, 2026
17 checks passed
@samdark samdark deleted the copilot/add-swarm-log-parsing-case branch March 19, 2026 20:20
@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.96%. Comparing base (0ea8683) to head (3661853).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #456   +/-   ##
=========================================
  Coverage     76.96%   76.96%           
  Complexity       29       29           
=========================================
  Files            11       11           
  Lines           178      178           
=========================================
  Hits            137      137           
  Misses           41       41           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI added a commit to yiisoft/app-api that referenced this pull request Mar 19, 2026
…oyment log parsing

Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the production deployment failure detection for Docker Swarm by expanding log parsing to catch the “service update paused” case, and reflects the change in user-facing output and release notes.

Changes:

  • Expand prod-deploy failure-detection grep pattern to include service update paused.
  • Adjust prod-deploy error messages from “rolled back; failing job” to a more general “failed” wording.
  • Add a corresponding entry to CHANGELOG.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
Makefile Extends swarm deploy failure detection and updates failure messaging in prod-deploy.
CHANGELOG.md Documents the enhancement in the “under development” section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 128 to +130
set -euo pipefail \
docker -H ${PROD_SSH} stack deploy --prune --detach=false --with-registry-auth -c docker/compose.yml -c docker/prod/compose.yml ${STACK_NAME} 2>&1 | tee deploy.log \
if grep -qiE 'rollback:|update rolled back' deploy.log then \
if grep -qiE 'rollback:|update rolled back|service update paused' deploy.log then \
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

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

The shell syntax in this recipe is invalid as written: with line continuations (\), set -euo pipefail and the tee deploy.log pipeline need command separators (typically ; \), and the if grep ... condition must use ; then. Otherwise these tokens concatenate into a single set invocation and/or produce a syntax error near unexpected token 'then', preventing make prod-deploy from running.

Copilot uses AI. Check for mistakes.
- Enh #448: Add grouping to `make` help output (@Xakki, @samdark)
- Enh #449: Update composer dependencies and refactor to replace use of deprecated classes (@vjik)
- Chg #449: Remove `yiisoft/data-response` dependency (@vjik)
- Enh #456: Add "service update paused" case for swarm deployment log parsing (@samdark)
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

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

The CHANGELOG entry references #456, but the linked issue/intent in the PR description is yiisoft/app#455. Please update the issue/PR number in the changelog line to match the correct tracker reference.

Copilot uses AI. Check for mistakes.
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.

Add another case for swarm deployment log parsing

3 participants