Skip to content

Use flavor-specific artifact names to avoid S3 upload collision#18578

Merged
manuelcandales merged 1 commit intomainfrom
manuel/fix-android-release-on-tag-flavor-collision
Mar 30, 2026
Merged

Use flavor-specific artifact names to avoid S3 upload collision#18578
manuelcandales merged 1 commit intomainfrom
manuel/fix-android-release-on-tag-flavor-collision

Conversation

@manuelcandales
Copy link
Copy Markdown
Contributor

When android-release-on-tag calls this workflow for multiple flavors, they share the same run_id and S3 prefix. Naming the intermediate artifact executorch-${FLAVOR}.aar prevents the second and third uploads from failing with "file already exists".

When android-release-on-tag calls this workflow for multiple flavors,
they share the same run_id and S3 prefix. Naming the intermediate
artifact executorch-${FLAVOR}.aar prevents the second and third
uploads from failing with "file already exists".
Copilot AI review requested due to automatic review settings March 30, 2026 15:02
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Mar 30, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18578

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 30, 2026
@github-actions
Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copy link
Copy Markdown
Contributor

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 Android release workflow to use flavor-specific intermediate artifact names so multiple flavor builds in the same run don’t collide during S3 artifact upload/download.

Changes:

  • Rename the produced AAR artifact to include the build flavor (executorch-${FLAVOR}.aar).
  • Update the S3 artifact download step to fetch the flavor-specific AAR before uploading to the public release bucket.

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

Comment on lines +148 to +150
cp aar-out/executorch.aar "${ARTIFACTS_DIR_NAME}/executorch-${FLAVOR}.aar"

shasum -a 256 "${ARTIFACTS_DIR_NAME}/executorch.aar"
shasum -a 256 "${ARTIFACTS_DIR_NAME}/executorch-${FLAVOR}.aar"
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

FLAVOR can be empty (e.g., schedule runs and workflow_dispatch has no default). In that case this will create/upload an artifact named executorch-.aar, while the upload job later defaults empty FLAVOR to xnnpack and tries to download executorch-xnnpack.aar, causing the workflow to fail. Set a default for FLAVOR in the build step before using it in the artifact filename (and ideally reuse the same defaulting logic across jobs).

Copilot uses AI. Check for mistakes.
Comment on lines +183 to +185
wget https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/executorch-${FLAVOR}.aar
mv executorch-${FLAVOR}.aar executorch.aar
shasum -a 256 executorch.aar > executorch.aar.sha256sums
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

This step assumes the flavor-specific artifact exists at .../executorch-${FLAVOR}.aar. If FLAVOR was empty in the build job (possible for schedule/manual dispatch), the artifact would have been named executorch-.aar and this download will 404. Ensure FLAVOR is consistently defaulted/validated in both the build and upload jobs (or make flavor required for the triggers that use this workflow).

Copilot uses AI. Check for mistakes.
@manuelcandales manuelcandales merged commit 330a567 into main Mar 30, 2026
161 of 170 checks passed
@manuelcandales manuelcandales deleted the manuel/fix-android-release-on-tag-flavor-collision branch March 30, 2026 15:07
@manuelcandales
Copy link
Copy Markdown
Contributor Author

@pytorchbot cherry-pick --onto release/1.2 -c critical

pytorchbot pushed a commit that referenced this pull request Mar 30, 2026
When android-release-on-tag calls this workflow for multiple flavors,
they share the same run_id and S3 prefix. Naming the intermediate
artifact executorch-${FLAVOR}.aar prevents the second and third uploads
from failing with "file already exists".

(cherry picked from commit 330a567)
@pytorchbot
Copy link
Copy Markdown
Collaborator

Cherry picking #18578

The cherry pick PR is at #18581 and it is recommended to link a critical cherry pick PR with an issue. The following tracker issues are updated:

Details for Dev Infra team Raised by workflow job

rascani pushed a commit to rascani/executorch that referenced this pull request Apr 1, 2026
…rch#18578)

When android-release-on-tag calls this workflow for multiple flavors,
they share the same run_id and S3 prefix. Naming the intermediate
artifact executorch-${FLAVOR}.aar prevents the second and third uploads
from failing with "file already exists".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants