aws / aws/aws-cdk

(contributing): Build failures don't always include `!!!!!!!!`

Open
#28,515 1 comment 4 reactions 0 assignees View on GitHub
@aws-cdk/aws-route53resolver bug effort/medium p3
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:   169 | const storeId = Arn.split(keyValueStoreArn, ArnFormat.SLASH_RESOURCE_NAME).resourceName;
aws-cdk-lib:   170 | if (!storeId) {
aws-cdk-lib: > 171 | throw new Error(`Invalid Key Value Store ID '${keyValueStoreArn}'`);
aws-cdk-lib:   | ^
aws-cdk-lib:   172 | }
aws-cdk-lib:   173 | return new class Import extends Resource implements IKeyValueStore {
aws-cdk-lib:   174 | readonly keyValueStoreArn: string = keyValueStoreArn;
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: @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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.