-
Notifications
You must be signed in to change notification settings - Fork 254
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
chore(repo): Expand CW Metric logging to all tests #3912
Changes from 10 commits
8fc67b1
5f63e70
98432de
b19c40b
28435df
fbce880
ef38ff6
3c01a85
03a8358
0055bf5
ff8fc13
4d6e399
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,11 @@ inputs: | |
github-token: | ||
required: true | ||
description: Github token for requesting failing steps. | ||
package-name: | ||
description: The name of the package being tested | ||
working-directory: | ||
description: The working directory relative to the repo root. | ||
required: true | ||
matrix: | ||
description: The matrix of the workflow | ||
required: true | ||
|
||
# Global Metric Dimensions | ||
metric-name: | ||
|
@@ -22,9 +21,6 @@ inputs: | |
test-type: | ||
description: canary, integration, unit testType. | ||
required: true | ||
category: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is now computed based on working-directory |
||
description: analytics, api, authenticator, etc. | ||
required: true | ||
|
||
# FlutterDart Workflows Metric Dimensions | ||
framework: | ||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,8 +22,8 @@ inputs: | |
test-type: | ||
description: canary, e2e, unit | ||
required: true | ||
package-name: | ||
description: The name of the package being tested | ||
working-directory: | ||
description: The working directory relative to the repo root. | ||
required: true | ||
|
||
# FlutterDart Workflows Metric Dimensions | ||
|
@@ -85,8 +85,8 @@ runs: | |
|
||
metric-name: "github_metric_1.0" | ||
test-type: ${{ inputs.test-type }} | ||
package-name: ${{ inputs.package-name }} | ||
matrix: ${{ toJson(matrix) }} | ||
working-directory: ${{ inputs.working-directory }} | ||
matrix: ${{ toJson(matrix) != 'null' && toJson(matrix) || '' }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not following this. Is there a way to write this more clearly in code? If not, can you add a comment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, this code can be improved. Updated to:
If the matrix value is empty we send a blank {} else we convert to json and send back. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to handle null matrix cases |
||
|
||
framework: ${{ inputs.framework }} | ||
flutter-dart-channel: ${{ inputs.flutter-dart-channel }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,10 @@ defaults: | |
run: | ||
shell: bash | ||
|
||
permissions: read-all | ||
# These permissions are needed to interact with GitHub's OIDC Token endpoint. | ||
permissions: | ||
id-token: write | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is write access needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting the permissions to write is required in order to request an OpenID Connect JWT. Removing this permission causes logging to fail to assume the token. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need a token in order to post the log to cloudwatch, I assume? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that's correct. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This utilizes the same framework that AppSec signed off several months ago when we just started sending Cloudwatch logs from our canaries. |
||
contents: read | ||
|
||
# Cancels in-progress job when there is another push to same ref. | ||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow | ||
|
@@ -89,6 +92,7 @@ concurrency: | |
jobs: | ||
test: | ||
uses: ./.github/workflows/flutter_vm.yaml | ||
secrets: inherit | ||
with: | ||
package-name: amplify_analytics_pinpoint | ||
working-directory: packages/analytics/amplify_analytics_pinpoint | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,10 @@ on: | |
defaults: | ||
run: | ||
shell: bash | ||
permissions: read-all | ||
# These permissions are needed to interact with GitHub's OIDC Token endpoint. | ||
permissions: | ||
id-token: write | ||
contents: read | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All workflows need these permissions now in order to send the Cloudwatch Metric |
||
|
||
# Cancels in-progress job when there is another push to same ref. | ||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow | ||
|
@@ -29,6 +32,7 @@ concurrency: | |
jobs: | ||
android: | ||
uses: ./.github/workflows/flutter_android.yaml | ||
secrets: inherit | ||
with: | ||
example-directory: packages/analytics/amplify_analytics_pinpoint/example | ||
package-name: amplify_analytics_pinpoint | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch parameter sent because package-name does not give sufficient information on category information for smithy and other minor categories.