Forge lint is not checking extension keys correctly

Hello,

I have found (probably) a bug in forge lint command. My manifest looks like:

modules:
  jira:issueGlance:
    - key: map-issue
      resource: map-issue
      resolver:
        function: map-issue
      title: something...
      label: anything...

  function:
    - key: map-issue
      handler: map-issue.handler

resources:
  - key: map-issue
    path: static/somewhere/anywhere/dist/map-issue

After running forge lint command I have receive message ‘No issues found’. Subsequent ‘forge deploy -e development --verbose‘ will fail with manifest validation error:

ℹ Validating manifest
  Upload URL is valid
  Found manifest file
  Manifest is a valid YAML
  Manifest validation failed
Validation errors: {
  "validationResult": {
    "tid": "8c0c75c4f87499c0",
    "code": 400,
    "type": "InvalidDescriptorError",
    "message": "JSON schema validation failed for extensions with the following keys:",
    "details": {
      "errors": [],
      "globalValidationErrors": [
        {
          "message": "has duplicate extension key 'map-issue'",
          "keyword": "constant",
          "dataPath": ".extensions['map-issue']",
          "schemaPath": "#/properties/extensions/properties/type",
          "params": {},
          "data": null
        }
      ]
    }
  }
}

The problem is, obviously, with the same keys for module, function, resource… (But, actually, why not? Specifying keys like key: my-function for function might seems like a tautology.)

I expect that forge lint will tell me about this issue, not only subsequent deployment.

2 Likes

Hi @kbujacek ,

Thanks for the report. I’ve filed your issue here: [FRGE-263] forge lint doesn't detect duplicate keys in the manifest - Ecosystem Jira and passed it along to the team.

1 Like