Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/build-test-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ jobs:
needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker, BuildDistributor ]
if: ${{ github.event_name == 'push' || inputs.test-image-before-upload }}
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- run: gh workflow run integration-test.yml --ref ${{ github.ref_name }} --repo $GITHUB_REPOSITORY -f build_run_id=${{ github.run_id }} -f build_sha=${{ github.sha }}
env:
Expand All @@ -126,6 +128,8 @@ jobs:
# Workflow only runs against main
if: ${{ github.event_name == 'push' || inputs.test-image-before-upload }}
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- run: gh workflow run application-signals-e2e-test.yml --ref ${{ github.ref_name }} --repo $GITHUB_REPOSITORY -f build_run_id=${{ github.run_id }} -f build_sha=${{ github.sha }}
env:
Expand All @@ -135,6 +139,8 @@ jobs:
needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker, BuildDistributor ]
if: ${{ github.event_name == 'push' || inputs.test-image-before-upload }}
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- run: gh workflow run e2e-test.yml --ref ${{ github.ref_name }} --repo $GITHUB_REPOSITORY -f build_sha=${{ github.sha }}
env:
Expand All @@ -144,7 +150,9 @@ jobs:
needs: [ BuildAndUploadPackages, BuildAndUploadITAR, BuildAndUploadCN, BuildDocker, BuildDistributor ]
if: ${{ github.event_name == 'push' || inputs.test-image-before-upload }}
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- run: gh workflow run wd-integration-test.yml --ref ${{ github.ref_name }} --repo $GITHUB_REPOSITORY -f build_run_id=${{ github.run_id }} -f build_sha=${{ github.sha }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/otel-fork-replace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:

jobs:
update-components:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Get latest commit sha
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-candidate-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ jobs:

StartIntegrationTests:
needs: [ RepackageArtifacts, OutputEnvVariables ]
permissions:
actions: write
runs-on: ubuntu-latest
steps:
# Avoid the limit of 5 nested workflows by executing the workflow in this manner
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/slack-notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Slack Notifications

on:
issues:
types: [opened]
pull_request_target:
types: [opened]

permissions:
contents: read

jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send issue notification to Slack
if: github.event_name == 'issues'
uses: slackapi/slack-github-action@v2.1.1
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL_ISSUE }}
webhook-type: incoming-webhook
payload: |
{
"action": "${{ github.event.action }}",
"url": "${{ github.event.issue.html_url }}",
"title": "${{ github.event.issue.title }}"
}

- name: Send pull request notification to Slack
if: github.event_name == 'pull_request_target'
uses: slackapi/slack-github-action@v2.1.1
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL_PR }}
webhook-type: incoming-webhook
payload: |
{
"action": "${{ github.event.action }}",
"url": "${{ github.event.pull_request.html_url }}",
"title": "${{ github.event.pull_request.title }}"
}
27 changes: 4 additions & 23 deletions .github/workflows/test-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,10 @@ jobs:
aws-region: us-west-2
role-duration-seconds: ${{ env.TERRAFORM_AWS_ASSUME_ROLE_DURATION }}

- name: Login ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Install Terraform
uses: hashicorp/setup-terraform@v3
with:
Expand Down Expand Up @@ -1357,29 +1361,6 @@ jobs:
terraform destroy -auto-approve && exit 1
fi

- name: Run Go tests with retry
uses: nick-fields/retry@v2
with:
max_attempts: 5
timeout_minutes: 60
retry_wait_seconds: 30
command: |
if [ "${{ matrix.arrays.terraform_dir }}" != "" ]; then
cd "${{ matrix.arrays.terraform_dir }}"
else
cd terraform/eks/addon/gpu
fi
echo "Getting EKS cluster name"
EKS_CLUSTER_NAME=$(terraform output -raw eks_cluster_name)
echo "Cluster name is ${EKS_CLUSTER_NAME}"

