fix(ci): align UploadDependenciesCN test-repo S3 key with build_id - #2224
Open
fedeghiglio wants to merge 1 commit into
Open
fix(ci): align UploadDependenciesCN test-repo S3 key with build_id#2224fedeghiglio wants to merge 1 commit into
fedeghiglio wants to merge 1 commit into
Conversation
China EC2 integration tests download the pre-cloned test repo tarball from s3://<cn-bucket>/integration-test/cloudwatch-agent-test-repo/<cwa_github_sha>.tar.gz where cwa_github_sha is the workflow build_id. UploadDependenciesCN, the only producer of that tarball, uploaded it keyed by github.sha instead. When build_id differs from the commit SHA (e.g. a release-candidate build number), the CN terraform download misses the tarball; the github.com clone fallback then fails because GitHub is unreachable inside the China partition, cascading to 'install_agent.go: no such file or directory' and failing every CN al2023 test. Align the upload key with build_id, matching StartLocalStackCN, StopLocalStackCN, and every other CN/ITAR consumer (all of which already use inputs.build_id).
okankoAMZ
approved these changes
Jul 31, 2026
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.
Description of the issue
The China (
cn-north-1) EC2 integration tests were failing on everyal2023test case. The
EC2LinuxCNterraform downloads a pre-cloned copy of the testrepo as a tarball from S3, at:
where
cwa_github_shais set from the workflow'sbuild_id. The only job thatproduces that tarball,
UploadDependenciesCN, was uploading it keyed by${{ github.sha }}instead of${{ inputs.build_id }}.When
build_idand the commit SHA differ (for example, whenbuild_idis arelease-candidate build number rather than a commit SHA), the CN download misses
the tarball. The download step then falls back to cloning the test repo directly
from github.com — which is unreachable from inside the China partition — so the
test dependencies never land on the instance. This cascades to
install_agent.go: no such file or directoryand fails every CNal2023test.Description of changes
Change the
github_shainput ofUploadDependenciesCNfrom${{ github.sha }}to
${{ inputs.build_id }}, so the upload key matches the key the CN downloaduses. This aligns the producer with
StartLocalStackCN,StopLocalStackCN, andthe other CN/ITAR consumers, all of which already reference
inputs.build_id.region: cn-north-1 test_repo_name: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_NAME }} test_repo_branch: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }} - github_sha: ${{github.sha}} + github_sha: ${{ inputs.build_id }} s3_integration_bucket: ${{ vars.S3_INTEGRATION_BUCKET_CN }} terraform_assume_role: ${{ vars.TERRAFORM_AWS_ASSUME_ROLE_CN }}One-line change, no behavior change outside the CN artifact upload key.
License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
Ran the full Test Artifacts workflow from this branch:
https://github.com/aws/amazon-cloudwatch-agent/actions/runs/30446999400
All China jobs passed — the tarball is now found and no github.com clone
fallback occurs:
UploadDependenciesCN— successStartLocalStackCN— successEC2LinuxCN— all 13al2023test cases pass (cloudwatchlogs,xray,otlp,metric_dimension,metric_value_benchmark,restart,run_as_user,ssm_document,ca_bundle,collection_interval,entity_metrics_benchmark,feature_linux_journald_logs,log_state_journald)StopLocalStackCN— successFor comparison, before this change the same 13
EC2LinuxCNcases failed 13/13.Note: the overall workflow run is marked failed due to unrelated test failures
on other platforms (GPU/EFA capacity on some EKS jobs, a
TestDbiassertion,and a few known-flaky SELinux/Windows cases). None are in the CN path and none
are affected by this change.