Rules do not scan dependency injection without a handler

Open
#35 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
aws, java, spring-boot
Domain
backend, cloud, tooling

Research direction

Start by tracing the SnapStart rule checks that currently depend on a class or method having a specific handler name, then compare them with the dependency-injection example in the issue. Done means standard Spring Boot applications using Serverless Java Container or Lambda Web Adapter are scanned and violations are recognized without a specific handler interface.

Written by the indexing model from the issue text.

Description

Problem: You can run standard Spring Boot applications via the Serverless Java Container or the Lambda Web Adapter. In that case, no specific handler interface needs to be implemented. Currently the SnapStart rules would therefore not recognize any violation of the rules:

public class UnicornControllerHandler {

    private final UnicornService unicornService;
    private final UUID uuid;
    private static final Logger logger = LoggerFactory.getLogger(UnicornControllerHandler.class);

    public UnicornControllerHandler(UnicornService unicornService) {
        this.unicornService = unicornService;
        uuid = UUID.randomUUID();
    }
}

This is somehow related to https://github.com/aws/aws-lambda-snapstart-java-rules/issues/24 but the checks seem to only apply when the class and the method have a specific name.

Dominant language
Java
Stars
53
Forks
10
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws/aws-lambda-snapstart-java-rules

All issues in aws/aws-lambda-snapstart-java-rules

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.