Repository navigation
Harden OHOS unsigned hap dependency resolution against mirror hash mismatches - #191
Merged
Merged
Conversation
Co-authored-by: HeZeBang <27360275+HeZeBang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job for OHOS unsigned hap
Harden OHOS unsigned hap dependency resolution against mirror hash mismatches
Nov 10, 2026
HeZeBang
approved these changes
Nov 10, 2026
HeZeBang
marked this pull request as ready for review
November 10, 2026 13:04
The first version of this fallback could not have worked, in either branch: - `PUB_HOSTED_URL=https://pub.dev` alone changes nothing, because pub reads each package's host from `pubspec.lock` — the retry would keep talking to the mirror that just failed. - `--enforce-lockfile` on that same lock refuses the retry, and dropping the flag re-resolves: measured against pub.dev, `xml` 6.5.0 became 7.0.1, so a "recovery" would have shipped packages the lock does not name. - It was also gated on `wrong content-hash`, while the outage's other half is `Package not available (could not find package qr_flutter ...)` — mirror metadata whose `archive_url` 404s. So retry on any failure, after rewriting the host in the lock, and prove the retry did not move a version: every line except `url:` must be byte-identical, or the step fails rather than build against a drifted resolution. The host goes into `$GITHUB_ENV` too, since the build steps resolve again. Verified locally against the live mirror: the failing path emits the warning, `seds` 125 hosts, resolves on pub.dev, keeps `xml` 6.5.0, and writes both variables to `$GITHUB_ENV`; the happy path leaves the lock untouched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
OHOS unsigned hap / Build unsigned hapjob was failing before build steps due to intermittent package integrity mismatches from the configured pub mirror (pub.flutter-io.cn). This change keeps the normal mirror path but adds a targeted fallback so release jobs can proceed when that specific mirror failure occurs.Problem scope
Resolve dependencies(flutter pub get) withwrong content-hash, causing the OHOS workflow to abort beforeBuild unsigned hap.Workflow change (
.github/workflows/ohos-release.yml)flutter pub get --enforce-lockfile.wrong content-hash, retry once withPUB_HOSTED_URL=https://pub.dev,Why this is minimal