Skip to content

fix(ci): preserve recovered macOS DMG diagnostics - #2393

Merged
hidb4ai merged 1 commit into
oceanbase:masterfrom
DongYao0:codex/fix-2230-macos-dmg-diagnostics
Nov 5, 2026
Merged

hidb4ai merged 1 commit into
oceanbase:masterfrom
DongYao0:codex/fix-2230-macos-dmg-diagnostics

Conversation

@DongYao0

@DongYao0 DongYao0 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Refs #2230. This captures evidence for the intermittent macOS Intel DMG failure; the underlying cause remains unconfirmed until a failing host run provides diagnostics.

Rationale for this change

The original bundle_dmg.sh failure exposed no underlying command error. The existing selective retry can recover a Resource busy failure, but a successful retry previously skipped diagnostic artifact upload, losing the first failure's evidence.

What changes are included in this PR?

  • Capture macOS/Xcode and Node/pnpm/Rust/Cargo versions, disk image and mount state, and the bundle file tree immediately after each failed attempt.
  • Upload per-attempt and combined logs when any retry occurred, including when the build eventually succeeds. Explicitly include the hidden .artifacts directory in the narrowly scoped diagnostic upload.
  • Keep the existing three-attempt limit and retry only the known hdiutil: create failed - Resource busy signature; unrelated failures retain their exit status.
  • Add regression coverage for immediate success, recovered busy failure, unrelated failure, mixed failures, and exhausted busy retries.

Are there any user-facing changes?

No application behavior, public API, or persisted format changes. CI may retain a diagnostic artifact after a recovered packaging failure.

How was this change tested?

  • python -m pytest tests/test_desktop_macos_workflow.py tests/test_workflow_actions.py tests/test_ci_changes.py -q: 109 passed, 5 Windows skips.
  • Executed all five extracted workflow shell scenarios through Git Bash: passed.
  • Ruff check and format, YAML hook, git diff --check, and repository-wide ty check --python-platform linux: passed.
  • Actual macOS DMG packaging and hdiutil behavior require this PR's remote macOS jobs; the shell scenarios only validate local control flow.

AI usage statement

OpenAI Codex (GPT-6) assisted with investigation, implementation, review, and regression tests. Local checks above were executed; macOS host behavior has not been claimed from simulation.

@PsiACE PsiACE left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks for the contribution!

@hireview001 hireview001 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@AlexStocks AlexStocks added the 1.5.1 v1.5.1 release tracking label Nov 3, 2026

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The retry behavior and diagnostic retention look reasonable. The successful macOS CI runs validate packaging; the recovered-failure upload path still needs evidence from an actual failing macOS run.

Comment thread .github/workflows/desktop.yml Outdated
build_status=$?
fi
capture_macos_state ".artifacts/macos-build-attempt-${attempt}-state.log"
if [ "$attempt" -eq 3 ] || ! grep -Fq 'hdiutil: create failed - Resource busy' "$attempt_log"; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] 重试判据仍只匹配 create failed,而 master 已扩到 couldn't eject;当前冲突正落在这行

本 head 该行是:

if [ "$attempt" -eq 3 ] || ! grep -Fq 'hdiutil: create failed - Resource busy' "$attempt_log"; then

master 2853ed98 上已经是:

if [ "$attempt" -eq 3 ] || ! grep -Eq "hdiutil: (create failed - Resource busy|couldn't eject .* - Resource busy)" "$attempt_log"; then

本 PR 的 merge-base 是 e192e08c,那行当时还是 -Fq,所以差异来自 base 前进而非本 PR 改动;PR 当前 mergeable_state=dirty,冲突出现在同一段。

影响:若冲突消解时取本 PR 版本,形如 hdiutil: couldn't eject "diskX" - Resource busy 的打包失败将不再重试。这不是假设——2026-11-04 #2306 的 head 5f783f29(run 41803592923 / job 126498786985)在 macOS 上正是这个形态:hdiutil: couldn't eject "disk2" - Resource busy ×3 → failed to bundle project: error running bundle_dmg.sh。

测试覆盖不到这一点:本 PR 新增的 test_macos_dmg_build_preserves_transient_failure_evidence 的 busy 序列只输出 hdiutil: create failed - Resource busy,参数表里没有 eject 形态,因此收窄判据不会让任何用例变红。

建议:rebase 到当前 master 后保留 -Eq 双形态判据,并在参数表补一条 busy_eject 序列(stderr 写 hdiutil: couldn't eject "disk2" - Resource busy),断言仍然重试且 retried=true 被写出。

@DongYao0
DongYao0 force-pushed the codex/fix-2230-macos-dmg-diagnostics branch from ffc8054 to 61da3aa Compare November 4, 2026 12:38

@hireview001 hireview001 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@hidb4ai
hidb4ai merged commit b79f692 into oceanbase:master Nov 5, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.5.1 v1.5.1 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants