The subjects used to calculate grafeas occurrences should be calculated according to the formatter version used. The way v2alpha3 and v1 calculate subjects is different from the way v2alpha4 does it.
Actual Behavior
When using grafeas as a backend, and payload formatter v2alpha4, the subjects from the provenance, used to calculate occurrences, are not right, the subjects are calculated using the same logic all the time, without considering the formatter version:
4. After generating the attestation you will see in the `deployment/tekton-chains-controller` logs that only 3 occurrences were uploaded, it should be 4.
Expected Behavior
The subjects used to calculate grafeas occurrences should be calculated according to the formatter version used. The way v2alpha3 and v1 calculate subjects is different from the way v2alpha4 does it.
Actual Behavior
When using grafeas as a backend, and payload formatter v2alpha4, the subjects from the provenance, used to calculate occurrences, are not right, the subjects are calculated using the same logic all the time, without considering the formatter version:
https://github.com/tektoncd/chains/blob/badc7340a7c749979af6e02e545d870b554830af/pkg/chains/storage/grafeas/grafeas.go#L256
Steps to Reproduce the Problem
Using this workflow: