Skip to content

Conversation

@EspenAlbert
Copy link
Collaborator

@EspenAlbert EspenAlbert commented May 21, 2025

Proposed changes

  • Hard to fix bug, as generated resources where changed after npm install -g cdk-import changed the behavior (not locked to a version in any workflow)
  • Simplest solution I could find is to avoid the @stylistic/{rule-name} directly in the cdk.sh script.
  • I tried locking in version for cdk-import but couldn't find exactly the right one to pick or if it depends on other packages, therefore, changing directly in cdk.sh seemed like the natrual choice.

More context

The generated typescript code contained different @Stylistic linter rules that made our code-health pipeline fail (first failure about ~1 week ago, last OK ~3 weeks ago).

A bit more background. projen doesn't support eslint 9 yet, so the stylistic plugin for eslint is not generated. See more in the projen issues:

Eslint no longer functional due to deprecated configuration
support-implementation-issue

Type of change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as
    expected)
  • This change requires a documentation update

Required Checklist:

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • I have tested the CDK constructor in a CFN stack. See TESTING.md
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@EspenAlbert EspenAlbert marked this pull request as ready for review May 21, 2025 13:20
@EspenAlbert EspenAlbert requested a review from a team as a code owner May 21, 2025 13:20
Copy link
Collaborator

@maastha maastha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
As mentioned by @oarbusi can we please add context in the PR description for this change

# Fix @typescript-eslint/no-shadow es-linter error in file federated-database-instance/index.ts
sed -e 's/map(y => toJson_TagSet(y))/map(x => toJson_TagSet(x))/g' "${dest}" > "${dest}.tmp" && mv "${dest}.tmp" "${dest}"

sed -e 's|@stylistic/max-len, ||g' -e 's|, @stylistic/quote-props||g' "${dest}" > "${dest}.tmp" && mv "${dest}.tmp" "${dest}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add here details about WHY this is done?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea: updated in baad371

@EspenAlbert EspenAlbert merged commit 324c7c3 into main May 21, 2025
13 checks passed
@EspenAlbert EspenAlbert deleted the cdk-import-fix branch May 21, 2025 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants