Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NR-383508] Sync develop branch with main branch #24

Open
wants to merge 78 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
b35a4b1
modified lambda-template with /src as codeUri. Region wise S3 gets ad…
ahegdeNR Dec 9, 2024
a03f176
modified how the yaml file changes by adding a script
ahegdeNR Dec 12, 2024
33a1f75
added lambda trigger script and some common stack script to validate …
ahegdeNR Dec 19, 2024
de62b23
added cloudwatch trigger script
ahegdeNR Dec 24, 2024
c80e547
added ci/cd automation to run tests during merge
ahegdeNR Dec 30, 2024
22cd0a9
fixed missing permission to fetch secrets from github secrets
ahegdeNR Dec 30, 2024
dd18908
fixed constants for scripts
ahegdeNR Dec 30, 2024
e5e49c3
moved license key to github secrets
ahegdeNR Dec 31, 2024
4349ebb
fixed filter pattern json format in template parameters
ahegdeNR Dec 31, 2024
93f5be7
fixes
ahegdeNR Dec 31, 2024
9514269
modified bucket name and log group name, build all templates
ahegdeNR Dec 31, 2024
be1fdb4
Merge pull request #10 from newrelic/local-deployment-support
ahegdeNR Jan 6, 2025
b03fcc9
code refactoring and fixes
ahegdeNR Jan 7, 2025
1b398af
fixes
ahegdeNR Jan 7, 2025
3925822
fixes
ahegdeNR Jan 7, 2025
c9ce5aa
updated permissions for common script
ahegdeNR Jan 7, 2025
f9a6d38
removed other templates from getting packaged and published as part o…
ahegdeNR Jan 7, 2025
e2f6a1c
modified parameters file name in triggers
ahegdeNR Jan 7, 2025
ef69275
removed parallelization of script
ahegdeNR Jan 7, 2025
41fd962
removed parallelization of script
ahegdeNR Jan 7, 2025
20adcf8
fixes
ahegdeNR Jan 7, 2025
5f7c392
fixes
ahegdeNR Jan 7, 2025
7c44eb6
fixes
ahegdeNR Jan 7, 2025
0def76a
add parallelization to running scripts
ahegdeNR Jan 7, 2025
94720fc
modified e2e tests to run during push workflow
ahegdeNR Jan 7, 2025
6114fe8
review fixes, comments and retries
ahegdeNR Jan 8, 2025
bd7278c
Merge branch 'develop' into NR-334397-e2e-testing-automation-part-1-test
ahegdeNR Jan 10, 2025
2397044
review fixes, comments and retries
ahegdeNR Jan 10, 2025
eb6a5e1
Merge pull request #13 from newrelic/NR-334397-e2e-testing-automation…
ahegdeNR Jan 13, 2025
a32827d
created events for cloudwatch, s3 and validating logs are present in …
ahegdeNR Jan 15, 2025
2248acd
fixes
ahegdeNR Jan 17, 2025
7924022
fixes
ahegdeNR Jan 17, 2025
3df901e
fixes
ahegdeNR Jan 17, 2025
e14079c
fixes
ahegdeNR Jan 17, 2025
fd2eb85
fixes
ahegdeNR Jan 17, 2025
c9d7f6f
fixes
ahegdeNR Jan 17, 2025
b119f50
fixes
ahegdeNR Jan 17, 2025
5fc970f
fixes
ahegdeNR Jan 19, 2025
ce2b778
fixes
ahegdeNR Jan 19, 2025
244d0c1
fixes
ahegdeNR Jan 19, 2025
062ccfe
fixes
ahegdeNR Jan 20, 2025
363b1f2
fixes
ahegdeNR Jan 20, 2025
b9d8401
fixes
ahegdeNR Jan 21, 2025
96d9333
fixes
ahegdeNR Jan 21, 2025
0521e7d
fixes
ahegdeNR Jan 21, 2025
8c7f08f
fixes
ahegdeNR Jan 21, 2025
39d0ee1
fixes
ahegdeNR Jan 21, 2025
2e07043
parsing requestId from message and stamping it as attribute (#12)
hrai-nr Jan 21, 2025
108ca4c
Merge branch 'develop' into NR-347440-e2e-event-creation
ahegdeNR Jan 22, 2025
a473916
fixes
ahegdeNR Jan 22, 2025
dfb4583
fixes
ahegdeNR Jan 29, 2025
73b80e6
fixes
ahegdeNR Feb 3, 2025
2a18eae
testing on pull request
ahegdeNR Feb 4, 2025
3511b81
testing on pull request
ahegdeNR Feb 4, 2025
7b99c52
fixes
ahegdeNR Feb 4, 2025
c0b5c07
fixes
ahegdeNR Feb 4, 2025
f070394
fixes
ahegdeNR Feb 4, 2025
7a8244d
fixes
ahegdeNR Feb 4, 2025
cf9ee11
fixes
ahegdeNR Feb 4, 2025
83d8ee0
fixes
ahegdeNR Feb 5, 2025
2820a28
fixes
ahegdeNR Feb 10, 2025
fa17d67
fixes
ahegdeNR Feb 10, 2025
99ab363
parallelised template build and made it run once only for the tests
ahegdeNR Feb 11, 2025
7faddac
fixes
ahegdeNR Feb 11, 2025
b72039f
send slack notification on failure
ahegdeNR Feb 11, 2025
262157c
fixes
ahegdeNR Feb 11, 2025
2150b04
fixes
ahegdeNR Feb 11, 2025
3612720
fixes
ahegdeNR Feb 11, 2025
eefc09c
fixes
ahegdeNR Feb 11, 2025
6ed1c9c
fixes
ahegdeNR Feb 11, 2025
ae7b378
fixes
ahegdeNR Feb 11, 2025
e1ece89
fixes
ahegdeNR Feb 11, 2025
6e4ed72
fixes
ahegdeNR Feb 11, 2025
5f9e08f
added e2e tests to run once every month as cron job
ahegdeNR Feb 11, 2025
2b48523
Merge pull request #17 from newrelic/NR-347440-e2e-event-creation
ahegdeNR Feb 17, 2025
9396bb1
[NR-352205] E2E tests to validate metrics with logging integration te…
ahegdeNR Feb 25, 2025
60bab1c
moving version number to a different file named version.go
hrai-nr Mar 4, 2025
e10d43b
updated entity_synthesis_param.cfg file with version change and new line
ahegdeNR Apr 3, 2025
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
3 changes: 2 additions & 1 deletion .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Pull Request Workflow
on:
pull_request:
branches:
- develop
- main

jobs:
Expand Down Expand Up @@ -124,7 +125,7 @@ jobs:
go tool cover -html=coverage/coverage.out -o coverage/coverage.html

- name: Upload Coverage Report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: src/coverage/coverage.html
4 changes: 2 additions & 2 deletions .github/workflows/release-lambda-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
cd ..

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: log-forwarder-zip
path: |
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:

steps:
- name: Download Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: log-forwarder-zip
path: ./build-artifacts
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/release-template-files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ jobs:
run: |
pip install aws-sam-cli

# modify lambda CodeUri to production as s3 bucket destination
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install ruamel
run: |
python -m pip install --upgrade pip
pip install ruamel.yaml

- name: Run Python Script to Update lambda-template.yaml
run: python workflow-scripts/update_lambda_template.py

- name: Verify the changes
run: cat lambda-template.yaml

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
Expand Down
241 changes: 241 additions & 0 deletions .github/workflows/run-e2e-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
name: E2E Test Workflow

on:
pull_request_review:
types:
- submitted
schedule:
- cron: '0 0 1 * *'

jobs:
build-templates:
if: github.event.review.state == 'approved'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
strategy:
matrix:
TEMPLATE_FILE: [lambda-template, logging-lambda-firehose-template, logging-lambda-metric-polling, logging-lambda-metric-stream, logging-firehose-metric-polling, logging-firehose-metric-stream, logging-lambda-firehose-metric-polling, logging-lambda-firehose-metric-stream]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Install AWS SAM CLI
run: |
pip install aws-sam-cli

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_E2E_ROLE }}
aws-region: us-east-1

- name: Build SAM Application
env:
S3_BUCKET: unified-lambda-e2e-test-templates
run: |
sam build -u --template-file "${{ matrix.TEMPLATE_FILE }}.yaml" --build-dir ".aws-sam/build/${{ matrix.TEMPLATE_FILE }}"
sam package --s3-bucket "$S3_BUCKET" --template-file ".aws-sam/build/${{ matrix.TEMPLATE_FILE }}/template.yaml" --output-template-file ".aws-sam/build/${{ matrix.TEMPLATE_FILE }}/${{ matrix.TEMPLATE_FILE }}.yaml"

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.TEMPLATE_FILE }}.yaml
path: .aws-sam/build/${{ matrix.TEMPLATE_FILE }}/${{ matrix.TEMPLATE_FILE }}.yaml

- name: Send failure notification to Slack
if: always()
uses: ravsamhq/notify-slack-action@v1
with:
status: ${{ job.status }}
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

run-e2e-tests-cloudwatch:
needs: [build-templates]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
strategy:
matrix:
test-case: [test_logs_with_filter_pattern, test_logs_for_secret_manager, test_logs_for_invalid_log_group]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download Artifact
uses: actions/download-artifact@v4
with:
path: build-artifacts

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Install AWS SAM CLI
run: |
pip install aws-sam-cli

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_E2E_ROLE }}
aws-region: us-east-1

