Skip to content

Commit eba42a9

Browse files
authored
Merge branch 'main' into default-log-concurrency
2 parents 30db968 + df626d1 commit eba42a9

File tree

5 files changed

+49
-5
lines changed

5 files changed

+49
-5
lines changed

.github/workflows/build-test-artifacts.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ on:
1515
- '!.github/workflows/build-test-artifacts.yml'
1616
- '!.github/workflows/integration-test.yml'
1717
- '!.github/workflows/application-signals-e2e-test.yml'
18+
schedule:
19+
- cron: '0 11 * * 1,2,3,4,5' # Every day at 11:00 UTC on Monday to Friday
1820
workflow_dispatch:
1921
inputs:
2022
test-image-before-upload:

.github/workflows/eks-e2e-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
terraform init
122122
if terraform apply --auto-approve \
123123
-var="region=${{ inputs.region }}" \
124-
-var="k8s_version=${{ matrix.arrays.k8s_version }}" \
124+
-var="k8s_version=${{ matrix.arrays.k8sVersion }}" \
125125
-var="nodes=${{ matrix.arrays.nodes }}" \
126126
-var="helm_charts_branch=${{ inputs.helm_charts_branch }}" \
127127
-var="cloudwatch_agent_repository_url=${{ steps.login-ecr.outputs.registry }}" \

.github/workflows/test-artifacts.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }}
5858
CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }}
5959
CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}
60+
CWA_COMMIT_DATE: ${{ steps.get-commit-date.outputs.commit_date }}
6061
steps:
6162
- name: SetOutputs
6263
id: set-outputs
@@ -67,12 +68,51 @@ jobs:
6768
echo "CWA_GITHUB_TEST_REPO_URL=${{ env.CWA_GITHUB_TEST_REPO_URL }}" >> "$GITHUB_OUTPUT"
6869
echo "CWA_GITHUB_TEST_REPO_BRANCH=${CWA_GITHUB_TEST_REPO_BRANCH:-${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}}" >> "$GITHUB_OUTPUT"
6970
71+
- name: Checkout agent repository for commit date
72+
uses: actions/checkout@v3
73+
with:
74+
repository: aws/amazon-cloudwatch-agent
75+
fetch-depth: 0
76+
path: agent-repo
77+
78+
- name: Get commit date
79+
id: get-commit-date
80+
run: |
81+
cd agent-repo # Navigate to agent repo checkout
82+
echo "Extracting commit date from agent repository..."
83+
84+
# Get commit date as Unix timestamp, fallback to 0 for easier backfilling
85+
if [[ "${{ inputs.build_id }}" =~ ^[0-9a-f]{40}$ ]]; then
86+
# Full SHA - get date from git log
87+
echo "Full SHA detected: ${{ inputs.build_id }}"
88+
COMMIT_DATE=$(git log -1 --format=%ct ${{ inputs.build_id }} 2>/dev/null || echo "0")
89+
elif [[ "${{ inputs.build_id }}" =~ ^[0-9]+\.[0-9]+\.[0-9a-f]+$ ]]; then
90+
# Version format like 1.300057.1b1168 - extract SHA and get date
91+
SHA_PART=$(echo "${{ inputs.build_id }}" | sed 's/.*\.//')
92+
echo "Version format detected, extracted SHA: $SHA_PART"
93+
COMMIT_DATE=$(git log -1 --format=%ct --grep="$SHA_PART" 2>/dev/null || echo "0")
94+
else
95+
# Fallback to 0 for easier backfilling of historical data
96+
echo "Unknown format, using 0 for easier backfilling"
97+
COMMIT_DATE="0"
98+
fi
99+
100+
echo "commit_date=${COMMIT_DATE}" >> $GITHUB_OUTPUT
101+
echo "Retrieved commit date: ${COMMIT_DATE} for build_id: ${{ inputs.build_id }}"
102+
103+
if [[ "$COMMIT_DATE" != "0" ]]; then
104+
echo "SUCCESS: Found commit date ${COMMIT_DATE}"
105+
else
106+
echo "Using 0 - can be backfilled later with historical data"
107+
fi
108+
70109
- name: Echo test variables
71110
run: |
72111
echo "build_id: ${{ inputs.build_id }}"
73112
echo "CWA_GITHUB_TEST_REPO_NAME: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_NAME }}"
74113
echo "CWA_GITHUB_TEST_REPO_URL: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_URL }}"
75114
echo "CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}"
115+
echo "CWA_COMMIT_DATE: ${{ steps.get-commit-date.outputs.commit_date }}"
76116
77117
- uses: actions/checkout@v3
78118
with:
@@ -941,7 +981,7 @@ jobs:
941981
-var="test_dir=${{ matrix.arrays.test_dir }}"\
942982
-var="cwagent_image_repo=${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_INTEGRATION_TEST_REPO }}" \
943983
-var="cwagent_image_tag=${{ inputs.build_id }}" \
944-
-var="k8s_version=${{ matrix.arrays.k8s_version }}"; then
984+
-var="k8s_version=${{ matrix.arrays.k8sVersion }}"; then
945985
terraform destroy -auto-approve
946986
else
947987
terraform destroy -auto-approve && exit 1
@@ -1005,6 +1045,7 @@ jobs:
10051045
if terraform apply --auto-approve \
10061046
-var="ssh_key_value=${PRIVATE_KEY}" \
10071047
-var="cwa_github_sha=${{ inputs.build_id }}" \
1048+
-var="cwa_github_sha_date=${{ needs.OutputEnvVariables.outputs.CWA_COMMIT_DATE }}" \
10081049
-var="ami=${{ matrix.arrays.ami }}" \
10091050
-var="arc=${{ matrix.arrays.arc }}" \
10101051
-var="s3_bucket=${S3_INTEGRATION_BUCKET}" \
@@ -1069,6 +1110,7 @@ jobs:
10691110
if terraform apply --auto-approve \
10701111
-var="ssh_key_value=${PRIVATE_KEY}" \
10711112
-var="cwa_github_sha=${{ inputs.build_id }}" \
1113+
-var="cwa_github_sha_date=${{ needs.OutputEnvVariables.outputs.CWA_COMMIT_DATE }}" \
10721114
-var="ami=${{ matrix.arrays.ami }}" \
10731115
-var="arc=${{ matrix.arrays.arc }}" \
10741116
-var="s3_bucket=${S3_INTEGRATION_BUCKET}" \

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ require (
343343
github.com/go-playground/locales v0.14.1 // indirect
344344
github.com/go-playground/universal-translator v0.18.1 // indirect
345345
github.com/go-resty/resty/v2 v2.16.3 // indirect
346-
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
346+
github.com/go-viper/mapstructure/v2 v2.3.0 // indirect
347347
github.com/go-zookeeper/zk v1.0.4 // indirect
348348
github.com/goccy/go-json v0.10.5 // indirect
349349
github.com/godbus/dbus/v5 v5.1.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,8 @@ github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1v
641641
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
642642
github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31 h1:28FVBuwkwowZMjbA7M0wXsI6t3PYulRTMio3SO+eKCM=
643643
github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
644-
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
645-
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
644+
github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk=
645+
github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
646646
github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw=
647647
github.com/go-zookeeper/zk v1.0.4 h1:DPzxraQx7OrPyXq2phlGlNSIyWEsAox0RJmjTseMV6I=
648648
github.com/go-zookeeper/zk v1.0.4/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw=

0 commit comments

Comments
 (0)