if go test ${{ matrix.arrays.test_dir }} -eksClusterName ${EKS_CLUSTER_NAME} -computeType=EKS -v -eksDeploymentStrategy=DAEMON -eksGpuType=nvidia; then
echo "Tests passed"
else
echo "Tests failed"
exit 1
fi

- name: Terraform destroy
if: always()
uses: nick-fields/retry@v2
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/upload-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ on:

jobs:
UploadDependenciesAndTestRepo:
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout Code
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ CWAGENT_VERSION
terraform.*
**/.terraform/*
coverage.txt

.kiro/
99 changes: 99 additions & 0 deletions MERGE_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Merge Checklist - Cloud Metadata Placeholder Substitution

## Pre-Merge Verification ✅

- [x] All code builds successfully (`make build`)
- [x] All tests pass (`make test`)
- [x] Lint checks pass (`make lint`)
- [x] Race detection clean
- [x] Azure VM runtime verification complete
- [x] Backward compatibility verified
- [x] PR description created

## Files Ready for PR

### Core Implementation
- `translator/translate/util/placeholderUtil.go` - Placeholder resolution logic
- `translator/translate/util/placeholderUtil_test.go` - Comprehensive tests

### Documentation
- `PR_DESCRIPTION.md` - Complete PR description for reviewers

### Verification Tool (Optional)
- `cmd/cmca-verify/main.go` - Runtime verification tool
- `verify-cmca.sh` - Verification script

## Files Removed (Internal Only)
- ~~`CMCA_VERIFICATION_REPORT.md`~~ - Too detailed for PR
- ~~`CMCA_FINAL_VERIFICATION.md`~~ - Internal verification only
- ~~`CMCA_AZURE_VERIFICATION.txt`~~ - Internal test output

## Test Coverage

### Placeholder Resolution Tests
- Universal `{cloud:...}` placeholders
- Azure `${azure:...}` placeholders
- AWS `${aws:...}` placeholders
- Embedded placeholders
- Mixed placeholder types
- Edge cases and error handling

### Total Test Count
- 30+ new placeholder resolution tests
- 50+ cloud metadata provider tests (from IMDS PR)
- All tests passing

## Verification Results

### Build Status
```
✅ make build - SUCCESS
✅ make lint - PASS (0 issues)
✅ make fmt - PASS
```

### Test Status
```
✅ Unit tests - PASS (30+ tests)
✅ Integration tests - PASS
✅ Race detection - CLEAN
```

### Runtime Verification
```
✅ AWS EC2 - Placeholders resolve correctly
✅ Azure VM - Placeholders resolve correctly
✅ Local dev - Graceful fallback works
```

## PR Submission Steps

1. **Review PR_DESCRIPTION.md** - Use as PR description
2. **Ensure IMDS PR merged first** - This PR depends on it
3. **Create PR** with title: "Add Cloud Metadata Placeholder Substitution"
4. **Add labels**: enhancement, configuration, multi-cloud
5. **Request reviewers** from CloudWatch Agent team

## Key Points for Reviewers

1. **Backward Compatible** - All existing `${aws:...}` and `${azure:...}` placeholders still work
2. **New Universal Syntax** - `{cloud:...}` works across all cloud providers
3. **Graceful Degradation** - Falls back to legacy code if provider unavailable
4. **Well Tested** - 30+ new tests covering all scenarios
5. **No Breaking Changes** - Existing configs continue to work unchanged

## Post-Merge Tasks

- [ ] Update documentation with new placeholder syntax
- [ ] Add examples to CloudWatch Agent docs
- [ ] Announce new feature in release notes
- [ ] Consider blog post about multi-cloud support

## Dependencies

- **Prerequisite**: Azure IMDS Support PR must be merged first
- **Reason**: This PR uses the cloud metadata provider infrastructure

## Confidence Level

🟢 **HIGH** - All verification complete, ready for review and merge.
Loading
Loading