- name: Run e2e tests for cloudwatch
env:
NEW_RELIC_USER_KEY: ${{ secrets.NEW_RELIC_USER_KEY }}
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
run: |
cd e2e-tests
./lambda-cloudwatch-trigger.sh ${{ matrix.test-case }}

- name: Send failure notification to Slack
if: always()
uses: ravsamhq/notify-slack-action@v1
with:
status: ${{ job.status }}
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

run-e2e-tests-s3:
needs: [build-templates]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
strategy:
matrix:
test-case: [test_logs_for_prefix, test_logs_for_secret_manager, test_logs_for_invalid_bucket_name]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download Artifact
uses: actions/download-artifact@v4
with:
path: build-artifacts

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Install AWS SAM CLI
run: |
pip install aws-sam-cli

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_E2E_ROLE }}
aws-region: us-east-1

- name: Run e2e tests for s3
env:
NEW_RELIC_USER_KEY: ${{ secrets.NEW_RELIC_USER_KEY }}
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
run: |
cd e2e-tests
./lambda-s3-trigger.sh ${{ matrix.test-case }}

- name: Send failure notification to Slack
if: always()
uses: ravsamhq/notify-slack-action@v1
with:
status: ${{ job.status }}
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

run-e2e-tests-lambda-firehose-metrics:
needs: [build-templates]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
strategy:
matrix:
test-case: [test_for_lambda_firehose_stack, test_for_firehose_metric_polling_stack, test_for_firehose_metric_streaming_stack, test_for_lambda_metrics_polling_stack, test_for_lambda_metrics_streaming_stack, test_for_lambda_firehose_metric_polling_stack, test_for_lambda_firehose_metric_streaming_stack]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download Artifact
uses: actions/download-artifact@v4
with:
path: build-artifacts

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Install AWS SAM CLI
run: |
pip install aws-sam-cli

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_E2E_ROLE }}
aws-region: us-east-1

- name: Run e2e tests for lambda and metrics stack
env:
NEW_RELIC_USER_KEY: ${{ secrets.NEW_RELIC_USER_KEY }}
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
run: |
cd e2e-tests/
./lambda-with-metrics-test.sh ${{ matrix.test-case }}

- name: Send failure notification to Slack
if: always()
uses: ravsamhq/notify-slack-action@v1
with:
status: ${{ job.status }}
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

clean-up:
needs: [run-e2e-tests-cloudwatch, run-e2e-tests-s3, run-e2e-tests-lambda-firehose-metrics]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Install AWS SAM CLI
run: |
pip install aws-sam-cli

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_E2E_ROLE }}
aws-region: us-east-1

- name: Delete Resources
env:
S3_BUCKET: unified-lambda-e2e-test-templates
run:
aws s3 rm "s3://$S3_BUCKET" --recursive

- name: Send failure notification to Slack
if: always()
uses: ravsamhq/notify-slack-action@v1
with:
status: ${{ job.status }}
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
4 changes: 4 additions & 0 deletions e2e-tests/common-scripts/entity_synthesis_param.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Entity synthesis Parameters , aws related params are dropped in pipeline.
instrumentation_provider=aws
instrumentation_name=lambda
instrumentation_version=1.1.0
Loading
Loading