Skip to content

Enums with duplicate values droppedΒ #2782

Closed

Description

@njlynch

πŸ› Bug Report

Affected Languages

  • [ ] TypeScript or Javascript
  • [βœ… ] Python
  • [βœ… ] Java
  • [βœ… ] .NET (C#, F#, ...)
  • [❓ ] Go

General Information

  • JSII Version: 1.27.0
  • Platform: OSX

What is the problem?

Originally reported in aws/aws-cdk#14059.

It appears that repeated values (not names) in enums are ignored, leading to dropped names. The example above is for SecretsManager.AttachmentTargetType:

https://github.com/aws/aws-cdk/blob/ad326da3ae392b78dcfc349f246acdf3a389f283/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts#L483-L527

Note that INSTANCE = 'AWS::RDS::DBInstance', and RDS_DB_INSTANCE = 'AWS::RDS::DBInstance', have different names, but the same values.

In the .jsii manifest generated for this module, the newer (non-deprecated) enums are not present:

Manifest:

    "@aws-cdk/aws-secretsmanager.AttachmentTargetType": {
      "assembly": "@aws-cdk/aws-secretsmanager",
      "docs": {
        "stability": "stable",
        "summary": "The type of service or database that's being associated with the secret."
      },
      "fqn": "@aws-cdk/aws-secretsmanager.AttachmentTargetType",
      "kind": "enum",
      "locationInModule": {
        "filename": "lib/secret.ts",
        "line": 483
      },
      "members": [
        {
          "docs": {
            "deprecated": "use RDS_DB_INSTANCE instead",
            "stability": "deprecated",
            "summary": "A database instance."
          },
          "name": "INSTANCE"
        },
        {
          "docs": {
            "deprecated": "use RDS_DB_CLUSTER instead",
            "stability": "deprecated",
            "summary": "A database cluster."
          },
          "name": "CLUSTER"
        },
        {
          "docs": {
            "stability": "stable",
            "summary": "AWS::RDS::DBProxy."
          },
          "name": "RDS_DB_PROXY"
        },
        {
          "docs": {
            "stability": "stable",
            "summary": "AWS::Redshift::Cluster."
          },
          "name": "REDSHIFT_CLUSTER"
        },
        {
          "docs": {
            "stability": "stable",
            "summary": "AWS::DocDB::DBInstance."
          },
          "name": "DOCDB_DB_INSTANCE"
        },
        {
          "docs": {
            "stability": "stable",
            "summary": "AWS::DocDB::DBCluster."
          },
          "name": "DOCDB_DB_CLUSTER"
        }
      ],
      "name": "AttachmentTargetType"
    },

Activity

  1. added
    bug
    needs-triage
    on Apr 9, 2021
  2. added
    effort/medium
    module/compiler
    and removed
    needs-triage
    on Apr 13, 2021
  3. removed their assignment
    on Jun 24, 2021
  4. njlynch commented on Sep 9, 2021

    @njlynch
    ContributorAuthor

    Another example: aws/aws-cdk#16443

  5. added a commit that references this issue on Nov 26, 2021
    450b87c
  6. added a commit that references this issue on Mar 7, 2022
    c32d7f6
  7. added a commit that references this issue on Jun 29, 2022
    f64dace
  8. github-actions commented on Jun 29, 2022

    @github-actions
    Contributor

    ⚠️COMMENT VISIBILITY WARNING⚠️

    Comments on closed issues are hard for our team to see.
    If you need more assistance, please either tag a team member or open a new issue that references this one.
    If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugeffort/mediummodule/compilerp1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions