(contributing): Build failures don't always include `!!!!!!!!`
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 74
Description
### Describe the bug
When a PR CodeBuild build fails, the end of the build text says:
> ⌠Last command failed. Scroll up to see errors in log (search for '!!!!!!!!').
Unfortunately, not all failures have that string. That being present seems to be specific to JSII failures?
### Expected Behavior
The error should be on a line that has `!!!!!!!!` or be pretty obvious/recent in the build output. The message saying how to find a failure should help lead a user to the failure.
### Current Behavior
Due to the parallel nature of the build, the error was way earlier without a `!!!!!!!!` and mixed in with other "random" output:
```
> @aws-cdk/aws-s3objectlambda-alpha:test
aws-cdk-lib: FAIL aws-cloudfront/test/key-value-store.test.ts
aws-cdk-lib: ◠Key Value Store › imported resource throws error when missing ID
aws-cdk-lib: expect(received).toThrow(expected)
aws-cdk-lib: Expected pattern: /Invalid Key Store Arn:/
aws-cdk-lib: Received message: "Invalid Key Value Store ID 'arn:aws:cloudfront::123456789012:key-value-store'"
aws-cdk-lib: [0m [90m 169 |[39m [36mconst[39m storeId [33m=[39m [33mArn[39m[33m.[39msplit(keyValueStoreArn[33m,[39m [33mArnFormat[39m[33m.[39m[33mSLASH_RESOURCE_NAME[39m)[33m.[39mresourceName[33m;[39m[0m
aws-cdk-lib: [0m [90m 170 |[39m [36mif[39m ([33m![39mstoreId) {[0m
aws-cdk-lib: [0m[31m[1m>[22m[39m[90m 171 |[39m [36mthrow[39m [36mnew[39m [33mError[39m([32m`Invalid Key Value Store ID '${keyValueStoreArn}'`[39m)[33m;[39m[0m
aws-cdk-lib: [0m [90m |[39m [31m[1m^[22m[39m[0m
aws-cdk-lib: [0m [90m 172 |[39m }[0m
aws-cdk-lib: [0m [90m 173 |[39m [36mreturn[39m [36mnew[39m [36mclass[39m [33mImport[39m [36mextends[39m [33mResource[39m [36mimplements[39m [33mIKeyValueStore[39m {[0m
aws-cdk-lib: [0m [90m 174 |[39m readonly keyValueStoreArn[33m:[39m string [33m=[39m keyValueStoreArn[33m;[39m[0m
aws-cdk-lib: at Function.fromKeyValueStoreArn (aws-cloudfront/lib/key-value-store.ts:171:13)
aws-cdk-lib: at aws-cloudfront/test/key-value-store.test.ts:108:27
aws-cdk-lib: at Object. (../../node_modules/expect/build/toThrowMatchers.js:74:11)
aws-cdk-lib: at Object.throwingMatcher [as toThrow] (../../node_modules/expect/build/index.js:320:21)
aws-cdk-lib: at Object. (aws-cloudfront/test/key-value-store.test.ts:109:7)
aws-cdk-lib: at Object. (aws-cloudfront/test/key-value-store.test.ts:109:7)
aws-cdk-lib: PASS aws-ssm/test/util.test.ts
@aws-cdk/aws-route53resolver-alpha: Build times for @aws-cdk/aws-route53resolver-alpha: Total time (53.4s) | /codebuild/output/src2064263468/src/github.com/aws/aws-cdk/tools/@aws-cdk/cdk-build-tools/node_modules/jsii/bin/jsii (41.8s) | /codebuild/output/src2064263468/src/github.com/aws/aws-cdk/node_modules/eslint/bin/eslint.js (10.4s) | /codebuild/output/src2064263468/src/github.com/aws/aws-cdk/tools/@aws-cdk/cdk-build-tools/bin/cdk-awslint (0.9s) | '/usr/bin/node' (0.2s) | pkglint (0.2s)
@aws-cdk/aws-route53resolver-alpha: [2K[1G@aws-cdk/aws-route53resolver-alpha: Done in 53.57s.
```
### Reproduction Steps
1. Review the logs at https://2cl995f30a.execute-api.us-east-1.amazonaws.com/Prod/buildlogs?key=85595289-c0ad-4b14-a403-b343cd25387c%2Fbuild.log
2. See that the actual failure is a unit test failure; that does not have `!!!!!!!!`.
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### CDK CLI Version
N/A
### Framework Version
_No response_
### Node.js Version
N/A
### OS
N/A
### Language
TypeScript
### Language Version
_No response_
### Other information
_No response_
Contributor guide
Research direction
Start by reviewing the linked CodeBuild log and the PR build-failure reporting flow. Compare the unit-test failure in aws-cloudfront/test/key-value-store.test.ts with failures that include `!!!!!!!!`; done means the final message reliably directs users to the actual recent failure, even when that marker is absent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- build-system, ci-cd
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100